plot
plot copied to clipboard
Cumulative group?
I think the group transform could support a cumulative option, as the bin transform does. It’s less rarely needed since group is sometimes used with a categorical dimension, but it should make sense with an ordinal dimension.
Example workaround using map and cumsum: https://observablehq.com/d/cc6eeed33e366ce8

Plot.plot({
marks: [
Plot.areaY(movies, Plot.mapY("cumsum", Plot.groupX({y: "count"}, {x: "IMDB Rating"}))),
Plot.ruleY([0])
]
})
Ref. https://talk.observablehq.com/t/how-to-translate-vega-lite-window-transform-grammar-to-pure-vega-lite-api-code/6679/4