🌍 Public
Viewing a saved revision (read-only)
3fca5e3c49bf4218abc9d347001e7aa2
Responding to Resize
This example demonstrates how a visualization can adapt to browser resizing. It shows a blank SVG canvas that fills the entire viewport, with a hardcoded dataset of two resources awaiting rendering. On every window resize event, the code extracts the container’s dimensions using `clientWidth` and `clientHeight`, then updates the SVG’s `width` and `height` attributes accordingly. The implementation uses d3.js v5 for DOM selection and SVG creation, with pure JavaScript event listeners to trigger the redraw function.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.