Published unlisted
Edited
Feb 7, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function tile(node, x0, y0, x1, y1) {
d3.treemapBinary(node, 0, 0, width, height);
for (const child of node.children) {
child.x0 = x0 + child.x0 / width * (x1 - x0);
child.x1 = x0 + child.x1 / width * (x1 - x0);
child.y0 = y0 + child.y0 / height * (y1 - y0);
child.y1 = y0 + child.y1 / height * (y1 - y0);
}
}
Insert cell
name = d => d.ancestors().reverse().map(d => d.data.name).join("/")
Insert cell
width = 954
Insert cell
height = 924
Insert cell
format = d3.format(".2f")
Insert cell
d3 = require("d3@5")
Insert cell
import { viewTag } from "2912613dea5a5003"
Insert cell
import { params, permalink } from "@jeffbaumes/permalink"
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