{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how to create a visualization that automatically responds to changes in the browser window size. The code uses CSS to position a chart container that fills the entire viewport, then extracts the container’s computed width and height via `clientWidth` and `clientHeight` in a `redraw` function. An SVG element is resized to match these dimensions, and two green lines are drawn across the space to form an X, verifying that the size updates correctly. A `window` resize event listener triggers the `redraw` function whenever the viewport changes. The example uses D3 v5 with SVG rendering.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/908bc56b7e774ed2a8e370d144ce7161?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}