🌍 Public
Viewing a saved revision (read-only)
501e8d5b87814e2c84052cd7e54036e3
Responding to Resize
This example demonstrates how a visualization can dynamically respond to browser window resizing. The code uses D3 v5 to render an SVG cross composed of two green lines that span the full width and height of the chart container. A CSS rule fills the page with the container, and a `redraw` function extracts its `clientWidth` and `clientHeight` to update the SVG attributes and line coordinates. A window `resize` event listener triggers this redraw, ensuring the graphic continuously adapts to viewport changes.
AI-generated description