drag and make connection between circle with line using d3.js
<p>I am new in d3.js.I have created three circles. I want circle should be drag and drop.we can also create connection between circles using line. here is my code:</p>

<pre><code>var spaceCircles = [30, 70, 110];

 var svgContainer = d3.select("body").append("svg")
                                     .attr("width", 200)
                                     .attr("height", 200);

 var circles = svgContainer.selectAll("circle")
                           .data(spaceCircles)
                           .enter()
                          .append("circle");

var circleAttributes = circles
                       .attr("cx", function (d) { return d; })
                       .attr("cy", function (d) { return d; })
                       .attr("r", 20 )
                       .style("fill", function(d) {
                         var returnColor;
                         if (d === 30) { returnColor = "green";
                         } else if (d === 70) { returnColor = "purple";
                        } else if (d === 110) { returnColor = "red"; }
                         return returnColor;
                       });
</code></pre>