Callbacks with charts

The examples I’ve seen using interactions and callbacks operate on bokeh.plotting objects with data stored in a ColumnDataSource. Is it possible to use high level charts with callbacks and update charts using pandas DataFrames? If not I’ll use bokeh.plotting glyphs but it would be nice if I didn’t have to.

I’m just trying to plot a bar chart that depends on a TextInput with callbacks. If the user types new text in the field, I want the bar chart to change.

I’m using python 2.7.10, bokeh 0.11.0dev2, and Windows 7.

Hi,

If you intend a “server side callback” the current charts do not support data update “out of the box”. This is on our radar and I hope we can get to an initial working support soon.

In case you mean a “client side JS callback” then the answer is no and it’s likely to not be supported in the near future since most of the charts data computation, transformations, grouping and filtering happens on the python side. You could update the datasources somehow but you’d need to do all the computation that Charts is doing for you on the JS side (and at this point you’d have more reason to use plotting API than charts)

Thanks

Fabio

···

On Tue, Dec 8, 2015 at 12:17 PM, Avi Shapiro [email protected] wrote:

The examples I’ve seen using interactions and callbacks operate on bokeh.plotting objects with data stored in a ColumnDataSource. Is it possible to use high level charts with callbacks and update charts using pandas DataFrames? If not I’ll use bokeh.plotting glyphs but it would be nice if I didn’t have to.

I’m just trying to plot a bar chart that depends on a TextInput with callbacks. If the user types new text in the field, I want the bar chart to change.

I’m using python 2.7.10, bokeh 0.11.0dev2, and Windows 7.

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/f2a4f620-6ae3-4f3b-8139-2996a5706e27%40continuum.io.

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


Fabio Pliger

Senior Software Engineer, Bokeh

Thanks Fabio. I’m rather new to web apps and haven’t written javascript in years. I don’t have strong preferences for how the server is setup at this point. The appeal of bokeh (or one of many virtues) for my small data project is the ability to concentrate on my data or simulation in python without a ton of JS/SQL. I’m trying to do something I believe is quite simple but need to see if bokeh is what I need (now and for more interesting/advanced python projects).

Here’s my current use case:

I have a csv file of around 15000 rows and 10 columns of numeric data. I’d like a horizontal bar chart for a given row. I’d like the user to type in an index value (here a zip code string) to update the bar chart.

Currently, I import the csv into a pandas dataframe. I could easily do this without pandas but I’m not sure this would help use bokeh callbacks. I don’t think I’d be able to use a python callback due to limitations of pyscript.

Thanks for any suggestions,

Avi

···

On Tuesday, December 8, 2015 at 3:43:56 PM UTC-5, Fabio Pliger wrote:

Hi,

If you intend a “server side callback” the current charts do not support data update “out of the box”. This is on our radar and I hope we can get to an initial working support soon.

In case you mean a “client side JS callback” then the answer is no and it’s likely to not be supported in the near future since most of the charts data computation, transformations, grouping and filtering happens on the python side. You could update the datasources somehow but you’d need to do all the computation that Charts is doing for you on the JS side (and at this point you’d have more reason to use plotting API than charts)

Thanks

Fabio

On Tue, Dec 8, 2015 at 12:17 PM, Avi Shapiro [email protected] wrote:

The examples I’ve seen using interactions and callbacks operate on bokeh.plotting objects with data stored in a ColumnDataSource. Is it possible to use high level charts with callbacks and update charts using pandas DataFrames? If not I’ll use bokeh.plotting glyphs but it would be nice if I didn’t have to.

I’m just trying to plot a bar chart that depends on a TextInput with callbacks. If the user types new text in the field, I want the bar chart to change.

I’m using python 2.7.10, bokeh 0.11.0dev2, and Windows 7.

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/f2a4f620-6ae3-4f3b-8139-2996a5706e27%40continuum.io.

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


Fabio Pliger

Senior Software Engineer, Bokeh