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.
Constructors
Sección titulada «Constructors»Constructor
Sección titulada «Constructor»new Spot(
x?,y?,offsetX?,offsetY?):Spot
Defined in: geometry/Spot.ts:17
Parameters
Sección titulada «Parameters»number = 0.5
number = 0.5
offsetX?
Sección titulada «offsetX?»number = 0
offsetY?
Sección titulada «offsetY?»number = 0
Returns
Sección titulada «Returns»Spot
Properties
Sección titulada «Properties»offsetX
Sección titulada «offsetX»
readonlyoffsetX:number
Defined in: geometry/Spot.ts:13
Offset in pixels applied after the fractional position.
offsetY
Sección titulada «offsetY»
readonlyoffsetY:number
Defined in: geometry/Spot.ts:15
Offset in pixels applied after the fractional position.
readonlyx:number
Defined in: geometry/Spot.ts:9
x as a fraction of the width (0..1).
readonlyy:number
Defined in: geometry/Spot.ts:11
y as a fraction of the height (0..1).
readonlystaticBottom:Spot
Defined in: geometry/Spot.ts:57
GoJS-compatible: Spot at the bottom-center.
BottomCenter
Sección titulada «BottomCenter»
readonlystaticBottomCenter:Spot
Defined in: geometry/Spot.ts:55
Spot at the bottom-center.
BottomLeft
Sección titulada «BottomLeft»
readonlystaticBottomLeft:Spot
Defined in: geometry/Spot.ts:53
Spot at the bottom-left corner.
BottomRight
Sección titulada «BottomRight»
readonlystaticBottomRight:Spot
Defined in: geometry/Spot.ts:59
Spot at the bottom-right corner.
readonlystaticCenter:Spot
Defined in: geometry/Spot.ts:41
Spot at the center.
readonlystaticLeft:Spot
Defined in: geometry/Spot.ts:37
GoJS-compatible: Spot at the middle of the left edge.
LeftMiddle
Sección titulada «LeftMiddle»
readonlystaticLeftMiddle:Spot
Defined in: geometry/Spot.ts:33
Spot at the middle of the left edge.
LeftSide
Sección titulada «LeftSide»
readonlystaticLeftSide:Spot
Defined in: geometry/Spot.ts:39
GoJS-compatible: Spot at the middle of the left edge.
MiddleCenter
Sección titulada «MiddleCenter»
readonlystaticMiddleCenter:Spot
Defined in: geometry/Spot.ts:43
GoJS-compatible: Spot at the center.
MiddleLeft
Sección titulada «MiddleLeft»
readonlystaticMiddleLeft:Spot
Defined in: geometry/Spot.ts:35
GoJS-compatible: Spot at the middle of the left edge.
MiddleRight
Sección titulada «MiddleRight»
readonlystaticMiddleRight:Spot
Defined in: geometry/Spot.ts:47
GoJS-compatible: Spot at the middle of the right edge.
readonlystaticNone:Spot
Defined in: geometry/Spot.ts:61
GoJS-compatible: A spot with no meaningful position.
readonlystaticRight:Spot
Defined in: geometry/Spot.ts:49
GoJS-compatible: Spot at the middle of the right edge.
RightMiddle
Sección titulada «RightMiddle»
readonlystaticRightMiddle:Spot
Defined in: geometry/Spot.ts:45
Spot at the middle of the right edge.
RightSide
Sección titulada «RightSide»
readonlystaticRightSide:Spot
Defined in: geometry/Spot.ts:51
GoJS-compatible: Spot at the middle of the right edge.
readonlystaticTop:Spot
Defined in: geometry/Spot.ts:29
GoJS-compatible: Spot at the top-center.
TopCenter
Sección titulada «TopCenter»
readonlystaticTopCenter:Spot
Defined in: geometry/Spot.ts:27
Spot at the top-center.
TopLeft
Sección titulada «TopLeft»
readonlystaticTopLeft:Spot
Defined in: geometry/Spot.ts:25
Spot at the top-left corner.
TopRight
Sección titulada «TopRight»
readonlystaticTopRight:Spot
Defined in: geometry/Spot.ts:31
Spot at the top-right corner.
Methods
Sección titulada «Methods»computePoint()
Sección titulada «computePoint()»computePoint(
x,y,width,height):object
Defined in: geometry/Spot.ts:149
Compute the point within a rect for this spot.
Parameters
Sección titulada «Parameters»number
number
number
number
Returns
Sección titulada «Returns»object
x:
number
y:
number
copy():
Spot
Defined in: geometry/Spot.ts:172
GoJS-compatible: Return a copy of this spot.
Returns
Sección titulada «Returns»Spot
equals()
Sección titulada «equals()»equals(
other):boolean
Defined in: geometry/Spot.ts:157
Check if two spots are equivalent.
Parameters
Sección titulada «Parameters»Spot
Returns
Sección titulada «Returns»boolean
isSpot()
Sección titulada «isSpot()»isSpot():
boolean
Defined in: geometry/Spot.ts:81
GoJS-compatible: Whether this spot has valid fractional coordinates.
Returns
Sección titulada «Returns»boolean
offset()
Sección titulada «offset()»offset(
dx,dy):Spot
Defined in: geometry/Spot.ts:167
Return a copy with additional offset.
Parameters
Sección titulada «Parameters»number
number
Returns
Sección titulada «Returns»Spot
pointToSpot()
Sección titulada «pointToSpot()»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.
Parameters
Sección titulada «Parameters»number
number
number
number
number
number
Returns
Sección titulada «Returns»Spot
setSpot()
Sección titulada «setSpot()»setSpot(
x,y,offsetX?,offsetY?):this
Defined in: geometry/Spot.ts:93
GoJS-compatible: In-place mutation returning this spot.
Parameters
Sección titulada «Parameters»number
number
offsetX?
Sección titulada «offsetX?»number = 0
offsetY?
Sección titulada «offsetY?»number = 0
Returns
Sección titulada «Returns»this
spotToPoint()
Sección titulada «spotToPoint()»spotToPoint(
x,y,width,height):object
Defined in: geometry/Spot.ts:102
GoJS-compatible: Compute the point in the rect for this spot.
Parameters
Sección titulada «Parameters»number
number
number
number
Returns
Sección titulada «Returns»object
x:
number
y:
number
fromName()
Sección titulada «fromName()»
staticfromName(name):Spot
Defined in: geometry/Spot.ts:114
Create a Spot from a standard name.
Parameters
Sección titulada «Parameters»string
Returns
Sección titulada «Returns»Spot
isSpot()
Sección titulada «isSpot()»
staticisSpot(value):boolean
Defined in: geometry/Spot.ts:76
GoJS-compatible: Whether the given value is a Spot object.
Parameters
Sección titulada «Parameters»unknown
Returns
Sección titulada «Returns»boolean
parse()
Sección titulada «parse()»
staticparse(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”.
Parameters
Sección titulada «Parameters»string
Returns
Sección titulada «Returns»Spot