Path
The path is the most powerful element in a graphical context since it allows for the definition of any complex or basic shape. The Node-i2djs Path offers a set of methods for building or interpreting the path, following the SVG Path syntax definition.
It can be imported as below.
import {path} from 'node-i2djs';
API
Path Instance creation:
var pathInstance = i2d.path()
#.m(absoluteflag, point);
pathInstance.m(true, { x: 0, y: 0 })
#.h(absoluteflag, point);
pathInstance.h(true, { x: 100 });
#.v(absoluteflag, point);
pathInstance.v(true, { y: 100 })
#.l(absoluteflag, point);
pathInstance.l(true, {x : 100, y: 100 });
#.c(absoluteflag, ctrl1, ctrl2, point);
pathInstance.c(true, {x : 50, y: 0 }, {x : 0, y: 50 }, {x : 100, y: 100 });
#.q(absoluteflag, ctrl1, point);
pathInstance.q(true, {x : 0, y: 50 }, {x : 100, y: 100 });
#.s(absoluteflag, ctrl2, point);
pathInstance.s(true, {x : 50, y: 0 }, {x : 50, y: 0 }, {x : 100, y: 100 })
#.a(absoluteflag, rx, ry, xRotation, arcLargeFlag, sweepFlag, point);
pathInstance.a(true, 0, 0, 2.1, true, false, {x : 100, y: 100 });
#.z();
pathInstance.z();
#.parse(Pathstring);
pathInstance.parse("M150 0 L75 200 L225 200 Z");
#.fetchPathString();
pathInstance.fetchPathString();
#.getTotalLength();
#.getPointAtLength();
#.isValid();
Last updated