website: snapshot

This commit is contained in:
nym21
2026-02-04 18:33:25 +01:00
parent 3818a72045
commit dd96709d18
3 changed files with 1171 additions and 2026 deletions

View File

@@ -18,6 +18,22 @@ import { createPriceRatioCharts } from "../shared.js";
import { baseline, price } from "../series.js";
import { Unit } from "../../utils/units.js";
/**
* @param {{ realized: { realizedPrice: ActivePricePattern, investorPrice: ActivePricePattern } }} tree
* @param {(metric: string) => string} title
* @returns {PartialChartOption}
*/
function createCompareChart(tree, title) {
return {
name: "Compare",
title: title("Prices"),
top: [
price({ metric: tree.realized.realizedPrice, name: "Realized", color: colors.realized }),
price({ metric: tree.realized.investorPrice, name: "Investor", color: colors.investor }),
],
};
}
/**
* Create prices section for cohorts with full ActivePriceRatioPattern
* (CohortAll, CohortFull, CohortWithPercentiles)
@@ -29,22 +45,7 @@ export function createPricesSectionFull({ cohort, title }) {
return {
name: "Prices",
tree: [
{
name: "Compare",
title: title("Prices"),
top: [
price({
metric: tree.realized.realizedPrice,
name: "Realized",
color: colors.realized,
}),
price({
metric: tree.realized.investorPrice,
name: "Investor",
color: colors.investor,
}),
],
},
createCompareChart(tree, title),
{
name: "Realized",
tree: createPriceRatioCharts({
@@ -84,22 +85,7 @@ export function createPricesSectionBasic({ cohort, title }) {
return {
name: "Prices",
tree: [
{
name: "Compare",
title: title("Prices"),
top: [
price({
metric: tree.realized.realizedPrice,
name: "Realized",
color: colors.realized,
}),
price({
metric: tree.realized.investorPrice,
name: "Investor",
color: colors.investor,
}),
],
},
createCompareChart(tree, title),
{
name: "Realized",
tree: [