Skip to content

Commit b730475

Browse files
pre aggregation
1 parent 69545cc commit b730475

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

index.html

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,41 @@
104104

105105

106106
import { TableExplorer } from "./rl-tools/static/extrack_ui/TableExplorer.js";
107-
const tableExplorer = new TableExplorer(idx, {"verbose": true})
108-
const explorerContainer = document.getElementById('explorer-container');
109-
explorerContainer.appendChild(tableExplorer.getContainer());
110-
111107
import { Zoo } from "./rl-tools/static/extrack_ui/Zoo.js";
112-
const zoo = new Zoo(idx, {"verbose": true})
113-
const zooContainer = document.getElementById('zoo-container');
114-
zooContainer.appendChild(zoo.getContainer());
108+
109+
// Wait for index to load before creating components
110+
idx_promise.then(() => {
111+
// Create Zoo first with empty selection
112+
const zoo = new Zoo([]);
113+
const zooContainer = document.getElementById('zoo-container');
114+
zooContainer.appendChild(zoo.getContainer());
115+
116+
// Create TableExplorer with callback to update Zoo
117+
const tableExplorer = new TableExplorer(idx, {
118+
onSelectionChange: (selectedRuns) => {
119+
zoo.updateRuns(selectedRuns);
120+
}
121+
});
122+
const explorerContainer = document.getElementById('explorer-container');
123+
explorerContainer.appendChild(tableExplorer.getContainer());
124+
125+
// Wait for table to initialize and set default selections
126+
tableExplorer.initialized.then(() => {
127+
// Select last curated run and last 3 CI runs
128+
const allRuns = tableExplorer.runs;
129+
const curatedRuns = allRuns.filter(r => r.source === 'curated');
130+
const ciRuns = allRuns.filter(r => r.source === 'ci');
131+
132+
const defaultSelections = [
133+
...(curatedRuns.length > 0 ? [curatedRuns[0]] : []),
134+
...ciRuns.slice(0, 3)
135+
];
136+
137+
if (defaultSelections.length > 0) {
138+
tableExplorer.setSelectedRuns(defaultSelections);
139+
}
140+
});
141+
});
115142

116143

117144
fetch("./last_updated.txt")

0 commit comments

Comments
 (0)