zenno: include rightmost endpoint in stat charts

This commit is contained in:
2026-05-24 18:06:40 -04:00
parent b1c6850ce1
commit 0f14ece4da

View File

@@ -39,7 +39,18 @@
plotOptions?: Omit<Plot.PlotOptions, 'marks' | 'x' | 'y'>;
}
let { stat, y = [], yArea = [], yLabel, range, xRange, xRule = [], yRule = [], class: className, plotOptions = {} }: Props = $props();
let {
stat,
y = [],
yArea = [],
yLabel,
range,
xRange,
xRule = [],
yRule = [],
class: className,
plotOptions = {},
}: Props = $props();
let width = $state(0);
let height = $state(0);
@@ -58,7 +69,7 @@
}
return 100 * Math.ceil(Math.max(1200, ...xLines) / 100);
});
const xVal = $derived(d3.range(xMin, xMax, 5));
const xVal = $derived(d3.range(xMin, xMax + 1, 5)); // +1 because d3.range does not include the max
const thrX = 1200;
const series = $derived([y].flat(1).filter((s) => s != null));