{"version":"1.0","type":"rich","title":"Colour and Size Legends","description":"This example demonstrates how to create legends for both color and size scales in D3. A color legend displays four fruit categories as colored circles using a `scaleOrdinal`, while a size legend uses a `scaleSqrt` with five tick values to show proportional circle radii. Both legends are built with reusable functions that append SVG groups, circles, and text elements. The code uses D3 v5 selections and scales, with transparent circles and black strokes styled via CSS.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/31ec513e83014f82aa95380ad9868b4d?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}