Skip to content

Commit

Permalink
Handle empty tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Aug 8, 2023
1 parent 5ba6537 commit 5d0e7e6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def _update_ranges(self, element, ranges):
continue
self._update_range(
extra_y_range, b, t, factors,
extra_y_range.tags[1]['invert_yaxis'] if extra_y_range.tags else False,
self._get_tag(extra_y_range, 'invert_yaxis'),
self._shared.get(extra_y_range.name, False), log, streaming
)

Expand Down Expand Up @@ -1111,10 +1111,16 @@ def _update_main_ranges(self, element, x_range, y_range, ranges):
self._update_range(x_range, l, r, xfactors, self.invert_xaxis,
self._shared['x-main-range'], self.logx, streaming)
if not self.drawn or yupdate:
self._update_range(y_range, b, t, yfactors,
y_range.tags[1]['invert_yaxis'] if y_range.tags else False,
self._shared['y-main-range'], self.logy, streaming)
self._update_range(
y_range, b, t, yfactors, self._get_tag(y_range, 'invert_yaxis'),
self._shared['y-main-range'], self.logy, streaming
)

def _get_tag(self, element, tag_name):
for tag in element.tags:
if isinstance(tag, dict) and tag_name in tag:
return tag[tag_name]
return False

def _update_range(self, axis_range, low, high, factors, invert, shared, log, streaming=False):
if isinstance(axis_range, FactorRange):
Expand Down

0 comments on commit 5d0e7e6

Please sign in to comment.