F1: whole-number axis range typed as a pair; explicit ranges win

This commit is contained in:
2026-12-01 13:51:14 -06:00
parent e14a85261c
commit 0fd5cc70ec
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ export function wholeNumberAxis(values: Iterable<number | null | undefined>) {
dtick: step * magnitude, dtick: step * magnitude,
tickformat: '.0f', tickformat: '.0f',
...(Math.ceil(min) > Math.floor(max) && min <= max ...(Math.ceil(min) > Math.floor(max) && min <= max
? { range: [Math.floor(min), Math.ceil(max)] } ? { range: [Math.floor(min), Math.ceil(max)] as [number, number] }
: {}), : {}),
}; };
} }
+2 -2
View File
@@ -333,8 +333,8 @@ export function zBars(eeg: Study): SingleTrace {
layout: { layout: {
xaxis: { xaxis: {
title: { text: 'Puntuación z' }, title: { text: 'Puntuación z' },
range: [-limit, limit],
...wholeNumberAxis([-limit, limit]), ...wholeNumberAxis([-limit, limit]),
range: [-limit, limit],
}, },
yaxis: { autorange: 'reversed', automargin: true }, yaxis: { autorange: 'reversed', automargin: true },
shapes: [ shapes: [
@@ -394,7 +394,7 @@ export function probabilityCurve(
data, data,
layout: { layout: {
xaxis: { title: { text: 'Puntuación z' } }, xaxis: { title: { text: 'Puntuación z' } },
yaxis: { title: { text: 'Probabilidad (%)' }, range: [0, 100], ...wholeNumberAxis([0, 100]) }, yaxis: { title: { text: 'Probabilidad (%)' }, ...wholeNumberAxis([0, 100]), range: [0, 100] },
}, },
}; };
} }