I’ve built a simple web application that uses BokehJS to display and update an image glyph every time new data is received via a websocket. I would like to add a marker glyph on top of the image glyph to show the location of the maximum image value, but I can’t find any information in the BokehJS Interface Reference on how to do this. Is it possible? If so, how can I accomplish this?
Thank you for your help,
Dustin
Here is the CoffeeScript for my real-time image plot:
···
$ →
window.first_message = 1
window.ws = new ReconnectingWebSocket ‘ws://’ + document.domain + ‘:8080/ws’
ws.onopen = () → console.log ‘open’
ws.onmessage = (e) →
console.log e
msg = JSON.parse e.data
console.log msg
if window.first_message then init_plot(msg) else update(msg)
You can definitely do this. The JS potting interface is not quite as developed and documented as the python side yet, but it is possible to pass more than one glyph and source to make plot. You scan do:
Where "marker" is a glyph spec for whatever glyph you want to show at the maximum value. Then to update it you simply update the data in the window.marker, something like:
Let me know if this is enough to get you going, if not I can try to work up a complete example.
BTW we are *definitely* interested in expanding and improving the BokehJS api, so if yo have any thoughts or ideas (or contributions!) please don't hesitate to share them here on on GitHub.
I've built a simple web application that uses BokehJS to display and update an image glyph every time new data is received via a websocket. I would like to add a marker glyph on top of the image glyph to show the location of the maximum image value, but I can't find any information in the BokehJS Interface Reference on how to do this. Is it possible? If so, how can I accomplish this?
Thank you for your help,
Dustin
Here is the CoffeeScript for my real-time image plot:
Great! That works perfectly. Thank you for the quick response and the great work so far on Bokeh.
Best,
Dustin
···
On Thu, May 1, 2014 at 3:11 PM, Bryan Van de Ven [email protected] wrote:
Hi Dustin,
You can definitely do this. The JS potting interface is not quite as developed and documented as the python side yet, but it is possible to pass more than one glyph and source to make plot. You scan do:
Where “marker” is a glyph spec for whatever glyph you want to show at the maximum value. Then to update it you simply update the data in the window.marker, something like:
Let me know if this is enough to get you going, if not I can try to work up a complete example.
BTW we are definitely interested in expanding and improving the BokehJS api, so if yo have any thoughts or ideas (or contributions!) please don’t hesitate to share them here on on GitHub.
I’ve built a simple web application that uses BokehJS to display and update an image glyph every time new data is received via a websocket. I would like to add a marker glyph on top of the image glyph to show the location of the maximum image value, but I can’t find any information in the BokehJS Interface Reference on how to do this. Is it possible? If so, how can I accomplish this?
Thank you for your help,
Dustin
Here is the CoffeeScript for my real-time image plot:
$ →
window.first_message = 1
window.ws = new ReconnectingWebSocket ‘ws://’ + document.domain + ‘:8080/ws’
ws.onopen = () → console.log ‘open’
ws.onmessage = (e) →
console.log e
msg = JSON.parse e.data
console.log msg
if window.first_message then init_plot(msg) else update(msg)
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 [email protected].
To post to this group, send email to [email protected].