second pass. medium

This commit is contained in:
Davide Scaini
2026-04-01 11:05:00 +02:00
parent 94369606a4
commit 3d364c3992
7 changed files with 34 additions and 15 deletions
+7 -2
View File
@@ -149,9 +149,14 @@
$: renderChart(plotData, colorMap);
// Re-render on resize
// Re-render on resize — use indirect call so we always get current reactive values
let currentPlotData = plotData;
let currentColorMap = colorMap;
$: currentPlotData = plotData;
$: currentColorMap = colorMap;
onMount(() => {
const ro = new ResizeObserver(() => renderChart(plotData, colorMap));
const ro = new ResizeObserver(() => renderChart(currentPlotData, currentColorMap));
ro.observe(chartEl);
return () => ro.disconnect();
});