parse static method
Produce a Geometry from a string that uses an SVG-like compact path geometry syntax. The syntax accepts all SVG Path Syntax (SVG Path Syntax (w3.org)), as well as three GoJS-specific tokens. Specifically, the following tokens are allowed:
M (x,y)+- Move commandsL (x,y)+, H (x)+, V (y)+Lines commands, including horizontal and vertical linesC (x1 y1 x2 y2 x y)+, S (x2 y2 x y)+Cubic bezier curvesQ (x1 y1 x y)+, T (x y)+Quadratic bezier curvesA (rx ry x-axis-rotation large-arc-flag clockwise-flag x y)+Arcs (following SVG arc conventions)ZDenotes that the previous subpath is closed
Additionally there are some tokens specific to GoJS:
B (startAngle, sweepAngle, centerX, centerY, radius)+Arcs following GoJS canvas arc conventionsXUsed before M-commands to denote separate PathFigures instead of a subpathFDenotes whether the current PathFigure is filled (true if F is present)F0(instead ofF) Denotes that the PathFigure should use the even-odd fill rule instead of the nonzero winding number rule (setting PathFigure#isEvenOdd)UDenotes that the PathFigure is not shadowed
See the Introduction page on Geometry Parsing for more details.
Implementation
static _i3.Geometry parse(
_i2.String str, [
_i2.bool? filled,
]) =>
_i4.callMethod(
_declaredGeometry,
'parse',
[
str,
filled ?? _i5.undefined,
],
);