global: snapshot

This commit is contained in:
nym21
2026-02-13 15:25:13 +01:00
parent 80b2c636b0
commit d18c872072
14 changed files with 707 additions and 267 deletions

View File

@@ -91,8 +91,8 @@ export function init() {
// Set blueprints first so storageId is correct before any index change
chart.setBlueprints({
name: opt.title,
top: buildTopBlueprints(opt.top),
bottom: opt.bottom,
top: buildTopBlueprints(opt.top()),
bottom: opt.bottom(),
onDataLoaded: updatePriceWithLatest,
});
@@ -120,11 +120,11 @@ const ALL_CHOICES = /** @satisfies {ChartableIndexName[]} */ ([
* @returns {ChartableIndexName[]}
*/
function computeChoices(opt) {
if (!opt.top.size && !opt.bottom.size) {
if (!opt.top().size && !opt.bottom().size) {
return [...ALL_CHOICES];
}
const rawIndexes = new Set(
[Array.from(opt.top.values()), Array.from(opt.bottom.values())]
[Array.from(opt.top().values()), Array.from(opt.bottom().values())]
.flat(2)
.filter((blueprint) => {
const path = Object.values(blueprint.metric.by)[0]?.path ?? "";