{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3 v5 visualization can dynamically resize to fill its browser window. It shows two thick, semi-transparent green lines forming an X that stretches and contracts as the viewport changes. The code uses the CSS `position: fixed` property with `clientWidth` and `clientHeight` to compute the current container dimensions on every window `resize` event. A `redraw` function updates the SVG’s width and height attributes and rebinds the line data, using the d3 selection `merge` pattern to efficiently update existing elements. Rendering is done via the SVG API.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/ec0792cc66184ebe8e84c3784a8a4b45?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}