Skip to main content
100%

19_ cheap tricks for interaction D3.js!

✓ Published2🌍 Public
FFMajid-ops
Last edited Dec 18, 2020
Created on Dec 18, 2020

This example creates a blank, full-window SVG canvas using D3.js v5. The SVG element is sized to match the browser window’s dimensions by reading `document.body.clientWidth` and `clientHeight`, then appends a single rounded rectangle (`rx` of 40) that fills that space. The code uses D3’s `select` function to target the SVG and sets its width and height attributes accordingly. The fixed-position body styling ensures the canvas fills the viewport without scrolling, though no additional interaction or data visualization is implemented beyond this static, rounded background shape.

AI-generated description
MIT Licensed

Similar vizzes