push_notebook() through JS kernel

I am using Bokeh with IPython/Jupyter notebooks. I noticed that dataSource.push_notebook() calls only update the plot if I execute them from a codecell. I want to run push_notebook() through Javascript, i.e., IPython.notebook.kernel.execute(‘dataSource.push_notebook()’). Doing that, however, leaves the bokeh plot unchanged (lines do not update) – how could I make such a call properly?

I am facing the same issue also. Did you manage to find a solution ?

···

On Monday, March 30, 2015 at 11:53:29 AM UTC+2, [email protected] wrote:

I am using Bokeh with IPython/Jupyter notebooks. I noticed that dataSource.push_notebook() calls only update the plot if I execute them from a codecell. I want to run push_notebook() through Javascript, i.e., IPython.notebook.kernel.execute(‘dataSource.push_notebook()’). Doing that, however, leaves the bokeh plot unchanged (lines do not update) – how could I make such a call properly?

push_notebook() currently constructs a snippet of JS to update the data, and then uses the notebook's HTML publication to execute this JS in the browser (causing the BokehJS data source to get updated). I'm not sure that executing in the kernel like this is ever going to be able to be made to work, but perhaps someone expert on IPython can chime in.

A better solution would use the IPython widget protocol to update data sources, and this has been discussed. But we are currently stretched thin on other development priorities. If anyone wanted to try and tackle this feature we would be glad to offer assistance.

Alternatively, we will be previewing a completely new, radically simpler bokeh server in the next month or so, and that would be another option.

Bryan

···

On Oct 14, 2015, at 3:40 AM, [email protected] wrote:

I am facing the same issue also. Did you manage to find a solution ?

On Monday, March 30, 2015 at 11:53:29 AM UTC+2, [email protected] wrote:
I am using Bokeh with IPython/Jupyter notebooks. I noticed that dataSource.push_notebook() calls only update the plot if I execute them from a codecell. I want to run push_notebook() through Javascript, i.e., IPython.notebook.kernel.execute('dataSource.push_notebook()'). Doing that, however, leaves the bokeh plot unchanged (lines do not update) -- how could I make such a call properly?

--
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/abe0dca7-8c1c-4987-8ad5-26e6fb4f3754%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I’m not sure that executing in the kernel like this is ever going to be able to be made to work, but perhaps someone expert on IPython can chime in.

Nop, because if you use IPython.notebook.kernel.execute, you are not getting back the display representation which in turn executes the JS necessary to trigger the update… but if you are in the JS, you can probably directly interact with Bokeh… otherwise, from the python side the option that Bryan already mentioned are probably the best to follow…

···

On Wed, Oct 14, 2015 at 11:03 AM Bryan Van de Ven [email protected] wrote:

push_notebook() currently constructs a snippet of JS to update the data, and then uses the notebook’s HTML publication to execute this JS in the browser (causing the BokehJS data source to get updated). I’m not sure that executing in the kernel like this is ever going to be able to be made to work, but perhaps someone expert on IPython can chime in.

A better solution would use the IPython widget protocol to update data sources, and this has been discussed. But we are currently stretched thin on other development priorities. If anyone wanted to try and tackle this feature we would be glad to offer assistance.

Alternatively, we will be previewing a completely new, radically simpler bokeh server in the next month or so, and that would be another option.

Bryan

On Oct 14, 2015, at 3:40 AM, [email protected] wrote:

I am facing the same issue also. Did you manage to find a solution ?

On Monday, March 30, 2015 at 11:53:29 AM UTC+2, [email protected] wrote:

I am using Bokeh with IPython/Jupyter notebooks. I noticed that dataSource.push_notebook() calls only update the plot if I execute them from a codecell. I want to run push_notebook() through Javascript, i.e., IPython.notebook.kernel.execute(‘dataSource.push_notebook()’). Doing that, however, leaves the bokeh plot unchanged (lines do not update) – how could I make such a call properly?

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/abe0dca7-8c1c-4987-8ad5-26e6fb4f3754%40continuum.io.

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

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/5EF32744-9EE2-4565-9FBE-3ADD4D361C80%40continuum.io.

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

thanks.

indeed interacting with Bokeh directly from JS works. simply by executing the same piece of code that push_notebook is running:

model_id = Bokeh.Collections(‘ColumnDataSource’).models[0].id;

var ds = Bokeh.Collections(‘ColumnDataSource’).get(model_id);

ds.set(‘data’, …); /// set new data value here

···

On Wed, Oct 14, 2015 at 8:24 PM, Damian Avila [email protected] wrote:

I’m not sure that executing in the kernel like this is ever going to be able to be made to work, but perhaps someone expert on IPython can chime in.

Nop, because if you use IPython.notebook.kernel.execute, you are not getting back the display representation which in turn executes the JS necessary to trigger the update… but if you are in the JS, you can probably directly interact with Bokeh… otherwise, from the python side the option that Bryan already mentioned are probably the best to follow…

On Wed, Oct 14, 2015 at 11:03 AM Bryan Van de Ven [email protected] wrote:

push_notebook() currently constructs a snippet of JS to update the data, and then uses the notebook’s HTML publication to execute this JS in the browser (causing the BokehJS data source to get updated). I’m not sure that executing in the kernel like this is ever going to be able to be made to work, but perhaps someone expert on IPython can chime in.

A better solution would use the IPython widget protocol to update data sources, and this has been discussed. But we are currently stretched thin on other development priorities. If anyone wanted to try and tackle this feature we would be glad to offer assistance.

Alternatively, we will be previewing a completely new, radically simpler bokeh server in the next month or so, and that would be another option.

Bryan

On Oct 14, 2015, at 3:40 AM, [email protected] wrote:

I am facing the same issue also. Did you manage to find a solution ?

On Monday, March 30, 2015 at 11:53:29 AM UTC+2, [email protected] wrote:

I am using Bokeh with IPython/Jupyter notebooks. I noticed that dataSource.push_notebook() calls only update the plot if I execute them from a codecell. I want to run push_notebook() through Javascript, i.e., IPython.notebook.kernel.execute(‘dataSource.push_notebook()’). Doing that, however, leaves the bokeh plot unchanged (lines do not update) – how could I make such a call properly?

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/abe0dca7-8c1c-4987-8ad5-26e6fb4f3754%40continuum.io.

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

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/5EF32744-9EE2-4565-9FBE-3ADD4D361C80%40continuum.io.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/cGIy7bxfi6Q/unsubscribe.

To unsubscribe from this group and all its topics, 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/CAM9Ly3GkK9Rt%3DLKkNxtLscKLzsyfvTkHGXXKcL6N5y7Vp7ODeQ%40mail.gmail.com.

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