🌍 Public
Viewing a saved revision (read-only)
574104eaa35246398513b39d2e64cc8f
Responding to Resize
This example demonstrates a visualization that adapts to the browser window’s size by redrawing a green X-shaped pair of lines whenever the window is resized. The chart container is positioned with CSS to fill the viewport, and the code extracts its computed `clientWidth` and `clientHeight` to set the SVG dimensions. It uses D3 v5’s selection and merge operations, along with a window `resize` event listener, to update two line elements dynamically.
AI-generated description