Ir al contenido

Spot

Defined in: geometry/Spot.ts:7

A Spot represents an alignment point within a rectangle. Standard spots: TopLeft, TopCenter, TopRight, LeftMiddle, Center, RightMiddle, BottomLeft, BottomCenter, BottomRight. Fractional spots allow any position using x/y in [0,1] plus offsets.

new Spot(x?, y?, offsetX?, offsetY?): Spot

Defined in: geometry/Spot.ts:17

number = 0.5

number = 0.5

number = 0

number = 0

Spot

readonly offsetX: number

Defined in: geometry/Spot.ts:13

Offset in pixels applied after the fractional position.


readonly offsetY: number

Defined in: geometry/Spot.ts:15

Offset in pixels applied after the fractional position.


readonly x: number

Defined in: geometry/Spot.ts:9

x as a fraction of the width (0..1).


readonly y: number

Defined in: geometry/Spot.ts:11

y as a fraction of the height (0..1).


readonly static Bottom: Spot

Defined in: geometry/Spot.ts:57

GoJS-compatible: Spot at the bottom-center.


readonly static BottomCenter: Spot

Defined in: geometry/Spot.ts:55

Spot at the bottom-center.


readonly static BottomLeft: Spot

Defined in: geometry/Spot.ts:53

Spot at the bottom-left corner.


readonly static BottomRight: Spot

Defined in: geometry/Spot.ts:59

Spot at the bottom-right corner.


readonly static Center: Spot

Defined in: geometry/Spot.ts:41

Spot at the center.


readonly static Left: Spot

Defined in: geometry/Spot.ts:37

GoJS-compatible: Spot at the middle of the left edge.


readonly static LeftMiddle: Spot

Defined in: geometry/Spot.ts:33

Spot at the middle of the left edge.


readonly static LeftSide: Spot

Defined in: geometry/Spot.ts:39

GoJS-compatible: Spot at the middle of the left edge.


readonly static MiddleCenter: Spot

Defined in: geometry/Spot.ts:43

GoJS-compatible: Spot at the center.


readonly static MiddleLeft: Spot

Defined in: geometry/Spot.ts:35

GoJS-compatible: Spot at the middle of the left edge.


readonly static MiddleRight: Spot

Defined in: geometry/Spot.ts:47

GoJS-compatible: Spot at the middle of the right edge.


readonly static None: Spot

Defined in: geometry/Spot.ts:61

GoJS-compatible: A spot with no meaningful position.


readonly static Right: Spot

Defined in: geometry/Spot.ts:49

GoJS-compatible: Spot at the middle of the right edge.


readonly static RightMiddle: Spot

Defined in: geometry/Spot.ts:45

Spot at the middle of the right edge.


readonly static RightSide: Spot

Defined in: geometry/Spot.ts:51

GoJS-compatible: Spot at the middle of the right edge.


readonly static Top: Spot

Defined in: geometry/Spot.ts:29

GoJS-compatible: Spot at the top-center.


readonly static TopCenter: Spot

Defined in: geometry/Spot.ts:27

Spot at the top-center.


readonly static TopLeft: Spot

Defined in: geometry/Spot.ts:25

Spot at the top-left corner.


readonly static TopRight: Spot

Defined in: geometry/Spot.ts:31

Spot at the top-right corner.

computePoint(x, y, width, height): object

Defined in: geometry/Spot.ts:149

Compute the point within a rect for this spot.

number

number

number

number

object

x: number

y: number


copy(): Spot

Defined in: geometry/Spot.ts:172

GoJS-compatible: Return a copy of this spot.

Spot


equals(other): boolean

Defined in: geometry/Spot.ts:157

Check if two spots are equivalent.

Spot

boolean


isSpot(): boolean

Defined in: geometry/Spot.ts:81

GoJS-compatible: Whether this spot has valid fractional coordinates.

boolean


offset(dx, dy): Spot

Defined in: geometry/Spot.ts:167

Return a copy with additional offset.

number

number

Spot


pointToSpot(px, py, x, y, width, height): Spot

Defined in: geometry/Spot.ts:107

GoJS-compatible: Compute the spot (fraction) for a point within a rect.

number

number

number

number

number

number

Spot


setSpot(x, y, offsetX?, offsetY?): this

Defined in: geometry/Spot.ts:93

GoJS-compatible: In-place mutation returning this spot.

number

number

number = 0

number = 0

this


spotToPoint(x, y, width, height): object

Defined in: geometry/Spot.ts:102

GoJS-compatible: Compute the point in the rect for this spot.

number

number

number

number

object

x: number

y: number


static fromName(name): Spot

Defined in: geometry/Spot.ts:114

Create a Spot from a standard name.

string

Spot


static isSpot(value): boolean

Defined in: geometry/Spot.ts:76

GoJS-compatible: Whether the given value is a Spot object.

unknown

boolean


static parse(value): Spot

Defined in: geometry/Spot.ts:64

GoJS-compatible: Parse a string like “0,0”, “1 1 4 4”, or a standard name like “MiddleCenter”.

string

Spot