{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3.js visualization can adapt to browser window resizing by redrawing an SVG to match its container’s current dimensions. It uses a fixed-position div and extracts `clientWidth` and `clientHeight` on each resize event, then updates the SVG’s width and height attributes accordingly. The redraw function binds two line elements to render a green X that spans the full chart area, with the lines’ coordinates recalculated from the new size. The code relies on D3 v5’s selection, data join, and merge patterns, along with a standard `window` resize listener to trigger the update.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/acefd9fa1c054418813c6d311c8e66f4?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}