{"name":"d3-svg-legend","version":"2.16.0","description":"A legend component for d3. Given a d3.scale it can create either a color legend, size legend, or symbol legend.","main":"indexRollup.js","jsnext:main":"indexRollup.mjs","files":["src","index.js","indexRollup.js","indexRollup.js.map","indexRollup.mjs","d3-legend.*"],"keywords":["d3","d3-module","legend"],"directories":{"example":"examples","test":"test"},"devDependencies":{"babel-plugin-external-helpers":"6.8.0","babel-preset-es2015":"6.13.2","babelify":"7.3.0","babelrc-rollup":"3.0.0","chai":"3.4.1","grunt":"0.4.5","grunt-browserify":"3.8.0","grunt-contrib-uglify":"0.9.1","marked":"0.3.5","mocha":"2.2.5","reify":"^0.3.8","rollup":"0.34.7","rollup-plugin-babel":"2.6.1","stringify":"3.1.0"},"scripts":{"build":"rollup -c","prepublish":"npm t && npm run build","test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/susielu/d3-legend.git"},"author":{"name":"Susie Lu","url":"http://www.susielu.com"},"license":"ISC","bugs":{"url":"https://github.com/susielu/d3-legend/issues"},"homepage":"http://d3-legend.susielu.com","dependencies":{"d3-array":"1.0.1","d3-dispatch":"1.0.1","d3-format":"1.0.2","d3-scale":"1.0.3","d3-selection":"1.0.2","d3-transition":"1.0.3"},"gitHead":"9084ba15074fa0677725ce127b42e279dd19def1","_id":"d3-svg-legend@2.16.0","_shasum":"29b489ecf1165c50f9383365f2c9d127de775627","_from":".","_npmVersion":"2.15.9","_nodeVersion":"6.2.1","_npmUser":{"name":"susielu","email":"lulnlul@gmail.com"},"dist":{"shasum":"29b489ecf1165c50f9383365f2c9d127de775627","tarball":"http://registry-npm.ywwl.com/d3-svg-legend/download/d3-svg-legend-2.16.0.tgz","integrity":"sha512-MDNMmVgOLZJOp6W0ZnUu7cvPdW3+PkjGN49ZTIbXKa7B+t4eYlTi8PdMLRJhs8UYoI7ZzDkYI/zYH8f+E85W/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo9PH4QTyMoMgQ2QL6lq6UGgPmx6/eaSxHC6k6Tn6RhwIhAIUa3ztT8U7Wk+j4wi6wBZg7xj26dPpATZ/ERPIaLzP1"}],"size":142947,"noattachment":false,"key":"/d3-svg-legend/-/d3-svg-legend-2.16.0.tgz"},"maintainers":[{"name":"susielu","email":"susie.lu.shan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/d3-svg-legend-2.16.0.tgz_1478577802354_0.28325667092576623"},"readme":"# d3-legend\n\nFull documentation: [http://d3-legend.susielu.com](http://d3-legend.susielu.com)\n\n## Looking for compatibility with d3 v3?\n- You can see the code for the d3 legend that works with d3 v3 in the [v3 branch](https://github.com/susielu/d3-legend/tree/v3)\n- [Documentation](http://d3-legend-v3.susielu.com) for the v3 version of the legend\n\n## d3-legend v4 updates (npm version 2.0.0 and higher)\n- Flattened naming for accessing functions\n    - d3.legend.color => d3.legendColor\n    - d3.legend.size => d3.legendSize\n    - d3.legend.symbol => d3.legendSymbol\n- NPM package no longer binds to global d3, is now just an object with the three legend functions\n\n## Usage\n\n### Using just the minified file\n\nYou must include the [d3 library](http://d3js.org/) before including the legend file. Then you can simply add the compiled js file to your website:\n\n- d3-legend.min.js\n- d3-legend.js (Human readable version)\n\n### Using CDN\n\nYou can also add the latest version of [d3-legend hosted on cdnjs](https://cdnjs.com/libraries/d3-legend).\n\n### Using npm\n\nYou can add the d3 legend as a node module by running:\n\n`npm i d3-svg-legend -S`\n\nTo use the version compatible with d3v3 run:\n`npm i d3-svg-legend@1.x -S`\n\nUsing the import syntax `import legend from 'd3-svg-legend'` gives access to the three legend types as an object. You can also import them independently for example `import { legendColor } from 'd3-svg-legend'`\n\n```\nvar svg = d3.select(\"#svg-color-quant\");\n\nvar quantize = d3.scaleQuantize()\n    .domain([ 0, 0.15 ])\n    .range(d3.range(9).map(function(i) { return \"q\" + i + \"-9\"; }));\n\nsvg.append(\"g\")\n  .attr(\"class\", \"legendQuant\")\n  .attr(\"transform\", \"translate(20,20)\");\n\nvar colorLegend = d3.legendColor()\n    .labelFormat(d3.format(\".2f\"))\n    .useClass(true)\n    .scale(quantize);\n\nsvg.select(\".legendQuant\")\n  .call(colorLegend);\n\n```\n\n## Feedback\nI would love to hear from you about any additional features that would be useful, please say hi on twitter [@DataToViz](https://www.twitter.com/DataToViz).\n","publish_time":1478577804393,"_cnpm_publish_time":1478577804393,"dist-tags":{"latest":"2.25.6"}}