({contentRect}: ResizeObserverEntry)
| 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); |
no test coverage detected
searching dependent graphs…