legend
✓ Published0🌍 Public
MMTClass
Last edited Mar 6, 2017
Created on Mar 6, 2017
This example displays a four-category ordinal legend for values from “Insignificant” to “High,” rendered as colored squares with adjacent text labels inside an SVG. It uses a custom `d3.legend()` function built with `d3.scaleOrdinal` to map domain values to color ranges, and appends the legend to a blank SVG canvas via a D3 selection. The legend’s position and colors are configurable through `.translate()` and `.colors()`, and a callback logs “Done!” after rendering. The code includes a separate `d3.legend.js` file and relies on D3 v4.
AI-generated descriptionBuilt with blockbuilder.org
forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/f76ab293be25bea76f562cd0546d0650'>fresh block</a>
mit Licensed