🌍 Public
Viewing a saved revision (read-only)
7e0fc41417504683b3cc8fc80ab3d2bb
Basic path and line with d3
This example demonstrates two fundamental SVG shapes—a closed path and a line—rendered with D3 version 7. The code appends an SVG element using `d3.select` and `svg.append`, then draws a path defined by arc (`A`) and quadratic Bézier (`Q`) commands, followed by a straight line with explicit `x1`, `y1`, `x2`, and `y2` attributes. The path’s `d` attribute is set using a template literal, while the line uses chained `.attr` calls for positioning and stroke styling.
AI-generated descriptionA demonstration of how to start using D3 version 6.