-
-
Notifications
You must be signed in to change notification settings - Fork 406
enh(bokeh): Optimize HeatMap rendering path if gridded and contiguous #6680
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
base: main
Are you sure you want to change the base?
Conversation
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.
Left some comments.
I can't think of a better way to get HoverTool to work than using CustomJS.
I can, will give that a shot. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6680 +/- ##
==========================================
- Coverage 89.02% 89.00% -0.03%
==========================================
Files 329 329
Lines 70422 70500 +78
==========================================
+ Hits 62693 62748 +55
- Misses 7729 7752 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a497c20
to
520c323
Compare
HeatMap is currently rendered using
rect
glyphs. This approach is flexible, since it allows the heatmap to be overlaid on arbitrary categorical axes, and each rectangle is drawn independently of the axis ordering. However, for large heatmaps with many categories, it becomes extremely inefficient: each rectangle (pixel) must be sent and rendered individually, which both increases data transfer and slows down rendering. To address this, we’ve added a new code path that is used when the HeatMap is already gridded and the data is contiguous with respect to the x- and y-axis factors.Example
ToDo
Observations
In implementing this I found a fairly undesirable behavior of our axis range/factor calculations. Specifically because we accumulate the ranges by element type the ordering of factors is not preserved correctly if there is a layer above and below that are of the same type.
As an example here we have
Points * HeatMap * Points
:because the factors of the Points are jointly calculated we end up with the x-axis order starting as
[-1, 0, 11, 12, ...]
rather than the[-1, 0, 1, 2, ...]
ordering you'd expect if you calculated the element factors in sequence. In this case, this causes the heatmap to be non-contiguous, disabling the optimized codepath.