Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Responding to Resize

Public visualization

Fork of Responding to Resize

0 stars0🌍 Public
Kkatreeder
Last edited Feb 4, 2021
Created on Feb 4, 2021

This example demonstrates how an SVG visualization can respond dynamically to browser resizing by reading the container’s computed CSS dimensions and applying them to the drawing. It renders a simple green X composed of two diagonal lines using `d3.select` and `data` binding, with the `redraw` function called on the `window` `resize` event. The chart container uses fixed positioning, and the SVG size is updated via the `attr` method based on `clientWidth` and `clientHeight`, ensuring the graphic always fills the page.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed