{"_id":"d3-force-cluster","_rev":"7-6a474c41a6c749918b3bdbd76dfb4e1a","name":"d3-force-cluster","description":"Clustering force for d3.forceSimulation.","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"d3-force-cluster","version":"0.0.1","description":"Clustering force for d3.forceSimulation.","keywords":["d3","d3-module","d3-force","layout","graph","cluster","infovis","dataviz"],"homepage":"http://ericsoco.github.io/d3-force-cluster/","license":"BSD-3-Clause","author":{"name":"Eric Socolofsky","url":"http://transmote.com/"},"main":"dist/d3-force-cluster.js","module":"dist/d3-force-cluster.mjs","jsnext:main":"dist/d3-force-cluster.mjs","repository":{"type":"git","url":"git+https://github.com/ericsoco/d3-force-cluster.git"},"scripts":{"lint":"eslint lib","test":"tape 'test/**/*-test.js' | tap-dot","predist":"npm run lint && npm run test","dist":"rollup -c","watch":"rollup -c -w","prepublish":"npm run dist && uglifyjs dist/d3-force-cluster.js -c -m -o dist/d3-force-cluster.min.js"},"pre-push":["dist"],"dependencies":{},"devDependencies":{"babel-eslint":"^7.0.0","babel-plugin-external-helpers":"^6.8.0","babel-preset-es2015":"^6.16.0","babelrc-rollup":"^3.0.0","eslint":"^3.8.1","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-watch":"^2.5.0","tap-dot":"^1.0.5","tape":"^4.6.2","uglify-js":"^2.7.3"},"gitHead":"95109b85d8bb52c5ae3885a64bc03c65195189fb","bugs":{"url":"https://github.com/ericsoco/d3-force-cluster/issues"},"_id":"d3-force-cluster@0.0.1","_shasum":"fd7b9cc08a2cc27ba5e20d74eff74e55c6fd5ef9","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"ericsoco","email":"eric@transmote.com"},"dist":{"shasum":"fd7b9cc08a2cc27ba5e20d74eff74e55c6fd5ef9","tarball":"https://registry.npmjs.org/d3-force-cluster/-/d3-force-cluster-0.0.1.tgz","integrity":"sha512-FCBKsdo/H5Bkvstkevv/sekfFltP785Fjpw8RUlEjkEhdD8uklfkLBZsvE6j0OCRHHs1lSEoxgoPbAy/LwV75A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrYHh38Og6t/VMLldLiNwMFs8vzF3hqG6uxYcCCpdFOQIgUspfv7wQt1+77DJuNNgbSAkLeV3BienQt6BjE2lKvnI="}]},"maintainers":[{"name":"ericsoco","email":"eric@transmote.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/d3-force-cluster-0.0.1.tgz_1477110598442_0.39153603254817426"}},"0.0.2":{"name":"d3-force-cluster","version":"0.0.2","description":"Clustering force for d3.forceSimulation.","keywords":["d3","d3-module","d3-force","layout","graph","cluster","infovis","dataviz"],"homepage":"http://ericsoco.github.io/d3-force-cluster/","license":"BSD-3-Clause","author":{"name":"Eric Socolofsky","url":"http://transmote.com/"},"main":"dist/d3-force-cluster.js","module":"dist/d3-force-cluster.mjs","jsnext:main":"dist/d3-force-cluster.mjs","repository":{"type":"git","url":"git+https://github.com/ericsoco/d3-force-cluster.git"},"scripts":{"lint":"eslint lib","test":"tape 'test/**/*-test.js' | tap-dot","predist":"npm run lint","dist":"rollup -c","postdist":"npm run test","watch":"rollup -c -w","prepublish":"npm run dist && uglifyjs dist/d3-force-cluster.js -c -m -o dist/d3-force-cluster.min.js","publish-patch":"npm version patch && npm publish"},"pre-push":["dist"],"dependencies":{},"devDependencies":{"babel-eslint":"^7.0.0","babel-plugin-external-helpers":"^6.8.0","babel-preset-es2015":"^6.16.0","babelrc-rollup":"^3.0.0","eslint":"^3.8.1","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-watch":"^2.5.0","tap-dot":"^1.0.5","tape":"^4.6.2","uglify-js":"^2.7.3"},"gitHead":"7327dba2f20353090804ce61894f961724b6f9aa","bugs":{"url":"https://github.com/ericsoco/d3-force-cluster/issues"},"_id":"d3-force-cluster@0.0.2","_shasum":"d20df0a5ffa82d8a7bb852731cb080411983ad41","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"ericsoco","email":"eric@transmote.com"},"dist":{"shasum":"d20df0a5ffa82d8a7bb852731cb080411983ad41","tarball":"https://registry.npmjs.org/d3-force-cluster/-/d3-force-cluster-0.0.2.tgz","integrity":"sha512-8yVJtTncobwFbgNWdjF0R+s4O4RIcyAcG/vz2X4NOgifNFS+TNoL8Bej3q8RfTvHWsiUEsOtyvEz7Emjj700tg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC87ApGB1GSLsG8QeXkeKYKBpPAU0TKmnuLAliMY/OqbQIgeE5ZvhmtAM5cVcBvvsVmNbZ33HLQXQWdIVi84GX3g6E="}]},"maintainers":[{"name":"ericsoco","email":"eric@transmote.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/d3-force-cluster-0.0.2.tgz_1477256157026_0.33893754752352834"}},"0.1.0":{"name":"d3-force-cluster","version":"0.1.0","description":"Clustering force for d3.forceSimulation.","keywords":["d3","d3-module","d3-force","layout","graph","cluster","infovis","dataviz"],"homepage":"http://ericsoco.github.io/d3-force-cluster/","license":"BSD-3-Clause","author":{"name":"Eric Socolofsky","url":"http://transmote.com/"},"main":"dist/d3-force-cluster.js","module":"dist/d3-force-cluster.mjs","jsnext:main":"dist/d3-force-cluster.mjs","repository":{"type":"git","url":"git+https://github.com/ericsoco/d3-force-cluster.git"},"scripts":{"lint":"eslint lib","test":"tape 'test/**/*-test.js' | tap-min","predist":"npm run lint","dist":"rollup -c","postdist":"npm run test","watch":"rollup -c -w","prepublish":"npm run dist && uglifyjs dist/d3-force-cluster.js -c -m -o dist/d3-force-cluster.min.js","publish-patch":"npm version patch && npm publish"},"pre-push":["dist"],"dependencies":{"tap-min":"^1.1.0"},"devDependencies":{"babel-eslint":"^7.0.0","babel-plugin-external-helpers":"^6.8.0","babel-preset-es2015":"^6.16.0","babelrc-rollup":"^3.0.0","eslint":"^3.8.1","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-watch":"^2.5.0","sinon":"^1.17.6","tape":"^4.6.2","uglify-js":"^2.7.3"},"gitHead":"65fc481ed7ea26c3053142603871819516e79a37","bugs":{"url":"https://github.com/ericsoco/d3-force-cluster/issues"},"_id":"d3-force-cluster@0.1.0","_shasum":"04ce87ca7c7b76d33ff28dd740aa71d301a613af","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"ericsoco","email":"eric@transmote.com"},"dist":{"shasum":"04ce87ca7c7b76d33ff28dd740aa71d301a613af","tarball":"https://registry.npmjs.org/d3-force-cluster/-/d3-force-cluster-0.1.0.tgz","integrity":"sha512-g1sl/ZJiYSaoq+7fjrz165bBBD6zphRfE8vavXNbroj3qEVRugczB5Dw4TmxWWl0VJHQrYI60M3aVAiJhtxk9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+I4ZsZdYMHfC7BM6ItRn86zgOZJB+/K/D5if3hpIMXAiBIGgHBXQAWK0aPNRQBeAuB2JCEc7bR+8n5wh38Ce/yZA=="}]},"maintainers":[{"name":"ericsoco","email":"eric@transmote.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/d3-force-cluster-0.1.0.tgz_1478321670881_0.8395481815095991"}},"0.1.1":{"name":"d3-force-cluster","version":"0.1.1","description":"Clustering force for d3.forceSimulation.","keywords":["d3","d3-module","d3-force","layout","graph","cluster","infovis","dataviz"],"homepage":"http://ericsoco.github.io/d3-force-cluster/","license":"BSD-3-Clause","author":{"name":"Eric Socolofsky","url":"http://transmote.com/"},"main":"dist/d3-force-cluster.js","module":"dist/d3-force-cluster.mjs","jsnext:main":"dist/d3-force-cluster.mjs","repository":{"type":"git","url":"git+https://github.com/ericsoco/d3-force-cluster.git"},"scripts":{"lint":"eslint lib","test":"tape 'test/**/*-test.js' | tap-min","predist":"npm run lint","dist":"rollup -c","postdist":"npm run test","watch":"rollup -c -w","prepublish":"npm run dist && uglifyjs dist/d3-force-cluster.js -c -m -o dist/d3-force-cluster.min.js","publish-patch":"npm version patch && npm publish"},"pre-push":["dist"],"dependencies":{"tap-min":"^1.1.0"},"devDependencies":{"babel-eslint":"^7.0.0","babel-plugin-external-helpers":"^6.8.0","babel-preset-es2015":"^6.16.0","babelrc-rollup":"^3.0.0","eslint":"^3.8.1","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-watch":"^2.5.0","sinon":"^1.17.6","tape":"^4.6.2","uglify-js":"^2.7.3"},"gitHead":"dafa876d66c6016f6b0332426645b69f133a2805","bugs":{"url":"https://github.com/ericsoco/d3-force-cluster/issues"},"_id":"d3-force-cluster@0.1.1","_shasum":"1e71f3a45eb95e2000473406724aa5a7e48daee4","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"ericsoco","email":"eric@transmote.com"},"dist":{"shasum":"1e71f3a45eb95e2000473406724aa5a7e48daee4","tarball":"https://registry.npmjs.org/d3-force-cluster/-/d3-force-cluster-0.1.1.tgz","integrity":"sha512-E7qO5MFQ19/yaVXdg7PCAz8/0Mj/8j2hro74LmyXf+J2ybrq7EPuG3Je+heD7Wu5cR1C2uNk6Xkq8ACcPF8Q2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQXkqORjnVf/Q3ETa9L+P7LZ1krjpAOog7+N3OPDSIAwIgL4fcoIsh+BM7eEc4WSldiUhbEiSfaduDjoweFi3crf0="}]},"maintainers":[{"name":"ericsoco","email":"eric@transmote.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/d3-force-cluster-0.1.1.tgz_1479192415034_0.46422820957377553"}},"0.1.2":{"name":"d3-force-cluster","version":"0.1.2","description":"Clustering force for d3.forceSimulation.","keywords":["d3","d3-module","d3-force","layout","graph","cluster","infovis","dataviz"],"homepage":"http://ericsoco.github.io/d3-force-cluster/","license":"BSD-3-Clause","author":{"name":"Eric Socolofsky","url":"http://transmote.com/"},"main":"dist/d3-force-cluster.js","module":"dist/d3-force-cluster.mjs","jsnext:main":"dist/d3-force-cluster.mjs","repository":{"type":"git","url":"git+https://github.com/ericsoco/d3-force-cluster.git"},"scripts":{"lint":"eslint lib","test":"tape 'test/**/*-test.js' | tap-min","predist":"npm run lint","dist":"rollup -c","postdist":"npm run test","watch":"rollup -c -w","prepublish":"npm run dist && uglifyjs dist/d3-force-cluster.js -c -m -o dist/d3-force-cluster.min.js","publish-patch":"npm version patch && npm publish"},"pre-push":["dist"],"dependencies":{"tap-min":"^1.1.0"},"devDependencies":{"babel-eslint":"^7.0.0","babel-plugin-external-helpers":"^6.8.0","babel-preset-es2015":"^6.16.0","babelrc-rollup":"^3.0.0","eslint":"^3.8.1","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-watch":"^2.5.0","sinon":"^1.17.6","tape":"^4.6.2","uglify-js":"^2.7.3"},"gitHead":"2b36df1a0af86aa37a5fefeeb8bde8896d07f5b0","bugs":{"url":"https://github.com/ericsoco/d3-force-cluster/issues"},"_id":"d3-force-cluster@0.1.2","_shasum":"93f78c7030054afb0bed1aba732dc86d172d020b","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"ericsoco","email":"eric@transmote.com"},"dist":{"shasum":"93f78c7030054afb0bed1aba732dc86d172d020b","tarball":"https://registry.npmjs.org/d3-force-cluster/-/d3-force-cluster-0.1.2.tgz","integrity":"sha512-3n4OwzIreh/ol4UYURIFx7cix/YRruPlKtLfRQPM8pmWIcJE72lZVq+Dbm1wAklfDbFuVldTTFzHuVLAG2JUrQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDa1bmWi/+BtznNxL7nnE2RJ0vvlDd8YZw39zagrbJt+AiEA42oRyxadHGRn58JtIQyTebShrp4lI+aGvwngEhbesQc="}]},"maintainers":[{"name":"ericsoco","email":"eric@transmote.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/d3-force-cluster-0.1.2.tgz_1484598148909_0.27686177659779787"}}},"readme":"# d3-force-cluster\n\nModular force for use with D3's [`forceSimulation`](https://github.com/d3/d3-force#forceSimulation).\n\nPulls nodes toward a set of cluster center nodes / points. Works well with a [collision force](https://github.com/d3/d3-force/blob/master/README.md#collision) to pack nodes together in clusters with no overlap.\n\nAdapted from Mike Bostock's [Clustered Force Layout III](https://bl.ocks.org/mbostock/7881887).\n\n[![Build Status](https://travis-ci.org/ericsoco/d3-force-cluster.svg?branch=master)](https://travis-ci.org/ericsoco/d3-force-cluster)\n\n\n## Installing\n\n#### npm\n\n`npm install d3-force-cluster`\n\n#### CDN ([UNPKG](https://unpkg.com/)), via `<script>`\n\n`<script src=\"https://unpkg.com/d3-force-cluster@latest\"></script>`\n\n#### Local, via `<script>`\n\nDownload the [latest release](https://github.com/ericsoco/d3-force-cluster/releases/latest)\n\n`<script src=\"./d3-force-cluster.min.js\"></script>`\n\n\n## Usage\n\n### Accessing the module\n\nThe install method you use determines the syntax for accessing the module in your code:\n\n#### npm\n\nImport the `forceCluster()` method and use it in a `forceSimulation`.\n\n```\nimport { forceCluster } from 'd3-force-cluster'\n// ...\nd3.forceSimulation\n\t.force('cluster', forceCluster());\n```\n\n#### via `<script>` or CDN ([UNPKG](https://unpkg.com/))\n\nThe `forceCluster()` method is available in the global `d3` namespace.\n\n```\nd3.forceSimulation\n\t.force('cluster', d3.forceCluster());\n```\n\n### Using the module\n\nAdd a `'cluster'` force just like you would any other D3 force module:\n\n```\n// add a clustering force to pull nodes toward their assigned cluster center node\nd3.forceSimulation()\n  // cluster by section\n  .force('cluster', forceCluster()\t// see 'Accessing the module' above for the correct syntax\n    .centers(function (d) { return clusters[d.cluster]; })\n    .strength(0.2)\n    .centerInertia(0.1))\n```\n\nMore detailed examples:\n- [Simple cluster layout<br>![Simple cluster layout](http://bl.ocks.org/ericsoco/raw/4e1b7b628771ae77753842e6dabfcef3/thumbnail.png)](http://bl.ocks.org/ericsoco/4e1b7b628771ae77753842e6dabfcef3)\n- [Centered cluster layout<br>![Centered cluster layout](http://bl.ocks.org/ericsoco/raw/d2d49d95d2f75552ac64f0125440b35e/thumbnail.png)](http://bl.ocks.org/ericsoco/d2d49d95d2f75552ac64f0125440b35e)\n- [Mouse following cluster layout<br>![Mouse following cluster layout](http://bl.ocks.org/ericsoco/raw/11d5013dee991b219b205a4ecd558d7c/thumbnail.png)](http://bl.ocks.org/ericsoco/11d5013dee991b219b205a4ecd558d7c)\n\n\n\n## API\n\nThe [`forceCluster`](https://github.com/ericsoco/d3-force-cluster/blob/master/lib/forceCluster.js) module follows the [basic interface described in d3-force](https://github.com/d3/d3-force/blob/master/README.md#forces), additionally implementing the following:\n\n<a name=\"cluster_initialize\" href=\"#cluster_initialize\">#</a> <i>cluster</i>.<b>initialize</b>(<i>nodes</i>) [<>](https://github.com/ericsoco/d3-force-cluster/blob/master/lib/forceCluster.js#L52 \"Source\")\n\nAssigns the array of *nodes* to this force. This method is called when a force is bound to a simulation via [*simulation*.force](https://github.com/d3/d3-force/blob/master/README.md#simulation_force) and when the simulation’s nodes change via [*simulation*.nodes](https://github.com/d3/d3-force/blob/master/README.md#simulation_nodes). A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force.\n\n<a name=\"cluster_centers\" href=\"#cluster_centers\">#</a> <i>cluster</i>.<b>centers</b>([<i>centers</i>]) [<>](https://github.com/ericsoco/d3-force-cluster/blob/master/lib/forceCluster.js#L62 \"Source\")\n\nIf *centers* is specified, specifies the center nodes or points of each force cluster. If *centers* is not specified, returns the current Array of centers.\n`// TODO: finish`\nthe force centers to the specified number in the range [0,1] and returns this force. \n\n<a name=\"cluster_strength\" href=\"#cluster_strength\">#</a> <i>cluster</i>.<b>strength</b>([<i>strength</i>]) [<>](https://github.com/ericsoco/d3-force-cluster/blob/master/lib/forceCluster.js#L79 \"Source\")\n\nIf *strength* is specified, sets the force strength to the specified number in the range [0,1] and returns this force. If *strength* is not specified, returns the current strength, which defaults to 0.1.\n\nThis parameter determines the attraction strength of each node to the specified (via [*cluster*.centers](#cluster_centers)) cluster center node/position.\n\n<a name=\"cluster_centerInertia\" href=\"#cluster_centerInertia\">#</a> <i>cluster</i>.<b>centerInertia</b>([<i>centerInertia</i>]) [<>](https://github.com/ericsoco/d3-force-cluster/blob/master/lib/forceCluster.js#L91 \"Source\")\n\nIf *centerInertia* is specified, sets the inertia of cluster center nodes to the specified number in the range [0,1] and returns this force. If *centerInertia* is not specified, returns the current center inertia, which defaults to 0.\n\nLower values (close to 0.0) result in cluster center nodes with lower inertia: they are easily pulled around by other nodes in the cluster. Higher values (close to 1.0) result in cluster center nodes that are moved very little by other nodes in the cluster.\n\n\n## Building and testing\n\nInstall [nvm](http://nvm.sh) and [npm](http://npmjs.com) if you haven't already.\n\nBuild with the following commands:\n\n```bash\nnvm use\nnpm install\nnpm run dist\n```\n\nTest with `npm run test`.\n","maintainers":[{"name":"ericsoco","email":"eric@transmote.com"}],"time":{"modified":"2022-06-14T07:41:07.300Z","created":"2016-10-22T04:30:00.812Z","0.0.1":"2016-10-22T04:30:00.812Z","0.0.2":"2016-10-23T20:55:57.282Z","0.1.0":"2016-11-05T04:54:31.117Z","0.1.1":"2016-11-15T06:46:57.006Z","0.1.2":"2017-01-16T20:22:30.703Z"},"homepage":"http://ericsoco.github.io/d3-force-cluster/","keywords":["d3","d3-module","d3-force","layout","graph","cluster","infovis","dataviz"],"repository":{"type":"git","url":"git+https://github.com/ericsoco/d3-force-cluster.git"},"author":{"name":"Eric Socolofsky","url":"http://transmote.com/"},"bugs":{"url":"https://github.com/ericsoco/d3-force-cluster/issues"},"license":"BSD-3-Clause","readmeFilename":"README.md"}