Save user generated data in notebook?

Is it possible to save user generated data inline or as an attachment such that refresh browser re-loads the data?

For example, extending off this example: Adding Nodes to a Force-Directed Graph / Robert Lesser / Observable

Once the user has created a few nodes, the dynamicData object is updated. Can that be written to an attachment or to inline data such that when I reload the browser the same data can be reloaded?

I’m guessing a Database may provide this capability, but my dataset is small and I’m hoping to shortcut the database.

I found the announcement for attachments which mentioned that mutable attachments may be planned- I think that may solve my problem.

Thank you

1 Like

The data could be save and loaded from in local-storage

An external why might be to use a github gist or Paste Bin for storage.
But that would be a lot more coding.

I don’t know if the localfiles system has been addressed in observable, I asked about it last year as I was wanting to use a notebook to save and load local data.

1 Like

Thank you for that suggestion. It appears this could solve for me on my machine but not other users visiting my notebook.

Here is the use case I’d like to support, maybe there is another way to get there -

I will create a default data set and a visualization and publish it in a notebook. The notebook includes a selector to choose which data-source to display (e.g. default). Any visitors to the notebook can tweak some of the data values with user controls in the notebook, and then save the data so that it appears in the data source selector, and can be re-loaded by any visitors.

Related:

1 Like