Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Responding to Resize

Public visualization

Responding to Resize

0 stars0🌍 Public
JJuan David Contreras
Last edited Oct 21, 2019
Created on Oct 21, 2019

This example demonstrates how a visualization can dynamically adjust to its container's size. It uses CSS to make a chart div fill the entire browser window, then extracts the `clientWidth` and `clientHeight` properties on every window resize event. The D3.js v5 code redraws an SVG element to match these dimensions, rendering a large, translucent green X across the full width and height. This simple pattern illustrates a responsive resizing strategy without inventing any complex data transformations or interactions.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed