@antv/g6 5.0.0-beta.11 → 5.0.0-beta.12

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 (273) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/esm/api-doc/graph.d.ts +3 -3
  3. package/esm/api-doc/graph.js +3 -3
  4. package/esm/api-doc/graph.js.map +1 -1
  5. package/esm/constant/shape.d.ts +1 -1
  6. package/esm/index.d.ts +12 -62
  7. package/esm/index.js +4 -5
  8. package/esm/index.js.map +1 -1
  9. package/esm/runtime/controller/item.js +15 -6
  10. package/esm/runtime/controller/item.js.map +1 -1
  11. package/esm/runtime/controller/layout.js +1 -3
  12. package/esm/runtime/controller/layout.js.map +1 -1
  13. package/esm/runtime/graph.d.ts +1 -1
  14. package/esm/runtime/graph.js +11 -5
  15. package/esm/runtime/graph.js.map +1 -1
  16. package/esm/stdlib/behavior/drag-canvas.d.ts +1 -1
  17. package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
  18. package/esm/stdlib/behavior/shortcuts-call.d.ts +2 -2
  19. package/esm/stdlib/behavior/shortcuts-call.js +12 -5
  20. package/esm/stdlib/behavior/shortcuts-call.js.map +1 -1
  21. package/esm/stdlib/behavior/zoom-canvas-3d.js +4 -1
  22. package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
  23. package/esm/stdlib/index.d.ts +6 -1
  24. package/esm/stdlib/index.js +8 -3
  25. package/esm/stdlib/index.js.map +1 -1
  26. package/esm/stdlib/item/edge/base.js +5 -1
  27. package/esm/stdlib/item/edge/base.js.map +1 -1
  28. package/esm/stdlib/item/edge/cubic-horizontal.js.map +1 -1
  29. package/esm/stdlib/item/edge/cubic-vertical.js.map +1 -1
  30. package/esm/stdlib/item/edge/cubic.js +1 -1
  31. package/esm/stdlib/item/edge/cubic.js.map +1 -1
  32. package/esm/stdlib/item/edge/loop.js +1 -1
  33. package/esm/stdlib/item/edge/loop.js.map +1 -1
  34. package/esm/stdlib/item/node/cube.d.ts +35 -0
  35. package/esm/stdlib/item/node/cube.js +54 -0
  36. package/esm/stdlib/item/node/cube.js.map +1 -0
  37. package/esm/stdlib/item/node/index.d.ts +3 -0
  38. package/esm/stdlib/item/node/index.js +3 -0
  39. package/esm/stdlib/item/node/index.js.map +1 -1
  40. package/esm/stdlib/plugin/edgeFilterLens/index.d.ts +66 -0
  41. package/esm/stdlib/plugin/edgeFilterLens/index.js +309 -0
  42. package/esm/stdlib/plugin/edgeFilterLens/index.js.map +1 -0
  43. package/esm/stdlib/plugin/grid/index.d.ts +1 -1
  44. package/esm/stdlib/plugin/grid/index.js +3 -4
  45. package/esm/stdlib/plugin/grid/index.js.map +1 -1
  46. package/esm/stdlib/plugin/hull/convexHull.d.ts +1 -1
  47. package/esm/stdlib/plugin/hull/hullComponent.js +2 -3
  48. package/esm/stdlib/plugin/hull/hullComponent.js.map +1 -1
  49. package/esm/stdlib/plugin/hull/util.d.ts +2 -2
  50. package/esm/stdlib/plugin/hull/util.js +6 -2
  51. package/esm/stdlib/plugin/hull/util.js.map +1 -1
  52. package/esm/stdlib/plugin/index.d.ts +1 -0
  53. package/esm/stdlib/plugin/index.js +1 -0
  54. package/esm/stdlib/plugin/index.js.map +1 -1
  55. package/esm/stdlib/plugin/legend/index.d.ts +2 -2
  56. package/esm/stdlib/plugin/legend/index.js +3 -3
  57. package/esm/stdlib/plugin/legend/index.js.map +1 -1
  58. package/esm/stdlib/plugin/map/index.d.ts +1 -1
  59. package/esm/stdlib/plugin/map/index.js +4 -4
  60. package/esm/stdlib/plugin/map/index.js.map +1 -1
  61. package/esm/stdlib/plugin/menu/index.d.ts +4 -4
  62. package/esm/stdlib/plugin/menu/index.js +3 -3
  63. package/esm/stdlib/plugin/menu/index.js.map +1 -1
  64. package/esm/stdlib/plugin/minimap/index.d.ts +1 -1
  65. package/esm/stdlib/plugin/minimap/index.js +3 -3
  66. package/esm/stdlib/plugin/minimap/index.js.map +1 -1
  67. package/esm/stdlib/plugin/timebar/index.js +2 -2
  68. package/esm/stdlib/plugin/timebar/index.js.map +1 -1
  69. package/esm/stdlib/plugin/toolbar/index.d.ts +3 -3
  70. package/esm/stdlib/plugin/toolbar/index.js +4 -4
  71. package/esm/stdlib/plugin/toolbar/index.js.map +1 -1
  72. package/esm/stdlib/plugin/tooltip/index.d.ts +4 -4
  73. package/esm/stdlib/plugin/tooltip/index.js +3 -4
  74. package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
  75. package/esm/stdlib/plugin/types.d.ts +1 -0
  76. package/esm/stdlib/plugin/watermaker/index.d.ts +78 -0
  77. package/esm/stdlib/plugin/watermaker/index.js +243 -0
  78. package/esm/stdlib/plugin/watermaker/index.js.map +1 -0
  79. package/esm/types/plugin.d.ts +1 -1
  80. package/esm/util/bbox.js +4 -5
  81. package/esm/util/bbox.js.map +1 -1
  82. package/esm/util/behavior.d.ts +2 -2
  83. package/esm/util/behavior.js +2 -2
  84. package/esm/util/behavior.js.map +1 -1
  85. package/esm/util/data.d.ts +2 -2
  86. package/esm/util/data.js.map +1 -1
  87. package/esm/util/dom.d.ts +15 -0
  88. package/esm/util/dom.js +29 -0
  89. package/esm/util/dom.js.map +1 -0
  90. package/esm/util/extend.d.ts +1 -1
  91. package/esm/util/extend.js +0 -1
  92. package/esm/util/extend.js.map +1 -1
  93. package/esm/util/index.d.ts +7 -52
  94. package/esm/util/index.js +7 -23
  95. package/esm/util/index.js.map +1 -1
  96. package/esm/util/layout.d.ts +1 -1
  97. package/esm/util/layout.js.map +1 -1
  98. package/esm/util/loop.d.ts +1 -1
  99. package/esm/util/math.d.ts +1 -1
  100. package/esm/util/matrix.d.ts +6 -0
  101. package/esm/util/matrix.js +48 -0
  102. package/esm/util/matrix.js.map +1 -0
  103. package/esm/util/path.js +1 -1
  104. package/esm/util/path.js.map +1 -1
  105. package/esm/util/point.d.ts +1 -1
  106. package/esm/util/polyline.d.ts +2 -1
  107. package/esm/util/polyline.js +2 -1
  108. package/esm/util/polyline.js.map +1 -1
  109. package/esm/util/router.d.ts +1 -1
  110. package/esm/util/shape.js.map +1 -1
  111. package/esm/util/shape3d.js +1 -1
  112. package/esm/util/shape3d.js.map +1 -1
  113. package/lib/api-doc/graph.d.ts +3 -3
  114. package/lib/api-doc/graph.js +27 -7
  115. package/lib/api-doc/graph.js.map +1 -1
  116. package/lib/constant/shape.d.ts +1 -1
  117. package/lib/index.d.ts +12 -62
  118. package/lib/index.js +18 -10
  119. package/lib/index.js.map +1 -1
  120. package/lib/runtime/controller/item.js +15 -6
  121. package/lib/runtime/controller/item.js.map +1 -1
  122. package/lib/runtime/controller/layout.js +1 -3
  123. package/lib/runtime/controller/layout.js.map +1 -1
  124. package/lib/runtime/graph.d.ts +1 -1
  125. package/lib/runtime/graph.js +12 -5
  126. package/lib/runtime/graph.js.map +1 -1
  127. package/lib/stdlib/behavior/drag-canvas.d.ts +1 -1
  128. package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
  129. package/lib/stdlib/behavior/shortcuts-call.d.ts +2 -2
  130. package/lib/stdlib/behavior/shortcuts-call.js +12 -5
  131. package/lib/stdlib/behavior/shortcuts-call.js.map +1 -1
  132. package/lib/stdlib/behavior/zoom-canvas-3d.js +4 -1
  133. package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
  134. package/lib/stdlib/index.d.ts +6 -1
  135. package/lib/stdlib/index.js +8 -3
  136. package/lib/stdlib/index.js.map +1 -1
  137. package/lib/stdlib/item/edge/base.js +5 -1
  138. package/lib/stdlib/item/edge/base.js.map +1 -1
  139. package/lib/stdlib/item/edge/cubic-horizontal.js.map +1 -1
  140. package/lib/stdlib/item/edge/cubic-vertical.js.map +1 -1
  141. package/lib/stdlib/item/edge/cubic.js +2 -2
  142. package/lib/stdlib/item/edge/cubic.js.map +1 -1
  143. package/lib/stdlib/item/edge/loop.js +3 -3
  144. package/lib/stdlib/item/edge/loop.js.map +1 -1
  145. package/lib/stdlib/item/node/cube.d.ts +35 -0
  146. package/lib/stdlib/item/node/cube.js +58 -0
  147. package/lib/stdlib/item/node/cube.js.map +1 -0
  148. package/lib/stdlib/item/node/index.d.ts +3 -0
  149. package/lib/stdlib/item/node/index.js +3 -0
  150. package/lib/stdlib/item/node/index.js.map +1 -1
  151. package/lib/stdlib/plugin/edgeFilterLens/index.d.ts +66 -0
  152. package/lib/stdlib/plugin/edgeFilterLens/index.js +313 -0
  153. package/lib/stdlib/plugin/edgeFilterLens/index.js.map +1 -0
  154. package/lib/stdlib/plugin/grid/index.d.ts +1 -1
  155. package/lib/stdlib/plugin/grid/index.js +6 -7
  156. package/lib/stdlib/plugin/grid/index.js.map +1 -1
  157. package/lib/stdlib/plugin/hull/convexHull.d.ts +1 -1
  158. package/lib/stdlib/plugin/hull/hullComponent.js +2 -3
  159. package/lib/stdlib/plugin/hull/hullComponent.js.map +1 -1
  160. package/lib/stdlib/plugin/hull/util.d.ts +2 -2
  161. package/lib/stdlib/plugin/hull/util.js +26 -22
  162. package/lib/stdlib/plugin/hull/util.js.map +1 -1
  163. package/lib/stdlib/plugin/index.d.ts +1 -0
  164. package/lib/stdlib/plugin/index.js +1 -0
  165. package/lib/stdlib/plugin/index.js.map +1 -1
  166. package/lib/stdlib/plugin/legend/index.d.ts +2 -2
  167. package/lib/stdlib/plugin/legend/index.js +3 -3
  168. package/lib/stdlib/plugin/legend/index.js.map +1 -1
  169. package/lib/stdlib/plugin/map/index.d.ts +1 -1
  170. package/lib/stdlib/plugin/map/index.js +6 -6
  171. package/lib/stdlib/plugin/map/index.js.map +1 -1
  172. package/lib/stdlib/plugin/menu/index.d.ts +4 -4
  173. package/lib/stdlib/plugin/menu/index.js +6 -6
  174. package/lib/stdlib/plugin/menu/index.js.map +1 -1
  175. package/lib/stdlib/plugin/minimap/index.d.ts +1 -1
  176. package/lib/stdlib/plugin/minimap/index.js +6 -6
  177. package/lib/stdlib/plugin/minimap/index.js.map +1 -1
  178. package/lib/stdlib/plugin/timebar/index.js +2 -2
  179. package/lib/stdlib/plugin/timebar/index.js.map +1 -1
  180. package/lib/stdlib/plugin/toolbar/index.d.ts +3 -3
  181. package/lib/stdlib/plugin/toolbar/index.js +5 -5
  182. package/lib/stdlib/plugin/toolbar/index.js.map +1 -1
  183. package/lib/stdlib/plugin/tooltip/index.d.ts +4 -4
  184. package/lib/stdlib/plugin/tooltip/index.js +10 -11
  185. package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
  186. package/lib/stdlib/plugin/types.d.ts +1 -0
  187. package/lib/stdlib/plugin/watermaker/index.d.ts +78 -0
  188. package/lib/stdlib/plugin/watermaker/index.js +247 -0
  189. package/lib/stdlib/plugin/watermaker/index.js.map +1 -0
  190. package/lib/types/plugin.d.ts +1 -1
  191. package/lib/util/bbox.js +4 -5
  192. package/lib/util/bbox.js.map +1 -1
  193. package/lib/util/behavior.d.ts +2 -2
  194. package/lib/util/behavior.js +2 -2
  195. package/lib/util/behavior.js.map +1 -1
  196. package/lib/util/data.d.ts +2 -2
  197. package/lib/util/data.js.map +1 -1
  198. package/lib/util/dom.d.ts +15 -0
  199. package/lib/util/dom.js +34 -0
  200. package/lib/util/dom.js.map +1 -0
  201. package/lib/util/extend.d.ts +1 -1
  202. package/lib/util/extend.js +0 -1
  203. package/lib/util/extend.js.map +1 -1
  204. package/lib/util/index.d.ts +7 -52
  205. package/lib/util/index.js +23 -23
  206. package/lib/util/index.js.map +1 -1
  207. package/lib/util/layout.d.ts +1 -1
  208. package/lib/util/layout.js.map +1 -1
  209. package/lib/util/loop.d.ts +1 -1
  210. package/lib/util/math.d.ts +1 -1
  211. package/lib/util/matrix.d.ts +6 -0
  212. package/lib/util/matrix.js +52 -0
  213. package/lib/util/matrix.js.map +1 -0
  214. package/lib/util/path.js +2 -2
  215. package/lib/util/path.js.map +1 -1
  216. package/lib/util/point.d.ts +1 -1
  217. package/lib/util/polyline.d.ts +2 -1
  218. package/lib/util/polyline.js +2 -1
  219. package/lib/util/polyline.js.map +1 -1
  220. package/lib/util/router.d.ts +1 -1
  221. package/lib/util/shape.js.map +1 -1
  222. package/lib/util/shape3d.js +1 -1
  223. package/lib/util/shape3d.js.map +1 -1
  224. package/package.json +32 -40
  225. package/src/api-doc/graph.ts +4 -3
  226. package/src/constant/shape.ts +1 -1
  227. package/src/index.ts +5 -6
  228. package/src/runtime/controller/item.ts +15 -6
  229. package/src/runtime/controller/layout.ts +1 -5
  230. package/src/runtime/graph.ts +12 -6
  231. package/src/stdlib/behavior/drag-canvas.ts +1 -1
  232. package/src/stdlib/behavior/shortcuts-call.ts +13 -4
  233. package/src/stdlib/behavior/zoom-canvas-3d.ts +4 -1
  234. package/src/stdlib/index.ts +10 -1
  235. package/src/stdlib/item/edge/base.ts +5 -2
  236. package/src/stdlib/item/edge/cubic-horizontal.ts +0 -1
  237. package/src/stdlib/item/edge/cubic-vertical.ts +0 -1
  238. package/src/stdlib/item/edge/cubic.ts +1 -1
  239. package/src/stdlib/item/edge/loop.ts +1 -1
  240. package/src/stdlib/item/node/cube.ts +102 -0
  241. package/src/stdlib/item/node/index.ts +3 -0
  242. package/src/stdlib/plugin/edgeFilterLens/index.ts +387 -0
  243. package/src/stdlib/plugin/grid/index.ts +6 -6
  244. package/src/stdlib/plugin/hull/convexHull.ts +1 -1
  245. package/src/stdlib/plugin/hull/hullComponent.ts +2 -3
  246. package/src/stdlib/plugin/hull/util.ts +6 -2
  247. package/src/stdlib/plugin/index.ts +1 -0
  248. package/src/stdlib/plugin/legend/index.ts +6 -6
  249. package/src/stdlib/plugin/map/index.ts +7 -7
  250. package/src/stdlib/plugin/menu/index.ts +13 -13
  251. package/src/stdlib/plugin/minimap/index.ts +6 -6
  252. package/src/stdlib/plugin/timebar/index.ts +4 -4
  253. package/src/stdlib/plugin/toolbar/index.ts +8 -8
  254. package/src/stdlib/plugin/tooltip/index.ts +10 -10
  255. package/src/stdlib/plugin/types.ts +1 -0
  256. package/src/stdlib/plugin/watermaker/index.ts +302 -0
  257. package/src/types/plugin.ts +1 -1
  258. package/src/util/bbox.ts +4 -5
  259. package/src/util/behavior.ts +4 -4
  260. package/src/util/data.ts +2 -3
  261. package/src/util/dom.ts +33 -0
  262. package/src/util/extend.ts +2 -3
  263. package/src/util/index.ts +7 -24
  264. package/src/util/layout.ts +3 -2
  265. package/src/util/loop.ts +1 -1
  266. package/src/util/math.ts +1 -1
  267. package/src/util/matrix.ts +66 -0
  268. package/src/util/path.ts +1 -1
  269. package/src/util/point.ts +1 -1
  270. package/src/util/polyline.ts +2 -1
  271. package/src/util/router.ts +1 -1
  272. package/src/util/shape.ts +0 -1
  273. package/src/util/shape3d.ts +1 -1
package/src/util/data.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { NodeUserModel } from 'types';
2
1
  import { ID, TreeData } from '@antv/graphlib';
3
- import { NodeUserModelData } from 'types/node';
4
2
  import { isArray } from '@antv/util';
5
3
  import { depthFirstSearch, connectedComponent } from '@antv/algorithm';
6
4
  import { GraphCore, GraphData } from '../types/data';
7
5
  import { IGraph } from '../types/graph';
8
- import { NodeModel } from '../types';
6
+ import { NodeModel, NodeUserModel } from '../types';
7
+ import { NodeUserModelData } from '../types/node';
9
8
 
10
9
  /**
11
10
  * Deconstruct data and distinguish nodes and combos from graphcore data.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Create DOM from a html string.
3
+ * @param str
4
+ * @returns
5
+ */
6
+ export function createDOM(str: string): HTMLElement {
7
+ const container = document.createElement('div');
8
+ container.innerHTML = str;
9
+
10
+ const dom = container.childNodes[0];
11
+ if (dom && container.contains(dom)) {
12
+ container.removeChild(dom);
13
+ }
14
+ return dom as HTMLElement;
15
+ }
16
+
17
+ /**
18
+ * Modify the CSS of a DOM.
19
+ * @param dom
20
+ * @param css
21
+ * @returns
22
+ */
23
+ export function modifyCSS(
24
+ dom: HTMLElement,
25
+ css: { [key: string]: any },
26
+ ): HTMLElement {
27
+ if (!dom) return;
28
+
29
+ Object.keys(css).forEach((key) => {
30
+ dom.style[key] = css[key];
31
+ });
32
+ return dom;
33
+ }
@@ -4,7 +4,7 @@ import { NodeRegistry } from '../types/node';
4
4
  import { EdgeRegistry } from '../types/edge';
5
5
  import { LayoutRegistry } from '../types/layout';
6
6
  import { PluginRegistry } from '../types/plugin';
7
- import Graph from '../runtime/graph';
7
+ import { Graph } from '../runtime/graph';
8
8
  import registry from '../stdlib';
9
9
 
10
10
  /**
@@ -43,6 +43,5 @@ export const extend = <
43
43
  extension.type = type;
44
44
  });
45
45
  });
46
- // @ts-expect-error
47
- return GraphClass;
46
+ return GraphClass as any;
48
47
  };
package/src/util/index.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { extend } from './extend';
2
- import { mock } from './mock';
3
- import { isEncode } from './type';
4
- import { getArrowPath } from './arrow';
5
- import {
1
+ export { extend } from './extend';
2
+ export { mock } from './mock';
3
+ export { isEncode } from './type';
4
+ export { getArrowPath } from './arrow';
5
+ export {
6
6
  graphCoreTreeDfs,
7
7
  graphComboTreeDfs,
8
8
  traverseAncestorsAndSucceeds,
@@ -13,22 +13,5 @@ import {
13
13
  graphData2TreeData,
14
14
  traverse,
15
15
  } from './data';
16
- import { getEdgesBetween } from './item';
17
-
18
- const Util = {
19
- extend,
20
- isEncode,
21
- mock,
22
- getArrowPath,
23
- graphCoreTreeDfs,
24
- graphComboTreeDfs,
25
- traverseAncestorsAndSucceeds,
26
- traverseGraphAncestors,
27
- traverseAncestors,
28
- isSucceed,
29
- treeData2GraphData,
30
- graphData2TreeData,
31
- traverse,
32
- getEdgesBetween,
33
- };
34
- export default Util;
16
+ export { getEdgesBetween } from './item';
17
+ export { transform } from './matrix';
@@ -1,10 +1,11 @@
1
1
  import Hierarchy from '@antv/hierarchy';
2
-
3
2
  import { isArray, isNumber } from '@antv/util';
4
- import { GraphData, ID, NodeModel } from 'types';
3
+ import { GraphData, ID, NodeModel } from '../types';
5
4
  import { Point } from '../types/common';
6
5
  import { traverse } from './data';
6
+
7
7
  type TreeGraphData = any;
8
+
8
9
  /**
9
10
  * Judge the direction according to options of a tree layout.
10
11
  * @param type Tree layout type.
package/src/util/loop.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Tuple3Number } from '@antv/g';
2
- import { vec2 } from '@antv/matrix-util';
2
+ import { vec2 } from 'gl-matrix';
3
3
  import { LOOP_POSITION, LoopPosition } from '../types/loop';
4
4
 
5
5
  const PI_OVER_8 = Math.PI / 8;
package/src/util/math.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Point, PolyPoint } from 'types/common';
1
+ import { Point, PolyPoint } from '../types/common';
2
2
 
3
3
  /**
4
4
  * Whether the value is begween the range of [min, max]
@@ -0,0 +1,66 @@
1
+ import { mat3 } from 'gl-matrix';
2
+
3
+ type mat3Type = [
4
+ number,
5
+ number,
6
+ number,
7
+ number,
8
+ number,
9
+ number,
10
+ number,
11
+ number,
12
+ number,
13
+ ];
14
+
15
+ function leftTranslate(out, a, v) {
16
+ const transMat: mat3Type = [0, 0, 0, 0, 0, 0, 0, 0, 0];
17
+ mat3.fromTranslation(transMat, v);
18
+ return mat3.multiply(out, transMat, a);
19
+ }
20
+
21
+ function leftRotate(out, a, rad) {
22
+ const rotateMat: mat3Type = [0, 0, 0, 0, 0, 0, 0, 0, 0];
23
+ mat3.fromRotation(rotateMat, rad);
24
+ return mat3.multiply(out, rotateMat, a);
25
+ }
26
+
27
+ function leftScale(out, a, v) {
28
+ const scaleMat: mat3Type = [0, 0, 0, 0, 0, 0, 0, 0, 0];
29
+ mat3.fromScaling(scaleMat, v);
30
+ return mat3.multiply(out, scaleMat, a);
31
+ }
32
+
33
+ function leftMultiply(out, a, a1) {
34
+ return mat3.multiply(out, a1, a);
35
+ }
36
+
37
+ /**
38
+ * 根据 actions 来做 transform
39
+ * @param m
40
+ * @param actions
41
+ */
42
+ export function transform(m: number[], actions: any[][]) {
43
+ const matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];
44
+
45
+ for (let i = 0, len = actions.length; i < len; i++) {
46
+ const action = actions[i];
47
+ switch (action[0]) {
48
+ case 't':
49
+ leftTranslate(matrix, matrix, [action[1], action[2]]);
50
+ break;
51
+ case 's':
52
+ leftScale(matrix, matrix, [action[1], action[2]]);
53
+ break;
54
+ case 'r':
55
+ leftRotate(matrix, matrix, action[1]);
56
+ break;
57
+ case 'm':
58
+ leftMultiply(matrix, matrix, action[1]);
59
+ break;
60
+ default:
61
+ break;
62
+ }
63
+ }
64
+
65
+ return matrix;
66
+ }
package/src/util/path.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { vec2 } from '@antv/matrix-util';
1
+ import { vec2 } from 'gl-matrix';
2
2
  import { Point } from '../types/common';
3
3
 
4
4
  /**
package/src/util/point.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { vec2 } from '@antv/matrix-util';
1
+ import { vec2 } from 'gl-matrix';
2
2
  import { Point } from '../types/common';
3
3
  import { isBetween } from './math';
4
4
 
@@ -55,7 +55,8 @@ export const simplifyPolylinePoints = (points: PolyPoint[]): PolyPoint[] => {
55
55
  };
56
56
 
57
57
  /**
58
- * Use the A* path-finding algorithm to obtain the shortest path. Considering that there is no need to implement automatic obstacle avoidance, use waypoints to plan the path
58
+ * Use the A* path-finding algorithm to obtain the shortest path.
59
+ * Considering that there is no need to implement automatic obstacle avoidance, use waypoints to plan the path.
59
60
  */
60
61
  export const simplePathFinder = (
61
62
  start: PolyPoint,
@@ -24,7 +24,7 @@ export interface RouterCfg {
24
24
  /** Allowed edge directions */
25
25
  directions?: any[];
26
26
  /** Penalties */
27
- penalties?: {};
27
+ penalties?: Record<string, any>;
28
28
  /** Determine if use simple router for polyline when no obstacles */
29
29
  simple?: boolean;
30
30
  /** Function to calculate the distance between two points */
package/src/util/shape.ts CHANGED
@@ -24,7 +24,6 @@ import {
24
24
  ItemShapeStyles,
25
25
  ShapeStyle,
26
26
  SHAPE_TYPE_3D,
27
- ItemModel,
28
27
  } from '../types/item';
29
28
  import { NodeDisplayModel, NodeShapeMap } from '../types/node';
30
29
  import { ComboDisplayModel, IGraph } from '../types';
@@ -19,7 +19,7 @@ import {
19
19
 
20
20
  const GeometryTagMap = {
21
21
  sphere: SphereGeometry,
22
- cubic: CubeGeometry,
22
+ cube: CubeGeometry,
23
23
  plane: PlaneGeometry,
24
24
  };
25
25