Skip to main content
100%

Basic path and line with d3

✓ Published1🌍 Public
NNita
Last edited Feb 16, 2022
Created on Feb 16, 2022
Forked from D3 Starter

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 description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes