You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would also find it useful to expose BrushState for persisting in localstorage. This allows for persistence of series and selected range.
100% agree, and actually started on this a bit ago and need to resume. Encapsulating the state in a new BrushState class will enable and simplify state management (this is a pattern I plan to lean into with more state management). Also looking at supporting band scales and fixing some element click interop.
In addition to exposing SereisState, BrushState, others, what about a prop like ...
<Chart persist="localStorage" / >
and Layerchart goes ahead and does the heavy lifting read/write to localStorage or sessionStorage?
Hmm... we would need to generate a unique ID per chart instance (could use $props.id()).
Initially I would prefer to have some callback hooks, similar to SvelteKit snapshots (capture / restore) and leave it to the user where the would like to persist (localStorage, sessionStorage, query string, API/db call, etc).
I think we approach this iteratively - expose the state, expose the hooks, and then maybe add convenient adapters if needed.
Activity
cycle4passion commentedon Jul 11, 2025
I would also find it useful to expose BrushState for persisting in localstorage. This allows for persistence of series and selected range.
techniq commentedon Jul 14, 2025
100% agree, and actually started on this a bit ago and need to resume. Encapsulating the state in a new
BrushStateclass will enable and simplify state management (this is a pattern I plan to lean into with more state management). Also looking at supporting band scales and fixing some element click interop.Progress here: #605
cycle4passion commentedon Jul 16, 2025
In addition to exposing SereisState, BrushState, others, what about a prop like ...
<Chart
persist="localStorage"
/ >
and Layerchart goes ahead and does the heavy lifting read/write to localStorage or sessionStorage?
techniq commentedon Jul 16, 2025
Hmm... we would need to generate a unique ID per chart instance (could use $props.id()).
Initially I would prefer to have some callback hooks, similar to SvelteKit snapshots (
capture/restore) and leave it to the user where the would like to persist (localStorage, sessionStorage, query string, API/db call, etc).I think we approach this iteratively - expose the state, expose the hooks, and then maybe add convenient adapters if needed.
techniq commentedon Mar 25, 2026
Coming soon in an upcoming release: