{"_id":"topojson-client","_rev":"374822","name":"topojson-client","description":"Manipulate TopoJSON and convert it to GeoJSON.","dist-tags":{"latest":"3.1.0"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"time":{"modified":"2021-07-30T05:38:54.000Z","created":"2016-10-30T18:58:47.307Z","3.1.0":"2019-11-06T03:44:54.022Z","3.0.1":"2019-09-05T16:49:29.157Z","3.0.0":"2017-03-31T05:06:36.650Z","2.1.0":"2016-11-03T19:03:26.121Z","2.0.1":"2016-10-31T20:28:54.403Z","2.0.0":"2016-10-31T18:28:57.969Z","1.8.0":"2016-10-30T21:52:26.911Z","1.7.0":"2016-10-30T18:58:47.307Z"},"users":{},"author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"versions":{"3.1.0":{"name":"topojson-client","version":"3.1.0","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","topology","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"ISC","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-client.js","unpkg":"dist/topojson-client.min.js","jsdelivr":"dist/topojson-client.min.js","module":"src/index.js","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topo2geo":"bin/topo2geo","topomerge":"bin/topomerge","topoquantize":"bin/topoquantize"},"scripts":{"pretest":"rollup -c","test":"tape 'test/**/*-test.js' && eslint src test","prepublishOnly":"rm -rf dist && yarn test","postpublish":"git push && git push --tags && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"6","rollup":"1","rollup-plugin-terser":"5","tape":"4"},"gitHead":"71e5bd6428fd8b7a40fa980d2ef7862140851f03","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@3.1.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"shasum":"22e8b1ed08a2b922feeb4af6f53b6ef09a467b99","size":15911,"noattachment":false,"key":"/topojson-client/-/topojson-client-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-3.1.0.tgz"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/topojson-client_3.1.0_1573011893877_0.11931120834813136"},"_hasShrinkwrap":false,"publish_time":1573011894022,"_cnpm_publish_time":1573011894022},"3.0.1":{"name":"topojson-client","version":"3.0.1","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","topology","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-client.js","unpkg":"dist/topojson-client.min.js","jsdelivr":"dist/topojson-client.min.js","module":"src/index.js","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topo2geo":"bin/topo2geo","topomerge":"bin/topomerge","topoquantize":"bin/topoquantize"},"scripts":{"pretest":"rollup -c","test":"tape 'test/**/*-test.js' && eslint src test","prepublishOnly":"rm -rf dist && yarn test","postpublish":"git push && git push --tags && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"6","rollup":"1","rollup-plugin-terser":"5","tape":"4"},"gitHead":"f85aeb94201d9fb327040375253458fc913463e7","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@3.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"shasum":"774c0343b44fc4ec29c3a2274d7a1a9c3b213cd9","size":16184,"noattachment":false,"key":"/topojson-client/-/topojson-client-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-3.0.1.tgz"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/topojson-client_3.0.1_1567702168997_0.5748936060321568"},"_hasShrinkwrap":false,"publish_time":1567702169157,"_cnpm_publish_time":1567702169157},"3.0.0":{"name":"topojson-client","version":"3.0.0","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","topology","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-client.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topo2geo":"bin/topo2geo","topomerge":"bin/topomerge","topoquantize":"bin/topoquantize"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n topojson -o dist/topojson-client.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-client.min.js -- dist/topojson-client.js","postpublish":"git push && git push --tags && zip -j dist/topojson-client.zip -- LICENSE.md README.md dist/topojson-client.js dist/topojson-client.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.41","tape":"4","uglify-js":"2"},"gitHead":"cac60b71854879df289767f0991bfe7ec45ee1ea","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@3.0.0","_shasum":"1f99293a77ef42a448d032a81aa982b73f360d2f","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"shasum":"1f99293a77ef42a448d032a81aa982b73f360d2f","size":16719,"noattachment":false,"key":"/topojson-client/-/topojson-client-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-3.0.0.tgz"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/topojson-client-3.0.0.tgz_1490936794724_0.6929810119327158"},"directories":{},"publish_time":1490936796650,"_hasShrinkwrap":false,"_cnpm_publish_time":1490936796650},"2.1.0":{"name":"topojson-client","version":"2.1.0","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","topology","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-client.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topo2geo":"bin/topo2geo","topomerge":"bin/topomerge","topoquantize":"bin/topoquantize"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n topojson -o dist/topojson-client.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-client.min.js -- dist/topojson-client.js","postpublish":"VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp -v README.md LICENSE.md dist/topojson-client.js dist/topojson-client.min.js ../topojson-bower && cd ../topojson-bower && mv topojson-client.js topojson.js && mv topojson-client.min.js topojson.min.js && git add README.md LICENSE.md topojson.js topojson.min.js && git commit -m \"Release $VERSION.\" && git tag -am \"Release $VERSION.\" v${VERSION} && git push && git push --tags && cd - && cp dist/topojson-client.js ../d3.github.com/topojson.v2.js && cp dist/topojson-client.min.js ../d3.github.com/topojson.v2.min.js && cd ../d3.github.com && git add topojson.v2.js topojson.v2.min.js && git commit -m \"topojson ${VERSION}\" && git push && cd - && zip -j dist/topojson-client.zip -- LICENSE.md README.md dist/topojson-client.js dist/topojson-client.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.36","tape":"4","uglify-js":"2"},"gitHead":"a0e375fc9a32967b1dcd77e16215889636f6aa7e","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@2.1.0","_shasum":"ff9f7bf38991185e0b4284c2b06ae834f0eac6c8","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"ff9f7bf38991185e0b4284c2b06ae834f0eac6c8","size":18576,"noattachment":false,"key":"/topojson-client/-/topojson-client-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-2.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/topojson-client-2.1.0.tgz_1478199804147_0.6537078565452248"},"directories":{},"publish_time":1478199806121,"_cnpm_publish_time":1478199806121,"_hasShrinkwrap":false},"2.0.1":{"name":"topojson-client","version":"2.0.1","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","topology","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-client.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topo2geo":"bin/topo2geo"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n topojson -o dist/topojson-client.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-client.min.js -- dist/topojson-client.js","postpublish":"VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp -v README.md LICENSE.md dist/topojson-client.js dist/topojson-client.min.js ../topojson-bower && cd ../topojson-bower && mv topojson-client.js topojson.js && mv topojson-client.min.js topojson.min.js && git add README.md LICENSE.md topojson.js topojson.min.js && git commit -m \"Release $VERSION.\" && git tag -am \"Release $VERSION.\" v${VERSION} && git push && git push --tags && cd - && cp dist/topojson-client.js ../d3.github.com/topojson.v2.js && cp dist/topojson-client.min.js ../d3.github.com/topojson.v2.min.js && cd ../d3.github.com && git add topojson.v2.js topojson.v2.min.js && git commit -m \"topojson ${VERSION}\" && git push && cd - && zip -j dist/topojson-client.zip -- LICENSE.md README.md dist/topojson-client.js dist/topojson-client.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.36","tape":"4","uglify-js":"2"},"gitHead":"bac5a2f24136b8a0b531ee1ff6de3f2e7330ceaa","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@2.0.1","_shasum":"3bd372706187dbb2f656afbcc33c0e09885cddb5","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"3bd372706187dbb2f656afbcc33c0e09885cddb5","size":11753,"noattachment":false,"key":"/topojson-client/-/topojson-client-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-2.0.1.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/topojson-client-2.0.1.tgz_1477945732489_0.6164501493331045"},"directories":{},"publish_time":1477945734403,"_cnpm_publish_time":1477945734403,"_hasShrinkwrap":false},"2.0.0":{"name":"topojson-client","version":"2.0.0","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-client.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topo2geo":"bin/topo2geo"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n topojson -o dist/topojson-client.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-client.min.js -- dist/topojson-client.js","postpublish":"VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp -v README.md LICENSE.md dist/topojson-client.js dist/topojson-client.min.js ../topojson-bower && cd ../topojson-bower && mv topojson-client.js topojson.js && mv topojson-client.min.js topojson.min.js && git add README.md LICENSE.md topojson.js topojson.min.js && git commit -m \"Release $VERSION.\" && git tag -am \"Release $VERSION.\" v${VERSION} && git push && git push --tags && cd - && cp dist/topojson-client.js ../d3.github.com/topojson.v2.js && cp dist/topojson-client.min.js ../d3.github.com/topojson.v2.min.js && cd ../d3.github.com && git add topojson.v2.js topojson.v2.min.js && git commit -m \"topojson ${VERSION}\" && git push && cd - && zip -j dist/topojson.zip -- LICENSE.md README.md dist/topojson-client.js dist/topojson-client.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.36","tape":"4","uglify-js":"2"},"gitHead":"241be3082bff36a10a1db71da8ed7b940bc08e4f","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@2.0.0","_shasum":"5f852ee449d1ca9c6d165677a41b4f337cfa6e87","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"5f852ee449d1ca9c6d165677a41b4f337cfa6e87","size":13062,"noattachment":false,"key":"/topojson-client/-/topojson-client-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-2.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/topojson-client-2.0.0.tgz_1477938536178_0.6163014671765268"},"directories":{},"publish_time":1477938537969,"_cnpm_publish_time":1477938537969,"_hasShrinkwrap":false},"1.8.0":{"name":"topojson-client","version":"1.8.0","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topo2geo":"bin/topo2geo"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n topojson -o dist/topojson.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson.min.js -- dist/topojson.js","postpublish":"VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp -v README.md LICENSE.md dist/topojson.js dist/topojson.min.js ../topojson-bower && cd ../topojson-bower && git add README.md LICENSE.md topojson.js topojson.min.js && git commit -m \"Release $VERSION.\" && git tag -am \"Release $VERSION.\" v${VERSION} && git push && git push --tags && cd - && cp dist/topojson.js ../d3.github.com/topojson.v1.js && cp dist/topojson.min.js ../d3.github.com/topojson.v1.min.js && cd ../d3.github.com && git add topojson.v1.js topojson.v1.min.js && git commit -m \"topojson ${VERSION}\" && git push && cd - && zip -j dist/topojson.zip -- LICENSE.md README.md dist/topojson.js dist/topojson.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.36","tape":"4","uglify-js":"2"},"gitHead":"5e33f346eea90d6fcb2531c6546775bd456081f0","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@1.8.0","_shasum":"c5c5f11e1a105b1032a2e2b1e888979855a210d8","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"c5c5f11e1a105b1032a2e2b1e888979855a210d8","size":14788,"noattachment":false,"key":"/topojson-client/-/topojson-client-1.8.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-1.8.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/topojson-client-1.8.0.tgz_1477864346678_0.7325928672216833"},"directories":{},"publish_time":1477864346911,"_cnpm_publish_time":1477864346911,"_hasShrinkwrap":false},"1.7.0":{"name":"topojson-client","version":"1.7.0","description":"Manipulate TopoJSON and convert it to GeoJSON.","keywords":["topojson","geojson"],"homepage":"https://github.com/topojson/topojson-client","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-client.git"},"bin":{"topojson-geojson":"bin/topojson-geojson"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n topojson -o dist/topojson.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs dist/topojson.js -c -m -o dist/topojson.min.js","postpublish":"VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp -v README.md LICENSE.md dist/topojson.js dist/topojson.min.js ../topojson-bower && cd ../topojson-bower && git add README.md LICENSE.md topojson.js topojson.min.js && git commit -m \"Release $VERSION.\" && git tag -am \"Release $VERSION.\" v${VERSION} && git push && git push --tags && cd ../topojson && cp dist/topojson.js ../d3.github.com/topojson.v1.js && cp dist/topojson.min.js ../d3.github.com/topojson.v1.min.js && cd ../d3.github.com && git add topojson.v1.js topojson.v1.min.js && git commit -m \"topojson ${VERSION}\" && git push && cd - && zip -j dist/topojson.zip -- LICENSE.md README.md dist/topojson.js dist/topojson.min.js"},"dependencies":{"commander":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.36","tape":"4","uglify-js":"2"},"gitHead":"0a8d1d60b3ba003fa47e19b3b0956d427d0fd7ab","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"_id":"topojson-client@1.7.0","_shasum":"72b44289789f30abcedef2e59d02e83c2780f48f","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"72b44289789f30abcedef2e59d02e83c2780f48f","size":11474,"noattachment":false,"key":"/topojson-client/-/topojson-client-1.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/topojson-client/download/topojson-client-1.7.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/topojson-client-1.7.0.tgz_1477853927059_0.9084350084885955"},"directories":{},"publish_time":1477853927307,"_cnpm_publish_time":1477853927307,"_hasShrinkwrap":false}},"readme":"# TopoJSON Client\n\nThe **topojson-client** module provides tools for manipulating [TopoJSON](https://github.com/topojson/topojson), such as to [merge shapes](#merge) or [quantize coordinates](#quantize), and for converting back to [GeoJSON](#feature) for rendering with standard tools such as [d3.geoPath](https://github.com/d3/d3-geo/blob/master/README.md#geoPath). For example, [bl.ocks.org/3783604](https://bl.ocks.org/mbostock/3783604):\n\n```html\n<!DOCTYPE html>\n<canvas width=\"960\" height=\"600\"></canvas>\n<script src=\"https://d3js.org/d3.v4.min.js\"></script>\n<script src=\"https://unpkg.com/topojson-client@3\"></script>\n<script>\n\nvar context = d3.select(\"canvas\").node().getContext(\"2d\"),\n    path = d3.geoPath().context(context);\n\nd3.json(\"https://d3js.org/us-10m.v1.json\", function(error, us) {\n  if (error) throw error;\n\n  context.beginPath();\n  path(topojson.mesh(us));\n  context.stroke();\n});\n\n</script>\n```\n\n## Installing\n\nIf you use NPM, `npm install topojson-client`. Otherwise, download the [latest release](https://github.com/topojson/topojson-client/releases/latest). You can also load directly from [UNPKG](https://unpkg.com) as a [standalone library](https://unpkg.com/topojson-client@3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `topojson` global is exported:\n\n```html\n<script src=\"https://unpkg.com/topojson-client@3\"></script>\n<script>\n\nvar feature = topojson.feature(topology, \"foo\");\n\n</script>\n```\n\nThe TopoJSON client API is implemented using ES2015 modules. In compatible environments, you can import the library as a namespace, like so:\n\n```js\nimport * as topojson from \"topojson-client\";\n```\n\n[Try topojson-client in your browser.](https://runkit.com/npm/topojson-client)\n\n# API Reference\n\n<a name=\"feature\" href=\"#feature\">#</a> topojson.<b>feature</b>(<i>topology</i>, <i>object</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/feature.js \"Source\")\n\nReturns the GeoJSON Feature or FeatureCollection for the specified *object* in the given *topology*. If the specified object is a string, it is treated as *topology*.objects[*object*]. Then, if the object is a GeometryCollection, a FeatureCollection is returned, and each geometry in the collection is mapped to a Feature. Otherwise, a Feature is returned. The returned feature is a shallow copy of the source *object*: they may share identifiers, bounding boxes, properties and coordinates.\n\nSome examples:\n\n* A point is mapped to a feature with a geometry object of type “Point”.\n* Likewise for line strings, polygons, and other simple geometries.\n* A null geometry object (of type null in TopoJSON) is mapped to a feature with a null geometry object.\n* A geometry collection of points is mapped to a feature collection of features, each with a point geometry.\n* A geometry collection of geometry collections is mapped to a feature collection of features, each with a geometry collection.\n\nSee [feature-test.js](https://github.com/topojson/topojson-client/blob/master/test/feature-test.js) for more examples.\n\n<a name=\"merge\" href=\"#merge\">#</a> topojson.<b>merge</b>(<i>topology</i>, <i>objects</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/merge.js#L5 \"Source\")\n\nReturns the GeoJSON MultiPolygon geometry object representing the union for the specified array of Polygon and MultiPolygon *objects* in the given *topology*. Interior borders shared by adjacent polygons are removed. See [Merging States](https://bl.ocks.org/mbostock/5416405) for an example. The returned geometry is a shallow copy of the source *object*: they may share coordinates.\n\n<a name=\"mergeArcs\" href=\"#mergeArcs\">#</a> topojson.<b>mergeArcs</b>(<i>topology</i>, <i>objects</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/merge.js#L9 \"Source\")\n\nEquivalent to [topojson.merge](#merge), but returns TopoJSON rather than GeoJSON. The returned geometry is a shallow copy of the source *object*: they may share coordinates.\n\n<a name=\"mesh\" href=\"#mesh\">#</a> topojson.<b>mesh</b>(<i>topology</i>[, <i>object</i>[, <i>filter</i>]]) [<>](https://github.com/topojson/topojson-client/blob/master/src/mesh.js#L4 \"Source\")\n\nReturns the GeoJSON MultiLineString geometry object representing the mesh for the specified *object* in the given *topology*. This is useful for rendering strokes in complicated objects efficiently, as edges that are shared by multiple features are only stroked once. If *object* is not specified, a mesh of the entire topology is returned. The returned geometry is a shallow copy of the source *object*: they may share coordinates.\n\nAn optional *filter* function may be specified to prune arcs from the returned mesh using the topology. The filter function is called once for each candidate arc and takes two arguments, *a* and *b*, two geometry objects that share that arc. Each arc is only included in the resulting mesh if the filter function returns true. For typical map topologies the geometries *a* and *b* are adjacent polygons and the candidate arc is their boundary. If an arc is only used by a single geometry then *a* and *b* are identical. This property is useful for separating interior and exterior boundaries; an easy way to produce a mesh of interior boundaries is:\n\n```js\nvar interiors = topojson.mesh(topology, object, function(a, b) { return a !== b; });\n```\n\nSee this [county choropleth](https://bl.ocks.org/mbostock/4060606) for example. Note: the *a* and *b* objects are TopoJSON objects (pulled directly from the topology), and not automatically converted to GeoJSON features as by [topojson.feature](#feature).\n\n<a name=\"meshArcs\" href=\"#meshArcs\">#</a> topojson.<b>meshArcs</b>(<i>topology</i>[, <i>object</i>[, <i>filter</i>]]) [<>](https://github.com/topojson/topojson-client/blob/master/src/mesh.js#L8 \"Source\")\n\nEquivalent to [topojson.mesh](#mesh), but returns TopoJSON rather than GeoJSON. The returned geometry is a shallow copy of the source *object*: they may share coordinates.\n\n<a name=\"neighbors\" href=\"#neighbors\">#</a> topojson.<b>neighbors</b>(<i>objects</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/neighbors.js \"Source\")\n\nReturns an array representing the set of neighboring objects for each object in the specified *objects* array. The returned array has the same number of elements as the input array; each element *i* in the returned array is the array of indexes for neighbors of object *i* in the input array. For example, if the specified objects array contains the features *foo* and *bar*, and these features are neighbors, the returned array will be \\[\\[1\\], \\[0\\]\\], indicating that *foo* is a neighbor of *bar* and *vice versa*. Each array of neighbor indexes for each object is guaranteed to be sorted in ascending order.\n\nFor a practical example, see the [world map](https://bl.ocks.org/mbostock/4180634) with topological coloring.\n\n### Transforms\n\n<a name=\"bbox\" href=\"#bbox\">#</a> topojson.<b>bbox</b>(<i>topology</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/bbox.js \"Source\")\n\nReturns the computed [bounding box](https://github.com/topojson/topojson-specification#3-bounding-boxes) of the specified *topology* [*x*₀, *y*₀, *x*₁, *y*₁] where *x*₀ is the minimum *x*-value, *y*₀ is the minimum *y*-value, *x*₁ is the maximum *x*-value, and *y*₁ is the maximum *y*-value. If the *topology* has no points and no arcs, the returned bounding box is [∞, ∞, -∞, -∞]. (This method ignores the existing *topology*.bbox, if any.)\n\n<a name=\"quantize\" href=\"#quantize\">#</a> topojson.<b>quantize</b>(<i>topology</i>, <i>transform</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/quantize.js \"Source\")\n\nReturns a shallow copy of the specified *topology* with [quantized and delta-encoded](https://github.com/topojson/topojson-specification#213-arcs) arcs according to the specified [*transform* object](https://github.com/topojson/topojson-specification/blob/master/README.md#212-transforms). If the *topology* is already quantized, an error is thrown. See also [topoquantize](#topoquantize).\n\nIf a quantization number *n* is specified instead of a *transform* object, the corresponding transform object is first computed using the bounding box of the topology. In this case, the quantization number *n* must be a positive integer greater than one which determines the maximum number of expressible values per dimension in the resulting quantized coordinates; typically, a power of ten is chosen such as 1e4, 1e5 or 1e6. If the *topology* does not already have a *topology*.bbox, one is computed using [topojson.bbox](#bbox).\n\n<a name=\"transform\" href=\"#transform\">#</a> topojson.<b>transform</b>(<i>transform</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/transform.js \"Source\")\n\nIf the specified [*transform* object](https://github.com/topojson/topojson-specification/blob/master/README.md#212-transforms) is non-null, returns a [point *transform* function](#_transform) to remove delta-encoding and apply the transform. If the *transform* is null, returns the identity function.\n\n<a name=\"untransform\" href=\"#untransform\">#</a> topojson.<b>untransform</b>(<i>transform</i>) [<>](https://github.com/topojson/topojson-client/blob/master/src/untransform.js \"Source\")\n\nIf the specified [*transform* object](https://github.com/topojson/topojson-specification/blob/master/README.md#212-transforms) is non-null, returns a [point *transform* function](#_transform) to apply quantized delta-encoding and remove the transform. If the *transform* is null, returns the identity function. See also [topojson.quantize](#quantize).\n\n<a name=\"_transform\" href=\"#_transform\">#</a> <i>transform</i>(<i>point</i>[, <i>index</i>])\n\nApplies this transform function to the specified *point*, returning a new point with the transformed coordinates. If the specified *index* is truthy, the input *point* is treated as relative to the previous point passed to this transform, as is the case with delta-encoded arcs.\n\n## Command Line Reference\n\n### topo2geo\n\n<a name=\"topo2geo\" href=\"#topo2geo\">#</a> <b>topo2geo</b> [<i>options…</i>] &lt;<i>name</i>=<i>file</i>&gt;… [<>](https://github.com/topojson/topojson-client/blob/master/bin/topo2geo \"Source\")\n\nConverts one or more TopoJSON objects from an input topology to one or more GeoJSON features. For example, to convert the “states” TopoJSON GeometryCollection object in us.json to a GeoJSON feature collection in us-states.json:\n\n```\ntopo2geo states=us-states.json < us.json\n```\n\nFor convenience, you can omit the object name and specify only the file *name*; the object name will be the basename of the file, with the directory and extension removed. For example, to convert the “states” TopoJSON GeometryCollection object in us.json to a GeoJSON feature collection in states.json:\n\n```\ntopo2geo states.json < us.json\n```\n\nSee also [geo2topo](https://github.com/topojson/topojson/blob/master/README.md#geo2topo).\n\nTo list the available object names, use [--list](#topo2geo_list).\n\n<a name=\"topo2geo_help\" href=\"#topo2geo_help\">#</a> topo2geo <b>-h</b>\n<br><a href=\"#topo2geo_help\">#</a> topo2geo <b>--help</b>\n\nOutput usage information.\n\n<a name=\"topo2geo_version\" href=\"#topo2geo_version\">#</a> topo2geo <b>-V</b>\n<br><a href=\"#topo2geo_version\">#</a> topo2geo <b>--version</b>\n\nOutput the version number.\n\n<a name=\"topo2geo_newline_delimited\" href=\"#topo2geo_newline_delimited\">#</a> topo2geo <b>-n</b>\n<br><a href=\"#topo2geo_newline_delimited\">#</a> topo2geo <b>--newline-delimited</b>\n\nOutput [newline-delimited JSON](http://ndjson.org/), with one feature per line.\n\n<a name=\"topo2geo_in\" href=\"#topo2geo_in\">#</a> topo2geo <b>-i</b> <i>file</i>\n<br><a href=\"#topo2geo_in\">#</a> topo2geo <b>--in</b> <i>file</i>\n\nSpecify the input TopoJSON file name. Defaults to “-” for stdin.\n\n<a name=\"topo2geo_list\" href=\"#topo2geo_list\">#</a> topo2geo <b>-l</b>\n<br><a href=\"#topo2geo_list\">#</a> topo2geo <b>--list</b>\n\nList the names of the objects in the input topology, and then exit. For example, this:\n\n```\ntopo2geo -l < us.json\n```\n\nWill output this:\n\n```\ncounties\nstates\nnation\n```\n\n### topomerge\n\n<a name=\"topomerge\" href=\"#topomerge\">#</a> <b>topomerge</b> [<i>options…</i>] &lt;<i>target</i>=<i>source</i>&gt; [<i>file</i>] [<>](https://github.com/topojson/topojson-client/blob/master/bin/topomerge \"Source\")\n\nMerges polygons (or meshes lines) from the specified *source* TopoJSON geometry collection object, assigning to the *target* object.\n\nSee also [topojson.mergeArcs](#mergeArcs) and [topojson.meshArcs](#meshArcs).\n\n<a name=\"topomerge_help\" href=\"#topomerge_help\">#</a> topomerge <b>-h</b>\n<br><a href=\"#topomerge_help\">#</a> topomerge <b>--help</b>\n\nOutput usage information.\n\n<a name=\"topomerge_version\" href=\"#topomerge_version\">#</a> topomerge <b>-V</b>\n<br><a href=\"#topomerge_version\">#</a> topomerge <b>--version</b>\n\nOutput the version number.\n\n<a name=\"topomerge_out\" href=\"#topomerge_out\">#</a> topomerge <b>-o</b> <i>file</i>\n<br><a href=\"#topomerge_out\">#</a> topomerge <b>--out</b> <i>file</i>\n\nSpecify the output TopoJSON file name. Defaults to “-” for stdout.\n\n<a name=\"topomerge_key\" href=\"#topomerge_key\">#</a> topomerge <b>-k</b> <i>expression</i>\n<br><a href=\"#topomerge_key\">#</a> topomerge <b>--key</b> <i>expression</i>\n\nSpecify a JavaScript *expression*, given a TopoJSON geometry object *d* and its zero-based index *i* in its parent collection, that determines how geometry objects are grouped before merging; each group is merged separately. For example, given a topology of U.S. *counties*, where the *id* of each county is it’s five-digit FIPS code, the county boundaries can be merged into state boundaries by using the first two digits of the county FIPS code, which represents the state FIPS code:\n\n```\ntopomerge states=counties -k 'd.id.slice(0, 2)' < us-counties.json > us-states.json\n```\n\nIf a key is not specified, all input geometry objects will be merged together. For example, this can be used to merge the state boundaries into a single nation boundary:\n\n```\ntopomerge nation=states < us-states.json > us.json\n```\n\n<a name=\"topomerge_filter\" href=\"#topomerge_filter\">#</a> topomerge <b>-f</b> <i>expression</i>\n<br><a href=\"#topomerge_filter\">#</a> topomerge <b>--filter</b> <i>expression</i>\n\nSpecify a JavaScript *expression* that filters the input geometries before merging or meshing. In conjunction with [--mesh](#topomerge_mesh), the *expression* is given two TopoJSON geometry objects *a* and *b* that represent the adjacent features for a given arc segment; if the *expression* evaluates truthily, the associated arc segment is retained in mesh. Otherwise, the *expression* is given an input TopoJSON geometry object *d* and its zero-based index *i* in its parent collection; if the *expression* evaluates truthily, the geometry object is retained in the merged polygon.\n\n<a name=\"topomerge_mesh\" href=\"#topomerge_mesh\">#</a> topomerge <b>--mesh</b>\n\nUse [topojson.meshArcs](#meshArcs) instead of [topojson.mergeArcs](#mergeArcs), generating a geometry collection of lines rather than polygons.\n\n### topoquantize\n\n<a name=\"topoquantize\" href=\"#topoquantize\">#</a> <b>topoquantize</b> [<i>options…</i>] &lt;<i>n</i>&gt; [<i>file</i>] [<>](https://github.com/topojson/topojson-client/blob/master/bin/topoquantize \"Source\")\n\nQuantizes the coordinates of the input TopoJSON topology and [delta-encodes](https://github.com/topojson/topojson-specification#213-arcs) the topology’s arcs. The quantization parameter *n* must be a positive integer greater than one, and determines the maximum expressible number of unique values per dimension in the resulting quantized coordinates; typically, a power of ten is chosen such as 1e4, 1e5 or 1e6. If the *topology* does not already have a [bbox](#bbox), one is computed and assigned. If the *topology* is already quantized, an error is thrown. See also [topojson.quantize](#quantize).\n\n<a name=\"topoquantize_help\" href=\"#topoquantize_help\">#</a> topoquantize <b>-h</b>\n<br><a href=\"#topoquantize_help\">#</a> topoquantize <b>--help</b>\n\nOutput usage information.\n\n<a name=\"topoquantize_version\" href=\"#topoquantize_version\">#</a> topoquantize <b>-V</b>\n<br><a href=\"#topoquantize_version\">#</a> topoquantize <b>--version</b>\n\nOutput the version number.\n\n<a name=\"topoquantize_out\" href=\"#topoquantize_out\">#</a> topoquantize <b>-o</b> <i>file</i>\n<br><a href=\"#topoquantize_out\">#</a> topoquantize <b>--out</b> <i>file</i>\n\nSpecify the output TopoJSON file name. Defaults to “-” for stdout.\n","_attachments":{},"homepage":"https://github.com/topojson/topojson-client","bugs":{"url":"https://github.com/topojson/topojson-client/issues"},"license":"ISC"}