Public
Edited
Sep 30, 2023
2 forks
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
randInt(5)
Insert cell
Insert cell
height = 600
Insert cell
Insert cell
d3 = require("d3@6", "d3-weighted-voronoi", "d3-voronoi-map", "d3-voronoi-treemap")
Insert cell
Insert cell
data_0 = [
{ name: "A", weight: 20 },
{ name: "B", weight: 30 },
{ name: "C", weight: 40 },
{ name: "D", weight: 8 },
{ name: "E", weight: 11 },
{ name: "E", weight: 33 },
{ name: "F", weight: 48 },
{ name: "G", weight: 20 },
{ name: "H", weight: 23 },
{ name: "I", weight: 10 },
{ name: "J", weight: 640 }
// ... more data objects
]
Insert cell
sa = d3
.forceSimulation(data_0)
.force("y", d3.forceY(height / 2).strength(0.05))
.on("tick", () => {
console.log(data_0[0].x);
})
Insert cell
ellipse = d3
.range(100)
.map((i) => [
(600 * (1 + 0.99 * Math.cos((i / 50) * Math.PI))) / 2,
(height * (1 + 0.99 * Math.sin((i / 50) * Math.PI))) / 2
])
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