The code here was copied directly from Mike Bostock's Cluster Dendrogram example, with a small addition of the dragging functionality. Any node can be dragged around and its children will come along for the ride with it. The trick is just to make sure that the entire subtree remains intact by moving all of the relevant nodes by the same offset.
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js