A reusable D3.js legend component for color, size, and symbol scales in SVG visualizations.
d3-legend is a reusable legend component for D3.js that generates legends for color, size, and symbol scales in SVG-based data visualizations. It solves the problem of manually creating and styling legends, providing a consistent, configurable way to explain visual encodings in charts and maps.
Data visualization developers using D3.js who need to add professional, customizable legends to their SVG charts, dashboards, or interactive maps.
Developers choose d3-legend because it integrates seamlessly with D3 scales, reduces boilerplate code for legend creation, and offers flexible styling through CSS classes, all while following D3's familiar API patterns.
A reusable d3 legend component.
Directly works with D3 scales and follows D3's data-binding patterns, making it a natural extension for existing D3 visualizations without extra abstractions.
Supports CSS classes via methods like .useClass(true), allowing easy customization to match project designs without modifying core JavaScript code.
Eliminates the need to manually draw and position SVG legend elements, saving development time for common legend types like color or size scales.
The library is in maintenance mode, ensuring a stable API with minimal breaking changes, which is reliable for production environments.
No new features or updates are planned, as stated in the README, which could lead to compatibility issues with future D3 versions or missing modern visualization needs.
Heavily dependent on D3.js and SVG; if a project migrates away from D3, the legend component becomes obsolete or requires significant reimplementation.
Only covers color, size, and symbol scales, lacking built-in support for other encodings like opacity or complex interactive legends without custom code.
Textures.js is a JavaScript library for creating SVG patterns
Fast n-dimensional filtering and grouping of records.
Use d3-annotation with built-in annotation types, or extend it to make custom annotations. It is made for d3-v4 in SVG.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.