Closed pplonski closed 6 months ago
Is it possible to have such behavior in JupyterLab? is it possible to have Jupyter Lab extension that will re-execute cells after widget interaction?
Yes, you can either create a custom JupyterLab extension registering a custom slider, with a callback using JupyterLab commands to execute cells directly, or you could execute them from Python via https://github.com/jtpio/ipylab.
Buttons can also use data-commandLinker-command
attribute, but I am not sure if these already work with ipywidgets.
Thank you for prompt response! So it should be possible to add a custom handler to observe widget's changes, and call cells exection from Python code, some pseudo-code below:
slider = ipywidgets.IntSlider(min=-5, max=5, value=1, description='Slider')
def handle_slider_change(change):
call_notebook_command('notebook:run-all-below')
slider.observe(handle_slider_change, names='value')
Is it possible to execute all cells (or cells below current cell) after interaction with selected widgets? For example, I would like to always re-execute all cells below slider widgets whenever slider is updated.
Is it possible to have such behavior in JupyterLab? is it possible to have Jupyter Lab extension that will re-execute cells after widget interaction?