{"name":"d3-svg-legend","version":"2.12.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","rollup":"0.34.7","rollup-plugin-babel":"2.6.1","stringify":"3.1.0"},"scripts":{"build":"rollup -c","prepublish":"npm t","test":"mocha test/test.js"},"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"},"gitHead":"39414ee403272ef916742232d08a8ccc95791f2f","_id":"d3-svg-legend@2.12.0","_shasum":"b3b0e3de0b27e696563fb3c6d247eae3491705e6","_from":".","_npmVersion":"2.15.9","_nodeVersion":"6.2.1","_npmUser":{"name":"susielu","email":"lulnlul@gmail.com"},"dist":{"shasum":"b3b0e3de0b27e696563fb3c6d247eae3491705e6","tarball":"http://registry-npm.ywwl.com/d3-svg-legend/download/d3-svg-legend-2.12.0.tgz","integrity":"sha512-JpQHPC4t28/LaWCUOjN87psRl4Ug6pFLWcoPiyZKcvhmegbQyoOM1IR6pgEpFT3WUCucdEZS8Ag0usBegkihtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHAShPVjh4lfjerl5lDjhUC5k2cxzamtFfSfkhukv1JQAiBmHZusNXk9k95ZPRzUrL7VhhdhLB7PftyoDsWqkagOUQ=="}],"size":139590,"noattachment":false,"key":"/d3-svg-legend/-/d3-svg-legend-2.12.0.tgz"},"maintainers":[{"name":"susielu","email":"susie.lu.shan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/d3-svg-legend-2.12.0.tgz_1477370867484_0.720969300949946"},"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":1477370867766,"_cnpm_publish_time":1477370867766,"dist-tags":{"latest":"2.25.6"}}