{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates a responsive SVG visualization that adapts to its container’s size. It uses CSS to make a chart div fill the viewport, then extracts the computed `clientWidth` and `clientHeight` in a `redraw` function to dynamically set the SVG’s width and height attributes. The code draws two green crossed lines, creating an X, with a thick semi-transparent stroke. A window `resize` event listener triggers `redraw` whenever the browser dimensions change, ensuring the visualization always matches the available space. The implementation relies on D3 v5’s `select` and data-join methods for updating the lines.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/08da99528830495980f2b53dd809bd66?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}