@xyflow/system 0.0.1
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/LICENSE +21 -0
- package/README.md +10 -0
- package/dist/esm/constants.d.ts +22 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +1741 -0
- package/dist/esm/types/edges.d.ts +62 -0
- package/dist/esm/types/edges.d.ts.map +1 -0
- package/dist/esm/types/general.d.ts +106 -0
- package/dist/esm/types/general.d.ts.map +1 -0
- package/dist/esm/types/handles.d.ts +29 -0
- package/dist/esm/types/handles.d.ts.map +1 -0
- package/dist/esm/types/index.d.ts +7 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/nodes.d.ts +76 -0
- package/dist/esm/types/nodes.d.ts.map +1 -0
- package/dist/esm/types/panzoom.d.ts +48 -0
- package/dist/esm/types/panzoom.d.ts.map +1 -0
- package/dist/esm/types/utils.d.ts +25 -0
- package/dist/esm/types/utils.d.ts.map +1 -0
- package/dist/esm/utils/dom.d.ts +20 -0
- package/dist/esm/utils/dom.d.ts.map +1 -0
- package/dist/esm/utils/edges/bezier-edge.d.ts +30 -0
- package/dist/esm/utils/edges/bezier-edge.d.ts.map +1 -0
- package/dist/esm/utils/edges/general.d.ts +29 -0
- package/dist/esm/utils/edges/general.d.ts.map +1 -0
- package/dist/esm/utils/edges/index.d.ts +6 -0
- package/dist/esm/utils/edges/index.d.ts.map +1 -0
- package/dist/esm/utils/edges/positions.d.ts +14 -0
- package/dist/esm/utils/edges/positions.d.ts.map +1 -0
- package/dist/esm/utils/edges/smoothstep-edge.d.ts +15 -0
- package/dist/esm/utils/edges/smoothstep-edge.d.ts.map +1 -0
- package/dist/esm/utils/edges/straight-edge.d.ts +8 -0
- package/dist/esm/utils/edges/straight-edge.d.ts.map +1 -0
- package/dist/esm/utils/general.d.ts +29 -0
- package/dist/esm/utils/general.d.ts.map +1 -0
- package/dist/esm/utils/graph.d.ts +26 -0
- package/dist/esm/utils/graph.d.ts.map +1 -0
- package/dist/esm/utils/index.d.ts +7 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/marker.d.ts +7 -0
- package/dist/esm/utils/marker.d.ts.map +1 -0
- package/dist/esm/utils/store.d.ts +20 -0
- package/dist/esm/utils/store.d.ts.map +1 -0
- package/dist/esm/utils/utils.d.ts +29 -0
- package/dist/esm/utils/utils.d.ts.map +1 -0
- package/dist/esm/xydrag/XYDrag.d.ts +48 -0
- package/dist/esm/xydrag/XYDrag.d.ts.map +1 -0
- package/dist/esm/xydrag/index.d.ts +2 -0
- package/dist/esm/xydrag/index.d.ts.map +1 -0
- package/dist/esm/xydrag/utils.d.ts +11 -0
- package/dist/esm/xydrag/utils.d.ts.map +1 -0
- package/dist/esm/xyhandle/XYHandle.d.ts +45 -0
- package/dist/esm/xyhandle/XYHandle.d.ts.map +1 -0
- package/dist/esm/xyhandle/index.d.ts +2 -0
- package/dist/esm/xyhandle/index.d.ts.map +1 -0
- package/dist/esm/xyhandle/utils.d.ts +15 -0
- package/dist/esm/xyhandle/utils.d.ts.map +1 -0
- package/dist/esm/xyminimap/index.d.ts +28 -0
- package/dist/esm/xyminimap/index.d.ts.map +1 -0
- package/dist/esm/xypanzoom/XYPanZoom.d.ts +10 -0
- package/dist/esm/xypanzoom/XYPanZoom.d.ts.map +1 -0
- package/dist/esm/xypanzoom/eventhandler.d.ts +48 -0
- package/dist/esm/xypanzoom/eventhandler.d.ts.map +1 -0
- package/dist/esm/xypanzoom/filter.d.ts +14 -0
- package/dist/esm/xypanzoom/filter.d.ts.map +1 -0
- package/dist/esm/xypanzoom/index.d.ts +2 -0
- package/dist/esm/xypanzoom/index.d.ts.map +1 -0
- package/dist/esm/xypanzoom/utils.d.ts +9 -0
- package/dist/esm/xypanzoom/utils.d.ts.map +1 -0
- package/dist/umd/constants.d.ts +22 -0
- package/dist/umd/constants.d.ts.map +1 -0
- package/dist/umd/index.d.ts +8 -0
- package/dist/umd/index.d.ts.map +1 -0
- package/dist/umd/index.js +1 -0
- package/dist/umd/types/edges.d.ts +62 -0
- package/dist/umd/types/edges.d.ts.map +1 -0
- package/dist/umd/types/general.d.ts +106 -0
- package/dist/umd/types/general.d.ts.map +1 -0
- package/dist/umd/types/handles.d.ts +29 -0
- package/dist/umd/types/handles.d.ts.map +1 -0
- package/dist/umd/types/index.d.ts +7 -0
- package/dist/umd/types/index.d.ts.map +1 -0
- package/dist/umd/types/nodes.d.ts +76 -0
- package/dist/umd/types/nodes.d.ts.map +1 -0
- package/dist/umd/types/panzoom.d.ts +48 -0
- package/dist/umd/types/panzoom.d.ts.map +1 -0
- package/dist/umd/types/utils.d.ts +25 -0
- package/dist/umd/types/utils.d.ts.map +1 -0
- package/dist/umd/utils/dom.d.ts +20 -0
- package/dist/umd/utils/dom.d.ts.map +1 -0
- package/dist/umd/utils/edges/bezier-edge.d.ts +30 -0
- package/dist/umd/utils/edges/bezier-edge.d.ts.map +1 -0
- package/dist/umd/utils/edges/general.d.ts +29 -0
- package/dist/umd/utils/edges/general.d.ts.map +1 -0
- package/dist/umd/utils/edges/index.d.ts +6 -0
- package/dist/umd/utils/edges/index.d.ts.map +1 -0
- package/dist/umd/utils/edges/positions.d.ts +14 -0
- package/dist/umd/utils/edges/positions.d.ts.map +1 -0
- package/dist/umd/utils/edges/smoothstep-edge.d.ts +15 -0
- package/dist/umd/utils/edges/smoothstep-edge.d.ts.map +1 -0
- package/dist/umd/utils/edges/straight-edge.d.ts +8 -0
- package/dist/umd/utils/edges/straight-edge.d.ts.map +1 -0
- package/dist/umd/utils/general.d.ts +29 -0
- package/dist/umd/utils/general.d.ts.map +1 -0
- package/dist/umd/utils/graph.d.ts +26 -0
- package/dist/umd/utils/graph.d.ts.map +1 -0
- package/dist/umd/utils/index.d.ts +7 -0
- package/dist/umd/utils/index.d.ts.map +1 -0
- package/dist/umd/utils/marker.d.ts +7 -0
- package/dist/umd/utils/marker.d.ts.map +1 -0
- package/dist/umd/utils/store.d.ts +20 -0
- package/dist/umd/utils/store.d.ts.map +1 -0
- package/dist/umd/utils/utils.d.ts +45 -0
- package/dist/umd/utils/utils.d.ts.map +1 -0
- package/dist/umd/xydrag/XYDrag.d.ts +48 -0
- package/dist/umd/xydrag/XYDrag.d.ts.map +1 -0
- package/dist/umd/xydrag/index.d.ts +2 -0
- package/dist/umd/xydrag/index.d.ts.map +1 -0
- package/dist/umd/xydrag/utils.d.ts +11 -0
- package/dist/umd/xydrag/utils.d.ts.map +1 -0
- package/dist/umd/xyhandle/XYHandle.d.ts +45 -0
- package/dist/umd/xyhandle/XYHandle.d.ts.map +1 -0
- package/dist/umd/xyhandle/index.d.ts +2 -0
- package/dist/umd/xyhandle/index.d.ts.map +1 -0
- package/dist/umd/xyhandle/utils.d.ts +15 -0
- package/dist/umd/xyhandle/utils.d.ts.map +1 -0
- package/dist/umd/xyminimap/index.d.ts +28 -0
- package/dist/umd/xyminimap/index.d.ts.map +1 -0
- package/dist/umd/xypanzoom/XYPanZoom.d.ts +10 -0
- package/dist/umd/xypanzoom/XYPanZoom.d.ts.map +1 -0
- package/dist/umd/xypanzoom/eventhandler.d.ts +48 -0
- package/dist/umd/xypanzoom/eventhandler.d.ts.map +1 -0
- package/dist/umd/xypanzoom/filter.d.ts +14 -0
- package/dist/umd/xypanzoom/filter.d.ts.map +1 -0
- package/dist/umd/xypanzoom/index.d.ts +2 -0
- package/dist/umd/xypanzoom/index.d.ts.map +1 -0
- package/dist/umd/xypanzoom/utils.d.ts +9 -0
- package/dist/umd/xypanzoom/utils.d.ts.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Position } from './utils';
|
|
2
|
+
export type EdgeBase<EdgeData = any> = {
|
|
3
|
+
id: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
source: string;
|
|
6
|
+
target: string;
|
|
7
|
+
sourceHandle?: string | null;
|
|
8
|
+
targetHandle?: string | null;
|
|
9
|
+
animated?: boolean;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
deletable?: boolean;
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
data?: EdgeData;
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
markerStart?: EdgeMarkerType;
|
|
16
|
+
markerEnd?: EdgeMarkerType;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
interactionWidth?: number;
|
|
20
|
+
focusable?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type SmoothStepPathOptions = {
|
|
23
|
+
offset?: number;
|
|
24
|
+
borderRadius?: number;
|
|
25
|
+
};
|
|
26
|
+
export type BezierPathOptions = {
|
|
27
|
+
curvature?: number;
|
|
28
|
+
};
|
|
29
|
+
export type DefaultEdgeOptionsBase<EdgeType extends EdgeBase> = Omit<EdgeType, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'sourceNode' | 'targetNode'>;
|
|
30
|
+
export declare enum ConnectionLineType {
|
|
31
|
+
Bezier = "default",
|
|
32
|
+
Straight = "straight",
|
|
33
|
+
Step = "step",
|
|
34
|
+
SmoothStep = "smoothstep",
|
|
35
|
+
SimpleBezier = "simplebezier"
|
|
36
|
+
}
|
|
37
|
+
export type EdgeMarker = {
|
|
38
|
+
type: MarkerType;
|
|
39
|
+
color?: string;
|
|
40
|
+
width?: number;
|
|
41
|
+
height?: number;
|
|
42
|
+
markerUnits?: string;
|
|
43
|
+
orient?: string;
|
|
44
|
+
strokeWidth?: number;
|
|
45
|
+
};
|
|
46
|
+
export type EdgeMarkerType = string | EdgeMarker;
|
|
47
|
+
export declare enum MarkerType {
|
|
48
|
+
Arrow = "arrow",
|
|
49
|
+
ArrowClosed = "arrowclosed"
|
|
50
|
+
}
|
|
51
|
+
export type MarkerProps = EdgeMarker & {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
export type EdgePosition = {
|
|
55
|
+
sourceX: number;
|
|
56
|
+
sourceY: number;
|
|
57
|
+
targetX: number;
|
|
58
|
+
targetY: number;
|
|
59
|
+
sourcePosition: Position;
|
|
60
|
+
targetPosition: Position;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=edges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,MAAM,MAAM,QAAQ,CAAC,QAAQ,GAAG,GAAG,IAAI;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,QAAQ,SAAS,QAAQ,IAAI,IAAI,CAClE,QAAQ,EACR,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAC3F,CAAC;AAEF,oBAAY,kBAAkB;IAC5B,MAAM,YAAY;IAClB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,YAAY,iBAAiB;CAC9B;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjD,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,WAAW,gBAAgB;CAC5B;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { D3DragEvent, Selection as D3Selection, SubjectPosition, ZoomBehavior } from 'd3';
|
|
2
|
+
import type { XYPosition, Rect } from './utils';
|
|
3
|
+
import type { NodeBase, NodeDragItem, NodeOrigin } from './nodes';
|
|
4
|
+
import type { ConnectingHandle, HandleType } from './handles';
|
|
5
|
+
import { PanZoomInstance } from './panzoom';
|
|
6
|
+
import { EdgeBase } from '..';
|
|
7
|
+
export type Project = (position: XYPosition) => XYPosition;
|
|
8
|
+
export type OnMove = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void;
|
|
9
|
+
export type OnMoveStart = OnMove;
|
|
10
|
+
export type OnMoveEnd = OnMove;
|
|
11
|
+
export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => void;
|
|
12
|
+
export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => void;
|
|
13
|
+
export type GetZoom = () => number;
|
|
14
|
+
export type GetViewport = () => Viewport;
|
|
15
|
+
export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => void;
|
|
16
|
+
export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => void;
|
|
17
|
+
export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => void;
|
|
18
|
+
export interface Connection {
|
|
19
|
+
source: string | null;
|
|
20
|
+
target: string | null;
|
|
21
|
+
sourceHandle: string | null;
|
|
22
|
+
targetHandle: string | null;
|
|
23
|
+
}
|
|
24
|
+
export type ConnectionStatus = 'valid' | 'invalid';
|
|
25
|
+
export declare enum ConnectionMode {
|
|
26
|
+
Strict = "strict",
|
|
27
|
+
Loose = "loose"
|
|
28
|
+
}
|
|
29
|
+
export type OnConnectStartParams = {
|
|
30
|
+
nodeId: string | null;
|
|
31
|
+
handleId: string | null;
|
|
32
|
+
handleType: HandleType | null;
|
|
33
|
+
};
|
|
34
|
+
export type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
|
|
35
|
+
export type OnConnect = (connection: Connection) => void;
|
|
36
|
+
export type OnConnectEnd = (event: MouseEvent | TouchEvent) => void;
|
|
37
|
+
export type IsValidConnection = (edge: EdgeBase | Connection) => boolean;
|
|
38
|
+
export type FitViewParamsBase<NodeType extends NodeBase> = {
|
|
39
|
+
nodes: NodeType[];
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
panZoom: PanZoomInstance;
|
|
43
|
+
minZoom: number;
|
|
44
|
+
maxZoom: number;
|
|
45
|
+
nodeOrigin?: NodeOrigin;
|
|
46
|
+
};
|
|
47
|
+
export type FitViewOptionsBase<NodeType extends NodeBase> = {
|
|
48
|
+
padding?: number;
|
|
49
|
+
includeHiddenNodes?: boolean;
|
|
50
|
+
minZoom?: number;
|
|
51
|
+
maxZoom?: number;
|
|
52
|
+
duration?: number;
|
|
53
|
+
nodes?: (Partial<NodeType> & {
|
|
54
|
+
id: NodeType['id'];
|
|
55
|
+
})[];
|
|
56
|
+
};
|
|
57
|
+
export type Viewport = {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
zoom: number;
|
|
61
|
+
};
|
|
62
|
+
export type KeyCode = string | Array<string>;
|
|
63
|
+
export type SnapGrid = [number, number];
|
|
64
|
+
export declare enum PanOnScrollMode {
|
|
65
|
+
Free = "free",
|
|
66
|
+
Vertical = "vertical",
|
|
67
|
+
Horizontal = "horizontal"
|
|
68
|
+
}
|
|
69
|
+
export type ViewportHelperFunctionOptions = {
|
|
70
|
+
duration?: number;
|
|
71
|
+
};
|
|
72
|
+
export type SetCenterOptions = ViewportHelperFunctionOptions & {
|
|
73
|
+
zoom?: number;
|
|
74
|
+
};
|
|
75
|
+
export type FitBoundsOptions = ViewportHelperFunctionOptions & {
|
|
76
|
+
padding?: number;
|
|
77
|
+
};
|
|
78
|
+
export type OnViewportChange = (viewport: Viewport) => void;
|
|
79
|
+
export type D3ZoomInstance = ZoomBehavior<Element, unknown>;
|
|
80
|
+
export type D3SelectionInstance = D3Selection<Element, unknown, null, undefined>;
|
|
81
|
+
export type D3ZoomHandler = (this: Element, event: any, d: unknown) => void;
|
|
82
|
+
export type UpdateNodeInternals = (nodeId: string) => void;
|
|
83
|
+
export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
84
|
+
export type ProOptions = {
|
|
85
|
+
account?: string;
|
|
86
|
+
hideAttribution: boolean;
|
|
87
|
+
};
|
|
88
|
+
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
|
|
89
|
+
export declare enum SelectionMode {
|
|
90
|
+
Partial = "partial",
|
|
91
|
+
Full = "full"
|
|
92
|
+
}
|
|
93
|
+
export type SelectionRect = Rect & {
|
|
94
|
+
startX: number;
|
|
95
|
+
startY: number;
|
|
96
|
+
};
|
|
97
|
+
export type OnError = (id: string, message: string) => void;
|
|
98
|
+
export type UpdateNodePositions = (dragItems: NodeDragItem[] | NodeBase[], positionChanged?: boolean, dragging?: boolean) => void;
|
|
99
|
+
export type PanBy = (delta: XYPosition) => boolean;
|
|
100
|
+
export type UpdateConnection = (params: {
|
|
101
|
+
connectionPosition?: XYPosition | null;
|
|
102
|
+
connectionStatus?: ConnectionStatus | null;
|
|
103
|
+
connectionStartHandle?: ConnectingHandle | null;
|
|
104
|
+
connectionEndHandle?: ConnectingHandle | null;
|
|
105
|
+
}) => void;
|
|
106
|
+
//# sourceMappingURL=general.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,IAAI,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAE/F,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,MAAM,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CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAE9E,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,CAChC,SAAS,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,EACtC,eAAe,CAAC,EAAE,OAAO,EACzB,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI,CAAC;AACV,MAAM,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE;IACtC,kBAAkB,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,qBAAqB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChD,mBAAmB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC/C,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { XYPosition, Position, Dimensions, OnConnect, IsValidConnection } from '.';
|
|
2
|
+
export type HandleType = 'source' | 'target';
|
|
3
|
+
export type HandleElement = XYPosition & Dimensions & {
|
|
4
|
+
id?: string | null;
|
|
5
|
+
position: Position;
|
|
6
|
+
};
|
|
7
|
+
export type ConnectingHandle = {
|
|
8
|
+
nodeId: string;
|
|
9
|
+
type: HandleType;
|
|
10
|
+
handleId?: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type ConnectionHandle = {
|
|
13
|
+
id: string | null;
|
|
14
|
+
type: HandleType;
|
|
15
|
+
nodeId: string;
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
export type HandleProps = {
|
|
20
|
+
type: HandleType;
|
|
21
|
+
position: Position;
|
|
22
|
+
isConnectable?: boolean;
|
|
23
|
+
isConnectableStart?: boolean;
|
|
24
|
+
isConnectableEnd?: boolean;
|
|
25
|
+
onConnect?: OnConnect;
|
|
26
|
+
isValidConnection?: IsValidConnection;
|
|
27
|
+
id?: string;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=handles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../src/types/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAExF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,UAAU,GACpC,UAAU,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { internalsSymbol } from '../constants';
|
|
2
|
+
import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
|
|
3
|
+
export type NodeBase<T = any, U extends string | undefined = string | undefined> = {
|
|
4
|
+
id: string;
|
|
5
|
+
position: XYPosition;
|
|
6
|
+
data: T;
|
|
7
|
+
type?: U;
|
|
8
|
+
sourcePosition?: Position;
|
|
9
|
+
targetPosition?: Position;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
dragging?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
selectable?: boolean;
|
|
15
|
+
connectable?: boolean;
|
|
16
|
+
deletable?: boolean;
|
|
17
|
+
dragHandle?: string;
|
|
18
|
+
width?: number | null;
|
|
19
|
+
height?: number | null;
|
|
20
|
+
parentNode?: string;
|
|
21
|
+
zIndex?: number;
|
|
22
|
+
extent?: 'parent' | CoordinateExtent;
|
|
23
|
+
expandParent?: boolean;
|
|
24
|
+
positionAbsolute?: XYPosition;
|
|
25
|
+
ariaLabel?: string;
|
|
26
|
+
focusable?: boolean;
|
|
27
|
+
origin?: NodeOrigin;
|
|
28
|
+
[internalsSymbol]?: {
|
|
29
|
+
z?: number;
|
|
30
|
+
handleBounds?: NodeHandleBounds;
|
|
31
|
+
isParent?: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type NodeProps<T = any> = {
|
|
35
|
+
id: NodeBase['id'];
|
|
36
|
+
data: T;
|
|
37
|
+
dragHandle: NodeBase['dragHandle'];
|
|
38
|
+
type: NodeBase['type'];
|
|
39
|
+
selected: NodeBase['selected'];
|
|
40
|
+
isConnectable: NodeBase['connectable'];
|
|
41
|
+
zIndex: NodeBase['zIndex'];
|
|
42
|
+
xPos: number;
|
|
43
|
+
yPos: number;
|
|
44
|
+
dragging: boolean;
|
|
45
|
+
targetPosition?: Position;
|
|
46
|
+
sourcePosition?: Position;
|
|
47
|
+
};
|
|
48
|
+
export type NodeHandleBounds = {
|
|
49
|
+
source: HandleElement[] | null;
|
|
50
|
+
target: HandleElement[] | null;
|
|
51
|
+
};
|
|
52
|
+
export type NodeDimensionUpdate = {
|
|
53
|
+
id: string;
|
|
54
|
+
nodeElement: HTMLDivElement;
|
|
55
|
+
forceUpdate?: boolean;
|
|
56
|
+
};
|
|
57
|
+
export type NodeBounds = XYPosition & {
|
|
58
|
+
width: number | null;
|
|
59
|
+
height: number | null;
|
|
60
|
+
};
|
|
61
|
+
export type NodeDragItem = {
|
|
62
|
+
id: string;
|
|
63
|
+
position: XYPosition;
|
|
64
|
+
positionAbsolute: XYPosition;
|
|
65
|
+
distance: XYPosition;
|
|
66
|
+
width?: number | null;
|
|
67
|
+
height?: number | null;
|
|
68
|
+
extent?: 'parent' | CoordinateExtent;
|
|
69
|
+
parentNode?: string;
|
|
70
|
+
dragging?: boolean;
|
|
71
|
+
origin?: NodeOrigin;
|
|
72
|
+
};
|
|
73
|
+
export type NodeOrigin = [number, number];
|
|
74
|
+
export type OnNodeDrag = (event: MouseEvent, node: NodeBase, nodes: NodeBase[]) => void;
|
|
75
|
+
export type OnSelectionDrag = (event: MouseEvent, nodes: NodeBase[]) => void;
|
|
76
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAG/E,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAAI;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,U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M,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,gBAAgB,EAAE,UAAU,CAAC;IAE7B,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAExF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ZoomTransform } from 'd3-zoom';
|
|
2
|
+
import { CoordinateExtent, PanOnScrollMode, Transform, Viewport } from './';
|
|
3
|
+
export type OnDraggingChange = (dragging: boolean) => void;
|
|
4
|
+
export type OnTransformChange = (transform: Transform) => void;
|
|
5
|
+
export type PanZoomParams = {
|
|
6
|
+
domNode: Element;
|
|
7
|
+
minZoom: number;
|
|
8
|
+
maxZoom: number;
|
|
9
|
+
viewport: Viewport;
|
|
10
|
+
translateExtent: CoordinateExtent;
|
|
11
|
+
onTransformChange: OnTransformChange;
|
|
12
|
+
onDraggingChange: OnDraggingChange;
|
|
13
|
+
onPanZoomStart?: OnPanZoom;
|
|
14
|
+
onPanZoom?: OnPanZoom;
|
|
15
|
+
onPanZoomEnd?: OnPanZoom;
|
|
16
|
+
};
|
|
17
|
+
export type PanZoomTransformOptions = {
|
|
18
|
+
duration?: number;
|
|
19
|
+
};
|
|
20
|
+
export type OnPanZoom = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void;
|
|
21
|
+
export type PanZoomUpdateOptions = {
|
|
22
|
+
noWheelClassName: string;
|
|
23
|
+
noPanClassName: string;
|
|
24
|
+
onPaneContextMenu?: (event: MouseEvent) => void;
|
|
25
|
+
preventScrolling: boolean;
|
|
26
|
+
panOnScroll: boolean;
|
|
27
|
+
panOnDrag: boolean | number[];
|
|
28
|
+
panOnScrollMode: PanOnScrollMode;
|
|
29
|
+
panOnScrollSpeed: number;
|
|
30
|
+
userSelectionActive: boolean;
|
|
31
|
+
zoomOnPinch: boolean;
|
|
32
|
+
zoomOnScroll: boolean;
|
|
33
|
+
zoomOnDoubleClick: boolean;
|
|
34
|
+
zoomActivationKeyPressed: boolean;
|
|
35
|
+
lib: string;
|
|
36
|
+
};
|
|
37
|
+
export type PanZoomInstance = {
|
|
38
|
+
update: (params: PanZoomUpdateOptions) => void;
|
|
39
|
+
destroy: () => void;
|
|
40
|
+
getViewport: () => Viewport;
|
|
41
|
+
setViewport: (viewport: Viewport, options?: PanZoomTransformOptions) => ZoomTransform | undefined;
|
|
42
|
+
setViewportConstrained: (viewport: Viewport, extent: CoordinateExtent, translateExtent: CoordinateExtent) => ZoomTransform | undefined;
|
|
43
|
+
setScaleExtent: (scaleExtent: [number, number]) => void;
|
|
44
|
+
setTranslateExtent: (translateExtent: CoordinateExtent) => void;
|
|
45
|
+
scaleTo: (scale: number, options?: PanZoomTransformOptions) => void;
|
|
46
|
+
scaleBy: (factor: number, options?: PanZoomTransformOptions) => void;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=panzoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panzoom.d.ts","sourceRoot":"","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EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,OAAO,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,QAAQ,CAAC;IAC5B,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,aAAa,GAAG,SAAS,CAAC;IAClG,sBAAsB,EAAE,CACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,gBAAgB,EACxB,eAAe,EAAE,gBAAgB,KAC9B,aAAa,GAAG,SAAS,CAAC;IAC/B,cAAc,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACpE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACtE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare enum Position {
|
|
2
|
+
Left = "left",
|
|
3
|
+
Top = "top",
|
|
4
|
+
Right = "right",
|
|
5
|
+
Bottom = "bottom"
|
|
6
|
+
}
|
|
7
|
+
export type XYPosition = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export type XYZPosition = XYPosition & {
|
|
12
|
+
z: number;
|
|
13
|
+
};
|
|
14
|
+
export type Dimensions = {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
export type Rect = Dimensions & XYPosition;
|
|
19
|
+
export type Box = XYPosition & {
|
|
20
|
+
x2: number;
|
|
21
|
+
y2: number;
|
|
22
|
+
};
|
|
23
|
+
export type Transform = [number, number, number];
|
|
24
|
+
export type CoordinateExtent = [[number, number], [number, number]];
|
|
25
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC;AAE3C,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Transform, XYPosition, SnapGrid, Dimensions, NodeOrigin, HandleElement } from '../types';
|
|
2
|
+
export type GetPointerPositionParams = {
|
|
3
|
+
transform: Transform;
|
|
4
|
+
snapGrid?: SnapGrid;
|
|
5
|
+
snapToGrid?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function getPointerPosition(event: MouseEvent | TouchEvent, { snapGrid, snapToGrid, transform }: GetPointerPositionParams): XYPosition & {
|
|
8
|
+
xSnapped: number;
|
|
9
|
+
ySnapped: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const getDimensions: (node: HTMLDivElement) => Dimensions;
|
|
12
|
+
export declare const getHostForElement: (element: HTMLElement) => Document | ShadowRoot;
|
|
13
|
+
export declare function isInputDOMNode(event: KeyboardEvent): boolean;
|
|
14
|
+
export declare const isMouseEvent: (event: MouseEvent | TouchEvent) => event is MouseEvent;
|
|
15
|
+
export declare const getEventPosition: (event: MouseEvent | TouchEvent, bounds?: DOMRect) => {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const getHandleBounds: (selector: string, nodeElement: HTMLDivElement, zoom: number, nodeOrigin?: NodeOrigin) => HandleElement[] | null;
|
|
20
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAY,MAAM,UAAU,CAAC;AAGjH,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,EAAE,QAAiB,EAAE,UAAkB,EAAE,SAAS,EAAE,EAAE,wBAAwB,GAC7E,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAYrD;AAED,eAAO,MAAM,aAAa,SAAU,cAAc,KAAG,UAGnD,CAAC;AAEH,eAAO,MAAM,iBAAiB,YAAa,WAAW,KAAG,QAAQ,GAAG,UACI,CAAC;AAIzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAS5D;AAED,eAAO,MAAM,YAAY,UAAW,UAAU,GAAG,UAAU,wBAA4C,CAAC;AAExG,eAAO,MAAM,gBAAgB,UAAW,UAAU,GAAG,UAAU,WAAW,OAAO;;;CAShF,CAAC;AAEF,eAAO,MAAM,eAAe,aAChB,MAAM,eACH,cAAc,QACrB,MAAM,8BAEX,aAAa,EAAE,GAAG,IAyBpB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Position } from '../../types';
|
|
2
|
+
export type GetBezierPathParams = {
|
|
3
|
+
sourceX: number;
|
|
4
|
+
sourceY: number;
|
|
5
|
+
sourcePosition?: Position;
|
|
6
|
+
targetX: number;
|
|
7
|
+
targetY: number;
|
|
8
|
+
targetPosition?: Position;
|
|
9
|
+
curvature?: number;
|
|
10
|
+
};
|
|
11
|
+
export type GetControlWithCurvatureParams = {
|
|
12
|
+
pos: Position;
|
|
13
|
+
x1: number;
|
|
14
|
+
y1: number;
|
|
15
|
+
x2: number;
|
|
16
|
+
y2: number;
|
|
17
|
+
c: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }: {
|
|
20
|
+
sourceX: number;
|
|
21
|
+
sourceY: number;
|
|
22
|
+
targetX: number;
|
|
23
|
+
targetY: number;
|
|
24
|
+
sourceControlX: number;
|
|
25
|
+
sourceControlY: number;
|
|
26
|
+
targetControlX: number;
|
|
27
|
+
targetControlY: number;
|
|
28
|
+
}): [number, number, number, number];
|
|
29
|
+
export declare function getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, curvature, }: GetBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
|
|
30
|
+
//# sourceMappingURL=bezier-edge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bezier-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/bezier-edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,EAAE,QAAQ,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,GACf,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CASnC;AAuBD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,SAAgB,GACjB,EAAE,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAmCxG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Connection, Transform } from '../..';
|
|
2
|
+
import { EdgeBase, NodeBase } from '../../types';
|
|
3
|
+
export declare function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }: {
|
|
4
|
+
sourceX: number;
|
|
5
|
+
sourceY: number;
|
|
6
|
+
targetX: number;
|
|
7
|
+
targetY: number;
|
|
8
|
+
}): [number, number, number, number];
|
|
9
|
+
export type GroupedEdges<EdgeType extends EdgeBase> = {
|
|
10
|
+
edges: EdgeType[];
|
|
11
|
+
level: number;
|
|
12
|
+
isMaxLevel: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function groupEdgesByZLevel<EdgeType extends EdgeBase>(edges: EdgeType[], nodes: NodeBase[], elevateEdgesOnSelect?: boolean): GroupedEdges<EdgeType>[];
|
|
15
|
+
type IsEdgeVisibleParams = {
|
|
16
|
+
sourceNode: NodeBase;
|
|
17
|
+
targetNode: NodeBase;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
transform: Transform;
|
|
21
|
+
};
|
|
22
|
+
export declare function isEdgeVisible({ sourceNode, targetNode, width, height, transform }: IsEdgeVisibleParams): boolean;
|
|
23
|
+
export declare const addEdgeBase: <EdgeType extends EdgeBase<any>>(edgeParams: Connection | EdgeType, edges: EdgeType[]) => EdgeType[];
|
|
24
|
+
export type UpdateEdgeOptions = {
|
|
25
|
+
shouldReplaceId?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare const updateEdgeBase: <EdgeType extends EdgeBase<any>>(oldEdge: EdgeType, newConnection: Connection, edges: EdgeType[], options?: UpdateEdgeOptions) => EdgeType[];
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=general.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAA8C,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIjD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQnC;AAID,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,QAAQ,IAAI;IACpD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,EAC1D,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,EAAE,QAAQ,EAAE,EACjB,oBAAoB,UAAQ,GAC3B,YAAY,CAAC,QAAQ,CAAC,EAAE,CA0C1B;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAmBhH;AAeD,eAAO,MAAM,WAAW,sGAyBvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,cAAc,qEAEV,UAAU,+BAEhB,iBAAiB,eA6B3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EdgePosition } from '../../types/edges';
|
|
2
|
+
import { ConnectionMode, OnError } from '../../types/general';
|
|
3
|
+
import { NodeBase } from '../../types/nodes';
|
|
4
|
+
export type GetEdgePositionParams = {
|
|
5
|
+
id: string;
|
|
6
|
+
sourceNode: NodeBase;
|
|
7
|
+
sourceHandle: string | null;
|
|
8
|
+
targetNode: NodeBase;
|
|
9
|
+
targetHandle: string | null;
|
|
10
|
+
connectionMode: ConnectionMode;
|
|
11
|
+
onError?: OnError;
|
|
12
|
+
};
|
|
13
|
+
export declare function getEdgePosition(params: GetEdgePositionParams): EdgePosition | null;
|
|
14
|
+
//# sourceMappingURL=positions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAoB,MAAM,mBAAmB,CAAC;AAK/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA0ClF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Position } from '../../types';
|
|
2
|
+
export interface GetSmoothStepPathParams {
|
|
3
|
+
sourceX: number;
|
|
4
|
+
sourceY: number;
|
|
5
|
+
sourcePosition?: Position;
|
|
6
|
+
targetX: number;
|
|
7
|
+
targetY: number;
|
|
8
|
+
targetPosition?: Position;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
centerX?: number;
|
|
11
|
+
centerY?: number;
|
|
12
|
+
offset?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, borderRadius, centerX, centerY, offset, }: GetSmoothStepPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
|
|
15
|
+
//# sourceMappingURL=smoothstep-edge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smoothstep-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/smoothstep-edge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAExD,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgJD,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,YAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAW,GACZ,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAyB5G"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type GetStraightPathParams = {
|
|
2
|
+
sourceX: number;
|
|
3
|
+
sourceY: number;
|
|
4
|
+
targetX: number;
|
|
5
|
+
targetY: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function getStraightPath({ sourceX, sourceY, targetX, targetY, }: GetStraightPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
|
|
8
|
+
//# sourceMappingURL=straight-edge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"straight-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/straight-edge.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAS1G"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, NodeOrigin, SnapGrid, Transform } from '../types';
|
|
2
|
+
export declare const clamp: (val: number, min?: number, max?: number) => number;
|
|
3
|
+
export declare const clampPosition: (position: XYPosition | undefined, extent: CoordinateExtent) => {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const calcAutoPan: (pos: XYPosition, bounds: Dimensions) => number[];
|
|
8
|
+
export declare const getBoundsOfBoxes: (box1: Box, box2: Box) => Box;
|
|
9
|
+
export declare const rectToBox: ({ x, y, width, height }: Rect) => Box;
|
|
10
|
+
export declare const boxToRect: ({ x, y, x2, y2 }: Box) => Rect;
|
|
11
|
+
export declare const nodeToRect: (node: NodeBase, nodeOrigin?: NodeOrigin) => Rect;
|
|
12
|
+
export declare const nodeToBox: (node: NodeBase, nodeOrigin?: NodeOrigin) => Box;
|
|
13
|
+
export declare const getBoundsOfRects: (rect1: Rect, rect2: Rect) => Rect;
|
|
14
|
+
export declare const getOverlappingArea: (rectA: Rect, rectB: Rect) => number;
|
|
15
|
+
export declare const isRectObject: (obj: any) => obj is Rect;
|
|
16
|
+
export declare const isNumeric: (n: any) => n is number;
|
|
17
|
+
export declare const devWarn: (id: string, message: string) => void;
|
|
18
|
+
export declare const getPositionWithOrigin: ({ x, y, width, height, origin, }: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
origin?: NodeOrigin | undefined;
|
|
24
|
+
}) => XYPosition;
|
|
25
|
+
export declare function snapPosition(position: XYPosition, snapGrid?: SnapGrid): XYPosition;
|
|
26
|
+
export declare const pointToRendererPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform, snapToGrid?: boolean, snapGrid?: SnapGrid) => XYPosition;
|
|
27
|
+
export declare const rendererPointToPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform) => XYPosition;
|
|
28
|
+
export declare const getTransformForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding?: number) => Transform;
|
|
29
|
+
//# sourceMappingURL=general.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,KAAK,QAAS,MAAM,iCAAqB,MAA2C,CAAC;AAElG,eAAO,MAAM,aAAa;;;CAGxB,CAAC;AAcH,eAAO,MAAM,WAAW,QAAS,UAAU,UAAU,UAAU,KAAG,MAAM,EAKvE,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,GAAG,QAAQ,GAAG,KAAG,GAKtD,CAAC;AAEH,eAAO,MAAM,SAAS,4BAA6B,IAAI,KAAG,GAKxD,CAAC;AAEH,eAAO,MAAM,SAAS,qBAAsB,GAAG,KAAG,IAKhD,CAAC;AAEH,eAAO,MAAM,UAAU,SAAU,QAAQ,8BAAoC,IAQ5E,CAAC;AAEF,eAAO,MAAM,SAAS,SAAU,QAAQ,8BAAoC,GAQ3E,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,IAAI,SAAS,IAAI,KAAG,IACK,CAAC;AAElE,eAAO,MAAM,kBAAkB,UAAW,IAAI,SAAS,IAAI,KAAG,MAK7D,CAAC;AAGF,eAAO,MAAM,YAAY,QAAS,GAAG,gBACkD,CAAC;AAGxF,eAAO,MAAM,SAAS,MAAO,GAAG,gBAA0C,CAAC;AAI3E,eAAO,MAAM,OAAO,OAAQ,MAAM,WAAW,MAAM,SAIlD,CAAC;AAEF,eAAO,MAAM,qBAAqB;OAO7B,MAAM;OACN,MAAM;WACF,MAAM;YACL,MAAM;;MAEZ,UASH,CAAC;AAEF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,GAAE,QAAiB,GAAG,UAAU,CAK1F;AAED,eAAO,MAAM,oBAAoB,aACrB,UAAU,6EAInB,UAOF,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,UAAU,kCAAgC,UAKxF,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,IAAI,SACL,MAAM,UACL,MAAM,WACL,MAAM,WACN,MAAM,gCAahB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Connection, type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, NodeDragItem, CoordinateExtent, OnError } from '../types';
|
|
2
|
+
export declare const isEdgeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: NodeType | EdgeType | Connection) => element is EdgeType;
|
|
3
|
+
export declare const isNodeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: Connection | NodeType | EdgeType) => element is NodeType;
|
|
4
|
+
export declare const getOutgoersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
|
|
5
|
+
export declare const getIncomersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
|
|
6
|
+
export declare const getNodePositionWithOrigin: (node: NodeBase | undefined, nodeOrigin?: NodeOrigin) => XYPosition & {
|
|
7
|
+
positionAbsolute: XYPosition;
|
|
8
|
+
};
|
|
9
|
+
export declare const getRectOfNodes: (nodes: NodeBase[], nodeOrigin?: NodeOrigin) => Rect;
|
|
10
|
+
export declare const getNodesInside: <NodeType extends NodeBase<any, string | undefined>>(nodes: NodeType[], rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean, nodeOrigin?: NodeOrigin) => NodeType[];
|
|
11
|
+
export declare const getConnectedEdgesBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[];
|
|
12
|
+
export declare function fitView<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom, nodeOrigin }: Params, options?: Options): boolean;
|
|
13
|
+
export declare function calcNextPosition<NodeType extends NodeBase>(node: NodeDragItem | NodeType, nextPosition: XYPosition, nodes: NodeType[], nodeExtent?: CoordinateExtent, nodeOrigin?: NodeOrigin, onError?: OnError): {
|
|
14
|
+
position: XYPosition;
|
|
15
|
+
positionAbsolute: XYPosition;
|
|
16
|
+
};
|
|
17
|
+
export declare function getElementsToRemove<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>({ nodesToRemove, edgesToRemove, nodes, edges, }: {
|
|
18
|
+
nodesToRemove: Partial<NodeType>[];
|
|
19
|
+
edgesToRemove: Partial<EdgeType>[];
|
|
20
|
+
nodes: NodeType[];
|
|
21
|
+
edges: EdgeType[];
|
|
22
|
+
}): {
|
|
23
|
+
matchingNodes: NodeType[];
|
|
24
|
+
matchingEdges: EdgeType[];
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":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