{"version":"1.0","type":"rich","title":"Color and size legends","description":"Two adjacent legends illustrate how to construct reusable D3 legend components. A color legend uses `d3.scaleOrdinal` with fruit types mapped to red, yellow, orange, and green, rendering circles with corresponding fills and text labels. A size legend uses `d3.scaleSqrt` to map values 0–10 to circle radii, with ticks generated via `sizeScale.ticks` and positioned by cumulative spacing. Both legends are appended as SVG groups, with enter/merge/exit selections managing dynamic updates.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/c373131f9a4140c3bc0095f0099ff082?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}