D3 Composite Projections updates
I first published the d3-composite-projections library quite a long time ago after a nice talk with a journalist that wanted to create Spanish election maps using d3. I kept adding some projections from time to time, but didn’t write any update about it. So here is the last status of the project:
- TypeScript support: The library is still written in JavaScript, but I added the
index.d.ts
declaration file and now it can be used in TypeScript projects getCompositionBorders
is only practical with SVG, so adrawCompositionBorders
has been added to use Canvas without using Canvas2D, not always available- There are new projections. The list is the following:
- USA: geoAlbersUSA. The original composite projection also available in the d3-geo library, but with the boundaries.
- USA Territories: geoAlbersUsaTerritories as albersUsa, but adding the American Samoa, Puerto Rico, U.S. Virgin Islands, Guam and Northern Marianas Islands, so all the Congressional Districts are represented
- France: geoConicConformalFrance
- Portugal: geoConicConformalPortugal
- Spain: geoConicConformalSpain
- Netherlands geoConicConformalNetherlands
- Europe: geoConicConformalEurope (thought for Eurostat data)
- Japan: geoConicEquidistantJapan
- Ecuador: geoMercatorEcuador
- Chile: geoTransverseMercatorChile, including the Chilean Antarctic Territory
- Malaysia: geoMercatorMalaysia, created with the help of Saiful Azfar Ramlee
- Equatorial Guinea: geoMercatorEquatorialGuinea
- United Kingdom: geoAlbersUk
- Denmark: geoTransverseMercatorDenmark
The library has currently about 20k weekly downloads, which is much more than I expected. I still find some countries with distant lands, so will keep updating!