{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates a dynamic SVG visualization that adjusts its output to match the browser window’s current dimensions. The code extracts the container’s `clientWidth` and `clientHeight`, then uses D3 v5’s `.attr` method to resize the SVG element while redrawing two diagonal lines that form a crosshair. The `redraw` function is invoked initially and again through a `window.addEventListener` listener, which triggers a recalculated layout whenever the viewport changes. The visualization uses D3’s selection and merging API to update the lines efficiently.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/217d141b2f8647ecbf5481613bd8d87b?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}