🌍 Public
Fork of Responding to Resize
This example shows a green X drawn across the browser’s full viewport, with the lines re-rendering to match the window’s current size whenever the window is resized. It uses an SVG element whose width and height are set from the CSS-computed dimensions of a fixed-position container. The code appends two `<line>` elements with `d3.select` and uses a custom `redraw()` function attached to the window’s `resize` event. The demo relies on d3.v5 and the `attr` and `style` methods to update coordinates and stroke properties.
AI-generated descriptionMIT Licensed








Comments
Sign in to join the discussion.