Public
Edited
Feb 6, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
viewof raw_cars = aq.from(cars).view(2)
Insert cell
Insert cell
Insert cell
viewof cars_xy = raw_cars.derive({
x: aq.escape(d => d[x]),
y: aq.escape(d => d[y])
}).view(2)
Insert cell
Insert cell
cars_kmeans = cars_xy.objects()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof cluster_chart = {
kmeans(cars_kmeans, clusters)
return vl.markPoint()
.data(cars_kmeans)
.encode(
vl.x().fieldQ("x").title(x),
vl.y().fieldQ("y").title(y),
vl.color().fieldN("cluster"),
vl.tooltip([x, y, 'Name', 'cluster'])
)
.render()
}
Insert cell
Insert cell
import {kmeans} from "@spond/k-means-clustering-algorithm"
Insert cell
import { aq, op } from '@uwdata/arquero'
Insert cell
import { vl } from "@vega/vega-lite-api"
Insert cell
import {Range, Select} from "@observablehq/inputs"
Insert cell
d3 = require("d3@6")
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