Public
Edited
May 15, 2023
Fork of Cluster map
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Inputs.table(data)
Insert cell
categoriesTable
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
chart.zoomTo(coord.x, coord.y, 10)
Insert cell
Insert cell
Insert cell
data.filter(d => d.cluster === 0)
Insert cell
x = d3.scaleLinear()
.domain([-100, 100])
.range([0, width])
Insert cell
xAxis = (g, x) => g
.attr("transform", `translate(0,${height})`)
.call(d3.axisTop(x).ticks(12))
.call(g => g.select(".domain").attr("display", "none"))
Insert cell
y = d3.scaleLinear()
.domain([-70, 70])
.range([height, 0])
Insert cell
yAxis = (g, y) => g
.call(d3.axisRight(y).ticks(12))
.call(g => g.select(".domain").attr("display", "none"))
Insert cell
z = d3.scaleOrdinal()
.domain(categoriesDomain)
.range(d3.schemeCategory10)
Insert cell
categoriesDomain = [...new Set(categoriesTable.map(d => d.category))].sort()
Insert cell
findCategory = cluster => categoriesTable[cluster].category
Insert cell
height = 600
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