Skip to main content
100%

Fork of D3 Starter

✓ Published0🌍 Public
Ssamuelbaker
Last edited Jan 5, 2023
Created on Aug 17, 2022
Forked from D3 Starter

This example shows a blank SVG canvas containing one white rectangle with a black outline and two dashed vertical lines, created as a minimal starter for D3 version 7. The code uses `d3.select` to target the body, appends an SVG element with fixed width and height, then draws the shapes using `svgContainer.append('rect')` and `svgContainer.append('line')`. The rectangle spans x-coordinates 50 to 850, while the dashed lines run from y=50 to y=130 at x=200 and x=300, all with black strokes and varying stroke widths. The visualization demonstrates basic SVG rendering through D3’s imperative API without any data binding.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes