Skip to content

Commit

Permalink
Clone model if Tool is model (#6220)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored May 7, 2024
1 parent bc684e3 commit ca56d1d
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit ca56d1d

Please sign in to comment.