question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImageRGBA error during change events

See original GitHub issue

Since 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 indicesvariable 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:closed
  • Created 6 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Jun 2, 2017

@philippjfr this should be fixed in master now

0reactions
mattpapcommented, Jun 2, 2017

@bryevdv, I submitted I PR (#6373).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found