Comments (3)
Take a look at the documentation for TaggingRules
which includes examples of using TaggingRules
to emulate DynamicModule
-type functionality, but which can be scoped to the notebook as a whole. I think this is the sort of thing you're looking for, and Wolfram frequently uses this technique in developing its own interfaces. Also, TaggingRules
at the notebook level in a palette will automatically be stored in your front end preferences. Discussion of this can be found in the Storing and Tracking Palette States Tech Note.
I'm speaking here of things which are fully implemented in the desktop FE...some of it (particularly the palettes) is less relevant at the Cloud level, although I believe that Cloud does have an understanding of TaggingRules
, et. al at the notebook level.
from wolfram-notebook-embedder.
@jfultz Thank you for the reference, I guess the "save and resume" can be achieved by TaggingRules in Desktop FE.
But I am referring to the scope of this library (Notebook-Embedder) which promises seamless integration with the web platform (html-css-js).
Looking at this from the perspective of a 3rd party WEB platform,
saving and loading state is already possible using the existing methods:
- setDynamicModuleVariable
- getDynamicModuleVariable
But my point is that its very limited because it can only be used with predefined variables.
On the other hand, by exposing only one method to "discover" all the available variables in the notebook like:
- getAllDynamicModuleVariables
will make this a powerful and generic approach for storing/loading state on any cloud notebook.
I know that this may not be as simple as it sounds so for now its only food for thought.
from wolfram-notebook-embedder.
@portokallidis just to make it clear.
A notebook contains many cells. Each cell can contain many dynamic modules. There's more, dynamic modules can be nested.
Currently if you have cell's ID you can use the API to operate on the first dynamic module found in that cell.
So even with getAllDynamicModuleVariables
you still need setALLDynamicModuleVariables
because currently you can only us this for the first dynamic module in each cell.
This boils down to a request for a more fine grained control, including selecting them, over dynamic module instances.
@jfultz @poeschko for what's it worth, our case involves single cell with a one case of a nested modules:
DynamicModule[{ specControlledByUs },
...
Manipulate[
...
, externalSpec (* we parse it to get variables list *)
, injectedDynamicWrapperThatManagesCommunicationBetweenSpecs
]
]
As for save and resume feature there are alternatives as making copy of notebooks or making notebooks only as a result of API[{DMstate},
action. Or even Delayed
notebooks. But that is very case sensitive and diverges from the OP.
from wolfram-notebook-embedder.
Related Issues (15)
- Punctuation rendering is abnormal HOT 1
- Method to generate /statichtml/ version of the current state of the embedded notebook HOT 1
- Control the notebook from your JavaScript code HOT 1
- When I republish a notebook, it is not updated in the embed HOT 2
- Documentation of JSON expression representation HOT 4
- Webpack v4 jsonpFunction conflict HOT 2
- Improve package loading compatibility in documentation HOT 3
- evaluation events vs. manipulate
- DynamicModule variables names convention HOT 1
- css selectors for styling sections/subsections etc?
- Can't capture 'Rejected unsafe expression'
- getDynamicModuleVariable bug? HOT 3
- Side effect of unsafe values in setDynamicModuleVariable
- Embedding non-public notebooks? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wolfram-notebook-embedder.