☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Streaming image data row-by-row?

Community Support
nicolas.fr
nicolas.fr

Hi all,
I’d like to use ‘ColumnDataSource.stream’ for an image which size grows row-by-row.

I gave it a try (using a numpy array) but the appended data does seem to be properly interpreted.

Is ‘ColumnDataSource.stream’ supposed to work for image?

Thanks,

N.

⌁   Link to post
Bryan
Bryan

Hi,

The streaming API lets you stream data to the end of a *column*. In the case of images, the columns contain 2d arrays as elements, so the stream API would only let you stream a new image, to the end of a column of images. If you want to stream "inside" one to of the existing images, you will need to do something more sophisticated. It's possible (though I have not tried) that the .patch API might be useful for "reaching in" to a single image. Alternatively, the spectrogram streams single columns into a larger image with the use of a custom extension:

  https://github.com/bokeh/bokeh/tree/master/examples/app/spectrogram

Thanks,

Bryan

···

On Feb 13, 2017, at 15:59, nicolas.fr <nicolas.leclercq@synchrotron-soleil.fr> wrote:

Hi all,
I'd like to use 'ColumnDataSource.stream' for an image which size grows row-by-row.
I gave it a try (using a numpy array) but the appended data does seem to be properly interpreted.
Is 'ColumnDataSource.stream' supposed to work for image?
Thanks,
N.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/54f9aad7-1fc9-4640-9f27-e4b28c9a33ab%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
nicolas.fr
nicolas.fr

The .patch API sounds interesting but I’m afraid that its indexing principle is not compatible with images. The documentation says:

This method should be passed a dictionary that maps column names to lists of tuples, each of the form (index, new_value). The value at the given index for that column will be updated with the new value.

``

As far as, we have an image at each index of the column, I don’t see how I can reach a specific row in the image using a scalar index.

Anyway, I will have a look to the spectrogram example but it looks quite advanced (seems to make use of a some specific JS code).

···

Le lundi 13 février 2017 23:40:18 UTC+1, Bryan Van de ven a écrit :

Hi,

The streaming API lets you stream data to the end of a column. In the case of images, the columns contain 2d arrays as elements, so the stream API would only let you stream a new image, to the end of a column of images. If you want to stream “inside” one to of the existing images, you will need to do something more sophisticated. It’s possible (though I have not tried) that the .patch API might be useful for “reaching in” to a single image. Alternatively, the spectrogram streams single columns into a larger image with the use of a custom extension:

    [https://github.com/bokeh/bokeh/tree/master/examples/app/spectrogram](https://github.com/bokeh/bokeh/tree/master/examples/app/spectrogram)

Thanks,

Bryan

On Feb 13, 2017, at 15:59, nicolas.fr nicolas....@synchrotron-soleil.fr wrote:

Hi all,

I’d like to use ‘ColumnDataSource.stream’ for an image which size grows row-by-row.

I gave it a try (using a numpy array) but the appended data does seem to be properly interpreted.
Is ‘ColumnDataSource.stream’ supposed to work for image?

Thanks,

N.

–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/54f9aad7-1fc9-4640-9f27-e4b28c9a33ab%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post

End of archived discussion · Replies are disabled