ipylab icon indicating copy to clipboard operation
ipylab copied to clipboard

Add more examples

Open jtpio opened this issue 5 years ago • 6 comments

There could be more examples, such as more advanced widgets, for example with bqplot:

bqplot-example

jtpio avatar Nov 22 '19 19:11 jtpio

Or even show the "Variable Inspector" from: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/examples/Variable%20Inspector.ipynb

jtpio avatar Nov 22 '19 19:11 jtpio

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.

krassowski avatar Nov 27 '21 14:11 krassowski

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", {})

deeplook avatar Dec 21 '22 21:12 deeplook

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

jtpio avatar Dec 22 '22 13:12 jtpio

Maybe something like this might help for now (although quite brittle): jupyterlab/jupyterlab#13080 (comment)

A helpful workaround, indeed, thanks!

deeplook avatar Dec 23 '22 09:12 deeplook

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

willeppy avatar Feb 10 '23 23:02 willeppy