Skip to content

Commit

Permalink
Ensure that markers are handled correctly in bokeh batched mode
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 13, 2019
1 parent 9a81a60 commit ebf66a8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions holoviews/plotting/bokeh/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PointPlot(LegendPlot, ColorbarPlot):
line_properties + fill_properties)

_plot_methods = dict(single='scatter', batched='scatter')
_batched_style_opts = line_properties + fill_properties + ['size']
_batched_style_opts = line_properties + fill_properties + ['size', 'marker', 'angle']

def _get_size_data(self, element, ranges, style):
data, mapping = {}, {}
Expand Down Expand Up @@ -124,11 +124,13 @@ def get_data(self, element, ranges, style):
def get_batched_data(self, element, ranges):
data = defaultdict(list)
zorders = self._updated_zorders(element)
has_angles = False
for (key, el), zorder in zip(element.data.items(), zorders):
self.param.set_param(**self.lookup_options(el, 'plot').options)
style = self.lookup_options(element.last, 'style')
style = style.max_cycles(len(self.ordering))[zorder]
eldata, elmapping, style = self.get_data(el, ranges, style)
style = mpl_to_bokeh(style)
for k, eld in eldata.items():
data[k].append(eld)

Expand All @@ -141,8 +143,13 @@ def get_batched_data(self, element, ranges):
sdata, smapping = expand_batched_style(style, self._batched_style_opts,
elmapping, nvals)
elmapping.update(smapping)
for k, v in sdata.items():
for k, v in sorted(sdata.items()):
if k == 'angle' and 'angle' not in data:
data['angle'] = [np.zeros(len(d)) for d in data['marker']]
has_angles = True
data[k].append(v)
if has_angles and 'angle' not in sdata:
data['angle'].append(np.zeros(len(v)))

if 'hover' in self.handles:
for d, k in zip(element.dimensions(), key):
Expand Down

0 comments on commit ebf66a8

Please sign in to comment.