{"version":"1.0","type":"rich","title":"Color and Size Legends","description":"This example demonstrates how to build interactive legends for ordinal color scales, displaying circles and labels for each category. It uses D3 v5’s `scaleOrdinal` to map fruit types to colors, with a custom `colorLegend` function that appends SVG groups, circles, and text elements. The legend positions items horizontally based on index and vertically centered, with the color scale domain defining the data categories. The code also includes a YouTube video link in the README for additional guidance.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/ca62560e41c545719c693af0079149a1?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}