-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Discrete heatmapgl #4953
Discrete heatmapgl #4953
Conversation
…and discrete options - add image test for heatmapgl with false zsmooth i.e. discrete
@ordiology nice work! |
Thanks for taking a look, @archmoij. I'll look into what's going on and get
back to you. Looking at your codepen example and ignoring the strange
offset for a moment, do you know why in the heatmapgl plot the tooltip
lines up with the axis grid, but in the straight heatmap plot it doesn't?
|
There is some subtlety about tooltip positioning: if you don't use |
That's interesting as I would expect it to work the other way. With
heatmapgl, the interpolated heatmap has the data located on the edges of
each brick with the interpolation occurring in between, whereas for the
discretised heatmap, the whole brick contains the mapping for the data so
the central location is where I intended the tooltip to point -- my version
of heatmapgl offsets x and y by half a brick and draw an extra brick at the
maximum location... This may be related to the offset issue we're
observing, but I didn't have it when I tested my code inside plotly so I
need to look into it further.
|
Sorry for the delay, @archmoj -- had something I had to work on last week for Friday deadline. The issue should be fixed... please let me know if it doesn't behave as expected. |
@ordiology no worries about this and thanks very much for the fix. |
Also here is the updated codepen including latest fix. |
Thanks @archmoj, the hover is not showing up due to the bounds that are set up for the chart in the plotly.js convert.js trace for gl-heatmap2d. The discrete webgl heatmap requires an extra patch that the interpolated heatmap doesn't need. This patch amounts to half a patch before the first data location and half a patch after the last data location. In my implementation, I increased the ppad for both x and y in fullTrace._extremes to adjust for this. I have also made a PR for my fork to gl-vis. Thank you so much for your support with getting this feature into release. |
@ordiology I merged your gl-vis PR 🥇 i.e. gl-vis/gl-heatmap2d#6 and published a |
That's great! Thanks @archmoj. As I tried to explain in the comment just above... The size of the discrete heatmap is one patch larger than the smoothed heatmap. The bounds now extend half a patch beyond the minima and maxima of the x and y data ranges. I resolved this in my implementation by increasing the padding (ppad) of fullTrace._extremes in the plotly trace convert.js for gl-heatmap2d. Please let me know if this doesn't make sense. |
@ordiology thanks for your work! |
Thank you so, so much, @archmoj! |
Initial PR to add
zsmooth
options toheatmapgl
and resolve #4924.@ordiology let's submit potential changes (as a separate PR) to this branch.
@plotly/plotly_js