diff --git a/doc/user_guide/Customization.ipynb b/doc/user_guide/Customization.ipynb index 4f99b0b6f..5c5ce5cbf 100644 --- a/doc/user_guide/Customization.ipynb +++ b/doc/user_guide/Customization.ipynb @@ -66,6 +66,16 @@ " hover_cols (default=[]): list or str\n", " Additional columns to add to the hover tool or 'all' which will\n", " includes all columns (including indexes if use_index is True).\n", + " hover_tooltips list[str] or list[tuple]:\n", + " A list of dimensions to be displayed in the hover tooltip. See\n", + " [HoloViews docs](https://holoviews.org/user_guide/Plotting_with_Bokeh.html#hover-tools)\n", + " or [Bokeh docs](https://docs.bokeh.org/en/latest/docs/user_guide/interaction/tools.html#hovertool)\n", + " for more info on structuring.\n", + " hover_formatters:\n", + " A dict of formatting options for the hover tooltip.\n", + " hover_mode (default='mouse'):\n", + " The hover mode determines how the hover tool is activated;\n", + " select from 'mouse', 'vline', or 'hline'.\n", " invert (default=False): boolean\n", " Swaps x- and y-axis\n", " frame_width/frame_height: int\n", diff --git a/hvplot/converter.py b/hvplot/converter.py index 255b14060..eafa8e691 100644 --- a/hvplot/converter.py +++ b/hvplot/converter.py @@ -148,6 +148,12 @@ class HoloViewsConverter: hover_cols (default=[]): list or str Additional columns to add to the hover tool or 'all' which will includes all columns (including indexes if use_index is True). + hover_tooltips list[str] or list[tuple]: + A list of dimensions to be displayed in the hover tooltip. + hover_formatters: + A dict of formatting options for the hover tooltip. + hover_mode (default='mouse'): + The hover mode determines how the hover tool is activated. invert (default=False): boolean Swaps x- and y-axis frame_width/frame_height: int @@ -550,6 +556,9 @@ def __init__( logy=None, loglog=None, hover=None, + hover_tooltips=None, + hover_formatters=None, + hover_mode=None, subplots=False, label=None, invert=False, @@ -818,6 +827,12 @@ def __init__( else: tools.append('hover') plot_opts['tools'] = tools + if hover_tooltips: + plot_opts['hover_tooltips'] = hover_tooltips + if hover_formatters: + plot_opts['hover_formatters'] = hover_formatters + if hover_mode: + plot_opts['hover_mode'] = hover_mode if self.crs and global_extent: plot_opts['global_extent'] = global_extent