This demonstrates dragging from HTML to SVG elements, which can be tricky because of the differences between SVG and HTML DOMs. JQueryUI has a nice API for handling drag and drop, including defining the appearance of a dragged object and providing start, drag, and stop events. Unfortunately, JQueryUI's "drop" does not work at all on SVG elements inside the SVG
tag, although it does appear to work on the SVG tag itself.
To get over this limitation, we create a custom Drag/Drop manager, and use the start, drag, and stop events for the dragged elements in conjunction with mouseover and mouseout events on the SVG elements to determine whether or not a "drop" has been dropped on a legal SVG element.
Modified http://d3js.org/d3.v3.min.js to a secure url
Modified http://codeorigin.jquery.com/jquery-1.10.2.min.js to a secure url
Modified http://codeorigin.jquery.com/ui/1.10.3/jquery-ui.min.js to a secure url
https://d3js.org/d3.v3.min.js
https://codeorigin.jquery.com/jquery-1.10.2.min.js
https://codeorigin.jquery.com/ui/1.10.3/jquery-ui.min.js