{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a visualization can respond to browser window resizing by redrawing an SVG to match its container’s updated dimensions. It shows a green X spanning the full width and height of the viewport, with thick, semi-transparent strokes. The code uses `d3.select` to create an SVG element and a `redraw()` function that reads `clientWidth` and `clientHeight` from the chart’s `<div>`, then sets the SVG’s `width` and `height` attributes accordingly. A `window.addEventListener(\"resize\", redraw)` triggers the redraw on every resize event, while `selection.enter().merge()` updates the two `<line>` elements’ coordinates.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/8ff8a8743ed34f94aef198b0e563bc42?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}