Skip to content

Commit

Permalink
Added unit tests for legend muting
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 26, 2018
1 parent 0ed155d commit 787a97d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/plotting/bokeh/testelementplot.py
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from holoviews.core import Dimension, DynamicMap
from holoviews.core import Dimension, DynamicMap, NdOverlay
from holoviews.element import Curve, Image, Scatter, Labels
from holoviews.streams import Stream
from holoviews.plotting.util import process_cmap
Expand Down Expand Up @@ -193,3 +193,16 @@ def test_overlay_gridstyle_applies(self):
plot = bokeh_renderer.get_plot(overlay)
self.assertEqual(plot.state.xgrid[0].grid_line_color, 'blue')
self.assertEqual(plot.state.xgrid[0].grid_line_width, 2)

def test_ndoverlay_legend_muted(self):
overlay = NdOverlay({i: Curve(np.random.randn(10).cumsum()) for i in range(5)}).options(legend_muted=True)
plot = bokeh_renderer.get_plot(overlay)
for sp in plot.subplots.values():
self.assertTrue(sp.handles['glyph_renderer'].muted)

def test_overlay_legend_muted(self):
overlay = (Curve(np.random.randn(10).cumsum(), label='A') *
Curve(np.random.randn(10).cumsum(), label='B')).options(legend_muted=True)
plot = bokeh_renderer.get_plot(overlay)
for sp in plot.subplots.values():
self.assertTrue(sp.handles['glyph_renderer'].muted)

0 comments on commit 787a97d

Please sign in to comment.