-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
feat(bokeh): Server side HoverTool for rasterized/datashaded plots with selector #6422
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6422 +/- ##
==========================================
- Coverage 88.50% 88.49% -0.02%
==========================================
Files 323 323
Lines 68631 68819 +188
==========================================
+ Hits 60741 60899 +158
- Misses 7890 7920 +30 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Ordering matters!
# Conflicts: # holoviews/element/raster.py
raise ValueError("The spread should not be equal to the original image") | ||
|
||
if isinstance(agg_fn, ds.count): | ||
data = spread_img.vdims[-1].name # FIXME: Last one as it is alpha for datashade, shouldn't matter |
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.
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.
I have resolved this in 9e71910. I think it is correct to set it to 0 when alpha is zero, but it is likely to be a somewhat subjective opinion.
data = element.clone(datatype=['xarray']).data[element.vdims[0].name] | ||
if element.interface.datatype != 'xarray': | ||
element = element.clone(datatype=['xarray']) | ||
data = shade._extract_data(element) |
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.
Note: Image is no longer cloned by default.
# TODO: Investigate why this does not work | ||
# element = element.clone(data=new_data, kdims=element.vdims.copy(), vdims=element.vdims.copy()) | ||
element = element.clone() | ||
element.data = new_data |
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.
Don't understand this.
) | ||
|
||
def on_change(attr, old, new): | ||
if np.isinf(new).all(): |
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.
expect(hv_plot).to_have_count(1) | ||
bbox = hv_plot.bounding_box() | ||
|
||
# Hover over the plot, first time the hovertool only have null |
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.
We could make it so it does not return null, but a random point.
Previously, we sent all hover data to the front end, which could lead to significant overhead on larger plots. With this PR, the data is pushed server-side to the hover tool with a custom data model.
script