second pass. medium
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user