d3 / d3-geo-projection

Extended geographic projections for d3-geo.
https://observablehq.com/collection/@d3/d3-geo-projection
Other
1.1k stars 201 forks source link

Adopt type=module #208

Closed Fil closed 3 years ago

Fil commented 3 years ago

follow changes in d3-format:

TODO:

mbostock commented 3 years ago

I rewrote the d3-geo snapshot tests to use pixelmatch, and it seems to work well:

https://github.com/d3/d3-geo/commit/356d26f62760be5cc908334dd858faead87fa4db

Do you want to take a crack at updating this PR to match? (And adding the .github/eslint.json, updating the rollup.config.js to extract the copyright from the LICENSE, upgrading the dependencies, using named imports in the tests, etc.)

The biggest question in my mind right now is how the CLI will work in a pure ES modules environment, given that geoproject currently takes a -r argument to require a library (e.g., d3-geo-polygon). I think we can just use dynamic import (e.g., import("d3-geo-polygon"))… but I haven’t tested that approach yet.