Closed hadim closed 5 years ago
Turns out that widget support is already in regular Jupyter. No Lab needed, I guess. At least, I ran these notebooks in Binder without a problem.
The trouble is: all the interactive widgets are Python-specific. You have to write Python code to link widgets together, deal with callbacks, etc. So I guess for SJJK, we will need to implement our own widget rendering using HTML <input>
tags in the output? I don't know what the JavaScript looks like to re-invoke that cell of the kernel when the widgets change, though.
Maybe I am on the wrong track here?
Custom JS code provided by the kernel is one way to do it but I feel like Jupyterlab is pushing in a slightly different direction with the renderers thing: https://github.com/jupyterlab/jupyter-renderers
The idea would be for the kernel to provide data as JSON and then have a "renderers" that take care of the rendering part.
I like this separation of the model and view but I don't think any interactive things with the kernel can be done that way (or maybe by sending back a modified JSON file to the kernel after an interaction is done?).
maybe by sending back a modified JSON file to the kernel after an interaction is done?
Right... I don't see any other way to do it, in general, than to send the new input values back to the kernel for recomputation. There's no way to compile all possible results into a big JSON data structure in advance.
Gonna close this, since we won't do anything with it here.
Try to get some IJ specific widgets working with the kernel.
A widget to visualize nD images would be great!