block by d3noob 204d08d309d2b2903e12554b0aef6a4d

d3.drag with grouped elements in v4

Full Screen

The resulting code (with some minor formatting alterations) from an answer on Stack Overflow to a question about how to group two elements and drag them using d3.drag.

Kudos (and thanks) to Dragon_Slayer for the solution.

A block for the original (not working correctly) code is here.

index.html