Skip to content

Commit 5139fc4

Browse files
committed
remove animation
Signed-off-by: Connor Tsui <[email protected]>
1 parent f5027cd commit 5139fc4

File tree

1 file changed

+6
-47
lines changed

1 file changed

+6
-47
lines changed

vortex-wasm/wasm-test.js

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -597,58 +597,15 @@ function renderGroupSummary(groupId, groupConfig) {
597597
}
598598
}
599599

600-
/**
601-
* Number of charts to resize per animation frame when expanding a group.
602-
*/
603-
const CHARTS_PER_BATCH = 4;
604-
605-
/**
606-
* Resizes all charts in a group in batches, yielding to the browser between batches.
607-
* This processes multiple charts per frame for faster expansion of large groups.
608-
* Skips yields when tab is hidden to avoid browser throttling.
609-
*/
610-
async function resizeGroupChartsBatched(groupId) {
611-
const groupCharts = [];
612-
for (const [prefix, chart] of chartInstances.entries()) {
613-
if (prefix.startsWith(groupId + "-")) {
614-
groupCharts.push(chart);
615-
}
616-
}
617-
618-
for (let i = 0; i < groupCharts.length; i += CHARTS_PER_BATCH) {
619-
const batch = groupCharts.slice(i, i + CHARTS_PER_BATCH);
620-
for (const chart of batch) {
621-
chart.resize();
622-
}
623-
// Skip delay if page is hidden to avoid browser throttling.
624-
if (!document.hidden) {
625-
await new Promise((r) => setTimeout(r, 0));
626-
}
627-
}
628-
}
629-
630600
/**
631601
* Sets up collapsible benchmark sections.
602+
*
603+
* Chart.js automatically detects visibility changes and resizes when charts become visible.
632604
*/
633605
function setupCollapsibleBenchmarks() {
634606
document.querySelectorAll(".benchmark-header").forEach((header) => {
635-
header.addEventListener("click", async () => {
636-
const benchmarkSet = header.closest(".benchmark-set");
637-
const wasCollapsed = benchmarkSet.classList.contains("collapsed");
638-
639-
// Disable transitions during expand to avoid jank with many charts.
640-
if (wasCollapsed) {
641-
benchmarkSet.classList.add("expanding");
642-
}
643-
644-
benchmarkSet.classList.toggle("collapsed");
645-
646-
// If we just expanded, resize charts in batches.
647-
if (wasCollapsed) {
648-
const groupId = benchmarkSet.id.replace("-group", "");
649-
await resizeGroupChartsBatched(groupId);
650-
benchmarkSet.classList.remove("expanding");
651-
}
607+
header.addEventListener("click", () => {
608+
header.closest(".benchmark-set").classList.toggle("collapsed");
652609
});
653610
});
654611
}
@@ -831,6 +788,7 @@ function createChartOptions(
831788
return {
832789
responsive: true,
833790
maintainAspectRatio: false,
791+
animation: false,
834792
layout: {
835793
padding: { left: 0, right: 0, top: 0, bottom: 0 },
836794
},
@@ -1161,6 +1119,7 @@ function createEmptyChart(groupId, chartName, groupConfig) {
11611119
options: {
11621120
responsive: true,
11631121
maintainAspectRatio: false,
1122+
animation: false,
11641123
scales: {
11651124
x: { display: true },
11661125
y: {

0 commit comments

Comments
 (0)