{"name":"d3-composite-projections","version":"1.3.2","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","jsnext:main":"index","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":"^1.11.9","d3-path":"^1.0.9"},"devDependencies":{"canvas":"2","eslint":"^6.7.1","pixelmatch":"^5.1.0","pngjs":"^3.4.0","rollup":"^1.27.5","rollup-plugin-terser":"^5.1.2","tape":"^4.11.0","topojson":"3"},"gitHead":"c27fcb72cc862e306e3d80592eb07bed7ad17ce0","bugs":{"url":"https://github.com/rveciana/d3-composite-projections/issues"},"_id":"d3-composite-projections@1.3.2","_nodeVersion":"12.13.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-dao+Dd/EEYBX+FqNYwe/4putAsMXWewSgDj5sETRFsj1z4X/CVI6ctmZhqvpa/MVYCFHoWV9Issu+20OU5VmbA==","shasum":"383f6a6096f38ed1fb379ae1983f25d3267377c7","tarball":"http://registry-npm.ywwl.com/d3-composite-projections/download/d3-composite-projections-1.3.2.tgz","fileCount":28,"unpackedSize":370963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6Ux7CRA9TVsSAnZWagAAPpcP/0XGzN4o+zZMSAJricMC\nuRUYEeq6g2iZE3mecyLvFgw5DU1q67GxgE0aApB+UEZpa81VIyog49DBj+PS\nVHICOlvDLCPg0I1wi08ZLkW2kQl/ch8BjKmkncjw+PbhqmHCQgFtS7a/vUL5\n17R9CCNdjNGsah5DNBSnz2Xc9sm4ousnAjr8lFe3ztkEEJpKeRZXPIn9L5PC\nnOi9+h2Bj/6aDg039rdljNRGaGtsfapvkvhQS2o4HA4jc5wMR12kxqDIS1RV\ngVikv72m4nOO43Upg2uvO1LyZWaq3U+svzmehlOaVF+IlzW1WHB9qIVOgoK5\nWdiLEK67UtLdd8jswvugWHTLvEMfKw9uge0nKkSW+d4yaivC2HzqRw/Wjajr\n1LSI+soy5RQtcAcGpxhz1ukNA5iAGtyRGQ8yKLHQhOQqT5FusV5WcdpSzimC\n0etvy8UkDgqA0jR1zDImMt/tsC9ZpWJhnDWlAKarly6555NIz6jl6lITQzi9\nwvN0kXcqHq2VtVHESf/bGRE3Dn/KfO6DyrwiZvk6yUiKRmuYHlfz89gR+t2p\nGEvGt0nxo9+MJE/dAAGeCD2MiVto2O+/4QKmosimtdIIWuRtwnGrU+nfrEuj\nvpQ7wlR8OzsPdOkBLiIgrHG0jTIGScPGJ0IGuR7uSJYhW1e2HX2pssJWd9BL\nzzxL\r\n=IiSD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxrr7P0t3NrfUKUteLREh2yByJ+I/GaRHYMoLNB7w7ygIhAK30u7KjIso7DW0lkspDU4Gp/ve05UNQDxL6yoW8plZa"}],"size":132251,"noattachment":false,"key":"/d3-composite-projections/-/d3-composite-projections-1.3.2.tgz"},"maintainers":[{"name":"rveciana","email":"rveciana@gmail.com"}],"_npmUser":{"name":"rveciana","email":"rveciana@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-composite-projections_1.3.2_1575570555215_0.30688514153259994"},"_hasShrinkwrap":false,"readme":"# d3-composite-projections\r\n\r\n[![Build Status](https://travis-ci.org/rveciana/d3-composite-projections.svg?branch=master)](https://travis-ci.org/rveciana/d3-composite-projections)\r\n\r\nSet of d3 projections for showing countries' distant lands together\r\n\r\n![conicConformalFrance](thumbnail.png \"Conic Conformal France example\")\r\n\r\n# USAGE\r\n\r\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).\r\n\r\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:\r\n\r\n```html\r\n<script src=\"https://d3js.org/d3.v4.min.js\"></script>\r\n<script src=\"d3-composite-projections.js\"></script>\r\n<script>\r\n\tvar projection = d3.geoConicConformalPortugal();\r\n</script>\r\n```\r\n\r\nChange the scale using scale i.e. `.scale(3000)`, as usual. The projections are prepared to fit a 960x500px SVG or Canvas.\r\n\r\nProjections are available for:\r\n\r\n- USA: [geoAlbersUSA](http://bl.ocks.org/rveciana/ee2119324e835e1bad42d0e4c1b9ab0d)\r\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\r\n- France: [geoConicConformalFrance](http://bl.ocks.org/rveciana/0ff189b15449330828605fe4e118a716)\r\n- Portugal: [geoConicConformalPortugal](http://bl.ocks.org/rveciana/ee09a2c3732f3e0d6872d1a7f796a29b)\r\n- Spain: [geoConicConformalSpain](http://bl.ocks.org/rveciana/d635afded8c4eae36ecf61a15bdf0a98)\r\n- Netherlands [geoConicConformalNetherlands](https://observablehq.com/@julesblm/the-netherlands-composite-projection)\r\n- Europe: [geoConicConformalEurope](http://bl.ocks.org/rveciana/ced3109b372039afbcf7278ba3d14250) (thought for Eurostat data)\r\n- Japan: [geoConicEquidistantJapan](http://bl.ocks.org/rveciana/1f5399d8887428ad67665d106ec089d1)\r\n- Ecuador: [geoMercatorEcuador](http://bl.ocks.org/rveciana/306a5202e1facf7a22e08fbb1044f568)\r\n- Chile: [geoTransverseMercatorChile](http://bl.ocks.org/rveciana/3a31865e82f4fab8ac2522545bbc7741), including the [Chilean Antarctic Territory](https://en.wikipedia.org/wiki/Chilean_Antarctic_Territory)\r\n- Malaysia: [geoMercatorMalaysia](http://bl.ocks.org/rveciana/6298dd3e71cf98b6930c06f19b6684a2), created with the help of [Saiful Azfar Ramlee](https://github.com/saifulazfar)\r\n- Equatorial Guinea: [geoMercatorEquatorialGuinea](http://bl.ocks.org/rveciana/4dfc136b8e2707f182aa4591f892f82e)\r\n- United Kingdom: [geoAlbersUk](https://gist.github.com/rveciana/27272a581e975835aaa321ddf816d726)\r\nTo draw the borders between the projection zones, use `getCompositionBorders()` for SVG:\r\n\r\n```javascript\r\nsvg.append(\"path\")\r\n .style(\"fill\",\"none\")\r\n .style(\"stroke\",\"#000\")\r\n .attr(\"d\", path(projection.getCompositionBorders()));\r\n```\r\n\r\nor drawCompositionBorders if using Canvas:\r\n\r\n`projection.drawCompositionBorders(context);`\r\n\r\nUsing with node\r\n\r\n---\r\n\r\n```javascript\r\nvar d3_composite = require(\"d3-composite-projections\");\r\nvar d3_geo = require(\"d3-geo\");\r\nvar projection = d3_composite.geoAlbersUsaTerritories();\r\n```\r\n\r\n# INSTALLATION\r\n\r\n## Getting the files\r\n\r\nYou can get the files just by cloning the repository:\r\n\r\n```bash\r\ngit clone https://github.com/rveciana/d3-composite-projections.git\r\n```\r\n\r\nor downloading the _d3-composite-projections.js_ or _d3-composite-projections.min.js_ files.\r\n\r\n## Using cdnjs or unpkg\r\n\r\nYou can link the files from your web page to [cdnjs](https://cdnjs.com/libraries/d3-composite-projections):\r\n\r\n```html\r\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/d3-composite-projections/1.0.2/d3-composite-projections.min.js\"></script>\r\n```\r\n\r\nor\r\n\r\n```html\r\n<script src=\"https://unpkg.com/d3-composite-projections@1.2.0\"></script>\r\n```\r\n\r\n## As a module:\r\n\r\nInstall the library:\r\n\r\n```bash\r\nnpm install --save d3-composite-projections\r\n```\r\n\r\nImport it:\r\n\r\n```javascript\r\nimport { geoAlbersUk } from \"d3-composite-projections\";\r\n```\r\n\r\n## In node:\r\n\r\nInstall the library:\r\n\r\n```bash\r\nnpm install --save d3-composite-projections\r\n```\r\n\r\nImport it:\r\n\r\n```javascript\r\nconst d3cp = require(\"d3-composite-projections\")\r\n\r\nconst projection = d3cp.geoAlbersUk();\r\n```\r\n\r\n## Running the tests\r\n\r\nDownload the library by cloning the git repo:\r\n\r\n```bash\r\ngit clone https://github.com/rveciana/d3-composite-projections.git\r\n```\r\n\r\nThe tests can be run using:\r\n\r\n```bash\r\nnpm test\r\n```\r\n","publish_time":1575570555333,"_cnpm_publish_time":1575570555333,"dist-tags":{"lates":"0.0.1","latest":"2.0.0"}}