{"version":"1.0","type":"rich","title":"Structuring D3 code with ES6 classes","description":"Two interactive line charts show monthly data points, with buttons to change the line color or regenerate random data. Built with D3 v5, the example structures chart logic as an ES6 `Chart` class that handles scales, axes, and rendering. The code uses `d3.scaleTime`, `d3.scaleLinear`, `d3.axisBottom`, `d3.axisLeft`, and `d3.line` to draw SVG paths, and demonstrates public methods like `setColor` and `setData` for updating the visualization.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/581a3798fc214b3ea5b31a2842c70ef5?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}