🌍 Public
Viewing a saved revision (read-only)
60ae18a3aee445c1a8be520bdfe0e8c2
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.