From c49cc4cfa16175784d04b9754f3b71c71a1712b1 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 28 Mar 2019 01:41:42 +0000 Subject: [PATCH] Ensure that explicit tick lookup of floats works in JS --- holoviews/plotting/bokeh/element.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py index c8f5b200e0..5d17f06bd2 100644 --- a/holoviews/plotting/bokeh/element.py +++ b/holoviews/plotting/bokeh/element.py @@ -597,6 +597,10 @@ def _axis_properties(self, axis, key, plot, dimension=None, elif isinstance(ticker, (tuple, list)): if all(isinstance(t, tuple) for t in ticker): ticks, labels = zip(*ticker) + # Ensure floats which are integers are serialized as ints + # because in JS the lookup fails otherwise + ticks = [int(t) if isinstance(t, float) and t.is_integer() else t + for t in ticks] labels = [l if isinstance(l, util.basestring) else str(l) for l in labels] axis_props['ticker'] = FixedTicker(ticks=ticks)