{"name":"d3-svg-legend","version":"2.10.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.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":"722d7ca0fd265f9901c114302b7f96d35fd0ff43","_id":"d3-svg-legend@2.10.0","_shasum":"d22a758caa31ae0237860607c71fefa0b44abcd9","_from":".","_npmVersion":"2.14.20","_nodeVersion":"5.5.0","_npmUser":{"name":"susielu","email":"lulnlul@gmail.com"},"dist":{"shasum":"d22a758caa31ae0237860607c71fefa0b44abcd9","tarball":"http://registry-npm.ywwl.com/d3-svg-legend/download/d3-svg-legend-2.10.0.tgz","integrity":"sha512-V6FmUSE8c8PfBALNkN6VusgpEr5mmqWUb9jFcjlpQzzUd3GN+zW6yADic4e3XI/0qQ817TcsBrxzhy7fIhRO1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2Dry8ukcVRl9knU/VOOko+bP3L3UwEhmNNO2GR7+ALAiEA9PI9Coh8zLU/eAsLQTaNp9jhJ2UxdC4SOM0LVQupGmU="}],"size":129405,"noattachment":false,"key":"/d3-svg-legend/-/d3-svg-legend-2.10.0.tgz"},"maintainers":[{"name":"susielu","email":"susie.lu.shan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/d3-svg-legend-2.10.0.tgz_1473710203312_0.6302576067391783"},"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":1473710206576,"_cnpm_publish_time":1473710206576,"dist-tags":{"latest":"2.25.6"}}