Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving the state of the application #11

Open
kolibril13 opened this issue May 23, 2023 · 2 comments
Open

Saving the state of the application #11

kolibril13 opened this issue May 23, 2023 · 2 comments

Comments

@kolibril13
Copy link
Owner

At the moment, closing and reopening a notebook will delete all drawings from a canvas.
Also, re-executing a cell will delete all drawings from a canvas.

Current workaround: Copy the drawings to the clipboard, re-execute the cell and paste it into the fresh canvas.

Saving the state to the metadata of the notebook cell would be nice to have!
E.g. buttons for

  • "Save tldraw state for this cell"
  • "Load tldraw state for this cell"
  • "Clear tldraw state for this cell"

Further idea: auto-saving the state for every interaction.

For reference: there is a similar button for ipywidgets
image

@TomToniq
Copy link

TomToniq commented Jan 6, 2024

What about the result of TldrawMakeStaticSVG and similar functions? How would I get those to stick?

@kolibril13
Copy link
Owner Author

First version of saving and loading drawings is now possible withTldrawMakeStaticTldraw
image

But that's not the final solution.
Re-rendering the whole widget with interactive canvers after notebook restart is currently not possible, but that's a jupyterlab issue that might get solved at some point
jupyterlab/jupyterlab#15361

I also have the idea to convert drawings to static formats like TldrawMakeStaticSVG and TldrawMakeStaticPNG, I've made an issue for that here: #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants