Version of Mike Bostock's Hierarchical Bar Chart updated to use d3v4. Not certain that I got it completely right, but appears to have the same functionality.
Forked from mbostock's block: Hierarchical Bar Chart: This bar chart visualizes hierarchical data using D3. Each blue bar represents a folder, whose length encodes the total size of all files in that folder (and all subfolders). Clicking on a bar dives into that folder, while clicking on the background bubbles back up to the parent folder. The effect is similar to a zoomable partition layout, though in a more conventional display.
https://d3js.org/d3.v4.min.js