jupyterlab / frontends-team-compass

A repository for team interaction, syncing, and handling meeting notes across the JupyterLab ecosystem.
https://jupyterlab-team-compass.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
59 stars 30 forks source link

Discussion on implementing directed acyclic graph-like structure in notebooks #118

Open jd41 opened 3 years ago

jd41 commented 3 years ago

I want to work/get advised on a project to support a directed acyclic graph-like structure between cells in Jupyter notebook, and set up a Zoom meeting with other interested people. See jupyter/notebook#1175 for former discussion by other people - I also brought this topic up in the January 13th JupyterLab development meeting.

What I currently roughly have in mind (of course, open to discussion, I am also happy to present something by screensharing):

  1. Each cell n is annotated with metadata specifying which cells it depends on (e.g. because cell n only works if a prerequisite cell calculated an array), and this is displayed visually (e.g. by arrows) in the notebook (I am not sure how to make this look good without overloading the UI at the moment - maybe some part of the screen that can be toggled, like the Table of Contents in Adobe Reader?)
  2. Explanatory cells/titles can also be part of the directed acyclic graph, which is hopefully useful in making the notebook's logical structure clearer to a human. If a human wants to understand only some results, they may save time by not following the entire notebook.
  3. If you click the "+" button (which adds a new cell) while cell n is in-focus, the new cell is automatically designated "dependent on cell n"; the user can add further dependencies manually.
  4. If you change a cell's code, all descendants get visually marked as stale; there is an option to "recalculate all stale cells" or suchlike.
  5. features in a cell n's dropdown menu:
    • Show dependent cells (so you can see how the variables that cell n uses are defined),
    • hide all cells that are not necessary to calculate cell n. As in point 2, in a notebook like this one, this can save time for a reader who wants to understand only some of the results.
bollwyvl commented 3 years ago

You may want to check out: https://github.com/cphyc/node_editor

There is also something of a discussion going on about it on gitter:

https://gitter.im/jupyterlab/jupyterlab?at=600e9a586b20cf7730d7d5b6

(can't find the origin of the thread, mostly about re-using parts of JupyterLab)

meeseeksmachine commented 3 years ago

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/dag-based-notebooks/11173/2