{"version":"1.0","type":"rich","title":"Color and size legends","description":"This example demonstrates two types of chart legends rendered side-by-side in SVG. A color legend uses a d3.scaleOrdinal to map fruit names to distinct colors, with circles and text labels offset vertically. A size legend uses d3.scaleSqrt to map a numeric domain to circle radii, filtering out zero, reversing the tick order, and positioning text labels using the scaled radius plus an offset. Both legends are implemented as reusable functions that manage enter/update/exit selections with D3 v5’s data join.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/71396d6cd25d4d34a5b8a188aafab79e?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}