1.3 KiB
1.3 KiB
Fixed dashboard geometry
The board uses fixed logical units:
- one
1 × 1item is exactly200 × 200logical pixels; - the gap is always
24logical pixels, giving a224pixel track pitch; - multi-cell items include the gaps between their cells (
2 × 1is424 × 200); - the canvas is transformed once with one uniform scale derived from its available width.
Items keep the same logical dimensions at every viewport. The viewport reserves
the painted size while the inner canvas remains at its logical dimensions, so a
widget's clientWidth, clientHeight, and ResizeObserver measurements stay
stable.
The read-only renderer should:
- convert persisted
xOffset/yOffset/width/heightvalues tox/y/w/h; - apply collapsed container heights and call
getCollapsedDisplayLayout; - render DOM children in
sortGridPlacementsForReadingOrderorder; - position children with
getLogicalItemStyle; - wrap them with
getScaledCanvasStylesand the read-only semantic helpers.
Edit mode can use any interaction library, but its final coordinates should be
normalized through this core. placeGridItem is the deterministic
keyboard/numeric fallback: the active item is pinned while collisions move out
of the way and all other items compact vertically. Pointer coordinates from a
scaled editor can be converted with toLogicalCanvasPoint.