☰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

Is it possible to user pure python for the interactive visualization (not interactive app)

Community Support
Dennis_O_Brien
Dennis_O_Brien

Hi Jeff,

You can write callbacks in Python that are executed in JavaScript in the browser. It covers a lot of common use cases, but there are limitations of course. Here’s some documentation that has links to the PyScript docs:

http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/callbacks.html#customjs-with-a-python-function

HTH,

Dennis

···

On Thu, Mar 23, 2017 at 12:47 AM Jeff Zhang zjffdu@gmail.com wrote:

Hi,

I check the following bokeh tutorial notebook, It seems for interactive visualization, bokeh has to use CustomJS, while for interactive app, bokeh can just use pure python. (Correct me if I am wrong), I am just wondering is it possible to use pure python code for the interactive visualization ? Thanks

https://github.com/bokeh/bokeh-notebooks/blob/master/tutorial/00%20-%20intro.ipynb

–

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/2e16133e-9653-4cc5-a213-b171ec28de80%40continuum.io.

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

⌁   Link to post
Jeff_Zhang
Jeff_Zhang

Thanks Dennis, what I want to is to write call back via python, just like bokeh app.

Dennis O’Brien dennis@dennisobrien.net于2017年3月28日周二 上午10:39写道:

···

Hi Jeff,

You can write callbacks in Python that are executed in JavaScript in the browser. It covers a lot of common use cases, but there are limitations of course. Here’s some documentation that has links to the PyScript docs:

http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/callbacks.html#customjs-with-a-python-function

HTH,

Dennis

On Thu, Mar 23, 2017 at 12:47 AM Jeff Zhang zjffdu@gmail.com wrote:

Hi,

I check the following bokeh tutorial notebook, It seems for interactive visualization, bokeh has to use CustomJS, while for interactive app, bokeh can just use pure python. (Correct me if I am wrong), I am just wondering is it possible to use pure python code for the interactive visualization ? Thanks

https://github.com/bokeh/bokeh-notebooks/blob/master/tutorial/00%20-%20intro.ipynb

–

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/2e16133e-9653-4cc5-a213-b171ec28de80%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 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/CAPUwX3OGAx3mtx_J_bSGHBU7Pydx-aH88ecnZzR6qUC4UO8jRQ%40mail.gmail.com.

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

⌁   Link to post
Bryan
Bryan

Hi,

I just want to re-iterate that the ability to write CustomJS callbacks in "python" using PyScript is offered as a (possibly) helpful convenience to avoid having to write JavaScript directly. But its important to note that such code is *converted* to JavaScript, and is *only* executed in the browser. It can't do anything that JS can't do. In particular it cannot, e.g. run pandas or numpy or any other real python library, because it's not executed as python code in a python interpreter.

If you need to run *real* python code in your callbacks, i.e. pandas or whatever, then your only option is to use a Bokeh server. The Bokeh server is the place where real python can actually be executed by a real python interpreter.

Thanks,

Bryan

···

On Mar 28, 2017, at 20:55, Jeff Zhang <zjffdu@gmail.com> wrote:

Thanks Dennis, what I want to is to write call back via python, just like bokeh app.

Dennis O'Brien <dennis@dennisobrien.net>于2017年3月28日周二 上午10:39写道:
Hi Jeff,

You can write callbacks in Python that are executed in JavaScript in the browser. It covers a lot of common use cases, but there are limitations of course. Here's some documentation that has links to the PyScript docs:
http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/callbacks.html#customjs-with-a-python-function

HTH,
Dennis

On Thu, Mar 23, 2017 at 12:47 AM Jeff Zhang <zjffdu@gmail.com> wrote:
Hi,

I check the following bokeh tutorial notebook, It seems for interactive visualization, bokeh has to use CustomJS, while for interactive app, bokeh can just use pure python. (Correct me if I am wrong), I am just wondering is it possible to use pure python code for the interactive visualization ? Thanks

https://github.com/bokeh/bokeh-notebooks/blob/master/tutorial/00%20-%20intro.ipynb

--
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/2e16133e-9653-4cc5-a213-b171ec28de80%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 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/CAPUwX3OGAx3mtx_J_bSGHBU7Pydx-aH88ecnZzR6qUC4UO8jRQ%40mail.gmail.com\.
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 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/CAADy7x4G5v2G9%3DEh6fQ1BPDbY3h4PfYpW%3DUd-x%3D98PALntqQfg%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled