-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Hover fix for colorbars with custom tickval / ticktext #1891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- failing on `master` during appendArrayPointValue when they are less items in 'colorbar.ticktext; or 'colorbar.tickvals' then pointNumber[0]. - test case is for surface, but same happens for other trace types with 2d coords.
- don't include point values of 1d array attributes when pointNumber is 2d in appendArrayPointValue. - note that 1d array attributes (e.g. `x` and `y`) can still be set in the `module.hoverPoints`.
Hmm, this will work to exclude 1D arrays from getting picked up alongside 2D arrays - so if you want to include it as a quick bug fix I'm OK with it. But there are going to be cases where the aux arrays have the same dimensionality as the main array and yet still shouldn't be included. Like TBH I'm not sure what |
Good point here. Maybe it would be best to manually skip |
- as they scale independently of coordinates arrays, so shouldn't be filtered nor included in point event data - do not add a schema field for this now. + wait until solution become clearer.
Good idea to handle this in |
|
||
expect(pt.z).toBe(3, 'z'); | ||
expect(pt.text).toBe(undefined, 'undefined text items are included'); | ||
expect('id' in pt).toBe(false, 'undefined ids items are not included'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
N.B. this 🔒 0d91074
We would prefer that too, but I don't want to add a schema field until we investigate these uncorrelated |
Ok. I'm merging this thing. #1894 documents the situation and potential long-term more-robust solutions. |
fixes https://community.plot.ly/t/tooltips-dont-show-up-in-a-heatmap/4972 first reported by @empet
Another bug introduced by #1770. This time
appendArrayPointValue
tried to dig into a trace'scolorbar.tickvals
andcolorbar.tickvals
with a 2DpointNumber
leading a slew of exceptions during hover. Note thatcolorbar.ticktext
andcolorbar.tickvals
are both declared asvalType: 'data_array'
at the moment.The proposed fix in 0aa87c9 isn't great, but feels the safest to my eyes.
Perhaps a better, more evolved fix would make a distinction between
data_array
attributes that are expected to have the same dimension as of the main data coordinates (in 2D traces, that main data coordinate isz
). and otherdata_array
attributes. To note, we might have to do this to getfilter
andsort
working for 2D traces in general.cc @alexcjohnson