{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3.js visualization can adapt to browser window resizing. It uses the CSS `position: fixed` to make the chart container fill the viewport, then extracts the container’s `clientWidth` and `clientHeight` to set the SVG’s width and height attributes on each resize event. A green X is drawn using SVG `<line>` elements and the `selection.merge()` method, with both lines re-rendered to span the full dimensions. The code relies on `d3.select` and the `window.addEventListener(\"resize\", redraw)` API to trigger updates.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/a15457ea562f4652b62caa858dc09ae2?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}