{"version":"1.0","type":"rich","title":"Selecting a Year on a Line Chart","description":"A line chart displays population over time for multiple regions, with a vertical line marking a selected year. Users can hover anywhere on the chart to update the selection, which triggers a re-render of the visualization. The code uses D3 v5’s `scaleTime`, `scaleLinear`, `axisBottom`, `axisLeft`, and `line` with `curveBasis` to draw the chart, while a `mouse` event on a transparent `rect` calls `setSelectedYear` to change the year. The data comes from UN population estimates and medium-variant projections, loaded via `csv` and processed with `nest`, `descending`, and a custom `melt` function. The rendering is SVG-based, with a color legend created by `colorLegend` and axes styled via CSS.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/7dfe562580db4ffa8446a57dbbb46b12?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}