Skip to main content
100%

Dynamic Size Example

✓ Published0🌍 Public
JJoe M
Last edited Apr 10, 2020
Created on Apr 10, 2020
Forked from HTML Starter

This example demonstrates a responsive SVG visualization that adapts to the browser window’s size. It uses D3 v4 to generate an SVG element whose width and height are dynamically recalculated via `clientWidth` and `clientHeight`, then draws two crossed lines to visually confirm the dimensions. The redraw function is triggered once on initialization and again whenever the window resizes, using `d3.select` and SVG line attributes to update the graphic in real time.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes