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:
Marcel
2026-05-29 16:26:07 +02:00
parent a7d0e96613
commit 369a0213e5
2 changed files with 21 additions and 0 deletions

View File

@@ -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) };
}