Public
Edited
May 6, 2023
Insert cell
Insert cell
Insert cell
Insert cell
viewof type = Radio(types, {value: types[0] , label: "Clusters by: ", format: x => x.name})
Insert cell
viewof linkage = Select(["single", "complete", "average"], {value: "complete", label: "Linkage"})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof threshold = Range([0, H.root[type.value] * 1.001], {value: max * 0.5, label: "Threshold: ", step: type.value == "depth" ? 1 : undefined});
Insert cell
Insert cell
X = {
reshuffle
return druid.Matrix.from(d3.shuffle(data.values));
}
Insert cell
Insert cell
Insert cell
H = new druid.Hierarchical_Clustering(D, linkage, "precomputed");
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
druid = require("@saehrimnir/druidjs@=0.4.1")
Insert cell
druid.version
Insert cell
d3 = require("d3")
Insert cell
data = datasets[dataset]
Insert cell
datasets = require("@saehrimnir/dataset")
Insert cell
import {Button, Select, Radio, Range} from "@observablehq/inputs"
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