{"version":"1.0","type":"rich","title":"Color and Size Legends","description":"Two legends demonstrate independent D3 color and size scales. A color legend maps ordinal domains like “apple” and “lemon” to discrete hues, while a size legend uses a square-root scale with tick marks and semi-transparent circles. Both are rendered as SVG groups via custom reusable functions, `colorLegend` and `sizeLegend`, which bind data to enter/merge/exit selections. The code uses D3 v5 APIs such as `scaleOrdinal`, `scaleSqrt`, and `scaleDiverging` (imported but unused), with text styling applied through CSS classes.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/190c29944ca94e00baa743c3adcf5f95?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}