{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3.js v5 visualization can respond dynamically to browser resize events. An SVG element fills the viewport via CSS positioning, and a redraw function extracts the container’s current pixel dimensions using `clientWidth` and `clientHeight`. The code then sets the SVG’s `width` and `height` attributes accordingly and renders two green diagonal lines to form an X, with an event listener on `window` for the `resize` event triggering the redraw. The visualization uses a data join with `selectAll` and `enter` to update the lines.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/a3c004a52472463891202c8719ca0d49?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}