{"version":"1.0","type":"rich","title":"Bowl of Fruit - General Update Pattern Special Cases","description":"Two legends for ordinal and quantitative scales demonstrate D3's general update pattern with special cases. The color legend maps fruit categories to red, yellow, green, and orange circles using `d3.scaleOrdinal`, while the size legend uses `d3.scaleSqrt` to encode values 0–10 as circle radii, filtering out zero and reversing ticks. Both legends use reusable functions (`colorLegend` and `sizeLegend`) with enter, merge, and exit selections, rendering as SVG. The code relies on D3 v5 APIs including `selection.enter`, `selection.merge`, and `selection.exit`.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/50980d87e80749b0b9a224102dc01913?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}