Skip to content

Commit

Permalink
Fixed categorical axis on radial HeatMap (#4162)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jan 6, 2020
1 parent f89bdfa commit 8eba4d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions holoviews/plotting/bokeh/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class RadialHeatMapPlot(CompositeElementPlot, ColorbarPlot):
['annular_' + p for p in fill_properties + line_properties] + \
['ticks_' + p for p in text_properties] + ['cmap'])


def __init__(self, *args, **kwargs):
super(RadialHeatMapPlot, self).__init__(*args, **kwargs)
self.xaxis = None
Expand Down Expand Up @@ -290,6 +291,10 @@ def get_extents(self, view, ranges, range_type='combined'):
return (lower, lower, upper, upper)


def _get_axis_dims(self, element):
return (None, None)


def _axis_properties(self, *args, **kwargs):
"""Overwrite default axis properties handling due to clashing
categorical input and numerical output axes.
Expand Down
7 changes: 7 additions & 0 deletions holoviews/tests/plotting/bokeh/testradialheatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,10 @@ def test_radial_heatmap_colorbar(self):
plot = bokeh_renderer.get_plot(hm)
self.assertIsInstance(plot.handles.get('colorbar'), ColorBar)

def test_radial_heatmap_ranges(self):
hm = HeatMap([(0, 0, 1), (0, 1, 2), (1, 0, 3)]).options(radial=True, colorbar=True)
plot = bokeh_renderer.get_plot(hm)
self.assertEqual(plot.handles['x_range'].start, -0.05)
self.assertEqual(plot.handles['x_range'].end, 1.05)
self.assertEqual(plot.handles['y_range'].start, -0.05)
self.assertEqual(plot.handles['y_range'].end, 1.05)

0 comments on commit 8eba4d2

Please sign in to comment.