{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3.js visualization can respond dynamically to browser resizing. It shows a green X shape drawn with SVG lines that maintains its position relative to the viewport as the window changes dimensions. The code uses a `window.addEventListener(\"resize\", redraw)` callback, which queries the container’s `clientWidth` and `clientHeight` properties to update the SVG’s `width` and `height` attributes. The `redraw()` function re-binds the line data and updates the `x1`, `y1`, `x2`, and `y2` attributes via `merge()`. The chart container is styled with fixed CSS positioning to fill the entire page.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/4772b0dae38b4566b96b90526dc48ab2?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}