Get user interaction events

  • How do I link the tools in an HTML page to the data and push/bull updates from/to the bokeh server?

The gallery has a candlestick example that’s typical of many financial plots.

http://bokeh.pydata.org/docs/gallery/candlestick.html

While the default tools provide a minor level of interactivity there’s so much more that can be done. Take a look at some of the Yahoo Finance charts.

Panning is a simple left–right (forward / back) shift of the time series along the horizontal axis (date). When the user pans, the y-axis (price) scales to fit the minimum and max values.

Best,

Jason

Jason,

Hi sorry for the tardy response. We are actually in the process of improving this, so some of what I mention here will change in the near future, but but this is how you can do it in Bokeh 0.4.4:

Forst let's look at plot.renderers:

  [<bokeh.objects.LinearAxis at 0x107d55c90>,
   <bokeh.objects.Grid at 0x107d5ffd0>,
   <bokeh.objects.LinearAxis at 0x107d5ff10>,
   <bokeh.objects.Grid at 0x107d55d10>,
   <bokeh.objects.BoxSelectionOverlay at 0x107d5e090>,
   <bokeh.objects.BoxSelectionOverlay at 0x107d5e1d0>,
   <bokeh.objects.Glyph at 0x1079d1c10>]

We need to get ahold of the Glyph, in this case it is :

  glyph = plot.renderers[-1]

Then we need to get ahold of the data source for this glyph:

  ds = glyph.data_source

Do a pull to sync with the server:

  ds.pull()

Finally the selected indices are on the selected attr:

  ds.selected

This will become quite a bit simpler in the near future, I will update the mailing list when some of the changes get pushed to master.

Thanks,

Bryan

···

On May 13, 2014, at 4:09 PM, Jason Wirth <[email protected]> wrote:

- How do I link the tools in an HTML page to the data and push/bull updates from/to the bokeh server?

The gallery has a candlestick example that's typical of many financial plots.

    http://bokeh.pydata.org/docs/gallery/candlestick.html

While the default tools provide a minor level of interactivity there's so much more that can be done. Take a look at some of the Yahoo Finance charts.

    AAPL Interactive Stock Chart | Apple Inc. Stock - Yahoo Finance

Panning is a simple left--right (forward / back) shift of the time series along the horizontal axis (date). When the user pans, the y-axis (price) scales to fit the minimum and max values.

Best,
Jason

--
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].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2ada7f4b-900d-4133-acd0-cc37e9c61dd4%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.