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
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:
On Thu, Mar 23, 2017 at 12:47 AM Jeff Zhang [email protected] 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
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:
On Thu, Mar 23, 2017 at 12:47 AM Jeff Zhang [email protected] 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
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.
On Thu, Mar 23, 2017 at 12:47 AM Jeff Zhang <[email protected]> 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