@moxa/graph 3.0.0-beta.1 → 3.0.0-beta.10

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 (118) hide show
  1. package/README.md +615 -114
  2. package/assets/icon-sprite.svg +1 -1
  3. package/behaviors/drill-down/drill-down-manager.d.ts +55 -0
  4. package/behaviors/drill-down/drill-down-manager.d.ts.map +1 -0
  5. package/behaviors/drill-down/index.d.ts +71 -0
  6. package/behaviors/drill-down/index.d.ts.map +1 -0
  7. package/behaviors/drill-down/models/index.d.ts +7 -0
  8. package/behaviors/drill-down/models/index.d.ts.map +1 -0
  9. package/components/edge-arrow/transforms/index.d.ts.map +1 -1
  10. package/components/edge-label/index.d.ts +4 -4
  11. package/components/edge-label/index.d.ts.map +1 -1
  12. package/components/edge-line/index.d.ts.map +1 -1
  13. package/components/edge-polyline/index.d.ts.map +1 -1
  14. package/components/edge-quadratic/index.d.ts.map +1 -1
  15. package/components/group-device/index.d.ts +34 -0
  16. package/components/group-device/index.d.ts.map +1 -1
  17. package/components/group-device/models/index.d.ts +10 -1
  18. package/components/group-device/models/index.d.ts.map +1 -1
  19. package/components/group-device/transforms/index.d.ts.map +1 -1
  20. package/components/group-device/utils/style.d.ts.map +1 -1
  21. package/components/node-device/models/index.d.ts +2 -0
  22. package/components/node-device/models/index.d.ts.map +1 -1
  23. package/components/node-device/utils/style.d.ts.map +1 -1
  24. package/components/node-label/index.d.ts +1 -1
  25. package/components/node-label/index.d.ts.map +1 -1
  26. package/components/shared/transforms/edge-transform.d.ts.map +1 -1
  27. package/components/shared/transforms/group-transform.d.ts.map +1 -1
  28. package/components/shared/transforms/node-transform.d.ts.map +1 -1
  29. package/components/shared/utils/edge-utils/index.d.ts +1 -0
  30. package/components/shared/utils/edge-utils/index.d.ts.map +1 -1
  31. package/components/shared/utils/edge-utils/state-style.d.ts +24 -0
  32. package/components/shared/utils/edge-utils/state-style.d.ts.map +1 -0
  33. package/components/shared/utils/edge-utils/style.d.ts +19 -1
  34. package/components/shared/utils/edge-utils/style.d.ts.map +1 -1
  35. package/components/shared/utils/group-utils/drill-icon.d.ts +10 -0
  36. package/components/shared/utils/group-utils/drill-icon.d.ts.map +1 -0
  37. package/components/shared/utils/group-utils/index.d.ts +3 -0
  38. package/components/shared/utils/group-utils/index.d.ts.map +1 -0
  39. package/components/shared/utils/group-utils/label-background.d.ts +10 -0
  40. package/components/shared/utils/group-utils/label-background.d.ts.map +1 -0
  41. package/components/shared/utils/index.d.ts +1 -0
  42. package/components/shared/utils/index.d.ts.map +1 -1
  43. package/components/shared/utils/node-utils/config.d.ts +27 -0
  44. package/components/shared/utils/node-utils/config.d.ts.map +1 -0
  45. package/components/shared/utils/node-utils/icon-style.d.ts.map +1 -1
  46. package/components/shared/utils/node-utils/index.d.ts +6 -5
  47. package/components/shared/utils/node-utils/index.d.ts.map +1 -1
  48. package/components/shared/utils/node-utils/label-background.d.ts.map +1 -1
  49. package/components/shared/utils/node-utils/offset.d.ts +2 -6
  50. package/components/shared/utils/node-utils/offset.d.ts.map +1 -1
  51. package/components/shared/utils/node-utils/state-styles.d.ts +63 -0
  52. package/components/shared/utils/node-utils/state-styles.d.ts.map +1 -0
  53. package/components/shared/utils/node-utils/status-style.d.ts.map +1 -1
  54. package/components/shared/utils/node-utils/text-style.d.ts.map +1 -1
  55. package/components/shared/utils/node-utils/theme.d.ts +1 -1
  56. package/components/shared/utils/node-utils/theme.d.ts.map +1 -1
  57. package/components/shared/utils/node-utils/title-style.d.ts.map +1 -1
  58. package/core/graph/graph.d.ts +218 -187
  59. package/core/graph/graph.d.ts.map +1 -1
  60. package/core/model/behavior.model.d.ts +6 -2
  61. package/core/model/behavior.model.d.ts.map +1 -1
  62. package/core/model/edge.model.d.ts +221 -0
  63. package/core/model/edge.model.d.ts.map +1 -1
  64. package/core/model/event.model.d.ts +7 -1
  65. package/core/model/event.model.d.ts.map +1 -1
  66. package/core/model/group.model.d.ts +1 -0
  67. package/core/model/group.model.d.ts.map +1 -1
  68. package/core/model/index.d.ts +1 -0
  69. package/core/model/index.d.ts.map +1 -1
  70. package/core/model/label.model.d.ts +2 -1
  71. package/core/model/label.model.d.ts.map +1 -1
  72. package/core/model/node.model.d.ts +98 -0
  73. package/core/model/node.model.d.ts.map +1 -1
  74. package/core/model/plugin.model.d.ts +6 -2
  75. package/core/model/plugin.model.d.ts.map +1 -1
  76. package/core/model/text.model.d.ts +5 -0
  77. package/core/model/text.model.d.ts.map +1 -0
  78. package/index.cjs +77 -77
  79. package/index.d.ts +1 -0
  80. package/index.d.ts.map +1 -1
  81. package/index.js +20306 -19052
  82. package/layouts/grid/index.d.ts.map +1 -1
  83. package/package.json +1 -1
  84. package/plugins/context-menu/index.d.ts +11 -1
  85. package/plugins/context-menu/index.d.ts.map +1 -1
  86. package/plugins/history/config/command-filter.d.ts +5 -0
  87. package/plugins/history/config/command-filter.d.ts.map +1 -0
  88. package/plugins/history/config/drill-integration.d.ts +7 -0
  89. package/plugins/history/config/drill-integration.d.ts.map +1 -0
  90. package/plugins/history/config/history-options.d.ts +4 -0
  91. package/plugins/history/config/history-options.d.ts.map +1 -0
  92. package/plugins/history/history.model.d.ts +5 -0
  93. package/plugins/history/history.model.d.ts.map +1 -0
  94. package/plugins/history/index.d.ts +8 -6
  95. package/plugins/history/index.d.ts.map +1 -1
  96. package/plugins/index.d.ts +10 -0
  97. package/plugins/index.d.ts.map +1 -0
  98. package/plugins/minimap/index.d.ts +3 -2
  99. package/plugins/minimap/index.d.ts.map +1 -1
  100. package/plugins/rich-tooltip/index.d.ts +11 -0
  101. package/plugins/rich-tooltip/index.d.ts.map +1 -0
  102. package/plugins/snapline/index.d.ts +130 -2
  103. package/plugins/snapline/index.d.ts.map +1 -1
  104. package/plugins/snapline/models/index.d.ts +1 -1
  105. package/plugins/snapline/models/index.d.ts.map +1 -1
  106. package/plugins/snapline/models/snapline-models.d.ts +61 -0
  107. package/plugins/snapline/models/snapline-models.d.ts.map +1 -0
  108. package/plugins/tooltip/index.d.ts +1 -2
  109. package/plugins/tooltip/index.d.ts.map +1 -1
  110. package/shared/transforms/behavior-transform.d.ts +1 -0
  111. package/shared/transforms/behavior-transform.d.ts.map +1 -1
  112. package/shared/transforms/graph-transform.d.ts.map +1 -1
  113. package/shared/transforms/plugin-transform.d.ts +5 -4
  114. package/shared/transforms/plugin-transform.d.ts.map +1 -1
  115. package/shared/utils/config-setter.d.ts +9 -0
  116. package/shared/utils/config-setter.d.ts.map +1 -0
  117. package/shared/utils/index.d.ts +3 -2
  118. package/shared/utils/index.d.ts.map +1 -1
@@ -0,0 +1,63 @@
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 > 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([]) // Returns 'default'
18
+ * ```
19
+ */
20
+ export declare function determineCurrentState(states: State[]): keyof NonNullable<NodeConfig['stateStyles']>;
21
+ /**
22
+ * Converts border style string or array to G6 lineDash format.
23
+ *
24
+ * @param style - Border style: 'solid', 'dashed', 'dotted', or custom dash array
25
+ * @returns G6 lineDash array or undefined for solid lines
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * convertBorderStyleToLineDash('solid') // Returns undefined
30
+ * convertBorderStyleToLineDash('dashed') // Returns [8, 4]
31
+ * convertBorderStyleToLineDash('dotted') // Returns [2, 4]
32
+ * convertBorderStyleToLineDash([5, 5]) // Returns [5, 5]
33
+ * ```
34
+ */
35
+ export declare function convertBorderStyleToLineDash(style: 'solid' | 'dashed' | 'dotted' | number[]): number[] | undefined;
36
+ /**
37
+ * Converts NodeStyleProperties to G6 style properties.
38
+ * Applies default border width (2px) when borderColor is set without borderWidth.
39
+ *
40
+ * @param stateStyle - Custom style properties for a specific state
41
+ * @returns G6 circle style properties
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const customStyle = {
46
+ * backgroundColor: '#E3F2FD',
47
+ * borderColor: '#1976D2',
48
+ * borderWidth: 3,
49
+ * borderStyle: 'dashed'
50
+ * };
51
+ * const g6Style = convertToG6Style(customStyle);
52
+ * // Returns: {
53
+ * // fill: '#E3F2FD',
54
+ * // fillOpacity: 1,
55
+ * // stroke: '#1976D2',
56
+ * // strokeOpacity: 1,
57
+ * // lineWidth: 3,
58
+ * // lineDash: [8, 4]
59
+ * // }
60
+ * ```
61
+ */
62
+ export declare function convertToG6Style(stateStyle: NodeStyleProperties): Partial<GCircleStyleProps>;
63
+ //# 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;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,KAAK,EAAE,GACd,MAAM,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAK9C;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,CA2BzB"}
@@ -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,CA4ChB"}
@@ -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"}