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

Clone model if Tool is model #6220

Merged
merged 1 commit into from
May 7, 2024
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
6 changes: 5 additions & 1 deletion holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import numpy as np
import param
from bokeh.document.events import ModelChangedEvent
from bokeh.model import Model
from bokeh.models import (
BinnedTicker,
ColorBar,
Expand Down Expand Up @@ -501,7 +502,10 @@ def _init_tools(self, element, callbacks=None):
copied_tools = []
for tool in tool_list:
if isinstance(tool, tools.Tool):
properties = tool.properties_with_values(include_defaults=False)
properties = {
p: v.clone() if isinstance(v, Model) else v
for p, v in tool.properties_with_values(include_defaults=False).items()
}
tool = type(tool)(**properties)
copied_tools.append(tool)

Expand Down
Loading