yunabe / tslab

Interactive JavaScript and TypeScript programming with Jupyter
Apache License 2.0
737 stars 45 forks source link

Help - How to use widgets #23

Open arvind47d opened 5 years ago

arvind47d commented 5 years ago

I am wondering how to use HTML widgets for user input that uses @jupyter-widgets/base and tslab kernel.

Thanks in advance!

yunabe commented 5 years ago

To use ipywidgets from non-Python kernels, we need to implement kernel-side code to control ipywidgets. The protocol of ipywidgets (between Jupyter frontends and Jupyer kernels) is documented at https://github.com/jupyter-widgets/ipywidgets/blob/master/packages/schema/messages.md

Also, you can find the example implementation of the protocol from jupyter-widgets/ipywidgets repository:

We need to implement an equivalent of Python kernel code in JavaScript (TypeScript).

I don't think I have time to implement it in a near future. If you are interested in it, feel free to implement it and publish it as your npm library.

arvind47d commented 4 years ago

I am interested. I will review your notes and get started. Thanks!

yunabe commented 4 years ago

Sounds good. FYI, here is a guide of installing tslab from source: https://github.com/yunabe/tslab/blob/master/docs/developing.md

jmikedupont2 commented 1 month ago

Any updates?