Skip to content

Commit

Permalink
fix: IndexError associated with HeatMap (#6438)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacetimeengineer authored Dec 20, 2024
1 parent 0d97cb0 commit cd2ca49
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions holoviews/plotting/bokeh/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import inspect
import time
from collections import defaultdict
from contextlib import suppress
from functools import partial

import numpy as np
Expand Down Expand Up @@ -518,7 +519,8 @@ def _process_msg(self, msg):
msg['y'] = convert_timestamp(msg['y'])

if isinstance(x_range, FactorRange) and isinstance(msg.get('x'), (int, float)):
msg['x'] = x_range.factors[int(msg['x'])]
with suppress(IndexError): # See: https://github.com/holoviz/holoviews/pull/6438
msg['x'] = x_range.factors[int(msg['x'])]
elif 'x' in msg and isinstance(x_range, (Range1d, DataRange1d)):
xstart, xend = x_range.start, x_range.end
if xstart > xend:
Expand All @@ -530,7 +532,8 @@ def _process_msg(self, msg):
msg['x'] = x

if isinstance(y_range, FactorRange) and isinstance(msg.get('y'), (int, float)):
msg['y'] = y_range.factors[int(msg['y'])]
with suppress(IndexError):
msg['y'] = y_range.factors[int(msg['y'])]
elif 'y' in msg and isinstance(y_range, (Range1d, DataRange1d)):
ystart, yend = y_range.start, y_range.end
if ystart > yend:
Expand Down

0 comments on commit cd2ca49

Please sign in to comment.