Smitten with partition
These next few charts are just going to fly by; they're really similar and we don't have anything else in terms of common functions to write.
Adjacency diagrams are similar to treemaps, but are intended to fill the available space. They tend to be useful for visualizing things such as disk usage. They are created by the partition layout.
Here's our example code in full:
westerosChart.partition = function Partition(_data) { const data = getMajorHouses(_data); const stratify = d3.stratify() .parentId(d => d.fatherLabel) .id(d => d.itemLabel); const root = stratify(data) .sum(d => d.screentime) .sort(heightOrValueComparator); const layout = d3.partition() .size([ this.innerWidth - 100, this.innerHeight, ]) .padding(2) .round(true); layout(root); const nodes = this.container.selectAll('.node') .data(root.descendants().slice(1)) .enter() .append('g') .attr('class', 'node...