{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3.js visualization can respond dynamically to browser window resizing by redrawing an SVG element to match its container’s current dimensions. The code uses `clientWidth` and `clientHeight` to extract the CSS-computed size of the chart div, then updates the SVG’s `width` and `height` attributes accordingly. It renders two green diagonal lines forming an X, with a thick stroke and partial opacity, to visually confirm the resizing behavior. The `window.addEventListener('resize', ...)` triggers the `redraw` function on every viewport change.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/301d51f95a9d47e2bf0e727c6c35d418?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}