I am using Version 4 of the D3 Library and am, to this point, unable to draw connecting lines between points on a Symbol Map. In the example, from an earlier version of the library, drawing connecting lines is accomplished with this code:
// calculate the Great Arc between each pair of points
var arc = d3.geo.greatArc()
.source(function(d) { return locationByAirport[d.source]; })
.target(function(d) { return locationByAirport[d.target]; });
[snip]
// Draw the Great Arcs on the Chart.
g.selectAll("path.arc")
.data(function(d) { return linksByOrigin[d.iata] || []; })
.enter().append("svg:path")
.attr("class", "arc")
.attr("d", function(d) { return path(arc(d)); });
The comments are mine (and could be wrong), the code is from the Symbol Map example, above.
In version 4, d3.geo.greatArc()
appears to have been deprecated in favor of d3.geoDistance()
. I cannot say this for sure, but I can find no reference to greatArc
in version 4. Unfortunately, I have no idea how to set up a call to geoDistance()
to get the same information that greatArc()
used to return. The documentation provided for geoDistance()
is not enough for me to understand how to use it.
So, my question is: How do I draw lines between points (lat/long pairs) on a D3 Symbol Chart using Version 4 of the library?