colorsize legnds
✓ Published0🌍 Public
This example demonstrates two types of legends for encoding data: a color legend for categorical fruit names and a size legend for a continuous numeric scale. Both legends render as SVG groups with circles and text labels, using d3.scaleOrdinal and d3.scaleSqrt to map data to visual properties. The fruitBowl module creates the color legend, while the sizeLegned module generates circles whose radii correspond to tick values. The code imports from the d3 library via UNPKG and uses local ES6 modules, with an SVG canvas in the HTML file.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed