Skip to main content
100%

Fork of Responding to Resize

✓ Published0🌍 Public
Aavgoust
Last edited May 16, 2022
Created on May 16, 2022

This example demonstrates a responsive D3.js visualization that automatically redraws an SVG cross to match the browser window’s dimensions. It uses CSS to stretch a container div to fill the page, then reads the container’s `clientWidth` and `clientHeight` inside a `redraw` function. The code binds data to `line` elements, entering new lines and merging updates, while a `window` resize event listener triggers redraws. The visualization relies on D3 v5 and SVG rendering, showing how to handle dynamic viewport sizes in data-driven graphics.

AI-generated description
MIT Licensed

Similar vizzes