Published unlisted
Edited
May 5, 2022
Insert cell
# Data Pivots
Insert cell
source = ([
{ year: 2020, month: "jan", total: 10 },
{ year: 2020, month: "feb", total: 20 },
{ year: 2019, month: "jan", total: 10 },
{ year: 2019, month: "feb", total: 7 },
{ year: 2018, month: "jan", total: 10 },
{ year: 2018, month: "feb", total: 5 }
])
Insert cell
pivot = d3.group(source, d => d.month)
Insert cell
Array.from(pivot)
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