Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Dynamic Size Example

Public visualization

Viewing a saved revision (read-only)

cc476809ad0c462fbf1ad94326ee0203

Dynamic Size Example

0 stars0🌍 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.