Updating Image Glyphs with 2D numpy arrays in Bokeh 3.2.1

@Bryan You are right, working with dictionaries in CustomJS should also work.
The use of a dictionary in the CustomJS arguments actually works, the dictionary then becomes a Map object in Javascript.
But calling a value of the map (former dictionary) with dict[key] in Javascript doesn’t seem to work anymore.
Instead, we can use dict.get(key).

So the initial Javascript code with dictionary will also work with the line:
src.data['im'] = [imdict.get(sl.value)]
instead of:
src.data['im'] = [imdict[sl.value]]

1 Like