@cratis/event-models 0.118.2 → 0.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Geometry/linkGeometry.d.ts +28 -4
- package/dist/index.js +1790 -1750
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -30,12 +30,36 @@ export declare function rectAt(point: Point): Rect;
|
|
|
30
30
|
* content rather than the full (specification-inclusive) footprint.
|
|
31
31
|
*/
|
|
32
32
|
export declare function contentRectOf(rect: Rect, contentHeight: number): Rect;
|
|
33
|
-
/** The
|
|
33
|
+
/** The side of a rectangle a connection dot sits on. */
|
|
34
|
+
export declare enum LinkSide {
|
|
35
|
+
Top = "top",
|
|
36
|
+
Right = "right",
|
|
37
|
+
Bottom = "bottom",
|
|
38
|
+
Left = "left"
|
|
39
|
+
}
|
|
40
|
+
export declare const linkSides: LinkSide[];
|
|
41
|
+
/** The connection dot of a rectangle on the given side: that edge's midpoint. */
|
|
42
|
+
export declare function sideAnchor(rect: Rect, side: LinkSide): Point;
|
|
43
|
+
/** The axis a curve leaving or arriving on the given side follows. */
|
|
44
|
+
export declare function axisOfSide(side: LinkSide): CurveAxis;
|
|
45
|
+
/** The point a link drag starts from by default: the right edge of a rectangle, vertically centered. */
|
|
34
46
|
export declare function linkAnchor(rect: Rect): Point;
|
|
47
|
+
/** The sides a link between two rectangles leaves the source from and arrives at on the target. */
|
|
48
|
+
export interface FacingSides {
|
|
49
|
+
source: LinkSide;
|
|
50
|
+
target: LinkSide;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Chooses the facing sides from the relative position of the two rectangle centers: along the
|
|
54
|
+
* dominant axis the link leaves the source on the side facing the target and arrives on the opposite
|
|
55
|
+
* side of the target (a target below connects at its top dot, to the left at its right dot, ...).
|
|
56
|
+
* Ties on the axis prefer horizontal, and identical centers prefer right to left.
|
|
57
|
+
*/
|
|
58
|
+
export declare function facingSides(source: Rect, target: Rect): FacingSides;
|
|
35
59
|
/**
|
|
36
|
-
* Computes the spline endpoints between two rectangles: the curve
|
|
37
|
-
*
|
|
38
|
-
*
|
|
60
|
+
* Computes the spline endpoints between two rectangles: the curve snaps from the source's connection
|
|
61
|
+
* dot to the target's dot on the facing sides (see facingSides), with the tangents following that
|
|
62
|
+
* axis — the same curve style as the connections between the cards inside a slice.
|
|
39
63
|
*/
|
|
40
64
|
export declare function computeSplineEndpoints(source: Rect, target: Rect): SplineEndpoints;
|
|
41
65
|
/** The midpoint between two points. */
|