fix: fix analyitics page for @SethBurkart123

This commit is contained in:
2026-06-13 19:36:04 +09:30
parent 160407dde6
commit 14a322a128
5 changed files with 381 additions and 171 deletions
@@ -25,10 +25,32 @@
return config;
},
});
function observeChartResize(node: HTMLElement) {
let frame = 0;
const notify = () => {
cancelAnimationFrame(frame);
frame = requestAnimationFrame(() => {
window.dispatchEvent(new Event("resize"));
});
};
const observer = new ResizeObserver(notify);
observer.observe(node);
notify();
return {
destroy() {
cancelAnimationFrame(frame);
observer.disconnect();
},
};
}
</script>
<div
bind:this={ref}
use:observeChartResize
data-chart={chartId}
data-slot="chart"
class="bsplus-chart-host {className}"