{"name":"d3-composite-projections","version":"1.1.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","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":"tape 'test/*-test.js' && mkdir -p test/output && test/compare-images && 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.2.4","d3-path":"^1.0.1"},"devDependencies":{"canvas":"1","eslint":"2","package-preamble":"0.0","rollup":"0.33","tape":"4","topojson":"1","uglify-js":"2"},"gitHead":"fcac4a718a404b51b6ad648f71e42c54da839816","bugs":{"url":"https://github.com/rveciana/d3-composite-projections/issues"},"_id":"d3-composite-projections@1.1.0","_shasum":"29815eead24b3a4f1df24a0c9cfc0ee081f59688","_from":".","_npmVersion":"4.1.1","_nodeVersion":"7.4.0","_npmUser":{"name":"rveciana","email":"rveciana@gmail.com"},"dist":{"shasum":"29815eead24b3a4f1df24a0c9cfc0ee081f59688","tarball":"http://registry-npm.ywwl.com/d3-composite-projections/download/d3-composite-projections-1.1.0.tgz","integrity":"sha512-kTixHoXdqY1iXQHR+0yfu/oHGruQmTqdcqEcILir1LzlOwWYd/fjO/B/6QMnPFACnkzy2OZtKIW9Li9qtPiIIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHpeXhdlsRNIZXysmU82sv6ZcONkiJiW+O0dSrPJeAh5AiAc7XAl3XZf+XWY58wx8pNlvZUIi5dEB6iy4Ap11jWMCQ=="}],"size":59486,"noattachment":false,"key":"/d3-composite-projections/-/d3-composite-projections-1.1.0.tgz"},"maintainers":[{"name":"rveciana","email":"rveciana@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/d3-composite-projections-1.1.0.tgz_1485787959097_0.6053875559009612"},"directories":{},"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":1485787959796,"_cnpm_publish_time":1485787959796,"dist-tags":{"lates":"0.0.1","latest":"2.0.0"}}