You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
window transform: difference, ratio, first and last drop the trailing outputs of each series #2472
The difference, ratio, first and last window reducers stop their loops early: with strict: true the last full window is missing, and with strict: false the last k - 1 - s truncated windows are missing. Other reducers such as mean fill these positions.
In a chart, Plot.lineY(data, Plot.windowY({k: 7, reduce: "difference"}, ...)) stops short of the right edge.
Tested with @observablehq/plot 0.6.19 and main 2245188, Node.js v26.13.0.
In src/transforms/window.js, reduceDifference, reduceRatio, reduceFirst and reduceLast use n = I.length - k in the strict branch (should be I.length - k + 1) and n = I.length - k + s + 1 in the non-strict branch (should be I.length - s, with the window clipped to I.length).
Activity