{"name":"d3-svg-legend","version":"1.3.0","description":"A legend component for d3. Given a d3.scale it can create either a color legend, size legend, or symbol legend.","main":"index.js","keywords":["d3","legend"],"directories":{"example":"examples","test":"test"},"dependencies":{"d3":"^3.5.6"},"devDependencies":{"grunt":"^0.4.5","grunt-browserify":"^3.8.0","grunt-contrib-uglify":"^0.9.1","mocha":"^2.2.5"},"scripts":{"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","gitHead":"6883de85e0d166053d4847724125b5fced2351d3","_id":"d3-svg-legend@1.3.0","_shasum":"d10f75cf48a93dba3334e17247c951642289a969","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"susielu","email":"lulnlul@gmail.com"},"dist":{"shasum":"d10f75cf48a93dba3334e17247c951642289a969","tarball":"http://registry-npm.ywwl.com/d3-svg-legend/download/d3-svg-legend-1.3.0.tgz","integrity":"sha512-yiWg8JZ6SZEXPcn+QkfcgP8wHMC2QchZ3yqEyie+W6rOGcH7vAG6jRdMrtsvZzg/3ksX3Y/YZmHYfX9TINWcGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIACddkPwVA29uT0znL600G1wcGnC+AkQ4LoO7t4edkhiAiBMx0i5YWOKegX+Yqvjq5+lxAza6RRY6twoWWIEX5EboQ=="}],"size":144370,"noattachment":false,"key":"/d3-svg-legend/-/d3-svg-legend-1.3.0.tgz"},"maintainers":[{"name":"susielu","email":"susie.lu.shan@gmail.com"}],"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":1439868821878,"_cnpm_publish_time":1439868821878,"dist-tags":{"latest":"2.25.6"}}