-
Notifications
You must be signed in to change notification settings - Fork 236
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
Added the possibility to store the data in an external file. #21
base: master
Are you sure you want to change the base?
Conversation
Hey, this is a nice idea. I wonder if we can take this a step higher. To store the whole application to a separate json file, and load that. This would possible be something that could go upstream in ipywidgets as well. |
We can store all the widget attributes, in a separate files (the one defined at tre traitlets level). |
What annoyed me a little with my implementation is that I could not find a way to load data from a model, and I had to use a collection. So to minimize the change on your code, this collection is an attribute of the scatterview. |
See for instance in the Notebook @SylvainCorlay: I wouldn't be surprised if someone already did this, do you know? |
I see. |
Yeah, I think both cases would be interesting. For instance (thinking ahead), I'd like to see some kind of 'datastore' object on the JS side, so that multiple libraries, like bqplot, ipyvolume could tap into that data. In that case you could think of loading external data. But that is (I think) quite far into the future, so I'm not sure what is wise to do in the meantime. |
A widget "file format" which stores both the manager state (current json downloadable in the menu bar) and which top-level widget(s) should be displayed at a top level. Then we can make a loader for that file format in jupyterlab. |
@SylvainCorlay what about an intermediate solution. If we add to the state schema a 'url' property. The manager could then, if this 'url' property is present, load the json using ajax, and have some kind spinner showing while loading. |
Sounds like a good idea too. |
@jeammimi would this work for you? I cannot work on if for ~2 weeks, I could help out if you want to give it a go. But it requires work setting up a dev version of ipywidgets. |
Hi. I will not be able to work on it this week, but I will see next week, if it is not too hard to implement. |
8531be1
to
f376042
Compare
3c896f6
to
a923744
Compare
e861e87
to
6dead3f
Compare
This property is control by the attribute embed added to the Scatter class
if set to None, the data is stored in the html file
if set to "" the data is stored in a json file whose name is generated kind of randomly
if set to example.json if will be stored in example.json
You can also control the behavior when applying embed_html
if inside is set to False, if will apply the rules previously describe.
if inside is set to True, in will put the data inside the html