{"name":"d3-composite-projections","version":"2.0.0","description":"Like the AlbersUsa projection, adds several d3 projections to show the countries that are far from the mainland close to it.","homepage":"http://geoexamples.com/d3-composite-projections/","license":"BSD-3-Clause","author":{"name":"Roger Veciana i Rovira","url":"http://geoexamples.com"},"main":"d3-composite-projections.js","unpkg":"d3-composite-projections.min.js","module":"./index.js","types":"./index.d.ts","jsnext:main":"index","type":"module","repository":{"type":"git","url":"git+https://github.com/rveciana/d3-composite-projections.git"},"scripts":{"build":"rollup -c","pretest":"npm run build","test":"mkdir -p test/output && tape 'test/*-test.js' && eslint index.js src","prepublish":"npm run test","postpublish":"git push && git push --tags"},"dependencies":{"d3-geo":"^3.1.1","d3-path":"^3.1.0","@types/d3-geo":"^3.1.0"},"devDependencies":{"@rollup/plugin-terser":"^0.4.4","canvas":"3.2.0","eslint":"9.34.0","pixelmatch":"7.1.0","pngjs":"7.0.0","rollup":"4.49.0","tape":"5.9.0","topojson-client":"^3.1.0"},"_id":"d3-composite-projections@2.0.0","gitHead":"f7e1b5595e6b2339e43c296f74fd3300f3640622","bugs":{"url":"https://github.com/rveciana/d3-composite-projections/issues"},"_nodeVersion":"20.15.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-uTxVr8j/rBMg6B/N+ESqQL1pF/wBrYISAG5nI0UNEbroSq7mIYdEb/0gOdftC/yOp0/fbITCwvf1IUsIe1JT3A==","shasum":"7dc5518ce5f89c04006e56e72c75a42d4e6eab7e","tarball":"http://registry-npm.ywwl.com/d3-composite-projections/download/d3-composite-projections-2.0.0.tgz","fileCount":31,"unpackedSize":413858,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGFMwFRbY2d6mDy4gz9Gr4lSQ9CNxqezolOiShR0kQt+AiEAt6r3jHyT+XGMxogbUh43cf0nBHHH6EjY8efhaNx+A30="}],"size":139501,"noattachment":false,"key":"/d3-composite-projections/-/d3-composite-projections-2.0.0.tgz"},"_npmUser":{"name":"rveciana","email":"rveciana@gmail.com"},"directories":{},"maintainers":[{"name":"rveciana","email":"rveciana@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/d3-composite-projections_2.0.0_1757179977493_0.030509637049176197"},"_hasShrinkwrap":false,"readme":"# d3-composite-projections\n\n[![Build Status](https://travis-ci.org/rveciana/d3-composite-projections.svg?branch=master)](https://travis-ci.org/rveciana/d3-composite-projections)\n\nSet of d3 projections for showing countries' distant lands together\n\n![conicConformalFrance](thumbnail.png \"Conic Conformal France example\")\n\n# USAGE\n\nThis is the version compatible with d3v6, please [go here for the version compatible with d3v3](https://github.com/rveciana/d3-composite-projections/tree/v0.4.0).\n\nThe projection itself works the same way as the other d3 projections. To be more precise, exactly as the [albersUsa](https://github.com/mbostock/d3/wiki/Geo-Projections#albersUsa) projection:\n\n```html\n<script src=\"https://d3js.org/d3.v4.min.js\"></script>\n<script src=\"d3-composite-projections.js\"></script>\n<script>\n  var projection = d3.geoConicConformalPortugal();\n</script>\n```\n\nChange the scale using scale i.e. `.scale(3000)`, as usual. The projections are prepared to fit a 960x500px SVG or Canvas.\n\nProjections are available for:\n\n- USA: [geoAlbersUSA](http://bl.ocks.org/rveciana/ee2119324e835e1bad42d0e4c1b9ab0d)\n- USA Territories: [geoAlbersUsaTerritories](http://bl.ocks.org/rveciana/5040be82aea528b6f785464f8816690f) as albersUsa, but adding the American Samoa, Puerto Rico, U.S. Virgin Islands, Guam and Northern Marianas Islands, so all the [Congressional Districts](https://en.wikipedia.org/wiki/List_of_districts_of_the_House_of_Representatives_of_Japan) are represented\n- France: [geoConicConformalFrance](http://bl.ocks.org/rveciana/0ff189b15449330828605fe4e118a716)\n- Portugal: [geoConicConformalPortugal](http://bl.ocks.org/rveciana/ee09a2c3732f3e0d6872d1a7f796a29b)\n- Spain: [geoConicConformalSpain](http://bl.ocks.org/rveciana/d635afded8c4eae36ecf61a15bdf0a98)\n- Netherlands [geoConicConformalNetherlands](https://observablehq.com/@julesblm/the-netherlands-composite-projection)\n- Europe: [geoConicConformalEurope](http://bl.ocks.org/rveciana/ced3109b372039afbcf7278ba3d14250) (thought for Eurostat data)\n- Japan: [geoConicEquidistantJapan](http://bl.ocks.org/rveciana/1f5399d8887428ad67665d106ec089d1)\n- Ecuador: [geoMercatorEcuador](http://bl.ocks.org/rveciana/306a5202e1facf7a22e08fbb1044f568)\n- Chile: [geoTransverseMercatorChile](http://bl.ocks.org/rveciana/3a31865e82f4fab8ac2522545bbc7741), including the [Chilean Antarctic Territory](https://en.wikipedia.org/wiki/Chilean_Antarctic_Territory)\n- Malaysia: [geoMercatorMalaysia](http://bl.ocks.org/rveciana/6298dd3e71cf98b6930c06f19b6684a2), created with the help of [Saiful Azfar Ramlee](https://github.com/saifulazfar)\n- Equatorial Guinea: [geoMercatorEquatorialGuinea](http://bl.ocks.org/rveciana/4dfc136b8e2707f182aa4591f892f82e)\n- United Kingdom: [geoAlbersUk](https://gist.github.com/rveciana/27272a581e975835aaa321ddf816d726)\n- Denmark: [geoTransverseMercatorDenmark](https://observablehq.com/d/3a28765e735c5e67)\n\nTo draw the borders between the projection zones, use `getCompositionBorders()` for SVG:\n\n```javascript\nsvg\n  .append(\"path\")\n  .style(\"fill\", \"none\")\n  .style(\"stroke\", \"#000\")\n  .attr(\"d\", path(projection.getCompositionBorders()));\n```\n\nor drawCompositionBorders if using Canvas:\n\n`projection.drawCompositionBorders(context);`\n\nUsing with node\n\n---\n\n```javascript\nvar d3_composite = require(\"d3-composite-projections\");\nvar d3_geo = require(\"d3-geo\");\nvar projection = d3_composite.geoAlbersUsaTerritories();\n```\n\n# INSTALLATION\n\n## Getting the files\n\nYou can get the files just by cloning the repository:\n\n```bash\ngit clone https://github.com/rveciana/d3-composite-projections.git\n```\n\nor downloading the _d3-composite-projections.js_ or _d3-composite-projections.min.js_ files.\n\n## Using cdnjs or unpkg\n\nYou can link the files from your web page to [cdnjs](https://cdnjs.com/libraries/d3-composite-projections):\n\n```html\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/d3-composite-projections/1.0.2/d3-composite-projections.min.js\"></script>\n```\n\nor\n\n```html\n<script src=\"https://unpkg.com/d3-composite-projections@1.2.0\"></script>\n```\n\n## As a module:\n\nInstall the library:\n\n```bash\nnpm install --save d3-composite-projections\n```\n\nImport it:\n\n```javascript\nimport { geoAlbersUk } from \"d3-composite-projections\";\n```\n\n## In node:\n\nInstall the library:\n\n```bash\nnpm install --save d3-composite-projections\n```\n\nImport it:\n\n```javascript\nconst d3cp = require(\"d3-composite-projections\");\n\nconst projection = d3cp.geoAlbersUk();\n```\n\n## Running the tests\n\nDownload the library by cloning the git repo:\n\n```bash\ngit clone https://github.com/rveciana/d3-composite-projections.git\n```\n\nThe tests can be run using:\n\n```bash\nnpm test\n```\n","publish_time":1757179977699,"_cnpm_publish_time":1757179977699,"dist-tags":{"lates":"0.0.1","latest":"2.0.0"}}