This example demonstrates how to create a force layout of a hierarchy whose internal nodes are collapsible. Leaf nodes are shown in orange, while internal nodes (packages) are shown in blue. Clicking on an internal node (without dragging) causes that node to expand or collapse, toggling the visibility of its descendant nodes.
forked from mbostock's block: Sample 4 (Collapsible Force Layout)
https://d3js.org/d3.v3.min.js