@moxa/graph 3.0.0-beta.1 → 3.0.0-beta.11
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/README.md +615 -114
- package/assets/icon-sprite.svg +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 +55 -0
- package/behaviors/drill-down/drill-down-manager.d.ts.map +1 -0
- package/behaviors/drill-down/index.d.ts +71 -0
- package/behaviors/drill-down/index.d.ts.map +1 -0
- package/behaviors/drill-down/models/index.d.ts +7 -0
- package/behaviors/drill-down/models/index.d.ts.map +1 -0
- package/behaviors/hover-activate/index.d.ts.map +1 -1
- package/components/edge-arrow/transforms/index.d.ts.map +1 -1
- package/components/edge-label/index.d.ts +4 -4
- package/components/edge-label/index.d.ts.map +1 -1
- package/components/edge-label/utils/style.d.ts.map +1 -1
- package/components/edge-line/index.d.ts.map +1 -1
- package/components/edge-polyline/index.d.ts.map +1 -1
- package/components/edge-quadratic/index.d.ts.map +1 -1
- package/components/group-device/index.d.ts +34 -0
- package/components/group-device/index.d.ts.map +1 -1
- package/components/group-device/models/index.d.ts +11 -1
- 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/models/index.d.ts +2 -0
- package/components/node-device/models/index.d.ts.map +1 -1
- package/components/node-device/utils/style.d.ts.map +1 -1
- package/components/node-label/index.d.ts +1 -1
- package/components/node-label/index.d.ts.map +1 -1
- package/components/shared/transforms/edge-transform.d.ts.map +1 -1
- package/components/shared/transforms/group-transform.d.ts.map +1 -1
- package/components/shared/transforms/node-transform.d.ts.map +1 -1
- package/components/shared/utils/edge-utils/index.d.ts +1 -0
- package/components/shared/utils/edge-utils/index.d.ts.map +1 -1
- package/components/shared/utils/edge-utils/state-style.d.ts +24 -0
- package/components/shared/utils/edge-utils/state-style.d.ts.map +1 -0
- package/components/shared/utils/edge-utils/style.d.ts +19 -1
- package/components/shared/utils/edge-utils/style.d.ts.map +1 -1
- package/components/shared/utils/group-utils/drill-icon.d.ts +10 -0
- package/components/shared/utils/group-utils/drill-icon.d.ts.map +1 -0
- package/components/shared/utils/group-utils/index.d.ts +3 -0
- package/components/shared/utils/group-utils/index.d.ts.map +1 -0
- package/components/shared/utils/group-utils/label-background.d.ts +10 -0
- package/components/shared/utils/group-utils/label-background.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/components/shared/utils/node-utils/config.d.ts +27 -0
- package/components/shared/utils/node-utils/config.d.ts.map +1 -0
- package/components/shared/utils/node-utils/icon-style.d.ts.map +1 -1
- package/components/shared/utils/node-utils/index.d.ts +6 -5
- package/components/shared/utils/node-utils/index.d.ts.map +1 -1
- package/components/shared/utils/node-utils/label-background.d.ts.map +1 -1
- package/components/shared/utils/node-utils/offset.d.ts +2 -6
- package/components/shared/utils/node-utils/offset.d.ts.map +1 -1
- package/components/shared/utils/node-utils/state-styles.d.ts +64 -0
- package/components/shared/utils/node-utils/state-styles.d.ts.map +1 -0
- 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/components/shared/utils/node-utils/theme.d.ts +1 -1
- package/components/shared/utils/node-utils/theme.d.ts.map +1 -1
- package/components/shared/utils/node-utils/title-style.d.ts.map +1 -1
- package/core/graph/graph.d.ts +218 -187
- package/core/graph/graph.d.ts.map +1 -1
- package/core/model/behavior.model.d.ts +6 -2
- package/core/model/behavior.model.d.ts.map +1 -1
- package/core/model/edge.model.d.ts +221 -0
- package/core/model/edge.model.d.ts.map +1 -1
- package/core/model/event.model.d.ts +7 -1
- package/core/model/event.model.d.ts.map +1 -1
- package/core/model/group.model.d.ts +57 -0
- package/core/model/group.model.d.ts.map +1 -1
- package/core/model/index.d.ts +1 -0
- package/core/model/index.d.ts.map +1 -1
- package/core/model/label.model.d.ts +2 -1
- package/core/model/label.model.d.ts.map +1 -1
- package/core/model/node.model.d.ts +106 -0
- package/core/model/node.model.d.ts.map +1 -1
- package/core/model/plugin.model.d.ts +6 -2
- package/core/model/plugin.model.d.ts.map +1 -1
- package/core/model/state.model.d.ts +1 -1
- package/core/model/state.model.d.ts.map +1 -1
- package/core/model/text.model.d.ts +5 -0
- package/core/model/text.model.d.ts.map +1 -0
- package/index.cjs +77 -77
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +19959 -18690
- package/layouts/grid/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugins/context-menu/index.d.ts +11 -1
- package/plugins/context-menu/index.d.ts.map +1 -1
- package/plugins/history/config/command-filter.d.ts +5 -0
- package/plugins/history/config/command-filter.d.ts.map +1 -0
- package/plugins/history/config/drill-integration.d.ts +7 -0
- package/plugins/history/config/drill-integration.d.ts.map +1 -0
- package/plugins/history/config/history-options.d.ts +4 -0
- package/plugins/history/config/history-options.d.ts.map +1 -0
- package/plugins/history/history.model.d.ts +5 -0
- package/plugins/history/history.model.d.ts.map +1 -0
- package/plugins/history/index.d.ts +8 -6
- package/plugins/history/index.d.ts.map +1 -1
- package/plugins/index.d.ts +10 -0
- package/plugins/index.d.ts.map +1 -0
- package/plugins/minimap/index.d.ts +3 -2
- package/plugins/minimap/index.d.ts.map +1 -1
- package/plugins/rich-tooltip/index.d.ts +11 -0
- package/plugins/rich-tooltip/index.d.ts.map +1 -0
- package/plugins/snapline/index.d.ts +130 -2
- package/plugins/snapline/index.d.ts.map +1 -1
- package/plugins/snapline/models/index.d.ts +1 -1
- package/plugins/snapline/models/index.d.ts.map +1 -1
- package/plugins/snapline/models/snapline-models.d.ts +61 -0
- package/plugins/snapline/models/snapline-models.d.ts.map +1 -0
- package/plugins/tooltip/index.d.ts +1 -2
- package/plugins/tooltip/index.d.ts.map +1 -1
- package/shared/transforms/behavior-transform.d.ts +1 -0
- package/shared/transforms/behavior-transform.d.ts.map +1 -1
- package/shared/transforms/graph-transform.d.ts.map +1 -1
- package/shared/transforms/plugin-transform.d.ts +5 -4
- package/shared/transforms/plugin-transform.d.ts.map +1 -1
- package/shared/utils/config-setter.d.ts +9 -0
- package/shared/utils/config-setter.d.ts.map +1 -0
- package/shared/utils/index.d.ts +3 -2
- package/shared/utils/index.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-background.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/label-background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAKzC,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,GAAG,GACT,cAAc,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"label-background.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/label-background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAKzC,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,GAAG,GACT,cAAc,GAAG,KAAK,CAkDxB"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import { NodeUtilsConfig } from './config';
|
|
1
2
|
export interface ElementOffsets {
|
|
2
3
|
iconOffset: number;
|
|
3
4
|
titleOffset: number;
|
|
4
5
|
labelOffset: number;
|
|
5
6
|
}
|
|
6
|
-
export
|
|
7
|
-
nodeSize: number;
|
|
8
|
-
iconSize: number;
|
|
9
|
-
fontSize: number;
|
|
10
|
-
keySize?: [number, number];
|
|
11
|
-
}
|
|
7
|
+
export type OffsetConfig = NodeUtilsConfig;
|
|
12
8
|
export declare function getElementOffsets(attrs: {
|
|
13
9
|
title?: boolean;
|
|
14
10
|
label?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/offset.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,
|
|
1
|
+
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/offset.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,OAAO,EAAkB,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC;AAE3C,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE;IACL,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,EACD,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,cAAc,CA6DhB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { CircleStyleProps as GCircleStyleProps } from '@antv/g';
|
|
2
|
+
import { State } from '@antv/g6';
|
|
3
|
+
import { NodeConfig, NodeStyleProperties } from '../../../../index.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Determines the current state for node styling purposes.
|
|
6
|
+
* When multiple states are active, returns the highest priority state.
|
|
7
|
+
*
|
|
8
|
+
* Priority order: disabled > readonly > active > selected > default
|
|
9
|
+
*
|
|
10
|
+
* @param states - Array of active states from G6
|
|
11
|
+
* @returns The current state key for stateStyles lookup
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* determineCurrentState(['selected', 'active']) // Returns 'active'
|
|
16
|
+
* determineCurrentState(['disabled', 'selected']) // Returns 'disabled'
|
|
17
|
+
* determineCurrentState(['readonly', 'active']) // Returns 'readonly'
|
|
18
|
+
* determineCurrentState([]) // Returns 'default'
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function determineCurrentState(states: State[]): keyof NonNullable<NodeConfig['stateStyles']>;
|
|
22
|
+
/**
|
|
23
|
+
* Converts border style string or array to G6 lineDash format.
|
|
24
|
+
*
|
|
25
|
+
* @param style - Border style: 'solid', 'dashed', 'dotted', or custom dash array
|
|
26
|
+
* @returns G6 lineDash array or undefined for solid lines
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* convertBorderStyleToLineDash('solid') // Returns undefined
|
|
31
|
+
* convertBorderStyleToLineDash('dashed') // Returns [8, 4]
|
|
32
|
+
* convertBorderStyleToLineDash('dotted') // Returns [2, 4]
|
|
33
|
+
* convertBorderStyleToLineDash([5, 5]) // Returns [5, 5]
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function convertBorderStyleToLineDash(style: 'solid' | 'dashed' | 'dotted' | number[]): number[] | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Converts NodeStyleProperties to G6 style properties.
|
|
39
|
+
* Applies default border width (2px) when borderColor is set without borderWidth.
|
|
40
|
+
*
|
|
41
|
+
* @param stateStyle - Custom style properties for a specific state
|
|
42
|
+
* @returns G6 circle style properties
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const customStyle = {
|
|
47
|
+
* backgroundColor: '#E3F2FD',
|
|
48
|
+
* borderColor: '#1976D2',
|
|
49
|
+
* borderWidth: 3,
|
|
50
|
+
* borderStyle: 'dashed'
|
|
51
|
+
* };
|
|
52
|
+
* const g6Style = convertToG6Style(customStyle);
|
|
53
|
+
* // Returns: {
|
|
54
|
+
* // fill: '#E3F2FD',
|
|
55
|
+
* // fillOpacity: 1,
|
|
56
|
+
* // stroke: '#1976D2',
|
|
57
|
+
* // strokeOpacity: 1,
|
|
58
|
+
* // lineWidth: 3,
|
|
59
|
+
* // lineDash: [8, 4]
|
|
60
|
+
* // }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function convertToG6Style(stateStyle: NodeStyleProperties): Partial<GCircleStyleProps>;
|
|
64
|
+
//# sourceMappingURL=state-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-styles.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/state-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,KAAK,EAAE,GACd,MAAM,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAM9C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,EAAE,GAC9C,MAAM,EAAE,GAAG,SAAS,CAKtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CA8B5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-style.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/status-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO1C,OAAO,
|
|
1
|
+
{"version":3,"file":"status-style.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/status-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO1C,OAAO,EAAE,YAAY,EAAqB,MAAM,UAAU,CAAC;AAI3D,wBAAgB,cAAc,CAC5B,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,GAAG,EACV,WAAW,EAAE,GAAG,EAChB,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,eAAe,GAAG,KAAK,CAgCzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-style.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/text-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"text-style.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/text-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAK3C,OAAO,EAAqB,YAAY,EAAE,MAAM,UAAU,CAAC;AAwC3D,wBAAgB,YAAY,CAC1B,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,cAAc,GAAG,eAAe,EAC5C,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,cAAc,CAiDhB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseStyleProps } from '@antv/g';
|
|
2
2
|
import { State } from '@antv/g6';
|
|
3
3
|
import { Graph, NodeConfig } from '../../../../index.ts';
|
|
4
|
-
export declare const getNodeTheme: (graph: Graph, states: State[], status?: NodeConfig["highlight"]) => BaseStyleProps;
|
|
4
|
+
export declare const getNodeTheme: (graph: Graph, states: State[], status?: NodeConfig["highlight"], stateStyles?: NodeConfig["stateStyles"]) => BaseStyleProps;
|
|
5
5
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGhD,eAAO,MAAM,YAAY,GACvB,OAAO,KAAK,EACZ,QAAQ,KAAK,EAAE,EACf,SAAS,UAAU,CAAC,WAAW,CAAC,EAChC,cAAc,UAAU,CAAC,aAAa,CAAC,KACtC,cAgJF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title-style.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/title-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"title-style.d.ts","sourceRoot":"","sources":["../../../../../../libs/graph/src/components/shared/utils/node-utils/title-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAqB,YAAY,EAAE,MAAM,UAAU,CAAC;AAI3D,wBAAgB,aAAa,CAC3B,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,GAAG,EACV,cAAc,EAAE,cAAc,EAC9B,cAAc,GAAE,OAAO,CAAC,cAAc,CAAM,EAC5C,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,cAAc,GAAG,KAAK,CAqCxB"}
|