score:1

Accepted answer

for the first part of your question, one way to select the path is to add an id to id :

d3.json("http://mbostock.github.io/d3/talk/20111018/world-countries.json", function(collection) {
  feature = svg.selectall("path")
      .data(collection.features)
    .enter().append("svg:path")
      .attr("d", clip)
      .attr("id", function(d) { return d.properties.name; }) ;

and then select the path like that :

var path = d3.select("#russia").node()

then you can select the first point with :

path.getpointatlength(0)

see this updated fiddle : http://jsfiddle.net/xqmevpjg/11/


Related Query