All examples By author By category About

syntagmatic

d3-hierarchy tree

A visualization of files in d3-hierarchy, based on Radial Tidy Tree.

Data Collection

Use git to clone a repository, then du to create a tsv with the directory contents.

git clone https://github.com/d3/d3-hierarchy.git
(echo -n 'size\tfile\n'; du -a d3-hierarchy/*) > d3-hierarchy.tsv

Burrow - recursive nesting

An updated version of the burrow function from d3 src tree in plain JavaScript. This function takes an array of keys to generate a hierarchy.

Compared to d3.nest: burrow allows for branches of arbitrary depth.

Compared to d3.stratify: parent nodes do not need to be specified as separate rows in the tabular data. Parents are created automatically as they are encountered.