🌍 Public
Viewing a saved revision (read-only)
fe0ab02248ed438fa8ddc96cc39578e9
Responding to Resize
This example demonstrates how a D3.js visualization can dynamically adjust to its container’s size by redrawing an SVG graphic on every browser resize event. The chart fills the entire page via CSS and uses `clientWidth` and `clientHeight` to set the SVG’s width and height attributes. It draws two crossed green lines with `stroke-width` and `stroke-opacity` to visually confirm that the resized dimensions are correct. The `redraw` function is called initially and then re-invoked through a `window` resize listener.
AI-generated description