feat(stammbaum): serialise pan/zoom state to URL params (#692)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -56,3 +56,8 @@ export function parsePanZoomParams(raw: {
|
||||
z: clampZoom(finiteOr(raw.z, DEFAULT_ZOOM))
|
||||
};
|
||||
}
|
||||
|
||||
/** Serialise a view state into URL query params (the inverse of {@link parsePanZoomParams}). */
|
||||
export function serializePanZoomParams(state: PanZoomState): { cx: string; cy: string; z: string } {
|
||||
return { cx: String(state.x), cy: String(state.y), z: String(state.z) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user