Repository navigation
Add analysis cards to share link and make URLs persistent #61
Description
Activity
In the EWED project, there will be a database with historic forest fires, and for each fire we would like to store a URL corresponding to the CLASS configuration for that specific case. To ensure that these URL will still be valid for future versions of CLASS, it would be nice if it was possible to store only partial configs in the URL.
To make sure a URL uniquely reproduces an old experiment, the default or preset configuration should be persistent.
- changed the title
[-]Add analysis cards to share link[/-][+]Add analysis cards to share link and make URLs persistent[/+]on Oct 21, 2024 For example
// Content of ewedv1.json preset could like const preset_ewedv1 = { $schema: 'https://classmodel.github.io/class-web/schema/class.v1.2.3.json', title: 'EWE DV1', description: 'Describe what is special about this preset', initialState: { h_0: 200, theta_0: 288, dtheta_0: 1, q_0: 0.008, dq_0: -0.001, }, timeControl: { dt: 60, runtime: 43200 }, mixedLayer: { wtheta: 0.1, advtheta: 0, gammatheta: 0.006, wq: 0.0001, advq: 0, gammaq: 0, divU: 0, beta: 0.2, }, } const appState = { expirments: [{ name: 'high', // Can be short name or url // Short names resolves to local presets directory which is part of a package // preset: 'ewedv1', preset: 'https://classmodel.github.io/class-web/presets/ewedv1.json', description: 'High elevation. Class config for [ewed entry #1234](https://.../1234)', reference: { // Applies defaults from given json schema initialState: { h_0: 500 } }, // This can be empty and does not have to include all fields permutations: { // Applies defaults from preset and from reference "beta2": { mixedLayer: { beta: 0.1 } }, } // This can be empty // Does not contain output of a CLASS model run, run(s) will be done on load }], analyis: [{ // ... skewT chart }] } const url = makeUrlSafe(appState)
Would be nice to have a JSON schema of the appState and export makeUrlSafe() in package so other applications can check they are giving right state in url.
Would nice to list preset links on some web page, part of webapp or docs site or README
We should minimize fetching the preset json, either use json part of package or cache it in ~/.cache/class/presets/bla.json
We will need functions to combine and subtract configs in preset, reference and permutation. Some components will need a full config and others will need a partial config.
In the form we will need to pass placeholders in the JSON schema or via new prop.
show vertical plot and timeseries plot after the first experiment is submitted.
Keep unsharable complex state in local storage. Local storage is filled by pressing save button.
In future could add name so multiple states can be stored.
Share simple experiment via url in clipboard, load simple experiment from url searchparam/fragment.
State in url has higher priority than local storage, use can still load from locals torage if needed.see nuqs package.
Done in #191
Since #55 you can create a link to share an experiment. However it does not included any analysis. As a receiver of a shared link I would expect that the analysis would be part of the link.
Also what would be nice to have description/comment included that explains something about the analysis.