Skip to content

Commit

Permalink
use tap if large ds
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 committed Oct 3, 2024
1 parent ea1d123 commit f849d5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from holoviews.plotting.bokeh import OverlayPlot, colormap_generator
from holoviews.plotting.util import process_cmap
from holoviews.operation import histogram, apply_when
from holoviews.streams import Buffer, Pipe, PointerXY
from holoviews.streams import Buffer, Pipe, Tap, PointerXY
from holoviews.util.transform import dim, lon_lat_to_easting_northing
from pandas import DatetimeIndex, MultiIndex

Expand Down Expand Up @@ -1835,8 +1835,14 @@ def method_wrapper(ds, x, y):
f'Got unsupported hover_mode={self.hover_mode!r} for '
f"datashaded points; reverting to 'mouse'."
)

stream = Tap if len(self.data) > 10000 else PointerXY
param.main.param.warning(
'Hovering over datashaded points is slow for large datasets; '
'tap on the plot to see a hover tooltip over desired point.'
)
inspector = inspect_points.instance(
streams=[PointerXY], transform=self._datashade_hover_transform
streams=[stream], transform=self._datashade_hover_transform
)
processed *= inspector(processed).opts(
size=10,
Expand Down

0 comments on commit f849d5d

Please sign in to comment.