{"version":"1.0","type":"rich","title":"Color and Size Legends","description":"This example demonstrates how D3 legends can visually encode data through both color and size. It uses a D3 ordinal color scale to map the categories \"apple\" and \"lemon\" to red and yellow swatches, while fixed circle radii and text offsets in the custom `colorLegend` function control the legend’s spatial layout. The SVG-based visualization is rendered using D3 v5, with the legend positioned via an SVG transform and styled through external CSS.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/037e5b7af4994ccab6b04e3388afa8aa?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}