Library globals

Class globals . canvas . api . path . Path

View source

-------------------------------------------------------------------------------
canvas.Path
-------------------------------------------------------------------------------
Class for an (OpenVG) path element on a canvas

Functions

addSegment

Add a path segment

addSegmentGeo

arcLargeCCW

arcLargeCCWTo

Draw an elliptical arc (longer counter-clockwise arc)

arcLargeCW

arcLargeCWTo

Draw an elliptical arc (shorter clockwise arc)

arcSmallCCW

arcSmallCCWTo

Draw an elliptical arc (shorter counter-clockwise arc)

arcSmallCW

arcSmallCWTo

Draw an elliptical arc (shorter clockwise arc)

circle

Add a circle to the path @param r radius @param cx (optional) center x coordinate or vector [cx, cy] @param cy (optional) center y coordinate

close

Close the path (implicit lineTo to first point of path)

cubic

cubicTo

Add a cubic Bézier curve

ellipse

Add an ellipse to the path @param rx radius x @param ry radius y @param cx (optional) center x coordinate or vector [cx, cy] @param cy (optional) center y coordinate

getColor

getColorFill

getNumCoords

Get the number of coordinates (each command has 0..n coords)

getNumSegments

Get the number of segments

getStroke

horiz

horizTo

Add a horizontal line

line

lineTo

Add a line

move

moveTo

Move path cursor

new

pop_back

Remove last segment

pop_front

Remove first segment

quad

quadTo

Add a quadratic Bézier curve

rect

Add a (rounded) rectangle to the path @param x Position of left border @param y Position of top border @param w Width @param h Height @param cfg Optional settings (eg. {"border-top-radius": 5})

reset

Remove all existing path data

scubic

scubicTo

Add a smooth cubic Bézier curve

setColor

setColorFill

setData

Set the path data (commands and coordinates)

setDataGeo

setFill

setStroke

setStrokeDashArray

Set stroke dasharray @param pattern Vector, Vector of alternating dash and gap lengths [on1, off1, on2, ...]

setStrokeLineCap

Set stroke linecap @param linecap String, "butt", "round" or "square" See http://www.w3.org/TR/SVG/painting.html#StrokeLinecapProperty for details

setStrokeLineJoin

Set stroke linejoin @param linejoin String, "miter", "round" or "bevel" See http://www.w3.org/TR/SVG/painting.html#StrokeLinejoinProperty for details

setStrokeLineWidth

squad

squadTo

Add a smooth quadratic Bézier curve

square

Add a (rounded) square to the path @param x Position of left border @param y Position of top border @param l length @param cfg Optional settings (eg. {"border-top-radius": 5})

vert

vertTo

Add a vertical line

Variables

VG_CLOSE_PATH

Path segment commands (VGPathCommand)

VG_CUBIC_TO

VG_CUBIC_TO_ABS

VG_CUBIC_TO_REL

VG_HLINE_TO

VG_HLINE_TO_ABS

VG_HLINE_TO_REL

VG_LCCWARC_TO

VG_LCCWARC_TO_ABS

VG_LCCWARC_TO_REL

VG_LCWARC_TO

VG_LCWARC_TO_ABS

VG_LCWARC_TO_REL

VG_LINE_TO

VG_LINE_TO_ABS

VG_LINE_TO_REL

VG_MOVE_TO

VG_MOVE_TO_ABS

VG_MOVE_TO_REL

VG_QUAD_TO

VG_QUAD_TO_ABS

VG_QUAD_TO_REL

VG_SCCWARC_TO

VG_SCCWARC_TO_ABS

VG_SCCWARC_TO_REL

VG_SCUBIC_TO

VG_SCUBIC_TO_ABS

VG_SCUBIC_TO_REL

VG_SCWARC_TO

VG_SCWARC_TO_ABS

VG_SCWARC_TO_REL

VG_SQUAD_TO

VG_SQUAD_TO_ABS

VG_SQUAD_TO_REL

VG_VLINE_TO

VG_VLINE_TO_ABS

VG_VLINE_TO_REL

num_coords

Number of coordinates per command