{"version":"1.0","type":"rich","title":"color and size lengend","description":"This example demonstrates two legends: a categorical color legend for fruits like apples and lemons, and a quantitative size legend for population data. The color legend uses `d3.scaleOrdinal` to assign fixed colors, while the size legend uses `d3.scaleSqrt` to map numeric ticks to circle radii. Both legends are rendered as SVG groups, with circles and text labels positioned via translation. The code uses `selection.selectAll` and `.merge` for incremental updates, and the size legend filters out the zero tick. The data source is a CSV listing country populations, though only the legend scales are visualized here.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/885ed6f3c90a41c4ab407438c80eb815?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}