Full documentation: http://d3-legend.susielu.com
You must inclue the d3 library before including the legend file. Then you can simply add the compiled js file to your website:
- d3-legend.min.js
- d3-legend.js (Human readable version)
You can add the d3 legend as a node module by running:
npm install --save d3-svg-legend
I would love to hear from you about any additional features that would be useful, please say hi on twitter @DataToViz.