Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Responding to Resize

Public visualization

Responding to Resize

0 stars0🌍 Public
Llokkafufya
Last edited Dec 11, 2019
Created on Dec 11, 2019
Forked from HTML Starter

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 description

A bare minimum HTML page.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed