MCPcopy Index your code
hub / github.com/tinyplex/tinybase / updateLayout

Function updateLayout

src/ui-react-dom-charts/common/svg.ts:34–41  ·  view source on GitHub ↗
({contentRect}: ResizeObserverEntry)

Source from the content-addressed store, hash-verified

32 }
33
34 const updateLayout = ({contentRect}: ResizeObserverEntry) => {
35 const style = svg.ownerDocument.defaultView?.getComputedStyle(svg);
36 const nextLayout = [getSvgSize(contentRect), getStyle(style)] as const;
37 if (!isLayoutEqual(chartLayoutRef.current, nextLayout)) {
38 chartLayoutRef.current = nextLayout;
39 setChartLayout(nextLayout);
40 }
41 };
42
43 const observer = new ResizeObserver(([entry]) => updateLayout(entry));
44 observer.observe(svg);

Callers 1

useLayoutFunction · 0.70

Calls 3

getSvgSizeFunction · 0.70
getStyleFunction · 0.70
isLayoutEqualFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…