Ir al contenido

Geometry

Defined in: geometry/Geometry.ts:173

GoJS-compatible: a custom, programmatically-built shape outline for Shape.geometry, mirroring real GoJS’s Geometry/PathFigure/ PathSegment object model.

Unlike real GoJS, graphojs doesn’t have a separate native rendering path for arbitrary geometries — a Geometry serializes to the same SVG-like mini-language string Shape.geometryString already supports (M/L/C/Q/A/Z), and Shape.geometry = someGeometry sets geometryString from that serialization under the hood. Geometry.parse/stringify round-trip through the same format; smooth-curve shorthand (SVG’s S/T) is expanded to an equivalent absolute C/Q on parse, since PathSegment has no direct “smooth” segment type.

new Geometry(type?, init?): Geometry

Defined in: geometry/Geometry.ts:186

GeometryType = GeometryType.Path

Partial<Geometry>

Geometry

endX: number = 0

Defined in: geometry/Geometry.ts:182


endY: number = 0

Defined in: geometry/Geometry.ts:183


startX: number = 0

Defined in: geometry/Geometry.ts:180


startY: number = 0

Defined in: geometry/Geometry.ts:181


type: GeometryType

Defined in: geometry/Geometry.ts:179


readonly static Ellipse: 2 = GeometryType.Ellipse

Defined in: geometry/Geometry.ts:176


readonly static Line: 0 = GeometryType.Line

Defined in: geometry/Geometry.ts:174


readonly static Path: 3 = GeometryType.Path

Defined in: geometry/Geometry.ts:177


readonly static Rectangle: 1 = GeometryType.Rectangle

Defined in: geometry/Geometry.ts:175

get figures(): List<PathFigure>

Defined in: geometry/Geometry.ts:206

List<PathFigure>

set figures(value): void

Defined in: geometry/Geometry.ts:210

List<PathFigure>

void

add(figure): this

Defined in: geometry/Geometry.ts:215

GoJS-compatible: append a figure; returns this.

PathFigure

this


computeBoundsWithoutOrigin(result?): Rect

Defined in: geometry/Geometry.ts:221

Compute the bounding box of every figure’s points (an approximation: does not flatten curves).

Rect

Rect


containsPoint(p): boolean

Defined in: geometry/Geometry.ts:405

Test membership by checking against the flattened bounding box (an approximation, not exact path containment).

Point

boolean


copy(): Geometry

Defined in: geometry/Geometry.ts:192

Geometry


equalsApprox(g): boolean

Defined in: geometry/Geometry.ts:202

Geometry

boolean


static parse(str, filled?): Geometry

Defined in: geometry/Geometry.ts:297

GoJS-compatible: parse a geometryString into a structured Geometry. H/V are expanded to an equivalent L; S/T (smooth curves) are approximated as a plain C/Q using the given control point directly (without SVG’s “reflect the previous control point” adjustment).

string

boolean = true

Geometry


static stringify(val): string

Defined in: geometry/Geometry.ts:256

GoJS-compatible: serialize to graphojs’s geometryString mini-language (M/L/C/Q/A/Z).

Geometry

string


static stringifyFixed(digits): (val) => string

Defined in: geometry/Geometry.ts:397

GoJS-compatible: a back-converter factory for Bindings that write a Geometry as a string, rounded to digits.

number

(val) => string