diff --git a/holoviews/plotting/bokeh/__init__.py b/holoviews/plotting/bokeh/__init__.py index 838bec2c9f..d3667b271d 100644 --- a/holoviews/plotting/bokeh/__init__.py +++ b/holoviews/plotting/bokeh/__init__.py @@ -283,10 +283,10 @@ def colormap_generator(palette): options.HSpan = Options('style', color=Cycle(), alpha=0.5) options.Arrow = Options('style', arrow_size=10) options.Labels = Options('style', text_align='center', text_baseline='middle') -options.HLines = Options('style', color=Cycle(), line_width=3, alpha=1) -options.VLines = Options('style', color=Cycle(), line_width=3, alpha=1) -options.VSpans = Options('style', color=Cycle(), alpha=0.5) -options.HSpans = Options('style', color=Cycle(), alpha=0.5) +options.HLines = Options('style', color=Cycle(), line_width=3, alpha=1, muted_alpha=0.2) +options.VLines = Options('style', color=Cycle(), line_width=3, alpha=1, muted_alpha=0.2) +options.VSpans = Options('style', color=Cycle(), alpha=0.5, muted_alpha=0.2) +options.HSpans = Options('style', color=Cycle(), alpha=0.5, muted_alpha=0.2) options.Labels = Options('style', text_color=Cycle(), text_align='center', text_baseline='middle') # Graphs diff --git a/holoviews/plotting/bokeh/annotation.py b/holoviews/plotting/bokeh/annotation.py index 3b6ef80ad9..56aca1f8d1 100644 --- a/holoviews/plotting/bokeh/annotation.py +++ b/holoviews/plotting/bokeh/annotation.py @@ -43,7 +43,8 @@ def _init_glyph(self, plot, mapping, properties): return super()._init_glyph(plot, mapping, properties) def get_data(self, element, ranges, style): - data = {str(k): v for k, v in element.dataset.data.items()} + data = element.columns(element.kdims) + self._get_hover_data(data, element) default = self._element_default[self.invert_axes].kdims mapping = {str(d): str(k) for d, k in zip(default, element.kdims)} return data, mapping, style diff --git a/holoviews/tests/plotting/bokeh/test_annotationplot.py b/holoviews/tests/plotting/bokeh/test_annotationplot.py index 28688f412b..ab955a8131 100644 --- a/holoviews/tests/plotting/bokeh/test_annotationplot.py +++ b/holoviews/tests/plotting/bokeh/test_annotationplot.py @@ -262,9 +262,8 @@ def test_hlines_plot(self): assert plot.handles["y_range"].end == 5.5 source = plot.handles["source"] - assert list(source.data) == ["y", "extra"] + assert list(source.data) == ["y"] assert (source.data["y"] == [0, 1, 2, 5.5]).all() - assert (source.data["extra"] == [-1, -2, -3, -44]).all() def test_hlines_xlabel_ylabel(self): hlines = HLines( @@ -306,9 +305,8 @@ def test_hlines_plot_invert_axes(self): assert plot.handles["y_range"].end == 1 source = plot.handles["source"] - assert list(source.data) == ["y", "extra"] + assert list(source.data) == ["y"] assert (source.data["y"] == [0, 1, 2, 5.5]).all() - assert (source.data["extra"] == [-1, -2, -3, -44]).all() def test_hlines_nondefault_kdim(self): hlines = HLines( @@ -343,9 +341,8 @@ def test_vlines_plot(self): assert plot.handles["y_range"].end == 1 source = plot.handles["source"] - assert list(source.data) == ["x", "extra"] + assert list(source.data) == ["x"] assert (source.data["x"] == [0, 1, 2, 5.5]).all() - assert (source.data["extra"] == [-1, -2, -3, -44]).all() def test_vlines_plot_invert_axes(self): vlines = VLines( @@ -362,9 +359,8 @@ def test_vlines_plot_invert_axes(self): assert plot.handles["y_range"].end == 5.5 source = plot.handles["source"] - assert list(source.data) == ["x", "extra"] + assert list(source.data) == ["x"] assert (source.data["x"] == [0, 1, 2, 5.5]).all() - assert (source.data["extra"] == [-1, -2, -3, -44]).all() def test_vlines_nondefault_kdim(self): vlines = VLines( @@ -450,10 +446,9 @@ def test_hspans_plot(self): assert plot.handles["y_range"].end == 6.5 source = plot.handles["source"] - assert list(source.data) == ["y0", "y1", "extra"] + assert list(source.data) == ["y0", "y1"] assert (source.data["y0"] == [0, 3, 5.5]).all() assert (source.data["y1"] == [1, 4, 6.5]).all() - assert (source.data["extra"] == [-1, -2, -3]).all() def test_hspans_plot_xlabel_ylabel(self): hspans = HSpans( @@ -479,10 +474,9 @@ def test_hspans_plot_invert_axes(self): assert plot.handles["y_range"].end == 1 source = plot.handles["source"] - assert list(source.data) == ["y0", "y1", "extra"] + assert list(source.data) == ["y0", "y1"] assert (source.data["y0"] == [0, 3, 5.5]).all() assert (source.data["y1"] == [1, 4, 6.5]).all() - assert (source.data["extra"] == [-1, -2, -3]).all() def test_hspans_nondefault_kdims(self): hspans = HSpans( @@ -518,10 +512,9 @@ def test_vspans_plot(self): assert plot.handles["y_range"].end == 1 source = plot.handles["source"] - assert list(source.data) == ["x0", "x1", "extra"] + assert list(source.data) == ["x0", "x1"] assert (source.data["x0"] == [0, 3, 5.5]).all() assert (source.data["x1"] == [1, 4, 6.5]).all() - assert (source.data["extra"] == [-1, -2, -3]).all() def test_vspans_plot_invert_axes(self): vspans = VSpans( @@ -538,10 +531,9 @@ def test_vspans_plot_invert_axes(self): assert plot.handles["y_range"].end == 6.5 source = plot.handles["source"] - assert list(source.data) == ["x0", "x1", "extra"] + assert list(source.data) == ["x0", "x1"] assert (source.data["x0"] == [0, 3, 5.5]).all() assert (source.data["x1"] == [1, 4, 6.5]).all() - assert (source.data["extra"] == [-1, -2, -3]).all() def test_vspans_nondefault_kdims(self): vspans = VSpans(