🌍 Public
Viewing a saved revision (read-only)
8d6e40f5092c48d88ddf9ff7839e3066
Fork of Responding to Resize
A full-window SVG responds to browser resizing by redrawing an X-shape through two crossing lines. The `#chart` container uses fixed CSS positioning to fill the viewport, and a `resize` event listener calls a `redraw()` function that reads `clientWidth` and `clientHeight` to update the SVG dimensions. D3 v5 binds the line data to the selection, merging enter and update nodes to adjust coordinates, stroke-width, opacity, and green color. The example demonstrates a simple pattern for size-aware, responsive visualization.
AI-generated description