Open toloudis opened 1 year ago
TODO: design json spec!
add a url query parameter or reuse existing "url". could maybe add "type" as a type hint to help decode the url.
url passed to viewer as baseUrl prop or we could add a new one if it makes sense to.
what are the minimal props you would need to specify?? at min, a url to volume data and everything has a sensible default
viewer component fetches json, and then initiates volume loading, and then populates UI entirely from json
if json prop is specified, we treat it as a complete viewer spec and no other props matter (all other props ignored)
assume json is complete (no need to specially handle missing settings yet?)
// random brainstorming:
// array of complete channels
[
{ url (index maybe), channel index, time, all the channel settings, ui group name},
{ ... },
]
// data sources
[ url, url, url ]
// what channels to pull from each data source...
consider using/extending VolumeDisplayOptions and VolumeChannelDisplayOptions from volume-viewer, or just refer to them
consider how the spread operator could be used to combine/merge objects with settings from two different places
see #107
Use Case
Users who spend a lot of time tweaking settings want to share their view with others.
Also, users may want to augment those settings (using e.g. python scripts) after obtaining them from their viewer session.
Solution
Generate a json file containing every viewer setting, including the location of the volume data loaded.
Create a new url query parameter to go and load json files to initialize the viewer with the settings contained within.
Bonus: allow loading json files from local disk also, via some ui control like a Load button. This brings up implications of being able to load other data via some kind of load button presenting a url entry dialog,etc...
Alternatives
Alternative: put all settings as url query parameters. This would generate potentially very long urls. This is probably less of a requirement than having a json file.