jupyter-widgets / ipywidgets

Interactive Widgets for the Jupyter Notebook
https://ipywidgets.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3.14k stars 948 forks source link

Vdom ipywidget #2039

Open jasongrout opened 6 years ago

jasongrout commented 6 years ago

It would be cool to have a vdom ipywidget using https://github.com/nteract/vdom on the python side and probably react on the browser side.

jasongrout commented 6 years ago

I would imagine this would be like the HTML widget - it has a single 'value' attribute which is the vdom root node, and uses react to render to it's root node.

jasongrout commented 6 years ago

(This may be better to be a separate widget at first, and we can eventually incorporate it into ipywidgets as it matures.)

shoobomb commented 5 years ago

Hi @jasongrout , I have created a custom IPyWidget using VDOM that uses VDOM on the backend/python side and ReactJS on the frontend/browser side. Please have a look at the example here. Ref: Vdom_Ipywidget. This example has been tried and tested on Jupyter Notebook.

How should we proceed further with integrating it with the IPyWidgets ?

AaronWatters commented 5 years ago

I added essentially the same functionality to the jp_doodle package. Here is the demo

https://github.com/AaronWatters/jp_doodle/blob/master/notebooks/misc/wdom%20demo.ipynb

It supports calling in from Python to widget components and calling back from the components (via javascript) to the Python kernel. FYI.