🌍 Public
Viewing a saved revision (read-only)
d06da44fc488489a9ba400dad0e91229
Responding to Resize
This example demonstrates how a D3.js v5 SVG visualization can automatically adjust its size to fill the browser window. A green X spanning the full chart area is drawn with two `<line>` elements, and both the SVG’s width and height are updated on every window resize event. The code reads the container’s `clientWidth` and `clientHeight` properties to drive the redraw, using `d3.select` to append the SVG and a `resize` event listener to trigger the update.
AI-generated description