{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3.js visualization can respond dynamically to browser resizing. A green X-shaped pair of lines is drawn across the full viewport, with the SVG dimensions updated to match the CSS-computed container size on every resize event. The code uses `chartDiv.clientWidth` and `chartDiv.clientHeight` within a `redraw` function, triggered initially and via `window.addEventListener(\"resize\", redraw)`. The SVG is created with `d3.select`, and lines are bound to data arrays and updated using the merge pattern.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/2c9c0b057bb84f1382eb86b537ca3b65?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}