From b4ded21ea3a1d2a8da62bd9df35178fe652eb32b Mon Sep 17 00:00:00 2001 From: nym21 Date: Thu, 26 Mar 2026 22:02:15 +0100 Subject: [PATCH] website: chart fix --- website/scripts/options/shared.js | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/website/scripts/options/shared.js b/website/scripts/options/shared.js index a593229c5..4f49c1482 100644 --- a/website/scripts/options/shared.js +++ b/website/scripts/options/shared.js @@ -415,32 +415,14 @@ export function revenueRollingBtcSatsUsd({ coinbase, subsidy, fee }) { * Build percentile USD mappings from a ratio pattern * @param {AnyRatioPattern} ratio */ +/** @param {AnyRatioPattern} ratio */ export function percentileUsdMap(ratio) { - const p = ratio.percentiles; - return /** @type {const} */ ([ - { name: "P95", prop: p.pct95.price, color: colors.ratioPct._95 }, - { name: "P5", prop: p.pct5.price, color: colors.ratioPct._5 }, - { name: "P98", prop: p.pct98.price, color: colors.ratioPct._98 }, - { name: "P2", prop: p.pct2.price, color: colors.ratioPct._2 }, - { name: "P99", prop: p.pct99.price, color: colors.ratioPct._99 }, - { name: "P1", prop: p.pct1.price, color: colors.ratioPct._1 }, - ]); + return percentileBandsWith(ratio.percentiles, (e) => e.price); } -/** - * Build percentile ratio mappings from a ratio pattern - * @param {AnyRatioPattern} ratio - */ +/** @param {AnyRatioPattern} ratio */ export function percentileMap(ratio) { - const p = ratio.percentiles; - return /** @type {const} */ ([ - { name: "P95", prop: p.pct95.ratio, color: colors.ratioPct._95 }, - { name: "P5", prop: p.pct5.ratio, color: colors.ratioPct._5 }, - { name: "P98", prop: p.pct98.ratio, color: colors.ratioPct._98 }, - { name: "P2", prop: p.pct2.ratio, color: colors.ratioPct._2 }, - { name: "P99", prop: p.pct99.ratio, color: colors.ratioPct._99 }, - { name: "P1", prop: p.pct1.ratio, color: colors.ratioPct._1 }, - ]); + return percentileBandsWith(ratio.percentiles, (e) => e.ratio); } /**