Commit 5bcc299
fix: use useLayoutEffect for D3 chart rendering to prevent frame mismatches (#175)
When switching the y-axis metric on the GPU chart, dots and roofline paths
could briefly appear out of sync. The useEffect + setTimeout(0) pattern
deferred D3 rendering to after the browser paint, allowing a stale frame
to be visible. Switching to useLayoutEffect ensures all D3 updates (dots,
lines, axes, zoom restore) are applied atomically before the browser paints.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Alec Ibarra <93070681+adibarra@users.noreply.github.com>1 parent 81a87d9 commit 5bcc299
1 file changed
Lines changed: 6 additions & 6 deletions
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | | - | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
470 | 472 | | |
471 | 473 | | |
472 | 474 | | |
473 | | - | |
474 | | - | |
475 | | - | |
| 475 | + | |
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| |||
0 commit comments