@moxa/graph 3.0.0-beta.13 → 3.0.0-beta.15
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/collapse-expand/index.d.ts.map +1 -1
- package/behaviors/drill-down/drill-down-manager.d.ts +57 -22
- package/behaviors/drill-down/drill-down-manager.d.ts.map +1 -1
- package/behaviors/drill-down/index.d.ts +9 -17
- package/behaviors/drill-down/index.d.ts.map +1 -1
- package/behaviors/drill-down/models/index.d.ts +165 -1
- package/behaviors/drill-down/models/index.d.ts.map +1 -1
- package/components/group-device/index.d.ts +25 -2
- package/components/group-device/index.d.ts.map +1 -1
- package/components/group-device/models/index.d.ts +9 -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/shared/utils/edge-utils/endpoint.d.ts +1 -1
- package/components/shared/utils/edge-utils/endpoint.d.ts.map +1 -1
- package/components/shared/utils/group-utils/drill-icon.d.ts +1 -4
- package/components/shared/utils/group-utils/drill-icon.d.ts.map +1 -1
- package/components/shared/utils/group-utils/index.d.ts +2 -1
- package/components/shared/utils/group-utils/index.d.ts.map +1 -1
- package/components/shared/utils/group-utils/label-background.d.ts +7 -4
- package/components/shared/utils/group-utils/label-background.d.ts.map +1 -1
- package/components/shared/utils/group-utils/label-layout.d.ts +87 -0
- package/components/shared/utils/group-utils/label-layout.d.ts.map +1 -0
- package/components/shared/utils/index.d.ts +1 -0
- package/components/shared/utils/index.d.ts.map +1 -1
- package/core/graph/graph.d.ts +5 -4
- package/core/graph/graph.d.ts.map +1 -1
- package/core/model/group.model.d.ts +10 -0
- package/core/model/group.model.d.ts.map +1 -1
- package/core/utils/graph.helper.d.ts +14 -0
- package/core/utils/graph.helper.d.ts.map +1 -1
- package/index.cjs +75 -75
- package/index.js +13683 -13324
- package/package.json +1 -1
- package/plugins/history/tests/helpers/history-test-utils.d.ts +20 -0
- package/plugins/history/tests/helpers/history-test-utils.d.ts.map +1 -0
- package/plugins/hull/{hull-events.d.ts → config/hull-events.d.ts} +1 -1
- package/plugins/hull/config/hull-events.d.ts.map +1 -0
- package/plugins/hull/{hull-metadata.d.ts → config/hull-metadata.d.ts} +1 -1
- package/plugins/hull/config/hull-metadata.d.ts.map +1 -0
- package/plugins/hull/index.d.ts +12 -6
- package/plugins/hull/index.d.ts.map +1 -1
- package/plugins/hull/{hull.model.d.ts → model/hull.model.d.ts} +103 -7
- package/plugins/hull/model/hull.model.d.ts.map +1 -0
- package/plugins/hull/model/index.d.ts +2 -0
- package/plugins/hull/model/index.d.ts.map +1 -0
- package/shared/utils/helpers/clean-object.d.ts.map +1 -0
- package/shared/utils/helpers/code-highlight.d.ts.map +1 -0
- package/shared/utils/{utils → helpers}/index.d.ts +1 -0
- package/shared/utils/helpers/index.d.ts.map +1 -0
- package/shared/utils/helpers/node-util.d.ts.map +1 -0
- package/shared/utils/helpers/random.d.ts +6 -0
- package/shared/utils/helpers/random.d.ts.map +1 -0
- package/shared/utils/index.d.ts +1 -1
- package/shared/utils/index.d.ts.map +1 -1
- package/plugins/hull/hull-events.d.ts.map +0 -1
- package/plugins/hull/hull-metadata.d.ts.map +0 -1
- package/plugins/hull/hull.model.d.ts.map +0 -1
- package/shared/utils/utils/clean-object.d.ts.map +0 -1
- package/shared/utils/utils/code-highlight.d.ts.map +0 -1
- package/shared/utils/utils/index.d.ts.map +0 -1
- package/shared/utils/utils/node-util.d.ts.map +0 -1
- /package/shared/utils/{utils → helpers}/clean-object.d.ts +0 -0
- /package/shared/utils/{utils → helpers}/code-highlight.d.ts +0 -0
- /package/shared/utils/{utils → helpers}/node-util.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/behaviors/collapse-expand/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAExD,eAAO,MAAM,yBAAyB,EAAE,gBAAgB,CACtD,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/behaviors/collapse-expand/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAExD,eAAO,MAAM,yBAAyB,EAAE,gBAAgB,CACtD,qBAAqB,CAwBpB,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Graph as G6Graph, Point } from '@antv/g6';
|
|
2
|
+
import { GraphData } from '../../core/model';
|
|
3
|
+
import { DrillIntoGroupOptions } from './models';
|
|
2
4
|
export interface DrillDownState {
|
|
3
5
|
navigationStack: string[];
|
|
4
6
|
originalViewport: {
|
|
5
7
|
zoom: number;
|
|
6
8
|
position: Point;
|
|
7
9
|
} | null;
|
|
10
|
+
dataStack: GraphData[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
10
13
|
* DrillDownManager handles all drill-down navigation logic
|
|
@@ -16,39 +19,26 @@ export declare class DrillDownManager {
|
|
|
16
19
|
private state;
|
|
17
20
|
constructor(g6Graph: G6Graph);
|
|
18
21
|
/**
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
private getAllElementData;
|
|
22
|
-
/**
|
|
23
|
-
* 計算指定群組的可見元素 ID 集合
|
|
24
|
-
* 注意:不包含被鑽入的群組本身,只顯示其子元素
|
|
25
|
-
*/
|
|
26
|
-
private getVisibleIds;
|
|
27
|
-
/**
|
|
28
|
-
* 根據可見性更新所有元素的顯示狀態
|
|
29
|
-
* @param visibleIds - 可見元素 ID 集合,null 表示顯示所有元素
|
|
30
|
-
*/
|
|
31
|
-
private updateVisibility;
|
|
32
|
-
/**
|
|
33
|
-
* Get current drill-down state
|
|
22
|
+
* Get current drill-down state (deep copy to prevent external mutations)
|
|
34
23
|
*/
|
|
35
24
|
getState(): DrillDownState;
|
|
36
25
|
/**
|
|
37
|
-
* Set drill-down state
|
|
26
|
+
* Set drill-down state (deep copy to prevent external mutations)
|
|
38
27
|
*/
|
|
39
28
|
setState(state: DrillDownState): void;
|
|
40
29
|
/**
|
|
41
|
-
*
|
|
30
|
+
* Orchestrates the drill-down process into a specific group.
|
|
31
|
+
* Handles validation, state persistence, data preparation, and synchronized rendering.
|
|
42
32
|
*/
|
|
43
|
-
drillIntoGroup(groupId: string): void
|
|
33
|
+
drillIntoGroup(groupId: string, options?: DrillIntoGroupOptions): Promise<void>;
|
|
44
34
|
/**
|
|
45
|
-
* Drill out to parent level
|
|
35
|
+
* Drill out to parent level by restoring saved data
|
|
46
36
|
*/
|
|
47
|
-
drillOutOfGroup(): void
|
|
37
|
+
drillOutOfGroup(): Promise<void>;
|
|
48
38
|
/**
|
|
49
|
-
* Reset to root view
|
|
39
|
+
* Reset to root view by restoring original data
|
|
50
40
|
*/
|
|
51
|
-
resetDrill(): void
|
|
41
|
+
resetDrill(): Promise<void>;
|
|
52
42
|
/**
|
|
53
43
|
* Check if currently navigating
|
|
54
44
|
*/
|
|
@@ -65,5 +55,50 @@ export declare class DrillDownManager {
|
|
|
65
55
|
* Cleanup
|
|
66
56
|
*/
|
|
67
57
|
destroy(): void;
|
|
58
|
+
/** ---------------------------------------------------------
|
|
59
|
+
* Private Helper Methods
|
|
60
|
+
* --------------------------------------------------------- */
|
|
61
|
+
/**
|
|
62
|
+
* Validates if the drill-down can proceed based on current state and existence.
|
|
63
|
+
*/
|
|
64
|
+
private canDrillDown;
|
|
65
|
+
/**
|
|
66
|
+
* Persists current graph state and viewport before navigation.
|
|
67
|
+
* Uses deep copy to prevent data corruption from subsequent modifications.
|
|
68
|
+
*/
|
|
69
|
+
private persistCurrentState;
|
|
70
|
+
/**
|
|
71
|
+
* Handles the default library rendering logic.
|
|
72
|
+
*/
|
|
73
|
+
private handleDefaultRender;
|
|
74
|
+
/**
|
|
75
|
+
* Invokes and manages the developer's custom drill action.
|
|
76
|
+
*/
|
|
77
|
+
private handleCustomAction;
|
|
78
|
+
/**
|
|
79
|
+
* Updates navigation stacks and triggers post-drill hooks/events.
|
|
80
|
+
*/
|
|
81
|
+
private finalizeDrillDown;
|
|
82
|
+
/**
|
|
83
|
+
* Reverts the state in case of a rendering or custom action failure.
|
|
84
|
+
* @param error - The error that triggered the rollback
|
|
85
|
+
* @param navDepthBefore - The navigation stack depth before the operation (optional)
|
|
86
|
+
*/
|
|
87
|
+
private rollback;
|
|
88
|
+
/** ---------------------------------------------------------
|
|
89
|
+
* Implementation of Missing Methods
|
|
90
|
+
* --------------------------------------------------------- */
|
|
91
|
+
/**
|
|
92
|
+
* Prepares the graph data for drilling, considering default logic and before-hooks.
|
|
93
|
+
*/
|
|
94
|
+
private prepareDrillData;
|
|
95
|
+
/**
|
|
96
|
+
* Creates the helper utility object passed to custom drill actions.
|
|
97
|
+
*/
|
|
98
|
+
private createDrillHelpers;
|
|
99
|
+
/**
|
|
100
|
+
* Helper method: Create GraphData from children
|
|
101
|
+
*/
|
|
102
|
+
private createGraphDataFromChildren;
|
|
68
103
|
}
|
|
69
104
|
//# sourceMappingURL=drill-down-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drill-down-manager.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/behaviors/drill-down/drill-down-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"drill-down-manager.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/behaviors/drill-down/drill-down-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAY,SAAS,EAAuB,MAAM,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CAAC,kBAAkB;IAgB1B;;OAEG;IACH,OAAO,CAAC,2BAA2B;CAoCpC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseBehavior, RuntimeContext } from '@antv/g6';
|
|
2
2
|
import { BehaviorFunction } from '../../core/model';
|
|
3
3
|
import { DrillDownState } from './drill-down-manager';
|
|
4
|
-
import { DrillDownOptions } from './models';
|
|
5
|
-
export type { DrillDownOptions } from './models';
|
|
4
|
+
import { DrillDownOptions, DrillIntoGroupOptions } from './models';
|
|
6
5
|
export type { DrillDownState } from './drill-down-manager';
|
|
6
|
+
export type { CustomDrillHandler, DrillAfterContext, DrillBeforeContext, DrillBeforeResult, DrillCustomContext, DrillCustomHelpers, DrillDownOptions, DrillIntoGroupOptions, } from './models';
|
|
7
7
|
/**
|
|
8
8
|
* Behavior function for backward compatibility
|
|
9
9
|
* @internal
|
|
@@ -20,16 +20,18 @@ declare class DrillDown extends BaseBehavior<DrillDownOptions> {
|
|
|
20
20
|
/**
|
|
21
21
|
* Drill into a group to view only its children
|
|
22
22
|
* @param groupId - ID of the group to drill into
|
|
23
|
+
* @param options - Optional drill options with callbacks and settings.
|
|
24
|
+
* If not provided, uses behavior's configured options.
|
|
23
25
|
*/
|
|
24
|
-
drillIntoGroup(groupId: string): void
|
|
26
|
+
drillIntoGroup(groupId: string, options?: DrillIntoGroupOptions): Promise<void>;
|
|
25
27
|
/**
|
|
26
28
|
* Go back to the previous drill level
|
|
27
29
|
*/
|
|
28
|
-
drillOutOfGroup(): void
|
|
30
|
+
drillOutOfGroup(): Promise<void>;
|
|
29
31
|
/**
|
|
30
32
|
* Reset drill navigation to the root level
|
|
31
33
|
*/
|
|
32
|
-
resetDrill(): void
|
|
34
|
+
resetDrill(): Promise<void>;
|
|
33
35
|
/**
|
|
34
36
|
* Get the current drill-down state
|
|
35
37
|
* @returns Current drill-down state
|
|
@@ -42,26 +44,16 @@ declare class DrillDown extends BaseBehavior<DrillDownOptions> {
|
|
|
42
44
|
setDrillDownState(state: DrillDownState): void;
|
|
43
45
|
/**
|
|
44
46
|
* Get event handlers
|
|
47
|
+
* Note: Click handling is now done by the group-device component
|
|
48
|
+
* which calls this behavior's drillIntoGroup method directly
|
|
45
49
|
*/
|
|
46
50
|
getEvents: () => {
|
|
47
51
|
[key: string]: (event: any) => void;
|
|
48
52
|
};
|
|
49
|
-
/**
|
|
50
|
-
* Handle combo (group) click events
|
|
51
|
-
*/
|
|
52
|
-
private handleComboClick;
|
|
53
53
|
/**
|
|
54
54
|
* Update behavior options
|
|
55
55
|
*/
|
|
56
56
|
update(options: Partial<DrillDownOptions>): void;
|
|
57
|
-
/**
|
|
58
|
-
* Bind event handlers
|
|
59
|
-
*/
|
|
60
|
-
private bindEvents;
|
|
61
|
-
/**
|
|
62
|
-
* Unbind event handlers
|
|
63
|
-
*/
|
|
64
|
-
private unbindEvents;
|
|
65
57
|
/**
|
|
66
58
|
* Destroy the behavior
|
|
67
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/behaviors/drill-down/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/behaviors/drill-down/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIZ,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAY,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAoB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAExE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,gBAAgB,CASjE,CAAC;AAEJ;;;GAGG;AACH,cAAM,SAAU,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IACpD,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAE9C;IAEF,OAAO,CAAC,OAAO,CAAmB;gBAEtB,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB;IAM9D;;;;;OAKG;IACU,cAAc,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAahB;;OAEG;IACU,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7C;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxC;;;OAGG;IACI,iBAAiB,IAAI,cAAc;IAI1C;;;OAGG;IACI,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAIrD;;;;OAIG;IACI,SAAS,QAAO;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;KAAE,CAE5D;IAEF;;OAEG;IACa,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAIhE;;OAEG;IACa,OAAO;CAIxB;AAMD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,7 +1,171 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Graph as MxGraph } from '../../../core/graph';
|
|
2
|
+
import { BehaviorBaseOptions, GraphData, GroupData, NodeData } from '../../../core/model';
|
|
2
3
|
/**
|
|
3
4
|
* DrillDownOptions interface defines drill-down behavior options
|
|
4
5
|
*/
|
|
5
6
|
export interface DrillDownOptions extends BehaviorBaseOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Callback invoked before drilling into a group
|
|
9
|
+
* Allows custom data loading, validation, and filtering
|
|
10
|
+
*/
|
|
11
|
+
onDrillBefore?: (context: DrillBeforeContext) => DrillBeforeResult | Promise<DrillBeforeResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Callback invoked after drilling into a group
|
|
14
|
+
* Allows analytics, state updates, and post-drill logic
|
|
15
|
+
*/
|
|
16
|
+
onDrillAfter?: (context: DrillAfterContext) => void | Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Custom drill handler for full takeover mode
|
|
19
|
+
* When provided, takes complete control of the drill operation
|
|
20
|
+
*/
|
|
21
|
+
customDrillAction?: CustomDrillHandler;
|
|
6
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Options for drillIntoGroup operation
|
|
25
|
+
*/
|
|
26
|
+
export interface DrillIntoGroupOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Before drill hook - can modify/replace data source
|
|
29
|
+
*/
|
|
30
|
+
onDrillBefore?: (context: DrillBeforeContext) => DrillBeforeResult | Promise<DrillBeforeResult>;
|
|
31
|
+
/**
|
|
32
|
+
* After drill hook - handle logic after completion
|
|
33
|
+
*/
|
|
34
|
+
onDrillAfter?: (context: DrillAfterContext) => void | Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Custom drill handler for full takeover mode
|
|
37
|
+
*/
|
|
38
|
+
customDrillAction?: CustomDrillHandler;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Context provided to onDrillBefore hook
|
|
42
|
+
*/
|
|
43
|
+
export interface DrillBeforeContext {
|
|
44
|
+
/**
|
|
45
|
+
* ID of the group being drilled into
|
|
46
|
+
*/
|
|
47
|
+
groupId: string;
|
|
48
|
+
/**
|
|
49
|
+
* Group data object
|
|
50
|
+
*/
|
|
51
|
+
groupData: GroupData;
|
|
52
|
+
/**
|
|
53
|
+
* Default children that would be shown
|
|
54
|
+
*/
|
|
55
|
+
defaultChildren: (NodeData | GroupData)[];
|
|
56
|
+
/**
|
|
57
|
+
* Graph instance
|
|
58
|
+
*/
|
|
59
|
+
graph: MxGraph;
|
|
60
|
+
/**
|
|
61
|
+
* Current navigation stack
|
|
62
|
+
*/
|
|
63
|
+
navigationStack: string[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Result object returned by onDrillBefore hook
|
|
67
|
+
*/
|
|
68
|
+
export interface DrillBeforeResult {
|
|
69
|
+
/**
|
|
70
|
+
* Whether to proceed with drill operation (default: true)
|
|
71
|
+
*/
|
|
72
|
+
proceed?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Custom children to display instead of default
|
|
75
|
+
*/
|
|
76
|
+
customChildren?: (NodeData | GroupData)[];
|
|
77
|
+
/**
|
|
78
|
+
* Complete custom graph data (overrides everything else)
|
|
79
|
+
*/
|
|
80
|
+
customGraphData?: GraphData;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Context provided to onDrillAfter hook
|
|
84
|
+
*/
|
|
85
|
+
export interface DrillAfterContext {
|
|
86
|
+
/**
|
|
87
|
+
* ID of the group that was drilled into
|
|
88
|
+
*/
|
|
89
|
+
groupId: string;
|
|
90
|
+
/**
|
|
91
|
+
* Previous graph data before drilling
|
|
92
|
+
*/
|
|
93
|
+
previousData: GraphData;
|
|
94
|
+
/**
|
|
95
|
+
* New graph data after drilling
|
|
96
|
+
*/
|
|
97
|
+
newData: GraphData;
|
|
98
|
+
/**
|
|
99
|
+
* Updated navigation stack
|
|
100
|
+
*/
|
|
101
|
+
navigationStack: string[];
|
|
102
|
+
/**
|
|
103
|
+
* Graph instance
|
|
104
|
+
*/
|
|
105
|
+
graph: MxGraph;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Helper methods provided to custom drill handlers
|
|
109
|
+
*/
|
|
110
|
+
export interface DrillCustomHelpers {
|
|
111
|
+
/**
|
|
112
|
+
* Create GraphData from children elements (same logic as library default)
|
|
113
|
+
*/
|
|
114
|
+
createGraphDataFromChildren: (children: (NodeData | GroupData)[]) => GraphData;
|
|
115
|
+
/**
|
|
116
|
+
* Save current graph state to data stack
|
|
117
|
+
*/
|
|
118
|
+
saveCurrentState: () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Update navigation stack with new group ID
|
|
121
|
+
*/
|
|
122
|
+
updateNavigationStack: (groupId: string) => void;
|
|
123
|
+
/**
|
|
124
|
+
* Emit drill down event for UI updates
|
|
125
|
+
*/
|
|
126
|
+
emitDrillEvent: (data: {
|
|
127
|
+
groupId: string;
|
|
128
|
+
navigationStack: string[];
|
|
129
|
+
children: (NodeData | GroupData)[];
|
|
130
|
+
}) => void;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Context provided to custom drill handlers in full takeover mode
|
|
134
|
+
*/
|
|
135
|
+
export interface DrillCustomContext {
|
|
136
|
+
/**
|
|
137
|
+
* ID of the group being drilled into
|
|
138
|
+
*/
|
|
139
|
+
groupId: string;
|
|
140
|
+
/**
|
|
141
|
+
* Group data object
|
|
142
|
+
*/
|
|
143
|
+
groupData: GroupData;
|
|
144
|
+
/**
|
|
145
|
+
* Default children that would be shown (for reference)
|
|
146
|
+
*/
|
|
147
|
+
defaultChildren: (NodeData | GroupData)[];
|
|
148
|
+
/**
|
|
149
|
+
* Graph instance
|
|
150
|
+
*/
|
|
151
|
+
graph: MxGraph;
|
|
152
|
+
/**
|
|
153
|
+
* Current navigation stack (read-only reference)
|
|
154
|
+
*/
|
|
155
|
+
navigationStack: string[];
|
|
156
|
+
/**
|
|
157
|
+
* Helper methods for common operations
|
|
158
|
+
*/
|
|
159
|
+
helpers: DrillCustomHelpers;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Custom drill handler function for full takeover mode
|
|
163
|
+
* @param context - Context with graph data and helper methods
|
|
164
|
+
* @returns Promise<boolean> | boolean
|
|
165
|
+
* - `true` or `void`: Drill operation succeeded
|
|
166
|
+
* - `false`: Explicitly cancel the operation and trigger rollback.
|
|
167
|
+
* This will restore the previous graph state and throw an error.
|
|
168
|
+
* Use this when you need to abort due to validation failure or other issues.
|
|
169
|
+
*/
|
|
170
|
+
export type CustomDrillHandler = (context: DrillCustomContext) => Promise<boolean | void> | boolean | void;
|
|
7
171
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/behaviors/drill-down/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/behaviors/drill-down/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D;;;OAGG;IACH,aAAa,CAAC,EAAE,CACd,OAAO,EAAE,kBAAkB,KACxB,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEpD;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpE;;;OAGG;IACH,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,CACd,OAAO,EAAE,kBAAkB,KACxB,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpD;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE;;OAEG;IACH,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAk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AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,eAAe,EAAE,CAAC,QAAQ,GAAG,SAAS,CAAC,EAAE,CAAC;IAC1C;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;;OAEG;IACH,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,kBAAkB,KACxB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC"}
|
|
@@ -22,6 +22,17 @@ export declare class DeviceGroup extends CircleCombo {
|
|
|
22
22
|
* Get enhanced attributes for label based on collapsed state
|
|
23
23
|
*/
|
|
24
24
|
private getLabelEnhancedAttrs;
|
|
25
|
+
/**
|
|
26
|
+
* Calculate label X offset using centralized layout configuration
|
|
27
|
+
*
|
|
28
|
+
* Uses getLabelLayoutConfig to handle 4 scenarios:
|
|
29
|
+
* 1. LABEL_ONLY: No offset
|
|
30
|
+
* 2. STATUS_LABEL: Offset right to balance status icon
|
|
31
|
+
* 3. LABEL_DRILL: No offset, background handles drill icon
|
|
32
|
+
* 4. STATUS_LABEL_DRILL: Center between both icons
|
|
33
|
+
*/
|
|
34
|
+
private calculateLabelOffsetX;
|
|
35
|
+
private calculateLabelOffsetY;
|
|
25
36
|
/**
|
|
26
37
|
* Get label bounds from rendered label shape
|
|
27
38
|
*/
|
|
@@ -36,6 +47,8 @@ export declare class DeviceGroup extends CircleCombo {
|
|
|
36
47
|
private getStatusIconSrc;
|
|
37
48
|
getDeviceCountStyle(attrs: Required<DeviceGroupStyleProps>): TextStyleProps | false;
|
|
38
49
|
private calculateDeviceCount;
|
|
50
|
+
private getShadowStyle;
|
|
51
|
+
private drawShadowShape;
|
|
39
52
|
getCollapseButtonStyle(attrs: Required<DeviceGroupStyleProps>): ImageStyleProps | false;
|
|
40
53
|
getDrillDownIconStyle(attrs: Required<DeviceGroupStyleProps>): ImageStyleProps | false;
|
|
41
54
|
getTitleBackgroundStyle(attrs: Required<DeviceGroupStyleProps>): RectStyleProps | false;
|
|
@@ -50,9 +63,19 @@ export declare class DeviceGroup extends CircleCombo {
|
|
|
50
63
|
render(attrs: Required<DeviceGroupStyleProps>, container: Group): void;
|
|
51
64
|
onframe(): void;
|
|
52
65
|
/**
|
|
53
|
-
*
|
|
66
|
+
* Brings the group and its child nodes to the front when selected
|
|
67
|
+
* This allows users to see and interact with the group and its children above other groups
|
|
68
|
+
*/
|
|
69
|
+
private ensureGroupOnTopWhenSelected;
|
|
70
|
+
/**
|
|
71
|
+
* Brings child nodes to front when the group is hovered (active state)
|
|
72
|
+
* This allows users to interact with child nodes while hovering
|
|
73
|
+
*/
|
|
74
|
+
private ensureChildrenOnTopWhenHover;
|
|
75
|
+
/**
|
|
76
|
+
* Brings all child nodes within this group to the front
|
|
54
77
|
*/
|
|
55
|
-
private
|
|
78
|
+
private bringChildrenToFront;
|
|
56
79
|
animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import('@antv/g').IAnimation | null;
|
|
57
80
|
/**
|
|
58
81
|
* Clean up event listeners to prevent memory leaks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/components/group-device/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,IAAI,iBAAiB,EACrC,KAAK,EACL,KAAK,EACL,eAAe,EACf,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,WAAW,EAEX,cAAc,EAEd,KAAK,EAEN,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAU7C,OAAO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CAAC,EAEtC,SAAS,EAAE,KAAK;IA4GlB,wBAAwB,CACtB,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,SAAS,EAAE,KAAK;IAUlB,wBAAwB,CACtB,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,SAAS,EAAE,KAAK;IAUT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,KAAK;IAwB/D,OAAO;IAuBhB;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAepC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAYpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAoBnB,OAAO,CACd,SAAS,EAAE,QAAQ,EAAE,EACrB,OAAO,CAAC,EAAE,MAAM,GAAG,wBAAwB;IAK7C;;OAEG;IACM,OAAO,IAAI,IAAI;CAwCzB"}
|
|
@@ -6,6 +6,7 @@ export interface DeviceGroupStyleProps extends CircleComboStyleProps {
|
|
|
6
6
|
labelStatus: GroupLabel['status'];
|
|
7
7
|
labelCustomBackground: GroupLabel['background'];
|
|
8
8
|
drillDownEnabled?: boolean;
|
|
9
|
+
collapsible?: boolean;
|
|
9
10
|
stateStyles: GroupConfig['stateStyles'];
|
|
10
11
|
}
|
|
11
12
|
export declare const TITLE_KEY = "title";
|
|
@@ -24,4 +25,12 @@ export declare const DRILL_DOWN_ICON_SIZE = 16;
|
|
|
24
25
|
export declare const COLLAPSE_BUTTON_SIZE = 16;
|
|
25
26
|
export declare const COLLAPSE_BUTTON_BG_SIZE = 24;
|
|
26
27
|
export declare const DEVICE_COUNT_FONT_SIZE = 12;
|
|
28
|
+
export declare const PADDING_LG = 12;
|
|
29
|
+
export declare const PADDING_MD = 8;
|
|
30
|
+
export declare const PADDING_SM = 4;
|
|
31
|
+
export declare const ICON_PADDING = 6;
|
|
32
|
+
export declare const GROUP_SHADOW_COLOR = "rgba(0, 0, 0, 0.06)";
|
|
33
|
+
export declare const GROUP_SHADOW_BLUR = 6;
|
|
34
|
+
export declare const GROUP_SHADOW_OFFSET_X = 0;
|
|
35
|
+
export declare const GROUP_SHADOW_OFFSET_Y = 1;
|
|
27
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/components/group-device/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,WAAW,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,qBAAqB,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAC3D,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAC/C,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,sBAAsB,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/components/group-device/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,WAAW,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,qBAAqB,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAC3D,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAC/C,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,YAAY,IAAI,CAAC;AAG9B,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,qBAAqB,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/components/group-device/transforms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,eAAO,MAAM,oBAAoB,GAAI,QAAQ,WAAW,KAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/components/group-device/transforms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,eAAO,MAAM,oBAAoB,GAAI,QAAQ,WAAW,KAAG,UAe1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/components/group-device/utils/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/components/group-device/utils/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB,CA8BnB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,SAAS,EAAE,iBAAiB,GAAG,KAAK,GACnC,iBAAiB,GAAG,KAAK,CAM3B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Node, Point } from '@antv/g6';
|
|
2
|
-
export declare const getEndpoints: (sourceNode: Node, targetNode: Node) => [Point, Point];
|
|
2
|
+
export declare const getEndpoints: (sourceNode: Node, targetNode: Node) => [Point, Point] | undefined;
|
|
3
3
|
//# sourceMappingURL=endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/edge-utils/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,YAAY,GAAI,YAAY,IAAI,EAAE,YAAY,IAAI,
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/edge-utils/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,YAAY,GAAI,YAAY,IAAI,EAAE,YAAY,IAAI,+BAc9D,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { ImageStyleProps } from '@antv/g';
|
|
2
|
-
|
|
3
|
-
* Check if drill down icon should be shown
|
|
4
|
-
*/
|
|
5
|
-
export declare function shouldShowDrillIcon(attrs: any, node?: any): boolean;
|
|
2
|
+
export { hasDrillIcon as shouldShowDrillIcon } from './label-layout';
|
|
6
3
|
/**
|
|
7
4
|
* Get drill-down icon style for groups
|
|
8
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drill-icon.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/group-utils/drill-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"drill-icon.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/group-utils/drill-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS1C,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErE;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,GAAG,GACT,eAAe,GAAG,KAAK,CA0CzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/group-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/group-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { RectStyleProps } from '@antv/g';
|
|
2
2
|
/**
|
|
3
3
|
* Group-specific label background style that handles four scenarios:
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
*
|
|
5
|
+
* Display order: [statusIcon] [label] [drillIcon]
|
|
6
|
+
*
|
|
7
|
+
* 1. LABEL_ONLY: Only label text - use base style
|
|
8
|
+
* 2. STATUS_LABEL: Status icon + label - base style handles this
|
|
9
|
+
* 3. LABEL_DRILL: Label + drill icon - shift background left
|
|
10
|
+
* 4. STATUS_LABEL_DRILL: Status icon + label + drill icon - expand width
|
|
8
11
|
*/
|
|
9
12
|
export declare function getLabelBackgroundStyle(node: any, attrs: any): RectStyleProps | false;
|
|
10
13
|
//# sourceMappingURL=label-background.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-background.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/group-utils/label-background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"label-background.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/group-utils/label-background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIzC;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,GAAG,GACT,cAAc,GAAG,KAAK,CAiCxB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label layout scenarios for group components
|
|
3
|
+
*
|
|
4
|
+
* Display order (left to right): [statusIcon] [label] [drillIcon]
|
|
5
|
+
*
|
|
6
|
+
* - LABEL_ONLY: Only label text
|
|
7
|
+
* - STATUS_LABEL: Status icon + label
|
|
8
|
+
* - LABEL_DRILL: Label + drill icon
|
|
9
|
+
* - STATUS_LABEL_DRILL: Status icon + label + drill icon
|
|
10
|
+
*/
|
|
11
|
+
export declare enum LabelLayoutScenario {
|
|
12
|
+
LABEL_ONLY = "LABEL_ONLY",
|
|
13
|
+
STATUS_LABEL = "STATUS_LABEL",
|
|
14
|
+
LABEL_DRILL = "LABEL_DRILL",
|
|
15
|
+
STATUS_LABEL_DRILL = "STATUS_LABEL_DRILL"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Layout configuration for each scenario
|
|
19
|
+
*/
|
|
20
|
+
export interface LabelLayoutConfig {
|
|
21
|
+
scenario: LabelLayoutScenario;
|
|
22
|
+
hasStatusIcon: boolean;
|
|
23
|
+
hasDrillIcon: boolean;
|
|
24
|
+
/** Label X offset to center it between icons */
|
|
25
|
+
labelOffsetX: number;
|
|
26
|
+
/** Adjustment for label max width */
|
|
27
|
+
labelMaxWidthAdjustment: number;
|
|
28
|
+
/** Background X offset adjustment */
|
|
29
|
+
backgroundOffsetX: number;
|
|
30
|
+
/** Additional background width for icons */
|
|
31
|
+
backgroundWidthAdjustment: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Spacing constants for label layout
|
|
35
|
+
*/
|
|
36
|
+
export declare const LABEL_LAYOUT_SPACING: {
|
|
37
|
+
/** Space between status icon and label */
|
|
38
|
+
readonly STATUS_ICON_GAP: 8;
|
|
39
|
+
/** Space between label and drill icon */
|
|
40
|
+
readonly DRILL_ICON_GAP: 6;
|
|
41
|
+
/** Total space occupied by status icon (icon + gap) */
|
|
42
|
+
readonly STATUS_ICON_SPACE: number;
|
|
43
|
+
/** Total space occupied by drill icon (icon + gap) */
|
|
44
|
+
readonly DRILL_ICON_SPACE: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Check if status icon should be shown
|
|
48
|
+
*/
|
|
49
|
+
export declare function hasStatusIcon(attrs: any): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Check if drill icon should be shown
|
|
52
|
+
*/
|
|
53
|
+
export declare function hasDrillIcon(attrs: any, node?: any): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Determine the current label layout scenario
|
|
56
|
+
*/
|
|
57
|
+
export declare function getLabelLayoutScenario(attrs: any, node?: any): LabelLayoutScenario;
|
|
58
|
+
/**
|
|
59
|
+
* Get the complete layout configuration for the current scenario
|
|
60
|
+
*
|
|
61
|
+
* This centralizes all the positioning logic for the 4 scenarios:
|
|
62
|
+
* 1. LABEL_ONLY: No adjustments needed
|
|
63
|
+
* 2. STATUS_LABEL: Offset label right to balance status icon on left
|
|
64
|
+
* 3. LABEL_DRILL: Shift label left to center the whole (label + drill icon)
|
|
65
|
+
* 4. STATUS_LABEL_DRILL: Balance between both icons
|
|
66
|
+
*/
|
|
67
|
+
export declare function getLabelLayoutConfig(attrs: any, node?: any): LabelLayoutConfig;
|
|
68
|
+
/**
|
|
69
|
+
* Get status icon position relative to label
|
|
70
|
+
*/
|
|
71
|
+
export declare function getStatusIconPosition(labelBounds: {
|
|
72
|
+
min: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
}): {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Get drill icon position relative to label text bounds
|
|
82
|
+
*/
|
|
83
|
+
export declare function getDrillIconPosition(textRightEdge: number): {
|
|
84
|
+
x: number;
|
|
85
|
+
y: number;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=label-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-layout.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/group-utils/label-layout.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,oBAAY,mBAAmB;IAC7B,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,aAAa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