ipylab
ipylab copied to clipboard
Add more examples
There could be more examples, such as more advanced widgets, for example with bqplot
:
Or even show the "Variable Inspector" from: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/examples/Variable%20Inspector.ipynb
An example for:
- Listen to JupyterLab signals (notebook opened, console closed) and trigger Python callbacks
which is mentioned in the readme would be useful :) Though I am not sure if this is even implemented right now after a glance at the codebase.
I struggle already with very simple examples like adding a code cell dynamically, most likely because I cannot find a description of the parameters to pass for the commands, like in:
from ipylab import JupyterFrontEnd
app = JupyterFrontEnd()
code = 'L = [1, 2, 3, 4])\nprint(L)'
app.commands.execute("notebook:insert-cell-below", {})
app.commands.execute("notebook:copy-cell", {})
app.commands.execute("notebook:paste-cell-below", {})
adding a code cell dynamically
Maybe something like this might help for now (although quite brittle): https://github.com/jupyterlab/jupyterlab/issues/13080#issuecomment-1270610006
Maybe something like this might help for now (although quite brittle): jupyterlab/jupyterlab#13080 (comment)
A helpful workaround, indeed, thanks!
Maybe something like this might help for now (although quite brittle): jupyterlab/jupyterlab#13080 (comment)
A helpful workaround, indeed, thanks!
+1 for adding more examples! Especially on where to figure out what the arguments are for each command. I am also trying to add a new code cell so glad I found this thread.
Would be helpful to know how is the current API generated and how it is related to the front end docs like in https://jupyterlab.github.io/jupyterlab/classes/application_src_index.jupyterfrontend.html#commands
Unfortunatley the jupyterlab frontend docs are also hard to navigate so linking only partially solves the example issue