Skip to content

Commit

Permalink
Ensure tool string lookup import is robust (#4308)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 22, 2020
1 parent c5b24a0 commit bb9590e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions holoviews/plotting/bokeh/element.py
Expand Up @@ -22,13 +22,9 @@
from bokeh.models.tickers import (
Ticker, BasicTicker, FixedTicker, LogTicker, MercatorTicker
)
from bokeh.models.tools import Tool
from bokeh.models.widgets import Panel, Tabs

try:
from bokeh.plotting.helpers import _known_tools as TOOLS_MAP
except:
from bokeh.plotting._tools import TOOLS_MAP

from ...core import DynamicMap, CompositeOverlay, Element, Dimension, Dataset
from ...core.options import abbreviated_exception, SkipRendering
from ...core import util
Expand All @@ -51,6 +47,16 @@
compute_layout_properties, wrap_formatter, match_ax_type, remove_legend
)

if bokeh_version >= '2.0.1':
try:
TOOLS_MAP = Tool._known_aliases
except Exception:
TOOLS_MAP = TOOL_TYPES
elif bokeh_version >= '2.0.0':
from bokeh.plotting._tools import TOOLS_MAP
else:
from bokeh.plotting.helpers import _known_tools as TOOLS_MAP



class ElementPlot(BokehPlot, GenericElementPlot):
Expand Down

0 comments on commit bb9590e

Please sign in to comment.