parse static method

Geometry parse(
  1. String str, [
  2. bool? filled
])

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 commands
  • L (x,y)+, H (x)+, V (y)+ Lines commands, including horizontal and vertical lines
  • C (x1 y1 x2 y2 x y)+, S (x2 y2 x y)+ Cubic bezier curves
  • Q (x1 y1 x y)+, T (x y)+ Quadratic bezier curves
  • A (rx ry x-axis-rotation large-arc-flag clockwise-flag x y)+ Arcs (following SVG arc conventions)
  • Z Denotes 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 conventions
  • X Used before M-commands to denote separate PathFigures instead of a subpath
  • F Denotes whether the current PathFigure is filled (true if F is present)
  • F0 (instead of F) Denotes that the PathFigure should use the even-odd fill rule instead of the nonzero winding number rule (setting PathFigure#isEvenOdd)
  • U Denotes 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,
      ],
    );