JerryI / wolfram-js-frontend

Dynamic Notebook Environment for Wolfram Language written in Javascript
https://jerryi.github.io/wljs-docs/
GNU General Public License v3.0
303 stars 13 forks source link

[Feature Request] Infinite Canvas interface #53

Closed dishmint closed 5 months ago

dishmint commented 1 year ago

Vertical layouts can restrict organizational flexibility.

There are times when I'd like to have a set of cells adjacent to my working location in a nb, so I don't have to scroll 'all the way up' or down. In Mathematica, I suppose one could copy and paste cells into a new nb and have two nbs open at once, or create some sort of palette that presents 'pinned' cells, but I think an infinite canvas is a much better solution, and presumably would be easier to implement with an open project than working with M's frontend itself.

In the pkm app Obsidian there's a feature called Canvas.

Users can create cards in an infinite workspace, and each card is a kind of note. Here, in the js-frontend, cards could be an embedded nb or groups of individual cells.

Having free cells / nbs would help with grouping ideas or approaches, for example, one can have areas for function prototyping, function exposition, and maybe another for relevant links to papers etc.

Crude example:

A notebook describing arithmetic on expressions with head expr Crude example of an infinite canvas notebook
dishmint commented 1 year ago

One thing I overlooked is order of evaluation 🫠

JerryI commented 1 year ago

Hi @dishmint! This is a nice idea to be implemented as sort of extension.

I see you are looking for OneNote 2016 on steroids heh. :)

I tried yesterday using attribute position:absolute and d3.drag applied to a cell's container and it looks quite promising.

We will share the results when they will be ready more or less ;)

JerryI commented 1 year ago

some preliminary results Canvas.txt

https://github.com/JerryI/wolfram-js-frontend/assets/4111822/49e20ba9-72f0-4a0f-8138-ce4121a741b1

(just change the extension to .wln and evaluate initializaition cells)

But this idea might be doomed because of Issue with an editor

dishmint commented 1 year ago

Dang! It's cool to see a preliminary version at least.

Fingers crossed, I think this will be very useful ext to nbs.

userrand commented 12 months ago

Nice idea.

For the scrolling problem you can maybe use cell tags with NotebookLocate.

The following stack exchange answer provides details on how to use NotebookLocate with the usual Mathematica notebooks.

Not sure if there is a tag feature in Jupyter notebooks with Jupyter, Vscode or Jupyter lab.

JerryI commented 12 months ago

But this idea might be doomed because of Issue with an editor

Ok. Good news, looks like it was fixed 2mo ago link