Public
Edited
Oct 21, 2022
Insert cell
Insert cell
familyChart = graph(family, {label: d => d.data.name})
Insert cell
Insert cell
Insert cell
d3.hierarchy(family).leaves()
Insert cell
d3.hierarchy(family).children[1].children[2]
Insert cell
items = [
{ name: 'Edward', value: 21 },
{ name: 'Sharpe', value: 37 },
{ name: 'And', value: 45 },
{ name: 'The', value: -12 },
{ name: 'Magnetic', value: 13 },
{ name: 'Zeros', value: 37 }
];

// sort by value
//items.sort((a, b) => a.value - b.value);
//console.log(items)}
Insert cell
items.sort((a, b) => b.value - a.value);
Insert cell
[3, 2, 5, 4, 1].sort((a, b) => a - b)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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