{"version":"1.0","type":"rich","title":"Color and size legend","description":"This example demonstrates how to create color and size legends for data visualization using D3.js v5. It shows two separate legend groups: a color legend using `scaleOrdinal` with four fruit categories (apple, lemon, melon, lime) and a size legend using `scaleSqrt` for numeric values from 0 to 10. The implementation uses data joins with `.enter()`, `.merge()`, and `.exit()` methods to manage SVG circle and text elements, with both legends rendering in an SVG container.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/8f2551b7ab5e45b0af2e962f6dfdb10c?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}