{"version":"1.0","type":"rich","title":"Responding to Resize","description":"This example demonstrates how a D3.js visualization can dynamically adjust to fit its container. It draws a large green X composed of two diagonal lines that stretch from corner to corner, with the SVG element’s width and height updated to match the chart div’s client dimensions. The code uses `d3.select` and `selection.attr` to resize the SVG, and a `window.addEventListener(\"resize\", redraw)` function to trigger the redraw. The rendering approach is SVG, with the chart container styled via CSS to fill the entire viewport.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/d26d0d38801a4b6288b6d419e444bebc?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}