F1: whole-number axis range typed as a pair; explicit ranges win
This commit is contained in:
@@ -427,7 +427,7 @@ export function wholeNumberAxis(values: Iterable<number | null | undefined>) {
|
||||
dtick: step * magnitude,
|
||||
tickformat: '.0f',
|
||||
...(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] }
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -333,8 +333,8 @@ export function zBars(eeg: Study): SingleTrace {
|
||||
layout: {
|
||||
xaxis: {
|
||||
title: { text: 'Puntuación z' },
|
||||
range: [-limit, limit],
|
||||
...wholeNumberAxis([-limit, limit]),
|
||||
range: [-limit, limit],
|
||||
},
|
||||
yaxis: { autorange: 'reversed', automargin: true },
|
||||
shapes: [
|
||||
@@ -394,7 +394,7 @@ export function probabilityCurve(
|
||||
data,
|
||||
layout: {
|
||||
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] },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user