{"name":"d3-composite-projections","version":"1.5.0","author":{"url":"http://geoexamples.com","name":"Roger Veciana i Rovira"},"license":"BSD-3-Clause","_id":"d3-composite-projections@1.5.0","maintainers":[{"name":"rveciana","email":"rveciana@gmail.com"}],"homepage":"http://geoexamples.com/d3-composite-projections/","bugs":{"url":"https://github.com/rveciana/d3-composite-projections/issues"},"dist":{"shasum":"cc420d55819b38b8b3f487fa0def3fa09b0102c4","tarball":"http://registry-npm.ywwl.com/d3-composite-projections/download/d3-composite-projections-1.5.0.tgz","fileCount":30,"integrity":"sha512-llWyqIrZgJyc2RCPZ9xkfuYhlw8OibmQQBiircByejkWqMppQAAx64EG8xkkae6cHgQGK3RCwnRoekTe+gjlpg==","signatures":[{"sig":"MEYCIQCNJQPTLauS+62yT/3xbQZX7M0Jx5DQa5o8p4UZlvcsfAIhANR4S/Bt6wXnC+9I0cbMbXHuJx0/uqoGedd3CYdMX6Hh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":412614,"size":139081,"noattachment":false,"key":"/d3-composite-projections/-/d3-composite-projections-1.5.0.tgz"},"main":"d3-composite-projections.js","type":"module","unpkg":"d3-composite-projections.min.js","module":"./index.js","gitHead":"a02e3ca3bbe4956c90e6506566ecb4e664a89e02","scripts":{"test":"mkdir -p test/output && tape 'test/*-test.js' && eslint index.js src","build":"rollup -c","pretest":"npm run build","prepublish":"npm run test","postpublish":"git push && git push --tags"},"_npmUser":{"name":"rveciana","email":"rveciana@gmail.com"},"repository":{"url":"git+https://github.com/rveciana/d3-composite-projections.git","type":"git"},"_npmVersion":"10.7.0","description":"Like the AlbersUsa projection, adds several d3 projections to show the countries that are far from the mainland close to it.","directories":{},"jsnext:main":"index","_nodeVersion":"20.15.0","dependencies":{"d3-geo":"^3.1.1","d3-path":"^3.1.0"},"_hasShrinkwrap":false,"devDependencies":{"tape":"5.9.0","pngjs":"7.0.0","canvas":"3.2.0","eslint":"9.34.0","rollup":"4.49.0","pixelmatch":"7.1.0","topojson-client":"^3.1.0","@rollup/plugin-terser":"^0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/d3-composite-projections_1.5.0_1756894964965_0.5987395509538131","host":"s3://npm-registry-packages-npm-production"},"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":1756894965179,"_cnpm_publish_time":1756894965179,"dist-tags":{"lates":"0.0.1","latest":"2.0.0"}}