ImageRGBA error during change events
See original GitHub issueSince https://github.com/bokeh/bokeh/pull/6313 was merged there is an error in the ImageRGBA._set_data
method where it is being passed two copies of the source. This means that the indices
variable incorrectly refers to the source resulting in an error on this line
if indices? and indices.indexOf(i) < 0
Exception in Comm callback TypeError: e.indexOf is not a function
because the source does not have an indexOf
method. I haven’t tried reproducing this using bokeh server yet but here is a minimal example to reproduce this in the notebook:
from __future__ import division
import numpy as np
from bokeh.plotting import figure, show, output_notebook
from bokeh.io import push_notebook
from bokeh.models import ColumnDataSource
output_notebook()
N = 20
img = np.empty((N,N), dtype=np.uint32)
view = img.view(dtype=np.uint8).reshape((N, N, 4))
for i in range(N):
for j in range(N):
view[i, j, 0] = int(i/N*255)
view[i, j, 1] = 158
view[i, j, 2] = int(j/N*255)
view[i, j, 3] = 255
p = figure(x_range=(0,10), y_range=(0,10))
cds = ColumnDataSource(data=dict(image=[img]))
# must give a vector of images
p.image_rgba(image='image', source=cds, x=0, y=0, dw=10, dh=10)
handle = show(p, notebook_handle=True) # open a browser
img[:20, :20] += 10
cds.data['image'][0] = img
push_notebook(handle=handle)
Tested on: bokeh 0.12.6dev7
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
ImageRGBA — Bokeh 2.4.2 Documentation
On the BokehJS side, change events for model properties have the form "change:property_name" . As a convenience, if the event name passed to...
Read more >Image - Go Packages
Package image implements a basic 2-D image library. The fundamental interface is called Image. An Image contains colors, which are described in the...
Read more >VM Image level Backup fails with 10026 Error to Data Domain
Backing up a VMware Image fails with 10026 or 10055, "Invalid length failed when overwriting to a file in a container for backup"...
Read more >python-bokeh-0.12.15-bp151.3.2 - SUSE Package Hub -
... Scale/range incompatibility in examples/models/server/population.py + #6365 [component: bokehjs] [regression] Imagergba error during change events + ...
Read more >items: Plot primitives — silx 1.1.0 documentation
Returns visible bounds of the item bounding box in the plot area. ... data or a 2D array with 2 rows of same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@philippjfr this should be fixed in master now
@bryevdv, I submitted I PR (#6373).