Closed curran closed 4 years ago
Here's a port of that logic to standalone ES6 module: https://github.com/datavis-tech/pleth/blob/4e916c05d7c3375cfdaa00172670c287a15a1205/packages/examples/src/pleth/geoAlbersUsaTerritories.js
It was also ported into dirty-reprojectors
for use with Mapbox https://github.com/stamen/dirty-reprojectors/blob/master/projections/albers-usa-territories.js
Isn't it a duplicate of https://github.com/d3/d3-geo/issues/152 ?
Yep, duplicate.
The distinction here is that it also includes US Virgin Islands, American Samoa, Guam, and Northern Mariana Islands.
Here's another variant with US Virgin Islands, American Samoa, Guam, and Northern Mariana Islands, but where the Pacific possessions are on the left side of the map. This one seemed to be preferred by most people:
https://observablehq.com/@almccon/u-s-map-with-puerto-rico-us-virgin-islands-american-samoa-gua
I downloaded the geoshape json files - one projected and another un-projected - from Mike Bostock's example both of which have Puerto Rico.
I am trying to display them in the "albersUsa" projection in Vega or Vega-Lite which uses d3. However I don't see it at all. In the unprojected file, "albersUsa" projection filters Puerto Rico and never displays it. In the projected version there is no map, everything is a giant dark rectangle.
@curran @almccon Any idea how to get it to display in Vega/Vega-Lite?
I see that there are some js files with Puerto Rico too, how do I get them to replace the native d3 js file responsible for the "albersUsa" projection? Perhaps this technique may help me with displaying Puerto Rico too in "albersUsa" projection.
Update - GIS StackExchange Post
@armsp It's not recommended to cross-post like this. I responded over in https://github.com/d3/d3-geo/issues/152
This projection by @almccon would be amazing to have as part of
d3-geo-projection
.https://observablehq.com/@almccon/u-s-map-with-puerto-rico