{"version":"1.0","type":"rich","title":"Color and Size Legends","description":"This example demonstrates two types of legends for mapping data to visual properties. The color legend uses a `scaleOrdinal` to map categorical names to colors, while the size legend uses a `scaleSqrt` to map numeric values to circle radii with tick marks. Both legends are implemented as reusable functions that append SVG `<g>` elements containing circles and text labels. The code uses D3 v5's selection and merge pattern to efficiently update the legend elements.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/19ca5c6346f9435aa43be47afd09360c?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}