Color and Size Legends
✓ Published0🌍 Public
This example demonstrates two legend types for scatterplot-style data: a color legend mapping categorical values to distinct hues, and a size legend using a square-root scale to encode continuous numeric magnitudes. Both legends render as SVG groups containing circles and text labels, with the color legend using `d3.scaleOrdinal` and the size legend using `d3.scaleSqrt` with tick generation from `sizeScale.ticks`. The legends are positioned manually via SVG transforms and styled with CSS classes for the tick marks.
AI-generated descriptionMIT Licensed