Skip to content

Commit

Permalink
Ensure that explicit tick lookup of floats works in JS (#3585)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 28, 2019
1 parent cddbefc commit bc9b1ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bc9b1ee

Please sign in to comment.