path
The path SVG element is the generic element to define a shape. All the basic shapes can be created with a path element.
Usually, this element is created with:
js
const path = parentElement.add('path')It's possible to create it as a disconnected element with gSVG('path') and attach it to the SVG document with .attachTo().
.d()
js
path.d( value )Set this attribute defines the shape of the path.
argument:
{Array|string} valueThedvaluereturns:
{gSVGObject}The original object
js
const d = element.d();Get the d current value.
- returns:
{Array|string}
.pathLength()
js
path.pathLength( length )Set this attribute lets authors specify the total length for the path, in user units.
argument:
{number} lengthThe path lengthreturns:
{gSVGObject}The original object
js
const pathLength = element.pathLength();Get the pathLength current value.