I am trying to modify this example with data from cvs file with node and link data. I have addresses that were obtained from python's googlemaps module. All the nodes have, two floats 39.338923 / -74.475714
that represent the longitudinal/ latitudinal (lng/lat) coordinates. However, when I get to:
.attr("d", function(d) { return path({type: "LineString", coordinates: [d.source, d.target]}); });
in the said example, things get fishy. Displaying the output of path()
via console.log
, I see NaN
and LNaN
. I have looked at this SO question, and I am fairly certain all lng/lat values are "kosher".
Since I am very new to javascript, d3.json, and cartography, how should I go about trouble-shooting this problem? I currently stuck. Since path()
's output is a string, I could find the lng., lat. values that give the NaN
. Here are some examples:
`-77.3860976/38.9695545 ----->M757.197171551755,218.52497030237407LNaN,NaN`
`-77.3860976/38.9695545 ----->M757.197171551755,218.52497030237407LNaN,NaN`
There is a lot of link data that is not able to be used due to the problem. I know there are lot of places the code could have gone wrong prior to this. I will say that if I comment out the above .attr("d",
..., there are no errors. Unfortunately, the links are not drawn in this case. Any and all help is hugely appreciated!