{"version":"1.0","type":"rich","title":"Fork of Color and Size Legends","description":"This example demonstrates two reusable legend components for D3 visualizations: a color legend showing ordinal categories (apple, lemon, lime, orange) with distinct hues, and a size legend using `scaleSqrt` to map numeric values to circle radii. The code exports `colorLegend` and `sizeLegend` as JavaScript modules, using `selection.selectAll` and `groups.enter()` to bind data, append SVG circles and text, and handle updates. The legends are rendered with d3.v5, with text styling defined in an external stylesheet.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/b33f9def4dce4184af106901fc5c085d?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}