{"name":"d3-svg-legend","version":"2.24.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":"indexRollupNext.js","module":"indexRollupNext.js","files":["src","index.js","indexRollup.js","indexRollup.js.map","indexRollup.mjs","d3-legend.*","types/*"],"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","npm-watch":"0.1.7","reify":"0.3.8","rollup":"0.41.4","rollup-plugin-babel":"2.6.1","stringify":"3.1.0"},"scripts":{"build":"rollup -c && grunt","prepublish":"npm t && npm run build","server":"http-server","start":"npm run server & npm run watch","watch":"npm-watch","grunt":"grunt","test":"mocha"},"watch":{"grunt":["src/*.js ","docs/legends.js"]},"repository":{"type":"git","url":"git+https://github.com/susielu/d3-legend.git"},"author":{"name":"Susie Lu","url":"http://www.susielu.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/susielu/d3-legend/issues"},"homepage":"http://d3-legend.susielu.com","types":"./types/d3-svg-legend.d.ts","dependencies":{"@types/d3-selection":"1.0.10","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":"049652652fed7a616b2323b80db405b0f3f67c32","_id":"d3-svg-legend@2.24.0","_shasum":"78ac56a968fec4929f6a762b736ef2be61e61f33","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"susielu","email":"lulnlul@gmail.com"},"dist":{"shasum":"78ac56a968fec4929f6a762b736ef2be61e61f33","tarball":"http://registry-npm.ywwl.com/d3-svg-legend/download/d3-svg-legend-2.24.0.tgz","integrity":"sha512-T9qIlNqSplpiNCKmNTWnU3U6ELtiG8/YbSq/w2Ne0jYtKzMBCqjg77e9NmdgA/QXQKMi1IZScZUQY5jL0eIqkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaRlVSlcPvHu4QoRBsv2Z86Ow5SbKpTJXPMaRO7qcyYQIhANbK7JKuBYpJQZuNlXEzarrgVuDa8O16TReWJSqbpI/K"}],"size":171933,"noattachment":false,"key":"/d3-svg-legend/-/d3-svg-legend-2.24.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.24.0.tgz_1490975940620_0.8523249970749021"},"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":1490975940993,"_cnpm_publish_time":1490975940993,"dist-tags":{"latest":"2.25.6"}}