Public
Edited
Oct 24, 2023
14 stars
Insert cell
Insert cell
Insert cell
d3.cumsum([1, 2, 3, 4])
Insert cell
Insert cell
function* countdown(n) {
do { yield n; } while (n-- > 0);
}
Insert cell
d3.cumsum(countdown(10))
Insert cell
Insert cell
d3.cumsum([1, NaN, undefined, 2, "wat", 7])
Insert cell
Insert cell
d3.cumsum([{a: 1.3}, {a: 2.2}, {a: 3.0}], d => d.a)
Insert cell
Insert cell
data = [
{a: "pass", time: 0},
{a: "pass", time: 10},
{a: "goal", time: 23},
{a: "pass", time: 31},
{a: "pass", time: 40}
]
Insert cell
d3.cumsum(data, d => d.a === "goal")
Insert cell
Insert cell
normal = d3.randomNormal(0, 4)
Insert cell
randomWalk1d = d3.cumsum({length: width - 20}, normal)
Insert cell
Insert cell
Insert cell
randomWalk2d = d3.zip(
d3.cumsum({length: 4000}, normal),
d3.cumsum({length: 4000}, normal)
)
Insert cell
Insert cell
Insert cell
d3.cumsum({length: 10}, () => 0.1)
Insert cell
d3.fcumsum({length: 10}, () => 0.1)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more