Public
Edited
Dec 2, 2023
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = Array.from({length: range}, (_, i) => {
return {
x: d3.randomNormal(0, 10)(),
y: d3.randomNormal(0, 10)(),
s: d3.randomUniform(20, 80)(),
c: d3.randomUniform(20, 80)()
} })
Insert cell
Plot.plot({
grid: true,
marks: [Plot.frame(), Plot.dot(data, {x: "x", y: "y", fill: "c", r: "s", opacity: .7})],
x: {domain: [-30, 30], ticks: d3.range(-30, 30, 5)},
y: {domain: [-30, 30], ticks: d3.range(-30, 30, 5)},
color: {scheme: "Turbo", domain: [20, 80]},
r: {range: [2, 16], domain: [20, 80]},
height: 500,
width: 900,
title: 'Random Data'
})
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