Issue with path.bounds

9 views
Skip to first unread message

Joe Keohan

unread,
Oct 24, 2016, 11:25:34 AM10/24/16
to d3-js
I'm creating a viz that builds out several maps.  One of the entire world...one based on continents and lastly one for each country.  Both the world and continent maps work fine however i'm encountering issues with the bounding box for the individual countries.  For each country I'm passing path.bounds the following object: 
{type: "FeatureCollection", features: Array[1]}.  

The result of that is: 
[Array[2], Array[2]]0: Array[2]0: -3.1415926535897931: Infinitylength: 2__proto__: Array[0]1: Array[2]0: 3.1415926535897931: -Infinitylength: 2__proto__: Array[0]length: 2__proto__: Array[0] 39.76486253151005 [131.5, NaN]

I've been working in the following CodePen and the code that is trying to build the countries is a series of functions called:  

countryInfo() - this creates each div and passes the individual object to buildCountry().
buildCountry() - this passes the path, object and class name to boundingBox()
boundingBox() and this is where it breaks ONLY for the individual countries.  

I've reviewed MB's "Project to Bounding Box"  and Christopher Moller's "Small Multiples".  

Any ideas...

Joe
Reply all
Reply to author
Forward
0 new messages