Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed legends for bokeh >=0.12.3 #900

Merged
merged 1 commit into from
Oct 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,14 +964,23 @@ def _process_legend(self):
if self.legend_position not in self.legend_specs:
plot.legend.location = self.legend_position
plot.legend.orientation = 'horizontal' if self.legend_cols else 'vertical'
legends = plot.legend[0].legends
new_legends = []
for label, l in legends:
if label in legend_labels:
continue
legend_labels.append(label)
new_legends.append((label, l))
plot.legend[0].legends[:] = new_legends
if bokeh_version > '0.12.2':
legends = plot.legend[0].items
for item in legends:
if item.label in legend_labels:
continue
legend_labels.append(item.label)
new_legends.append(item)
plot.legend[0].items[:] = new_legends
else:
legends = plot.legend[0].legends
for label, l in legends:
if label in legend_labels:
continue
legend_labels.append(label)
new_legends.append((label, l))
plot.legend[0].legends[:] = new_legends
if self.legend_position in self.legend_specs:
legend = plot.legend[0]
plot.legend[:] = []
Expand Down