{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a visualization can adapt to browser resizing. The code uses CSS to make a chart container fill the viewport and JavaScript to extract its `clientWidth` and `clientHeight` on every resize event. It redraws an SVG element with `d3.select` and `svg.attr` to match the new dimensions, then renders two intersecting green lines to form an X. The D3 v5 code uses `.selectAll(\"line\")`, `.data()`, `.enter()`, and `.merge()` to update the line elements, which visually confirms the chart’s size synchronization.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/847e128c2b844d48a48d30a80e81e437?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}