@moxa/graph 3.0.0-beta.12 → 3.0.0-beta.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxa/graph",
3
- "version": "3.0.0-beta.12",
3
+ "version": "3.0.0-beta.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://gitlab.com/moxa/sw/f2e/one/one-moxa-vizion"
@@ -1 +1 @@
1
- {"version":3,"file":"command-filter.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/plugins/history/config/command-filter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAIL,OAAO,EAGR,MAAM,UAAU,CAAC;AAMlB,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAyCtC,eAAO,MAAM,mBAAmB,GAAI,KAAK,OAAO,KAAG,OAII,CAAC"}
1
+ {"version":3,"file":"command-filter.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/plugins/history/config/command-filter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAIL,OAAO,EAGR,MAAM,UAAU,CAAC;AAMlB,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAyCtC,eAAO,MAAM,mBAAmB,GAAI,KAAK,OAAO,KAAG,OAKtB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ export interface HistoryLocators {
3
+ historyInfo: Locator;
4
+ undoButton: Locator;
5
+ redoButton: Locator;
6
+ }
7
+ /**
8
+ * Get common history plugin UI locators
9
+ */
10
+ export declare function getHistoryLocators(page: Page): HistoryLocators;
11
+ /**
12
+ * Assert history state: current/total and undo/redo availability
13
+ */
14
+ export declare function expectHistoryState(historyInfo: Locator, state: {
15
+ current: number;
16
+ total: number;
17
+ canUndo: boolean;
18
+ canRedo: boolean;
19
+ }): Promise<void>;
20
+ //# sourceMappingURL=history-test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-test-utils.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/plugins/history/tests/helpers/history-test-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAU,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,eAAe,CAM9D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,OAAO,EACpB,KAAK,EAAE;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -0,0 +1,88 @@
1
+ import { HullConfig, UpdateHullOptions } from '../model/hull.model';
2
+ /**
3
+ * Hull event names
4
+ */
5
+ export declare enum HullEventEnum {
6
+ /** Fired when a hull is created */
7
+ HULL_CREATED = "hull:created",
8
+ /** Fired when a hull is updated */
9
+ HULL_UPDATED = "hull:updated",
10
+ /** Fired when a hull is removed */
11
+ HULL_REMOVED = "hull:removed"
12
+ }
13
+ /**
14
+ * Base hull event payload
15
+ */
16
+ export interface BaseHullEventPayload {
17
+ /** Hull key */
18
+ key: string;
19
+ /** Timestamp of the event */
20
+ timestamp: number;
21
+ /** Unique operation ID for tracking */
22
+ operationId: string;
23
+ }
24
+ /**
25
+ * Hull created event payload
26
+ */
27
+ export interface HullCreatedEventPayload extends BaseHullEventPayload {
28
+ /** Full hull configuration */
29
+ hullConfig: HullConfig;
30
+ /** Node IDs affected by this operation */
31
+ affectedNodeIds: string[];
32
+ }
33
+ /**
34
+ * Hull updated event payload
35
+ */
36
+ export interface HullUpdatedEventPayload extends BaseHullEventPayload {
37
+ /** Previous hull configuration */
38
+ previousConfig: HullConfig;
39
+ /** Updated hull configuration */
40
+ updatedConfig: HullConfig;
41
+ /** Update options applied */
42
+ updateOptions: UpdateHullOptions;
43
+ /** Node IDs affected by this operation */
44
+ affectedNodeIds: string[];
45
+ }
46
+ /**
47
+ * Hull removed event payload
48
+ */
49
+ export interface HullRemovedEventPayload extends BaseHullEventPayload {
50
+ /** Hull configuration that was removed */
51
+ removedConfig: HullConfig;
52
+ /** Node IDs that were in the hull */
53
+ affectedNodeIds: string[];
54
+ }
55
+ /**
56
+ * Union type of all hull event payloads
57
+ */
58
+ export type HullEventPayload = HullCreatedEventPayload | HullUpdatedEventPayload | HullRemovedEventPayload;
59
+ /**
60
+ * Generate a unique operation ID
61
+ * @param operation - Operation type
62
+ * @returns Unique operation ID
63
+ */
64
+ export declare function generateOperationId(operation: string): string;
65
+ /**
66
+ * Create hull created event payload
67
+ * @param key - Hull key
68
+ * @param hullConfig - Hull configuration
69
+ * @returns Event payload
70
+ */
71
+ export declare function createHullCreatedPayload(key: string, hullConfig: HullConfig): HullCreatedEventPayload;
72
+ /**
73
+ * Create hull updated event payload
74
+ * @param key - Hull key
75
+ * @param previousConfig - Previous hull configuration
76
+ * @param updatedConfig - Updated hull configuration
77
+ * @param updateOptions - Update options
78
+ * @returns Event payload
79
+ */
80
+ export declare function createHullUpdatedPayload(key: string, previousConfig: HullConfig, updatedConfig: HullConfig, updateOptions: UpdateHullOptions): HullUpdatedEventPayload;
81
+ /**
82
+ * Create hull removed event payload
83
+ * @param key - Hull key
84
+ * @param removedConfig - Removed hull configuration
85
+ * @returns Event payload
86
+ */
87
+ export declare function createHullRemovedPayload(key: string, removedConfig: HullConfig): HullRemovedEventPayload;
88
+ //# sourceMappingURL=hull-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hull-events.d.ts","sourceRoot":"","sources":["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,CACtC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,UAAU,GACrB,uBAAuB,CAQzB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,UAAU,EAC1B,aAAa,EAAE,UAAU,EACzB,aAAa,EAAE,iBAAiB,GAC/B,uBAAuB,CAkBzB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,UAAU,GACxB,uBAAuB,CAQzB"}
@@ -0,0 +1,154 @@
1
+ import { Graph as G6Graph } from '@antv/g6';
2
+ import { ComboData } from '@antv/g6/lib/spec';
3
+ import { HullConfig } from '../model/hull.model';
4
+ /**
5
+ * Hull metadata stored in combo data
6
+ */
7
+ export interface HullMetadataData {
8
+ /** Marker to identify this as hull metadata */
9
+ _isHullMetadata: true;
10
+ /** Hull key */
11
+ hullKey: string;
12
+ /** Full hull configuration */
13
+ hullConfig: HullConfig;
14
+ }
15
+ /**
16
+ * Hull metadata combo (G6 ComboData with hull metadata)
17
+ */
18
+ export interface HullMetadataCombo extends ComboData {
19
+ id: string;
20
+ data: HullMetadataData & Record<string, any>;
21
+ style?: {
22
+ visibility: 'hidden';
23
+ [key: string]: any;
24
+ };
25
+ }
26
+ /**
27
+ * Generate metadata combo ID from hull key
28
+ * @param hullKey - Hull key
29
+ * @returns Metadata combo ID
30
+ */
31
+ export declare function getHullMetadataComboId(hullKey: string): string;
32
+ /**
33
+ * Extract hull key from metadata combo ID
34
+ * @param comboId - Metadata combo ID
35
+ * @returns Hull key or undefined if not a metadata combo
36
+ */
37
+ export declare function extractHullKeyFromComboId(comboId: string): string | undefined;
38
+ /**
39
+ * Check if a combo ID is a hull metadata combo
40
+ * @param comboId - Combo ID to check
41
+ * @returns Whether this is a hull metadata combo ID
42
+ */
43
+ export declare function isHullMetadataComboId(comboId: string): boolean;
44
+ /**
45
+ * Check if combo data is hull metadata
46
+ * @param comboData - Combo data to check
47
+ * @returns Whether this is hull metadata
48
+ */
49
+ export declare function isHullMetadataCombo(comboData: ComboData | any): comboData is HullMetadataCombo;
50
+ /**
51
+ * Create a hidden metadata combo for a hull
52
+ * @param hullConfig - Hull configuration
53
+ * @returns Metadata combo data
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * const metadataCombo = createHullMetadataCombo({
58
+ * key: 'zone-a',
59
+ * members: ['node1', 'node2'],
60
+ * style: { fill: '#4CAF50' },
61
+ * });
62
+ *
63
+ * g6Graph.addCombo(metadataCombo); // G6 history automatically records this
64
+ * ```
65
+ */
66
+ export declare function createHullMetadataCombo(hullConfig: HullConfig): HullMetadataCombo;
67
+ /**
68
+ * Update metadata combo for a hull
69
+ * @param g6Graph - G6 graph instance
70
+ * @param hullKey - Hull key
71
+ * @param hullConfig - Updated hull configuration
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * updateHullMetadataCombo(g6Graph, 'zone-a', {
76
+ * key: 'zone-a',
77
+ * members: ['node1', 'node2', 'node3'], // Updated members
78
+ * style: { fill: '#FF5722' }, // Updated style
79
+ * });
80
+ * ```
81
+ */
82
+ export declare function updateHullMetadataCombo(g6Graph: G6Graph, hullKey: string, hullConfig: HullConfig): void;
83
+ /**
84
+ * Remove metadata combo for a hull
85
+ * @param g6Graph - G6 graph instance
86
+ * @param hullKey - Hull key
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * removeHullMetadataCombo(g6Graph, 'zone-a');
91
+ * ```
92
+ */
93
+ export declare function removeHullMetadataCombo(g6Graph: G6Graph, hullKey: string): void;
94
+ /**
95
+ * Check if metadata combo exists for a hull
96
+ * @param g6Graph - G6 graph instance
97
+ * @param hullKey - Hull key
98
+ * @returns Whether metadata combo exists
99
+ */
100
+ export declare function hasHullMetadataCombo(g6Graph: G6Graph, hullKey: string): boolean;
101
+ /**
102
+ * Get metadata combo for a hull
103
+ * @param g6Graph - G6 graph instance
104
+ * @param hullKey - Hull key
105
+ * @returns Metadata combo or undefined if not found
106
+ */
107
+ export declare function getHullMetadataCombo(g6Graph: G6Graph, hullKey: string): HullMetadataCombo | undefined;
108
+ /**
109
+ * Get all hull metadata from graph
110
+ * @param g6Graph - G6 graph instance
111
+ * @returns Map of hull key to hull config
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * const metadata = getHullMetadataFromGraph(g6Graph);
116
+ * // Map { 'zone-a' => { key: 'zone-a', members: [...], ... } }
117
+ * ```
118
+ */
119
+ export declare function getHullMetadataFromGraph(g6Graph: G6Graph): Map<string, HullConfig>;
120
+ /**
121
+ * Get all hull keys from metadata
122
+ * @param g6Graph - G6 graph instance
123
+ * @returns Array of hull keys
124
+ */
125
+ export declare function getAllHullKeysFromMetadata(g6Graph: G6Graph): string[];
126
+ /**
127
+ * Synchronize hull plugins from metadata combos
128
+ *
129
+ * This is the core synchronization function called after undo/redo.
130
+ * It ensures that hull plugins match the metadata combos in the graph.
131
+ *
132
+ * @param g6Graph - G6 graph instance
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * // After undo/redo
137
+ * g6Graph.on('afterrender', () => {
138
+ * syncHullPluginsFromMetadata(g6Graph);
139
+ * });
140
+ * ```
141
+ */
142
+ export declare function syncHullPluginsFromMetadata(g6Graph: G6Graph): void;
143
+ /**
144
+ * Clear all hull metadata combos from graph
145
+ * @param g6Graph - G6 graph instance
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * // During graph cleanup
150
+ * clearAllHullMetadata(g6Graph);
151
+ * ```
152
+ */
153
+ export declare function clearAllHullMetadata(g6Graph: G6Graph): void;
154
+ //# sourceMappingURL=hull-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hull-metadata.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/plugins/hull/config/hull-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAC5C,OAA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E,MAAM,GACd,IAAI,CAGN;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,iBAAiB,GAAG,SAAS,CAS/B;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,GACf,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAYzB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAErE;AAwFD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2ElE;AAqCD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAS3D"}
@@ -0,0 +1,96 @@
1
+ import { Graph as G6Graph, HullOptions as G6HullOptions } from '@antv/g6';
2
+ import { PluginFunction } from '../../core/model';
3
+ import { HullConfig, HullOptions, RemoveHullOptions, RemoveHullWithMembersOptions, UpdateHullOptions } from './model/hull.model';
4
+ export type { HullConfig, HullLabelOptions, HullOptions, HullStyleOptions, RemoveHullOptions, RemoveHullWithMembersOptions, UpdateHullOptions, } from './model/hull.model';
5
+ export { DEFAULT_HULL_LABEL_STYLE, DEFAULT_HULL_OPTIONS, DEFAULT_HULL_STYLE, G6_HULL_TYPE, } from './model/hull.model';
6
+ export { clearAllHullMetadata, createHullMetadataCombo, extractHullKeyFromComboId, getAllHullKeysFromMetadata, getHullMetadataCombo, getHullMetadataComboId, getHullMetadataFromGraph, hasHullMetadataCombo, isHullMetadataCombo, isHullMetadataComboId, removeHullMetadataCombo, syncHullPluginsFromMetadata, updateHullMetadataCombo, } from './config/hull-metadata';
7
+ export type { HullMetadataCombo, HullMetadataData, } from './config/hull-metadata';
8
+ export { createHullCreatedPayload, createHullRemovedPayload, createHullUpdatedPayload, generateOperationId, HullEventEnum, } from './config/hull-events';
9
+ export type { BaseHullEventPayload, HullCreatedEventPayload, HullEventPayload, HullRemovedEventPayload, HullUpdatedEventPayload, } from './config/hull-events';
10
+ /**
11
+ * Validate that members don't belong to other hulls
12
+ * @throws Error if a member already belongs to another hull
13
+ */
14
+ export declare function validateMembership(hullKey: string, members: string[]): void;
15
+ /**
16
+ * Register members to a hull
17
+ */
18
+ export declare function registerMembers(hullKey: string, members: string[]): void;
19
+ /**
20
+ * Unregister members from a hull
21
+ */
22
+ export declare function unregisterMembers(hullKey: string, members: string[]): void;
23
+ /**
24
+ * Unregister all members of a hull
25
+ */
26
+ export declare function unregisterAllMembers(hullKey: string): void;
27
+ /**
28
+ * Get the hull a node belongs to
29
+ * @returns Hull key or undefined if not in any hull
30
+ */
31
+ export declare function getNodeHull(nodeId: string): string | undefined;
32
+ /**
33
+ * Check if removal is confirmed
34
+ * @throws Error if confirmation is missing
35
+ */
36
+ export declare function validateRemoval(options?: RemoveHullOptions): void;
37
+ /**
38
+ * Check if removal with members is confirmed
39
+ * @throws Error if confirmation is missing
40
+ */
41
+ export declare function validateRemovalWithMembers(options?: RemoveHullWithMembersOptions): void;
42
+ /**
43
+ * Get hull plugin options by converting HullOptions to G6 HullOptions
44
+ */
45
+ export declare const getHullPluginOptions: PluginFunction<HullOptions, G6HullOptions>;
46
+ /**
47
+ * Clear all hull membership data
48
+ * Useful for cleanup during graph destruction
49
+ */
50
+ export declare function clearAllHullMembership(): void;
51
+ /**
52
+ * Convert HullConfig to G6 HullOptions format
53
+ * @internal
54
+ */
55
+ export declare function toG6HullOptions(options: HullConfig): G6HullOptions;
56
+ /**
57
+ * Add a hull to the graph
58
+ * @param g6Graph - The underlying G6 graph instance
59
+ * @param options - Hull configuration options
60
+ */
61
+ export declare function addHullToGraph(g6Graph: G6Graph, options: HullConfig): Promise<void>;
62
+ /**
63
+ * Remove a hull from the graph
64
+ * @param g6Graph - The underlying G6 graph instance
65
+ * @param key - Hull key to remove
66
+ * @param options - Removal options (requires confirmation)
67
+ */
68
+ export declare function removeHullFromGraph(g6Graph: G6Graph, key: string, options?: RemoveHullOptions): Promise<void>;
69
+ /**
70
+ * Remove multiple hulls from the graph in a single batch operation
71
+ * @param g6Graph - The underlying G6 graph instance
72
+ * @param keys - Hull keys to remove
73
+ * @param options - Removal options (requires confirmation)
74
+ */
75
+ export declare function removeBatchHullsFromGraph(g6Graph: G6Graph, keys: string[], options?: RemoveHullOptions): Promise<void>;
76
+ /**
77
+ * Update a hull in the graph
78
+ * @param g6Graph - The underlying G6 graph instance
79
+ * @param key - Hull key to update
80
+ * @param options - Partial hull options to update
81
+ */
82
+ export declare function updateHullInGraph(g6Graph: G6Graph, key: string, options: UpdateHullOptions): Promise<void>;
83
+ /**
84
+ * Get a hull configuration from the graph
85
+ * @param g6Graph - The underlying G6 graph instance
86
+ * @param key - Hull key to find
87
+ * @returns Hull config or undefined if not found
88
+ */
89
+ export declare function getHullFromGraph(g6Graph: any, key: string): HullConfig | undefined;
90
+ /**
91
+ * Get all hulls from the graph
92
+ * @param g6Graph - The underlying G6 graph instance
93
+ * @returns Array of all hull configurations
94
+ */
95
+ export declare function getAllHullsFromGraph(g6Graph: any): HullConfig[];
96
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/plugins/hull/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAc7C,OAAO,EAKL,KAAK,UAAU,EAEf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,E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{ BasePluginOptions, Hull as G6Hull } from '@antv/g6';
2
+ /** @hidden */
3
+ export type Hull = G6Hull;
4
+ /**
5
+ * Label configuration for Hull
6
+ */
7
+ export interface HullLabelOptions {
8
+ /**
9
+ * Whether to show the label
10
+ * @defaultValue true
11
+ */
12
+ show?: boolean;
13
+ /**
14
+ * Label text content
15
+ */
16
+ text: string;
17
+ /**
18
+ * Font size of the label
19
+ * @defaultValue 14
20
+ */
21
+ fontSize?: number;
22
+ /**
23
+ * Text color of the label
24
+ * @defaultValue '#000'
25
+ */
26
+ fill?: string;
27
+ /**
28
+ * Font family of the label
29
+ * @defaultValue 'Roboto, sans-serif'
30
+ */
31
+ fontFamily?: string;
32
+ /**
33
+ * Font weight of the label
34
+ * @defaultValue 'normal'
35
+ */
36
+ fontWeight?: string | number;
37
+ /**
38
+ * Padding of the label
39
+ */
40
+ padding?: number | number[];
41
+ /**
42
+ * Background configuration for the label
43
+ */
44
+ background?: {
45
+ /**
46
+ * Background show or hide flag
47
+ */
48
+ show?: boolean;
49
+ /**
50
+ * Background fill color
51
+ */
52
+ fill?: string;
53
+ /**
54
+ * Background opacity, fillOpacity is not work for background
55
+ * @default 0.6
56
+ */
57
+ opacity?: number;
58
+ /**
59
+ * Background border radius
60
+ */
61
+ radius?: number;
62
+ };
63
+ /**
64
+ * Label offset from the default position
65
+ */
66
+ offsetX?: number;
67
+ /**
68
+ * Label offset from the default position
69
+ */
70
+ offsetY?: number;
71
+ }
72
+ /**
73
+ * Style options for Hull appearance
74
+ */
75
+ export interface HullStyleOptions {
76
+ /**
77
+ * Fill color of the hull
78
+ * @defaultValue 'lightblue'
79
+ */
80
+ fill?: string;
81
+ /**
82
+ * Fill opacity of the hull (0-1)
83
+ * @defaultValue 0.2
84
+ */
85
+ fillOpacity?: number;
86
+ /**
87
+ * Stroke color of the hull border
88
+ * @defaultValue 'blue'
89
+ */
90
+ stroke?: string;
91
+ /**
92
+ * Stroke opacity of the hull border (0-1)
93
+ * @defaultValue 0.2
94
+ */
95
+ strokeOpacity?: number;
96
+ /**
97
+ * Line width of the hull border
98
+ * @defaultValue 1
99
+ */
100
+ lineWidth?: number;
101
+ }
102
+ /**
103
+ * Options for removing a hull
104
+ */
105
+ export interface RemoveHullOptions {
106
+ /**
107
+ * Confirm the removal operation
108
+ * Required unless force is true
109
+ */
110
+ confirm?: boolean;
111
+ /**
112
+ * Force removal without confirmation
113
+ * Use for programmatic operations
114
+ */
115
+ force?: boolean;
116
+ }
117
+ /**
118
+ * Options for removing a hull with its members
119
+ */
120
+ export interface RemoveHullWithMembersOptions {
121
+ /**
122
+ * Confirm the removal operation
123
+ * Required because this is a destructive operation
124
+ */
125
+ confirm: boolean;
126
+ }
127
+ /**
128
+ * Hull plugin options
129
+ * Extends BasePluginOptions for type and key properties
130
+ */
131
+ export interface HullOptions extends BasePluginOptions {
132
+ /**
133
+ * Node IDs to include in the hull
134
+ */
135
+ members: string[];
136
+ /**
137
+ * Style options for the hull
138
+ */
139
+ style?: HullStyleOptions;
140
+ /**
141
+ * Label configuration for the hull
142
+ */
143
+ label?: HullLabelOptions;
144
+ /**
145
+ * Padding between the hull outline and member nodes
146
+ * @defaultValue 10
147
+ */
148
+ padding?: number;
149
+ /**
150
+ * Corner type for the hull outline
151
+ * @defaultValue 'rounded'
152
+ */
153
+ corner?: 'rounded' | 'smooth' | 'sharp';
154
+ /**
155
+ * Concavity level. Higher values mean less indentation.
156
+ * Infinity creates a convex hull
157
+ * @defaultValue Infinity
158
+ */
159
+ concavity?: number;
160
+ /**
161
+ * Line dash pattern for the hull outline
162
+ */
163
+ lineDash?: number[];
164
+ }
165
+ /**
166
+ * Options for updating a hull (all fields optional except those being updated)
167
+ */
168
+ export interface UpdateHullOptions {
169
+ /**
170
+ * New members for the hull
171
+ */
172
+ members?: string[];
173
+ /**
174
+ * Style updates
175
+ */
176
+ style?: Partial<HullStyleOptions>;
177
+ /**
178
+ * Label configuration update
179
+ */
180
+ label?: Partial<HullLabelOptions>;
181
+ /**
182
+ * Padding update
183
+ */
184
+ padding?: number;
185
+ /**
186
+ * Corner style update
187
+ */
188
+ corner?: 'rounded' | 'smooth' | 'sharp';
189
+ /**
190
+ * Concavity update
191
+ */
192
+ concavity?: number;
193
+ /**
194
+ * Line dash pattern update
195
+ */
196
+ lineDash?: number[];
197
+ }
198
+ /**
199
+ * Hull configuration returned by getHull/getAllHulls
200
+ */
201
+ export interface HullConfig {
202
+ /**
203
+ * Unique key for the hull
204
+ */
205
+ key: string;
206
+ /**
207
+ * Node IDs included in the hull
208
+ */
209
+ members: string[];
210
+ /**
211
+ * Style options for the hull
212
+ */
213
+ style?: HullStyleOptions;
214
+ /**
215
+ * Label configuration for the hull
216
+ */
217
+ label?: HullLabelOptions;
218
+ /**
219
+ * Padding between the hull outline and member nodes
220
+ */
221
+ padding?: number;
222
+ /**
223
+ * Corner type for the hull outline
224
+ */
225
+ corner?: 'rounded' | 'smooth' | 'sharp';
226
+ /**
227
+ * Concavity level
228
+ */
229
+ concavity?: number;
230
+ /**
231
+ * Line dash pattern
232
+ */
233
+ lineDash?: number[];
234
+ }
235
+ /**
236
+ * G6's internal type identifier for Hull plugin.
237
+ */
238
+ export declare const G6_HULL_TYPE = "hull";
239
+ /**
240
+ * Default style for hulls
241
+ */
242
+ export declare const DEFAULT_HULL_STYLE: HullStyleOptions;
243
+ /**
244
+ * Default label style for hulls
245
+ */
246
+ export declare const DEFAULT_HULL_LABEL_STYLE: Omit<HullLabelOptions, 'text'>;
247
+ /**
248
+ * Default options for hull plugin
249
+ */
250
+ export declare const DEFAULT_HULL_OPTIONS: Partial<HullOptions>;
251
+ //# sourceMappingURL=hull.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hull.model.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/plugins/hull/model/hull.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7D,cAAc;AACd,MAAM,MA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CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IAExC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAMD;;GAEG;AACH,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,gBAMhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAWnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,WAAW,CAIrD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './hull.model';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/plugins/hull/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -4,6 +4,7 @@ export * from './fixed-toolbar';
4
4
  export * from './graph-background';
5
5
  export * from './history';
6
6
  export * from './minimap';
7
+ export * from './hull';
7
8
  export * from './rich-tooltip';
8
9
  export * from './snapline';
9
10
  export * from './tooltip';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../libs/graph/src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../libs/graph/src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}