Every chart uses the shared short number format: axes, hover and bar/value text

Counts print as integers and other values with at most one decimal, in tick labels (valueAxis, percentAxis), hover templates and bar and pie text.
This commit is contained in:
2026-12-01 17:20:28 -06:00
parent 5cd601651c
commit ef407ce0a7
3 changed files with 53 additions and 26 deletions
+2 -2
View File
@@ -249,7 +249,7 @@ export function ageNorm(rows: Centile[], metric: Metric, age: number): Figure {
},
],
layout: {
xaxis: { title: { text: 'Edad (meses)' } },
xaxis: { title: { text: 'Edad (meses)' }, ...valueAxis([age]) },
yaxis: {
title: { text: metric.unit ?? 'Valor' },
...valueAxis([metric.value, ...rows.flatMap(({ p5, median, p95 }) => [p5, median, p95])]),
@@ -390,7 +390,7 @@ export function probabilityCurve(
return {
data,
layout: {
xaxis: { title: { text: 'Puntuación z' } },
xaxis: { title: { text: 'Puntuación z' }, ...valueAxis([pair.z, 0]) },
yaxis: { title: { text: 'Probabilidad (%)' }, ...valueAxis([0, 100]), range: [0, 100] },
},
};