diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py index 869df3c58e..d346ea2033 100644 --- a/holoviews/plotting/bokeh/element.py +++ b/holoviews/plotting/bokeh/element.py @@ -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 @@ -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):