@moxa/graph 3.0.0-beta.10 → 3.0.0-beta.12
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/behaviors/brush-select/index.d.ts.map +1 -1
- package/behaviors/click-select/index.d.ts.map +1 -1
- package/behaviors/drag-element/index.d.ts.map +1 -1
- package/behaviors/drill-down/drill-down-manager.d.ts +16 -2
- package/behaviors/drill-down/drill-down-manager.d.ts.map +1 -1
- package/behaviors/hover-activate/index.d.ts.map +1 -1
- package/components/edge-label/utils/style.d.ts.map +1 -1
- package/components/group-device/models/index.d.ts +1 -0
- package/components/group-device/models/index.d.ts.map +1 -1
- package/components/group-device/transforms/index.d.ts.map +1 -1
- package/components/group-device/utils/style.d.ts.map +1 -1
- package/components/node-device/utils/style.d.ts.map +1 -1
- package/components/shared/transforms/node-transform.d.ts.map +1 -1
- package/components/shared/utils/edge-utils/style.d.ts.map +1 -1
- package/components/shared/utils/group-utils/label-background.d.ts.map +1 -1
- package/components/shared/utils/node-utils/icon-style.d.ts.map +1 -1
- package/components/shared/utils/node-utils/label-background.d.ts.map +1 -1
- package/components/shared/utils/node-utils/state-styles.d.ts +2 -1
- package/components/shared/utils/node-utils/state-styles.d.ts.map +1 -1
- package/components/shared/utils/node-utils/status-style.d.ts.map +1 -1
- package/components/shared/utils/node-utils/text-style.d.ts.map +1 -1
- package/core/graph/data-manager.d.ts +4 -0
- package/core/graph/data-manager.d.ts.map +1 -1
- package/core/graph/graph.d.ts +37 -36
- package/core/graph/graph.d.ts.map +1 -1
- package/core/graph/group-manager.d.ts +98 -0
- package/core/graph/group-manager.d.ts.map +1 -0
- package/core/graph/index.d.ts +1 -0
- package/core/graph/index.d.ts.map +1 -1
- package/core/model/event.model.d.ts +16 -2
- package/core/model/event.model.d.ts.map +1 -1
- package/core/model/group.model.d.ts +78 -0
- package/core/model/group.model.d.ts.map +1 -1
- package/core/model/node.model.d.ts +9 -1
- package/core/model/node.model.d.ts.map +1 -1
- package/core/model/state.model.d.ts +6 -4
- package/core/model/state.model.d.ts.map +1 -1
- package/core/utils/bounding-box.d.ts +27 -0
- package/core/utils/bounding-box.d.ts.map +1 -0
- package/core/utils/group-validation.d.ts +51 -0
- package/core/utils/group-validation.d.ts.map +1 -0
- package/core/utils/index.d.ts +3 -0
- package/core/utils/index.d.ts.map +1 -1
- package/core/utils/lca-calculation.d.ts +36 -0
- package/core/utils/lca-calculation.d.ts.map +1 -0
- package/index.cjs +71 -71
- package/index.js +14338 -13791
- package/package.json +5 -1
- package/plugins/tooltip/index.d.ts.map +1 -1
|
@@ -2,6 +2,7 @@ import { ID } from '@antv/g6';
|
|
|
2
2
|
import { IconConfig } from './icon.model';
|
|
3
3
|
import { ImageConfig } from './image.model';
|
|
4
4
|
import { LabelConfig } from './label.model';
|
|
5
|
+
import { NodeStyleProperties } from './node.model';
|
|
5
6
|
import { GroupState } from './state.model';
|
|
6
7
|
export interface GroupData {
|
|
7
8
|
id: ID;
|
|
@@ -28,6 +29,61 @@ export interface GroupConfig {
|
|
|
28
29
|
highlight?: GroupHighlightType;
|
|
29
30
|
states?: GroupState[];
|
|
30
31
|
drillDownEnabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* State-based custom styling configuration.
|
|
34
|
+
* Allows customization of group appearance for different interaction states.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Style Priority Order:
|
|
38
|
+
* 1. Highlight styles (success, warning, error) - Highest priority
|
|
39
|
+
* 2. State-specific custom styles from stateStyles
|
|
40
|
+
* 3. Theme state styles
|
|
41
|
+
* 4. Theme default styles - Lowest priority
|
|
42
|
+
*
|
|
43
|
+
* State Priority when multiple states are active:
|
|
44
|
+
* - disabled > active > selected > default
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const groupConfig: GroupConfig = {
|
|
49
|
+
* type: 'device-group',
|
|
50
|
+
* stateStyles: {
|
|
51
|
+
* default: {
|
|
52
|
+
* backgroundColor: '#E3F2FD',
|
|
53
|
+
* borderColor: '#1976D2',
|
|
54
|
+
* borderWidth: 2,
|
|
55
|
+
* borderStyle: 'solid'
|
|
56
|
+
* },
|
|
57
|
+
* selected: {
|
|
58
|
+
* backgroundColor: '#BBDEFB',
|
|
59
|
+
* borderColor: '#0D47A1',
|
|
60
|
+
* borderWidth: 3,
|
|
61
|
+
* borderStyle: 'dashed'
|
|
62
|
+
* },
|
|
63
|
+
* active: {
|
|
64
|
+
* backgroundColor: '#90CAF9',
|
|
65
|
+
* borderColor: '#1565C0'
|
|
66
|
+
* },
|
|
67
|
+
* disabled: {
|
|
68
|
+
* backgroundColor: '#ECEFF1',
|
|
69
|
+
* borderColor: '#B0BEC5',
|
|
70
|
+
* borderWidth: 1,
|
|
71
|
+
* borderStyle: 'dotted'
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
* };
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
stateStyles?: {
|
|
78
|
+
/** Styles for the default (idle/normal) state */
|
|
79
|
+
default?: NodeStyleProperties;
|
|
80
|
+
/** Styles for the selected state */
|
|
81
|
+
selected?: NodeStyleProperties;
|
|
82
|
+
/** Styles for the active (hover) state */
|
|
83
|
+
active?: NodeStyleProperties;
|
|
84
|
+
/** Styles for the disabled state */
|
|
85
|
+
disabled?: NodeStyleProperties;
|
|
86
|
+
};
|
|
31
87
|
}
|
|
32
88
|
export type GroupHighlightType = 'success' | 'warning' | 'error' | 'default';
|
|
33
89
|
export type GroupType = 'circle-group' | 'rect-group' | 'device-group';
|
|
@@ -41,4 +97,26 @@ export type GroupEventData = {
|
|
|
41
97
|
ids: ID | ID[];
|
|
42
98
|
type: string;
|
|
43
99
|
};
|
|
100
|
+
export interface GroupCreatedEventData {
|
|
101
|
+
groupId: ID;
|
|
102
|
+
groupData: GroupData;
|
|
103
|
+
affectedElementIds: ID[];
|
|
104
|
+
previousParentIds: Map<ID, ID | undefined>;
|
|
105
|
+
sharedParentId?: ID | null;
|
|
106
|
+
lcaResult?: {
|
|
107
|
+
id: ID | null;
|
|
108
|
+
depth: number;
|
|
109
|
+
path: ID[];
|
|
110
|
+
};
|
|
111
|
+
timestamp: number;
|
|
112
|
+
operationId: string;
|
|
113
|
+
}
|
|
114
|
+
export interface GroupUngroupedEventData {
|
|
115
|
+
groupIds: ID[];
|
|
116
|
+
ungroupedData: GroupData[];
|
|
117
|
+
affectedElementIds: ID[];
|
|
118
|
+
newParentIds: Map<ID, ID | undefined>;
|
|
119
|
+
timestamp: number;
|
|
120
|
+
operationId: string;
|
|
121
|
+
}
|
|
44
122
|
//# sourceMappingURL=group.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.model.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/model/group.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,EAAE,CAAC;IACP,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,GACxE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAEhB,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,CAAC,EAAE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;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAGF,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,EAAE,CAAC;IACZ,SAAS,EAAE,SAAS,CAAC;IACrB,kBAAkB,EAAE,EAAE,EAAE,CAAC;IACzB,iBAAiB,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,EAAE,EAAE,CAAC;KACZ,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,EAAE,EAAE,CAAC;IACf,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,kBAAkB,EAAE,EAAE,EAAE,CAAC;IACzB,YAAY,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -84,7 +84,7 @@ export interface NodeConfig {
|
|
|
84
84
|
* 4. Theme default styles - Lowest priority
|
|
85
85
|
*
|
|
86
86
|
* State Priority when multiple states are active:
|
|
87
|
-
* - disabled > active > selected > default
|
|
87
|
+
* - disabled > readonly > active > selected > default
|
|
88
88
|
*
|
|
89
89
|
* @example
|
|
90
90
|
* ```typescript
|
|
@@ -112,6 +112,12 @@ export interface NodeConfig {
|
|
|
112
112
|
* borderColor: '#B0BEC5',
|
|
113
113
|
* borderWidth: 1,
|
|
114
114
|
* borderStyle: 'dotted'
|
|
115
|
+
* },
|
|
116
|
+
* readonly: {
|
|
117
|
+
* backgroundColor: '#F5F5F5',
|
|
118
|
+
* borderColor: '#9E9E9E',
|
|
119
|
+
* borderWidth: 2,
|
|
120
|
+
* borderStyle: 'solid'
|
|
115
121
|
* }
|
|
116
122
|
* }
|
|
117
123
|
* };
|
|
@@ -126,6 +132,8 @@ export interface NodeConfig {
|
|
|
126
132
|
active?: NodeStyleProperties;
|
|
127
133
|
/** Styles for the disabled state */
|
|
128
134
|
disabled?: NodeStyleProperties;
|
|
135
|
+
/** Styles for the readonly state */
|
|
136
|
+
readonly?: NodeStyleProperties;
|
|
129
137
|
};
|
|
130
138
|
}
|
|
131
139
|
export type NodeType = 'circle-node' | 'rect-node' | 'device-node';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.model.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/model/node.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,EAAE,CAAC;IACP,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC1D,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,WAAW,CA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E;QACZ,iDAAiD;QACjD,OAAO,CAAC,EAAE,mBAAmB,CAAC;QAC9B,oCAAoC;QACpC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;QAC/B,0CAA0C;QAC1C,MAAM,CAAC,EAAE,mBAAmB,CAAC;QAC7B,oCAAoC;QACpC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;QAC/B,oCAAoC;QACpC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;KAChC,CAAC;CACH;AAED,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa,CAAC;AAEnE,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,GACrE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export type CommonState = 'default' | 'active' | 'selected' | 'disabled';
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
1
|
+
export type CommonState = 'default' | 'active' | 'selected' | 'disabled' | 'readonly';
|
|
2
|
+
export type ElementManagementState = 'locked' | 'frozen' | 'hidden';
|
|
3
|
+
export type GroupManagementState = 'collapsed';
|
|
4
|
+
export type NodeState = CommonState | FixElementState | ElementManagementState;
|
|
5
|
+
export type EdgeState = CommonState | FixElementState | ElementManagementState;
|
|
6
|
+
export type GroupState = CommonState | FixElementState | ElementManagementState | GroupManagementState;
|
|
5
7
|
export type FixElementState = 'fixed';
|
|
6
8
|
export type MxNodeState = NodeState;
|
|
7
9
|
//# sourceMappingURL=state.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.model.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/model/state.model.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"state.model.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/model/state.model.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAGf,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,eAAe,GAAG,sBAAsB,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,eAAe,GAAG,sBAAsB,CAAC;AAE/E,MAAM,MAAM,UAAU,GAClB,WAAW,GACX,eAAe,GACf,sBAAsB,GACtB,oBAAoB,CAAC;AAGzB,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;AAGtC,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ID } from '@antv/g6';
|
|
2
|
+
export interface BoundingBox {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ElementBounds {
|
|
9
|
+
id: ID;
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Calculates the bounding box that encompasses all given elements
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateBoundingBox(elements: ElementBounds[]): BoundingBox | null;
|
|
19
|
+
/**
|
|
20
|
+
* Updates bounding box with padding
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyPadding(bbox: BoundingBox, padding: number): BoundingBox;
|
|
23
|
+
/**
|
|
24
|
+
* Merges multiple bounding boxes into one
|
|
25
|
+
*/
|
|
26
|
+
export declare function mergeBoundingBoxes(boxes: BoundingBox[]): BoundingBox | null;
|
|
27
|
+
//# sourceMappingURL=bounding-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounding-box.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/utils/bounding-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,EAAE,CAAC;IACP,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,aAAa,EAAE,GACxB,WAAW,GAAG,IAAI,CA4BpB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CAO5E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,GAAG,IAAI,CAc3E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ID } from '@antv/g6';
|
|
2
|
+
import { ElementType } from '../model';
|
|
3
|
+
export declare const MAX_GROUP_DEPTH = 5;
|
|
4
|
+
export type ElementState = 'locked' | 'frozen' | 'hidden' | 'collapsed' | 'normal';
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ElementWithState {
|
|
10
|
+
id: ID;
|
|
11
|
+
type: ElementType;
|
|
12
|
+
state?: ElementState;
|
|
13
|
+
parentId?: ID;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validates minimum selection requirement for group creation
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateMinimumSelection(elementIds: ID[]): ValidationResult;
|
|
19
|
+
/**
|
|
20
|
+
* Validates element states for group operations
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateElementStates(elements: ElementWithState[], operation: 'create' | 'ungroup'): ValidationResult;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if elements have parent-child relationship
|
|
25
|
+
*/
|
|
26
|
+
export declare function hasParentChildRelationship(elements: ElementWithState[], getAncestors: (id: ID) => ID[]): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Validates that selection doesn't include parent-child relationships
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateParentChildRelationships(elements: ElementWithState[], getAncestors: (id: ID) => ID[]): ValidationResult;
|
|
31
|
+
/**
|
|
32
|
+
* Calculates the depth of an element in the hierarchy
|
|
33
|
+
*/
|
|
34
|
+
export declare function calculateElementDepth(elementId: ID, getParent: (id: ID) => ID | undefined): number;
|
|
35
|
+
/**
|
|
36
|
+
* Calculates maximum depth after group operation
|
|
37
|
+
*/
|
|
38
|
+
export declare function calculateMaxDepthAfterGrouping(selectedElements: ElementWithState[], lcaDepth: number, getDescendants: (id: ID) => ElementWithState[]): number;
|
|
39
|
+
/**
|
|
40
|
+
* Validates depth limit for group operation
|
|
41
|
+
*/
|
|
42
|
+
export declare function validateDepthLimit(selectedElements: ElementWithState[], lcaDepth: number, getDescendants: (id: ID) => ElementWithState[]): ValidationResult;
|
|
43
|
+
/**
|
|
44
|
+
* Validates complete group selection (no partial selection)
|
|
45
|
+
*/
|
|
46
|
+
export declare function validateCompleteGroupSelection(selectedIds: Set<ID>, getChildren: (id: ID) => ID[]): ValidationResult;
|
|
47
|
+
/**
|
|
48
|
+
* Validates that selection contains only groups for ungroup operation
|
|
49
|
+
*/
|
|
50
|
+
export declare function validateGroupsOnly(elements: ElementWithState[]): ValidationResult;
|
|
51
|
+
//# sourceMappingURL=group-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-validation.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/utils/group-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,eAAO,MAAM,eAAe,IAAI,CAAC;AAGjC,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,QAAQ,CAAC;AAEb,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,EAAE,CAAC;IACP,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAQ3E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,SAAS,EAAE,QAAQ,GAAG,SAAS,GAC9B,gBAAgB,CAoClB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,GAC7B,OAAO,CAeT;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,GAC7B,gBAAgB,CAQlB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,EAAE,EACb,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,SAAS,GACpC,MAAM,CAYR;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,gBAAgB,EAAE,EACpC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,gBAAgB,EAAE,GAC7C,MAAM,CAoDR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,gBAAgB,EAAE,gBAAgB,EAAE,EACpC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,gBAAgB,EAAE,GAC7C,gBAAgB,CAelB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,EACpB,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,GAC5B,gBAAgB,CAgBlB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,gBAAgB,EAAE,GAC3B,gBAAgB,CAWlB"}
|
package/core/utils/index.d.ts
CHANGED
|
@@ -6,4 +6,7 @@ export * from './rect.helper';
|
|
|
6
6
|
export * from './state.helper';
|
|
7
7
|
export * from './theme.helper';
|
|
8
8
|
export * from './tree.helper';
|
|
9
|
+
export * from './group-validation';
|
|
10
|
+
export * from './lca-calculation';
|
|
11
|
+
export * from './bounding-box';
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ID } from '@antv/g6';
|
|
2
|
+
export interface LCAResult {
|
|
3
|
+
id: ID | null;
|
|
4
|
+
depth: number;
|
|
5
|
+
path: ID[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Builds the path from root to the given element
|
|
9
|
+
* @param elementId - The element ID to build path for
|
|
10
|
+
* @param getParent - Function to get parent ID
|
|
11
|
+
* @param maxDepth - Safety limit to prevent infinite loops (default: MAX_GROUP_DEPTH)
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildParentPath(elementId: ID, getParent: (id: ID) => ID | undefined, maxDepth?: number): ID[];
|
|
14
|
+
/**
|
|
15
|
+
* Calculates the Lowest Common Ancestor of multiple elements.
|
|
16
|
+
*
|
|
17
|
+
* The returned LCA is the deepest common ancestor that will become
|
|
18
|
+
* the parent of a newly created group containing all selected elements.
|
|
19
|
+
*
|
|
20
|
+
* Path format: [root_ancestor, ..., parent, element]
|
|
21
|
+
* - paths[0][0] is the root-most ancestor
|
|
22
|
+
* - paths[0][length-1] is the element itself
|
|
23
|
+
*/
|
|
24
|
+
export declare function calculateLCA(elementIds: ID[], getParent: (id: ID) => ID | undefined): LCAResult;
|
|
25
|
+
/**
|
|
26
|
+
* Cache for parent paths to optimize repeated LCA calculations
|
|
27
|
+
*/
|
|
28
|
+
export declare class ParentPathCache {
|
|
29
|
+
private getParent;
|
|
30
|
+
private cache;
|
|
31
|
+
constructor(getParent: (id: ID) => ID | undefined);
|
|
32
|
+
getPath(elementId: ID): ID[];
|
|
33
|
+
clear(): void;
|
|
34
|
+
invalidate(elementIds: ID[]): void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=lca-calculation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lca-calculation.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/core/utils/lca-calculation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAG9B,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,EAAE,EAAE,CAAC;CACZ;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,EAAE,EACb,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,SAAS,EACrC,QAAQ,SAAkB,GACzB,EAAE,EAAE,CAwBN;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,EAAE,EAAE,EAChB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,SAAS,GACpC,SAAS,CAoDX;AAED;;GAEG;AACH,qBAAa,eAAe;IAGd,OAAO,CAAC,SAAS;IAF7B,OAAO,CAAC,KAAK,CAAuB;gBAEhB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,SAAS;IAEzD,OAAO,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE;IAO5B,KAAK,IAAI,IAAI;IAIb,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE,GAAG,IAAI;CAMnC"}
|