Public
Edited
Apr 5, 2019
1 fork
3 stars
Insert cell
Insert cell
Insert cell
data = [
{ label: 'Sent emails', value: 10000, color: '#d7191c' },
{ label: 'Received', value: 2000, color: '#fdae61' },
{ label: 'Opened', value: 400, color: '#abdda4' },
{ label: 'Clicked CTA', value: 80, color: '#2b83ba' }
];
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
height_fn = (t, a, b, h) => {
if (a === 0 && b === 0) {
throw new Error("The trapezoid can't have both bases be zero-length.");
}
if (a === b) {
return (a + b) / 2 * h * t / a;
}
return (-a + Math.sqrt(a * a + (b*b - a*a) * t)) * h / (b - a);
}
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