{"version":"1.0","type":"rich","title":"Color and size legends","description":"This example demonstrates two distinct legend types for data visualization: a color legend and a size legend, both rendered as SVG. The color legend maps categorical values (apple, lemon, limes, orange) to distinct colors using `d3.scaleOrdinal`, while the size legend uses `d3.scaleSqrt` to map a numeric range (0–10) to circle radii, showing a proportional relationship. Both legends are built with the D3 library (v5) and its selective update pattern via `selection.merge`.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/4c515e87128d4086a78a1884d9f0aae2?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}