{"name":"d3-composite-projections","version":"1.2.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","jsnext:main":"index","repository":{"type":"git","url":"git+https://github.com/rveciana/d3-composite-projections.git"},"scripts":{"pretest":"rollup --banner \"$(preamble)\" -f umd -g d3-geo:d3,d3-path:d3 -n d3 -o d3-composite-projections.js -- index.js","test":"mkdir -p test/output && tape 'test/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" d3-composite-projections.js -c -m -o d3-composite-projections.min.js","postpublish":"git push && git push --tags"},"dependencies":{"d3-geo":"^1.11","d3-path":"^1.0.7"},"devDependencies":{"canvas":"2","eslint":"5","package-preamble":"0.1","rollup":"1.14","tape":"4","topojson":"3","uglify-js":"3.6","pixelmatch":"^5.0.2","pngjs":"^3.4.0"},"gitHead":"fc086f5b370c7350c49bcab9b5204b98b38be908","bugs":{"url":"https://github.com/rveciana/d3-composite-projections/issues"},"_id":"d3-composite-projections@1.2.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-4zdymQF8XBTGBSn7R6zUGnuKwQhPtbj6Nne/CgjeR8tV5MnsGH6D/b9WXeRC7Bi9dPJnqBze7Z5/uCqDzGJGTg==","shasum":"24837d3c70ce9270398f11c722548a4688bb15a7","tarball":"http://registry-npm.ywwl.com/d3-composite-projections/download/d3-composite-projections-1.2.2.tgz","fileCount":26,"unpackedSize":362916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAgKjCRA9TVsSAnZWagAAhkgP/3XqpHSpMktgGL3oDPJ5\nRoAoIsQe/Sbe8CVDXXR1ge4OVt5P1JswyXDctKnZyGDmzNvCLwc907o0R3wt\n+gXcQNMFQITZ2gLd0ONT9HUnZ+SE9D2LHioQv5cPgIsNP81DBVxKCOBTQUQ5\nxPRBkI+omynVV7BU6EYVmjkwxtoyBA68Ibc0Gwxt2qVPM+f6iYklDheiCstN\nwRijWrwEH0SppoHHe1hoX4sf27BsjdWAIJq1QOPQ4GENMCLf59ckdhvIpc0f\ngZWJtXEw6w5GjCm5wuS6WR/q0mFR1B2z0mIX0JDDHQymwDtLnC61chNuQjvW\na3M6vL2Rtsj6XXhNwY1U//a4yzgt5Q+H2rUFixnN/hwW5VSJ162uuIi3lj/D\nM3h+2JXaJan5xm7suw/0aI6eQIlmhYPzSKxuBRfz1iayk8m0R90TYErth5IC\n/a+hh62h9xcvjlPyv5XVduzCSC0+35tzw+m1buFleadV4t9eo/OOzcAXypDs\nqVV/VVMcVaxBFmjHZ8RkXTxl3eLt/rOv949pFBO3axUeX2A+Igjx0oVUS1n4\naHkUOL/mTJDO/89ZhKZ6OkKvHOLML7w3VUxJP09NenOUaAvp3xJBsmxpCCj+\ndwIGxmhLIKTBgI0FcL1BB94CC4R3TE9ra18ZLzJQOITC3YG6zzytT1E5j4UP\nf/Ae\r\n=Plyq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbw8PMpn/in4qXU1gZNvsqDS6qzWFKUgpllkF0W+RDFAiEAtvkvsCf4WTQsEzMGCbzvhSL7OcCpZeeAyhw8QWjgYKg="}],"size":130818,"noattachment":false,"key":"/d3-composite-projections/-/d3-composite-projections-1.2.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.2.2_1560412834434_0.050911893616048864"},"_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":1560412834548,"_cnpm_publish_time":1560412834548,"dist-tags":{"lates":"0.0.1","latest":"2.0.0"}}