@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.
Files changed (124) hide show
  1. package/README.md +615 -114
  2. package/assets/icon-sprite.svg +1 -1
  3. package/behaviors/click-select/index.d.ts.map +1 -1
  4. package/behaviors/drag-element/index.d.ts.map +1 -1
  5. package/behaviors/drill-down/drill-down-manager.d.ts +55 -0
  6. package/behaviors/drill-down/drill-down-manager.d.ts.map +1 -0
  7. package/behaviors/drill-down/index.d.ts +71 -0
  8. package/behaviors/drill-down/index.d.ts.map +1 -0
  9. package/behaviors/drill-down/models/index.d.ts +7 -0
  10. package/behaviors/drill-down/models/index.d.ts.map +1 -0
  11. package/behaviors/hover-activate/index.d.ts.map +1 -1
  12. package/components/edge-arrow/transforms/index.d.ts.map +1 -1
  13. package/components/edge-label/index.d.ts +4 -4
  14. package/components/edge-label/index.d.ts.map +1 -1
  15. package/components/edge-label/utils/style.d.ts.map +1 -1
  16. package/components/edge-line/index.d.ts.map +1 -1
  17. package/components/edge-polyline/index.d.ts.map +1 -1
  18. package/components/edge-quadratic/index.d.ts.map +1 -1
  19. package/components/group-device/index.d.ts +34 -0
  20. package/components/group-device/index.d.ts.map +1 -1
  21. package/components/group-device/models/index.d.ts +11 -1
  22. package/components/group-device/models/index.d.ts.map +1 -1
  23. package/components/group-device/transforms/index.d.ts.map +1 -1
  24. package/components/group-device/utils/style.d.ts.map +1 -1
  25. package/components/node-device/models/index.d.ts +2 -0
  26. package/components/node-device/models/index.d.ts.map +1 -1
  27. package/components/node-device/utils/style.d.ts.map +1 -1
  28. package/components/node-label/index.d.ts +1 -1
  29. package/components/node-label/index.d.ts.map +1 -1
  30. package/components/shared/transforms/edge-transform.d.ts.map +1 -1
  31. package/components/shared/transforms/group-transform.d.ts.map +1 -1
  32. package/components/shared/transforms/node-transform.d.ts.map +1 -1
  33. package/components/shared/utils/edge-utils/index.d.ts +1 -0
  34. package/components/shared/utils/edge-utils/index.d.ts.map +1 -1
  35. package/components/shared/utils/edge-utils/state-style.d.ts +24 -0
  36. package/components/shared/utils/edge-utils/state-style.d.ts.map +1 -0
  37. package/components/shared/utils/edge-utils/style.d.ts +19 -1
  38. package/components/shared/utils/edge-utils/style.d.ts.map +1 -1
  39. package/components/shared/utils/group-utils/drill-icon.d.ts +10 -0
  40. package/components/shared/utils/group-utils/drill-icon.d.ts.map +1 -0
  41. package/components/shared/utils/group-utils/index.d.ts +3 -0
  42. package/components/shared/utils/group-utils/index.d.ts.map +1 -0
  43. package/components/shared/utils/group-utils/label-background.d.ts +10 -0
  44. package/components/shared/utils/group-utils/label-background.d.ts.map +1 -0
  45. package/components/shared/utils/index.d.ts +1 -0
  46. package/components/shared/utils/index.d.ts.map +1 -1
  47. package/components/shared/utils/node-utils/config.d.ts +27 -0
  48. package/components/shared/utils/node-utils/config.d.ts.map +1 -0
  49. package/components/shared/utils/node-utils/icon-style.d.ts.map +1 -1
  50. package/components/shared/utils/node-utils/index.d.ts +6 -5
  51. package/components/shared/utils/node-utils/index.d.ts.map +1 -1
  52. package/components/shared/utils/node-utils/label-background.d.ts.map +1 -1
  53. package/components/shared/utils/node-utils/offset.d.ts +2 -6
  54. package/components/shared/utils/node-utils/offset.d.ts.map +1 -1
  55. package/components/shared/utils/node-utils/state-styles.d.ts +64 -0
  56. package/components/shared/utils/node-utils/state-styles.d.ts.map +1 -0
  57. package/components/shared/utils/node-utils/status-style.d.ts.map +1 -1
  58. package/components/shared/utils/node-utils/text-style.d.ts.map +1 -1
  59. package/components/shared/utils/node-utils/theme.d.ts +1 -1
  60. package/components/shared/utils/node-utils/theme.d.ts.map +1 -1
  61. package/components/shared/utils/node-utils/title-style.d.ts.map +1 -1
  62. package/core/graph/graph.d.ts +218 -187
  63. package/core/graph/graph.d.ts.map +1 -1
  64. package/core/model/behavior.model.d.ts +6 -2
  65. package/core/model/behavior.model.d.ts.map +1 -1
  66. package/core/model/edge.model.d.ts +221 -0
  67. package/core/model/edge.model.d.ts.map +1 -1
  68. package/core/model/event.model.d.ts +7 -1
  69. package/core/model/event.model.d.ts.map +1 -1
  70. package/core/model/group.model.d.ts +57 -0
  71. package/core/model/group.model.d.ts.map +1 -1
  72. package/core/model/index.d.ts +1 -0
  73. package/core/model/index.d.ts.map +1 -1
  74. package/core/model/label.model.d.ts +2 -1
  75. package/core/model/label.model.d.ts.map +1 -1
  76. package/core/model/node.model.d.ts +106 -0
  77. package/core/model/node.model.d.ts.map +1 -1
  78. package/core/model/plugin.model.d.ts +6 -2
  79. package/core/model/plugin.model.d.ts.map +1 -1
  80. package/core/model/state.model.d.ts +1 -1
  81. package/core/model/state.model.d.ts.map +1 -1
  82. package/core/model/text.model.d.ts +5 -0
  83. package/core/model/text.model.d.ts.map +1 -0
  84. package/index.cjs +77 -77
  85. package/index.d.ts +1 -0
  86. package/index.d.ts.map +1 -1
  87. package/index.js +19959 -18690
  88. package/layouts/grid/index.d.ts.map +1 -1
  89. package/package.json +1 -1
  90. package/plugins/context-menu/index.d.ts +11 -1
  91. package/plugins/context-menu/index.d.ts.map +1 -1
  92. package/plugins/history/config/command-filter.d.ts +5 -0
  93. package/plugins/history/config/command-filter.d.ts.map +1 -0
  94. package/plugins/history/config/drill-integration.d.ts +7 -0
  95. package/plugins/history/config/drill-integration.d.ts.map +1 -0
  96. package/plugins/history/config/history-options.d.ts +4 -0
  97. package/plugins/history/config/history-options.d.ts.map +1 -0
  98. package/plugins/history/history.model.d.ts +5 -0
  99. package/plugins/history/history.model.d.ts.map +1 -0
  100. package/plugins/history/index.d.ts +8 -6
  101. package/plugins/history/index.d.ts.map +1 -1
  102. package/plugins/index.d.ts +10 -0
  103. package/plugins/index.d.ts.map +1 -0
  104. package/plugins/minimap/index.d.ts +3 -2
  105. package/plugins/minimap/index.d.ts.map +1 -1
  106. package/plugins/rich-tooltip/index.d.ts +11 -0
  107. package/plugins/rich-tooltip/index.d.ts.map +1 -0
  108. package/plugins/snapline/index.d.ts +130 -2
  109. package/plugins/snapline/index.d.ts.map +1 -1
  110. package/plugins/snapline/models/index.d.ts +1 -1
  111. package/plugins/snapline/models/index.d.ts.map +1 -1
  112. package/plugins/snapline/models/snapline-models.d.ts +61 -0
  113. package/plugins/snapline/models/snapline-models.d.ts.map +1 -0
  114. package/plugins/tooltip/index.d.ts +1 -2
  115. package/plugins/tooltip/index.d.ts.map +1 -1
  116. package/shared/transforms/behavior-transform.d.ts +1 -0
  117. package/shared/transforms/behavior-transform.d.ts.map +1 -1
  118. package/shared/transforms/graph-transform.d.ts.map +1 -1
  119. package/shared/transforms/plugin-transform.d.ts +5 -4
  120. package/shared/transforms/plugin-transform.d.ts.map +1 -1
  121. package/shared/utils/config-setter.d.ts +9 -0
  122. package/shared/utils/config-setter.d.ts.map +1 -0
  123. package/shared/utils/index.d.ts +3 -2
  124. 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,CAsCxB"}
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 interface OffsetConfig {
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,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;AAQD,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"}
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,EAAqB,YAAY,EAAE,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,CA0BzB"}
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;AAE3C,OAAO,EAAqB,YAAY,EAAE,MAAM,UAAU,CAAC;AAK3D,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,CAoChB"}
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;AAEhD,eAAO,MAAM,YAAY,GACvB,OAAO,KAAK,EACZ,QAAQ,KAAK,EAAE,EACf,SAAS,UAAU,CAAC,WAAW,CAAC,KAC/B,cAwFF,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;AAEzC,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,CAexB"}
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"}