@antv/g 1.0.0-alpha.20 → 1.0.0-alpha.24

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 (293) hide show
  1. package/es/Canvas.d.ts +40 -18
  2. package/es/Canvas.js +121 -65
  3. package/es/DisplayObjectPool.d.ts +2 -1
  4. package/es/DisplayObjectPool.js +4 -0
  5. package/{lib → es/camera}/Camera.d.ts +6 -3
  6. package/es/{Camera.js → camera/Camera.js} +22 -16
  7. package/es/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
  8. package/es/{Landmark.js → camera/Landmark.js} +1 -1
  9. package/es/camera/index.d.ts +2 -0
  10. package/es/camera/index.js +2 -0
  11. package/es/components/Cullable.js +1 -1
  12. package/es/components/Geometry.d.ts +8 -1
  13. package/es/components/Renderable.d.ts +9 -8
  14. package/es/components/Renderable.js +2 -6
  15. package/es/components/Sortable.d.ts +6 -2
  16. package/es/display-objects/Circle.d.ts +2 -3
  17. package/es/display-objects/Circle.js +2 -5
  18. package/es/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
  19. package/es/{CustomElement.js → display-objects/CustomElement.js} +22 -12
  20. package/{lib → es/display-objects}/DisplayObject.d.ts +136 -141
  21. package/es/{DisplayObject.js → display-objects/DisplayObject.js} +408 -292
  22. package/es/display-objects/Ellipse.d.ts +2 -3
  23. package/es/display-objects/Ellipse.js +2 -5
  24. package/es/display-objects/Group.d.ts +2 -1
  25. package/es/display-objects/Group.js +13 -5
  26. package/es/display-objects/HTML.d.ts +2 -2
  27. package/es/display-objects/HTML.js +4 -7
  28. package/es/display-objects/Image.d.ts +2 -2
  29. package/es/display-objects/Image.js +2 -6
  30. package/es/display-objects/Line.d.ts +2 -2
  31. package/es/display-objects/Line.js +8 -8
  32. package/es/display-objects/Path.d.ts +3 -2
  33. package/es/display-objects/Path.js +8 -8
  34. package/es/display-objects/Polygon.d.ts +2 -2
  35. package/es/display-objects/Polygon.js +2 -6
  36. package/es/display-objects/Polyline.d.ts +2 -2
  37. package/es/display-objects/Polyline.js +8 -8
  38. package/es/display-objects/Rect.d.ts +2 -2
  39. package/es/display-objects/Rect.js +2 -6
  40. package/es/display-objects/Text.d.ts +2 -3
  41. package/es/display-objects/Text.js +8 -7
  42. package/es/display-objects/index.d.ts +2 -0
  43. package/es/display-objects/index.js +2 -0
  44. package/es/{Animation.d.ts → dom/Animation.d.ts} +3 -3
  45. package/es/{Animation.js → dom/Animation.js} +2 -3
  46. package/{lib → es/dom}/AnimationEffectTiming.d.ts +2 -0
  47. package/es/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -2
  48. package/es/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
  49. package/es/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
  50. package/es/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
  51. package/es/{Timeline.js → dom/AnimationTimeline.js} +1 -1
  52. package/es/dom/CustomElementRegistry.d.ts +15 -0
  53. package/es/dom/CustomElementRegistry.js +40 -0
  54. package/{lib → es/dom}/CustomEvent.d.ts +1 -1
  55. package/es/{CustomEvent.js → dom/CustomEvent.js} +1 -1
  56. package/es/dom/Document.d.ts +36 -17
  57. package/es/dom/Document.js +98 -14
  58. package/es/dom/Element.d.ts +71 -92
  59. package/es/dom/Element.js +179 -195
  60. package/es/dom/EventTarget.d.ts +11 -6
  61. package/es/dom/EventTarget.js +12 -4
  62. package/es/dom/FederatedEvent.d.ts +15 -7
  63. package/es/dom/FederatedEvent.js +33 -0
  64. package/es/dom/FederatedMouseEvent.d.ts +1 -1
  65. package/es/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
  66. package/es/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
  67. package/es/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
  68. package/es/{KeyframeList.js → dom/KeyframeList.js} +0 -0
  69. package/es/dom/Node.d.ts +38 -23
  70. package/es/dom/Node.js +37 -33
  71. package/es/dom/index.d.ts +15 -2
  72. package/es/dom/index.js +16 -3
  73. package/es/dom/interfaces.d.ts +301 -0
  74. package/es/dom/interfaces.js +1 -0
  75. package/es/global-module.d.ts +0 -2
  76. package/es/global-module.js +31 -29
  77. package/es/index.d.ts +7 -14
  78. package/es/index.js +8 -15
  79. package/es/plugins/CullingPlugin.d.ts +2 -2
  80. package/es/plugins/CullingPlugin.js +13 -16
  81. package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
  82. package/es/plugins/DirtyCheckPlugin.js +8 -7
  83. package/es/plugins/EventPlugin.js +52 -31
  84. package/es/plugins/FrustumCullingStrategy.d.ts +1 -1
  85. package/es/plugins/FrustumCullingStrategy.js +5 -4
  86. package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
  87. package/es/plugins/PrepareRendererPlugin.js +42 -38
  88. package/es/property-handlers/aabb.d.ts +2 -3
  89. package/es/property-handlers/aabb.js +29 -21
  90. package/es/property-handlers/anchor.d.ts +3 -0
  91. package/es/property-handlers/anchor.js +21 -0
  92. package/es/property-handlers/clipPath.d.ts +1 -1
  93. package/es/property-handlers/clipPath.js +3 -4
  94. package/es/property-handlers/color.d.ts +1 -1
  95. package/es/property-handlers/dimension.d.ts +1 -1
  96. package/es/property-handlers/dimension.js +6 -9
  97. package/es/property-handlers/filter.d.ts +1 -1
  98. package/es/property-handlers/index.d.ts +5 -4
  99. package/es/property-handlers/index.js +1 -0
  100. package/es/property-handlers/localPosition.d.ts +1 -1
  101. package/es/property-handlers/localPosition.js +1 -6
  102. package/es/property-handlers/offsetDistance.d.ts +1 -1
  103. package/es/property-handlers/offsetPath.d.ts +1 -1
  104. package/es/property-handlers/origin.d.ts +1 -1
  105. package/es/property-handlers/origin.js +9 -2
  106. package/es/property-handlers/path.d.ts +2 -2
  107. package/es/property-handlers/path.js +8 -4
  108. package/es/property-handlers/points.d.ts +1 -1
  109. package/es/property-handlers/transform.d.ts +1 -1
  110. package/es/property-handlers/zIndex.d.ts +1 -1
  111. package/es/services/ContextService.d.ts +3 -2
  112. package/es/services/EventService.d.ts +18 -13
  113. package/es/services/EventService.js +604 -384
  114. package/es/services/RenderingContext.d.ts +1 -1
  115. package/es/services/RenderingService.d.ts +23 -29
  116. package/es/services/RenderingService.js +63 -54
  117. package/es/services/SceneGraphSelector.d.ts +7 -7
  118. package/es/services/SceneGraphSelector.js +10 -6
  119. package/es/services/SceneGraphService.d.ts +73 -78
  120. package/es/services/SceneGraphService.js +165 -78
  121. package/es/services/aabb/PathUpdater.d.ts +1 -1
  122. package/es/services/aabb/RectUpdater.d.ts +2 -2
  123. package/es/services/aabb/interfaces.d.ts +1 -1
  124. package/es/shapes/Point.d.ts +4 -0
  125. package/es/shapes/Polygon.d.ts +9 -0
  126. package/es/shapes/Polygon.js +62 -0
  127. package/es/shapes/index.d.ts +1 -0
  128. package/es/shapes/index.js +2 -1
  129. package/es/types.d.ts +18 -6
  130. package/es/utils/animation.d.ts +1 -2
  131. package/es/utils/animation.js +5 -10
  132. package/es/utils/canvas.d.ts +1 -1
  133. package/es/utils/custom-easing.d.ts +3 -2
  134. package/es/utils/custom-easing.js +12 -6
  135. package/es/utils/event.js +1 -1
  136. package/es/utils/index.d.ts +1 -0
  137. package/es/utils/index.js +2 -1
  138. package/es/utils/interpolation.d.ts +3 -4
  139. package/es/utils/interpolation.js +0 -16
  140. package/es/utils/path.d.ts +2 -2
  141. package/lib/Canvas.d.ts +40 -18
  142. package/lib/Canvas.js +131 -74
  143. package/lib/DisplayObjectPool.d.ts +2 -1
  144. package/lib/DisplayObjectPool.js +4 -0
  145. package/{es → lib/camera}/Camera.d.ts +6 -3
  146. package/lib/{Camera.js → camera/Camera.js} +25 -20
  147. package/lib/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
  148. package/lib/{Landmark.js → camera/Landmark.js} +2 -3
  149. package/lib/camera/index.d.ts +2 -0
  150. package/lib/camera/index.js +31 -0
  151. package/lib/components/Cullable.js +1 -1
  152. package/lib/components/Geometry.d.ts +8 -1
  153. package/lib/components/Renderable.d.ts +9 -8
  154. package/lib/components/Renderable.js +2 -6
  155. package/lib/components/Sortable.d.ts +6 -2
  156. package/lib/display-objects/Circle.d.ts +2 -3
  157. package/lib/display-objects/Circle.js +3 -6
  158. package/lib/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
  159. package/lib/{CustomElement.js → display-objects/CustomElement.js} +22 -12
  160. package/{es → lib/display-objects}/DisplayObject.d.ts +136 -141
  161. package/lib/{DisplayObject.js → display-objects/DisplayObject.js} +418 -299
  162. package/lib/display-objects/Ellipse.d.ts +2 -3
  163. package/lib/display-objects/Ellipse.js +3 -6
  164. package/lib/display-objects/Group.d.ts +2 -1
  165. package/lib/display-objects/Group.js +12 -4
  166. package/lib/display-objects/HTML.d.ts +2 -2
  167. package/lib/display-objects/HTML.js +4 -7
  168. package/lib/display-objects/Image.d.ts +2 -2
  169. package/lib/display-objects/Image.js +2 -6
  170. package/lib/display-objects/Line.d.ts +2 -2
  171. package/lib/display-objects/Line.js +8 -8
  172. package/lib/display-objects/Path.d.ts +3 -2
  173. package/lib/display-objects/Path.js +8 -8
  174. package/lib/display-objects/Polygon.d.ts +2 -2
  175. package/lib/display-objects/Polygon.js +2 -6
  176. package/lib/display-objects/Polyline.d.ts +2 -2
  177. package/lib/display-objects/Polyline.js +8 -8
  178. package/lib/display-objects/Rect.d.ts +2 -2
  179. package/lib/display-objects/Rect.js +2 -6
  180. package/lib/display-objects/Text.d.ts +2 -3
  181. package/lib/display-objects/Text.js +9 -8
  182. package/lib/display-objects/index.d.ts +2 -0
  183. package/lib/display-objects/index.js +26 -0
  184. package/lib/{Animation.d.ts → dom/Animation.d.ts} +3 -3
  185. package/lib/{Animation.js → dom/Animation.js} +2 -3
  186. package/{es → lib/dom}/AnimationEffectTiming.d.ts +2 -0
  187. package/lib/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -3
  188. package/lib/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
  189. package/lib/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
  190. package/lib/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
  191. package/lib/{Timeline.js → dom/AnimationTimeline.js} +1 -1
  192. package/lib/dom/CustomElementRegistry.d.ts +15 -0
  193. package/lib/dom/CustomElementRegistry.js +48 -0
  194. package/{es → lib/dom}/CustomEvent.d.ts +1 -1
  195. package/lib/{CustomEvent.js → dom/CustomEvent.js} +1 -1
  196. package/lib/dom/Document.d.ts +36 -17
  197. package/lib/dom/Document.js +99 -15
  198. package/lib/dom/Element.d.ts +71 -92
  199. package/lib/dom/Element.js +180 -198
  200. package/lib/dom/EventTarget.d.ts +11 -6
  201. package/lib/dom/EventTarget.js +20 -10
  202. package/lib/dom/FederatedEvent.d.ts +15 -7
  203. package/lib/dom/FederatedEvent.js +33 -0
  204. package/lib/dom/FederatedMouseEvent.d.ts +1 -1
  205. package/lib/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
  206. package/lib/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
  207. package/lib/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
  208. package/lib/{KeyframeList.js → dom/KeyframeList.js} +0 -0
  209. package/lib/dom/Node.d.ts +38 -23
  210. package/lib/dom/Node.js +37 -33
  211. package/lib/dom/index.d.ts +15 -2
  212. package/lib/dom/index.js +177 -8
  213. package/lib/dom/interfaces.d.ts +301 -0
  214. package/lib/dom/interfaces.js +5 -0
  215. package/lib/global-module.d.ts +0 -2
  216. package/lib/global-module.js +30 -30
  217. package/lib/index.d.ts +7 -14
  218. package/lib/index.js +44 -135
  219. package/lib/plugins/CullingPlugin.d.ts +2 -2
  220. package/lib/plugins/CullingPlugin.js +14 -16
  221. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
  222. package/lib/plugins/DirtyCheckPlugin.js +9 -7
  223. package/lib/plugins/EventPlugin.js +52 -30
  224. package/lib/plugins/FrustumCullingStrategy.d.ts +1 -1
  225. package/lib/plugins/FrustumCullingStrategy.js +5 -4
  226. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
  227. package/lib/plugins/PrepareRendererPlugin.js +41 -37
  228. package/lib/property-handlers/aabb.d.ts +2 -3
  229. package/lib/property-handlers/aabb.js +28 -22
  230. package/lib/property-handlers/anchor.d.ts +3 -0
  231. package/lib/property-handlers/anchor.js +34 -0
  232. package/lib/property-handlers/clipPath.d.ts +1 -1
  233. package/lib/property-handlers/clipPath.js +3 -4
  234. package/lib/property-handlers/color.d.ts +1 -1
  235. package/lib/property-handlers/dimension.d.ts +1 -1
  236. package/lib/property-handlers/dimension.js +6 -9
  237. package/lib/property-handlers/filter.d.ts +1 -1
  238. package/lib/property-handlers/index.d.ts +5 -4
  239. package/lib/property-handlers/index.js +14 -0
  240. package/lib/property-handlers/localPosition.d.ts +1 -1
  241. package/lib/property-handlers/localPosition.js +1 -7
  242. package/lib/property-handlers/offsetDistance.d.ts +1 -1
  243. package/lib/property-handlers/offsetPath.d.ts +1 -1
  244. package/lib/property-handlers/origin.d.ts +1 -1
  245. package/lib/property-handlers/origin.js +10 -2
  246. package/lib/property-handlers/path.d.ts +2 -2
  247. package/lib/property-handlers/path.js +8 -4
  248. package/lib/property-handlers/points.d.ts +1 -1
  249. package/lib/property-handlers/transform.d.ts +1 -1
  250. package/lib/property-handlers/zIndex.d.ts +1 -1
  251. package/lib/services/ContextService.d.ts +3 -2
  252. package/lib/services/EventService.d.ts +18 -13
  253. package/lib/services/EventService.js +616 -385
  254. package/lib/services/RenderingContext.d.ts +1 -1
  255. package/lib/services/RenderingService.d.ts +23 -29
  256. package/lib/services/RenderingService.js +66 -56
  257. package/lib/services/SceneGraphSelector.d.ts +7 -7
  258. package/lib/services/SceneGraphSelector.js +10 -6
  259. package/lib/services/SceneGraphService.d.ts +73 -78
  260. package/lib/services/SceneGraphService.js +166 -79
  261. package/lib/services/aabb/PathUpdater.d.ts +1 -1
  262. package/lib/services/aabb/RectUpdater.d.ts +2 -2
  263. package/lib/services/aabb/interfaces.d.ts +1 -1
  264. package/lib/shapes/Point.d.ts +4 -0
  265. package/lib/shapes/Polygon.d.ts +9 -0
  266. package/lib/shapes/Polygon.js +69 -0
  267. package/lib/shapes/index.d.ts +1 -0
  268. package/lib/shapes/index.js +13 -0
  269. package/lib/types.d.ts +18 -6
  270. package/lib/utils/animation.d.ts +1 -2
  271. package/lib/utils/animation.js +8 -16
  272. package/lib/utils/canvas.d.ts +1 -1
  273. package/lib/utils/custom-easing.d.ts +3 -2
  274. package/lib/utils/custom-easing.js +16 -8
  275. package/lib/utils/event.js +1 -1
  276. package/lib/utils/index.d.ts +1 -0
  277. package/lib/utils/index.js +13 -0
  278. package/lib/utils/interpolation.d.ts +3 -4
  279. package/lib/utils/interpolation.js +0 -17
  280. package/lib/utils/path.d.ts +2 -2
  281. package/package.json +6 -6
  282. package/es/Batch.d.ts +0 -25
  283. package/es/Batch.js +0 -82
  284. package/es/shapes-type.d.ts +0 -175
  285. package/es/shapes-type.js +0 -18
  286. package/es/utils/matrix-decompose.d.ts +0 -3
  287. package/es/utils/matrix-decompose.js +0 -404
  288. package/lib/Batch.d.ts +0 -25
  289. package/lib/Batch.js +0 -91
  290. package/lib/shapes-type.d.ts +0 -175
  291. package/lib/shapes-type.js +0 -41
  292. package/lib/utils/matrix-decompose.d.ts +0 -3
  293. package/lib/utils/matrix-decompose.js +0 -414
@@ -1,404 +0,0 @@
1
- import { clamp } from '@antv/util';
2
-
3
- function toRadians(arg) {
4
- var rads = arg.rad || 0;
5
- var degs = arg.deg || 0;
6
- var grads = arg.grad || 0;
7
- var turns = arg.turn || 0;
8
- var angle = (degs / 360 + grads / 400 + turns) * (2 * Math.PI) + rads;
9
- return angle;
10
- }
11
-
12
- function convertItemToMatrix(item) {
13
- switch (item.t) {
14
- case 'rotatex':
15
- var angle = toRadians(item.d[0]);
16
- return [1, 0, 0, 0, 0, Math.cos(angle), Math.sin(angle), 0, 0, -Math.sin(angle), Math.cos(angle), 0, 0, 0, 0, 1];
17
-
18
- case 'rotatey':
19
- var angle = toRadians(item.d[0]);
20
- return [Math.cos(angle), 0, -Math.sin(angle), 0, 0, 1, 0, 0, Math.sin(angle), 0, Math.cos(angle), 0, 0, 0, 0, 1];
21
-
22
- case 'rotate':
23
- case 'rotatez':
24
- var angle = toRadians(item.d[0]);
25
- return [Math.cos(angle), Math.sin(angle), 0, 0, -Math.sin(angle), Math.cos(angle), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
26
-
27
- case 'rotate3d':
28
- var x = item.d[0];
29
- var y = item.d[1];
30
- var z = item.d[2];
31
- var angle = toRadians(item.d[3]);
32
- var sqrLength = x * x + y * y + z * z;
33
-
34
- if (sqrLength === 0) {
35
- x = 1;
36
- y = 0;
37
- z = 0;
38
- } else if (sqrLength !== 1) {
39
- var length = Math.sqrt(sqrLength);
40
- x /= length;
41
- y /= length;
42
- z /= length;
43
- }
44
-
45
- var s = Math.sin(angle / 2);
46
- var sc = s * Math.cos(angle / 2);
47
- var sq = s * s;
48
- return [1 - 2 * (y * y + z * z) * sq, 2 * (x * y * sq + z * sc), 2 * (x * z * sq - y * sc), 0, 2 * (x * y * sq - z * sc), 1 - 2 * (x * x + z * z) * sq, 2 * (y * z * sq + x * sc), 0, 2 * (x * z * sq + y * sc), 2 * (y * z * sq - x * sc), 1 - 2 * (x * x + y * y) * sq, 0, 0, 0, 0, 1];
49
-
50
- case 'scale':
51
- return [item.d[0], 0, 0, 0, 0, item.d[1], 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
52
-
53
- case 'scalex':
54
- return [item.d[0], 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
55
-
56
- case 'scaley':
57
- return [1, 0, 0, 0, 0, item.d[0], 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
58
-
59
- case 'scalez':
60
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, item.d[0], 0, 0, 0, 0, 1];
61
-
62
- case 'scale3d':
63
- return [item.d[0], 0, 0, 0, 0, item.d[1], 0, 0, 0, 0, item.d[2], 0, 0, 0, 0, 1];
64
-
65
- case 'skew':
66
- var xAngle = toRadians(item.d[0]);
67
- var yAngle = toRadians(item.d[1]);
68
- return [1, Math.tan(yAngle), 0, 0, Math.tan(xAngle), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
69
-
70
- case 'skewx':
71
- var angle = toRadians(item.d[0]);
72
- return [1, 0, 0, 0, Math.tan(angle), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
73
-
74
- case 'skewy':
75
- var angle = toRadians(item.d[0]);
76
- return [1, Math.tan(angle), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
77
-
78
- case 'translate':
79
- var x = item.d[0].px || 0;
80
- var y = item.d[1].px || 0;
81
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, 0, 1];
82
-
83
- case 'translatex':
84
- var x = item.d[0].px || 0;
85
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, 0, 0, 1];
86
-
87
- case 'translatey':
88
- var y = item.d[0].px || 0;
89
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, y, 0, 1];
90
-
91
- case 'translatez':
92
- var z = item.d[0].px || 0;
93
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, z, 1];
94
-
95
- case 'translate3d':
96
- var x = item.d[0].px || 0;
97
- var y = item.d[1].px || 0;
98
- var z = item.d[2].px || 0;
99
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1];
100
-
101
- case 'perspective':
102
- var p = item.d[0].px ? -1 / item.d[0].px : 0;
103
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, p, 0, 0, 0, 1];
104
-
105
- case 'matrix':
106
- return [item.d[0], item.d[1], 0, 0, item.d[2], item.d[3], 0, 0, 0, 0, 1, 0, item.d[4], item.d[5], 0, 1];
107
-
108
- case 'matrix3d':
109
- return item.d;
110
-
111
- default:
112
- }
113
- }
114
-
115
- function convertToMatrix(transformList) {
116
- if (transformList.length === 0) {
117
- return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
118
- }
119
-
120
- return transformList.map(convertItemToMatrix).reduce(multiplyMatrices);
121
- }
122
-
123
- function dot(v1, v2) {
124
- var result = 0;
125
-
126
- for (var i = 0; i < v1.length; i++) {
127
- result += v1[i] * v2[i];
128
- }
129
-
130
- return result;
131
- }
132
-
133
- function multiplyMatrices(a, b) {
134
- return [a[0] * b[0] + a[4] * b[1] + a[8] * b[2] + a[12] * b[3], a[1] * b[0] + a[5] * b[1] + a[9] * b[2] + a[13] * b[3], a[2] * b[0] + a[6] * b[1] + a[10] * b[2] + a[14] * b[3], a[3] * b[0] + a[7] * b[1] + a[11] * b[2] + a[15] * b[3], a[0] * b[4] + a[4] * b[5] + a[8] * b[6] + a[12] * b[7], a[1] * b[4] + a[5] * b[5] + a[9] * b[6] + a[13] * b[7], a[2] * b[4] + a[6] * b[5] + a[10] * b[6] + a[14] * b[7], a[3] * b[4] + a[7] * b[5] + a[11] * b[6] + a[15] * b[7], a[0] * b[8] + a[4] * b[9] + a[8] * b[10] + a[12] * b[11], a[1] * b[8] + a[5] * b[9] + a[9] * b[10] + a[13] * b[11], a[2] * b[8] + a[6] * b[9] + a[10] * b[10] + a[14] * b[11], a[3] * b[8] + a[7] * b[9] + a[11] * b[10] + a[15] * b[11], a[0] * b[12] + a[4] * b[13] + a[8] * b[14] + a[12] * b[15], a[1] * b[12] + a[5] * b[13] + a[9] * b[14] + a[13] * b[15], a[2] * b[12] + a[6] * b[13] + a[10] * b[14] + a[14] * b[15], a[3] * b[12] + a[7] * b[13] + a[11] * b[14] + a[15] * b[15]];
135
- }
136
-
137
- function determinant(m) {
138
- return m[0][0] * m[1][1] * m[2][2] + m[1][0] * m[2][1] * m[0][2] + m[2][0] * m[0][1] * m[1][2] - m[0][2] * m[1][1] * m[2][0] - m[1][2] * m[2][1] * m[0][0] - m[2][2] * m[0][1] * m[1][0];
139
- } // from Wikipedia:
140
- //
141
- // [A B]^-1 = [A^-1 + A^-1B(D - CA^-1B)^-1CA^-1 -A^-1B(D - CA^-1B)^-1]
142
- // [C D] [-(D - CA^-1B)^-1CA^-1 (D - CA^-1B)^-1 ]
143
- //
144
- // Therefore
145
- //
146
- // [A [0]]^-1 = [A^-1 [0]]
147
- // [C 1 ] [ -CA^-1 1 ]
148
-
149
-
150
- function inverse(m) {
151
- var iDet = 1 / determinant(m);
152
- var a = m[0][0],
153
- b = m[0][1],
154
- c = m[0][2];
155
- var d = m[1][0],
156
- e = m[1][1],
157
- f = m[1][2];
158
- var g = m[2][0],
159
- h = m[2][1],
160
- k = m[2][2];
161
- var Ainv = [[(e * k - f * h) * iDet, (c * h - b * k) * iDet, (b * f - c * e) * iDet, 0], [(f * g - d * k) * iDet, (a * k - c * g) * iDet, (c * d - a * f) * iDet, 0], [(d * h - e * g) * iDet, (g * b - a * h) * iDet, (a * e - b * d) * iDet, 0]];
162
- var lastRow = [];
163
-
164
- for (var i = 0; i < 3; i++) {
165
- var val = 0;
166
-
167
- for (var j = 0; j < 3; j++) {
168
- val += m[3][j] * Ainv[j][i];
169
- }
170
-
171
- lastRow.push(val);
172
- }
173
-
174
- lastRow.push(1);
175
- Ainv.push(lastRow);
176
- return Ainv;
177
- }
178
-
179
- function transposeMatrix4(m) {
180
- return [[m[0][0], m[1][0], m[2][0], m[3][0]], [m[0][1], m[1][1], m[2][1], m[3][1]], [m[0][2], m[1][2], m[2][2], m[3][2]], [m[0][3], m[1][3], m[2][3], m[3][3]]];
181
- }
182
-
183
- function multVecMatrix(v, m) {
184
- var result = [];
185
-
186
- for (var i = 0; i < 4; i++) {
187
- var val = 0;
188
-
189
- for (var j = 0; j < 4; j++) {
190
- val += v[j] * m[j][i];
191
- }
192
-
193
- result.push(val);
194
- }
195
-
196
- return result;
197
- }
198
-
199
- function normalize(v) {
200
- var len = length(v);
201
- return [v[0] / len, v[1] / len, v[2] / len];
202
- }
203
-
204
- function length(v) {
205
- return Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
206
- }
207
-
208
- function combine(v1, v2, v1s, v2s) {
209
- return [v1s * v1[0] + v2s * v2[0], v1s * v1[1] + v2s * v2[1], v1s * v1[2] + v2s * v2[2]];
210
- }
211
-
212
- function cross(v1, v2) {
213
- return [v1[1] * v2[2] - v1[2] * v2[1], v1[2] * v2[0] - v1[0] * v2[2], v1[0] * v2[1] - v1[1] * v2[0]];
214
- }
215
-
216
- function decomposeMatrix(matrix) {
217
- var m3d = [matrix.slice(0, 4), matrix.slice(4, 8), matrix.slice(8, 12), matrix.slice(12, 16)]; // skip normalization step as m3d[3][3] should always be 1
218
-
219
- if (m3d[3][3] !== 1) {
220
- return null;
221
- }
222
-
223
- var perspectiveMatrix = [];
224
-
225
- for (var i = 0; i < 4; i++) {
226
- perspectiveMatrix.push(m3d[i].slice());
227
- }
228
-
229
- for (var i = 0; i < 3; i++) {
230
- perspectiveMatrix[i][3] = 0;
231
- }
232
-
233
- if (determinant(perspectiveMatrix) === 0) {
234
- return null;
235
- }
236
-
237
- var rhs = [];
238
- var perspective;
239
-
240
- if (m3d[0][3] || m3d[1][3] || m3d[2][3]) {
241
- rhs.push(m3d[0][3]);
242
- rhs.push(m3d[1][3]);
243
- rhs.push(m3d[2][3]);
244
- rhs.push(m3d[3][3]);
245
- var inversePerspectiveMatrix = inverse(perspectiveMatrix);
246
- var transposedInversePerspectiveMatrix = transposeMatrix4(inversePerspectiveMatrix);
247
- perspective = multVecMatrix(rhs, transposedInversePerspectiveMatrix);
248
- } else {
249
- perspective = [0, 0, 0, 1];
250
- }
251
-
252
- var translate = m3d[3].slice(0, 3);
253
- var row = [];
254
- row.push(m3d[0].slice(0, 3));
255
- var scale = [];
256
- scale.push(length(row[0]));
257
- row[0] = normalize(row[0]);
258
- var skew = [];
259
- row.push(m3d[1].slice(0, 3));
260
- skew.push(dot(row[0], row[1]));
261
- row[1] = combine(row[1], row[0], 1.0, -skew[0]);
262
- scale.push(length(row[1]));
263
- row[1] = normalize(row[1]);
264
- skew[0] /= scale[1];
265
- row.push(m3d[2].slice(0, 3));
266
- skew.push(dot(row[0], row[2]));
267
- row[2] = combine(row[2], row[0], 1.0, -skew[1]);
268
- skew.push(dot(row[1], row[2]));
269
- row[2] = combine(row[2], row[1], 1.0, -skew[2]);
270
- scale.push(length(row[2]));
271
- row[2] = normalize(row[2]);
272
- skew[1] /= scale[2];
273
- skew[2] /= scale[2];
274
- var pdum3 = cross(row[1], row[2]);
275
-
276
- if (dot(row[0], pdum3) < 0) {
277
- for (var i = 0; i < 3; i++) {
278
- scale[i] *= -1;
279
- row[i][0] *= -1;
280
- row[i][1] *= -1;
281
- row[i][2] *= -1;
282
- }
283
- }
284
-
285
- var t = row[0][0] + row[1][1] + row[2][2] + 1;
286
- var s;
287
- var quaternion;
288
-
289
- if (t > 1e-4) {
290
- s = 0.5 / Math.sqrt(t);
291
- quaternion = [(row[2][1] - row[1][2]) * s, (row[0][2] - row[2][0]) * s, (row[1][0] - row[0][1]) * s, 0.25 / s];
292
- } else if (row[0][0] > row[1][1] && row[0][0] > row[2][2]) {
293
- s = Math.sqrt(1 + row[0][0] - row[1][1] - row[2][2]) * 2.0;
294
- quaternion = [0.25 * s, (row[0][1] + row[1][0]) / s, (row[0][2] + row[2][0]) / s, (row[2][1] - row[1][2]) / s];
295
- } else if (row[1][1] > row[2][2]) {
296
- s = Math.sqrt(1.0 + row[1][1] - row[0][0] - row[2][2]) * 2.0;
297
- quaternion = [(row[0][1] + row[1][0]) / s, 0.25 * s, (row[1][2] + row[2][1]) / s, (row[0][2] - row[2][0]) / s];
298
- } else {
299
- s = Math.sqrt(1.0 + row[2][2] - row[0][0] - row[1][1]) * 2.0;
300
- quaternion = [(row[0][2] + row[2][0]) / s, (row[1][2] + row[2][1]) / s, 0.25 * s, (row[1][0] - row[0][1]) / s];
301
- }
302
-
303
- return [translate, scale, skew, quaternion, perspective];
304
- }
305
-
306
- export function makeMatrixDecomposition(transformList) {
307
- return [decomposeMatrix(convertToMatrix(transformList))];
308
- }
309
- export function quat(fromQ, toQ, f) {
310
- var product = dot(fromQ, toQ);
311
- product = clamp(product, -1.0, 1.0);
312
- var quat = [];
313
-
314
- if (product === 1.0) {
315
- quat = fromQ;
316
- } else {
317
- var theta = Math.acos(product);
318
- var w = Math.sin(f * theta) * 1 / Math.sqrt(1 - product * product);
319
-
320
- for (var i = 0; i < 4; i++) {
321
- quat.push(fromQ[i] * (Math.cos(f * theta) - product * w) + toQ[i] * w);
322
- }
323
- }
324
-
325
- return quat;
326
- }
327
-
328
- function multiply(a, b) {
329
- var result = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
330
-
331
- for (var i = 0; i < 4; i++) {
332
- for (var j = 0; j < 4; j++) {
333
- for (var k = 0; k < 4; k++) {
334
- result[i][j] += b[i][k] * a[k][j];
335
- }
336
- }
337
- }
338
-
339
- return result;
340
- }
341
-
342
- function is2D(m) {
343
- return m[0][2] === 0 && m[0][3] === 0 && m[1][2] === 0 && m[1][3] === 0 && m[2][0] === 0 && m[2][1] === 0 && m[2][2] === 1 && m[2][3] === 0 && m[3][2] === 0 && m[3][3] === 1;
344
- }
345
-
346
- export function composeMatrix(translate, scale, skew, quat, perspective) {
347
- var matrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
348
-
349
- for (var i = 0; i < 4; i++) {
350
- matrix[i][3] = perspective[i];
351
- }
352
-
353
- for (var i = 0; i < 3; i++) {
354
- for (var j = 0; j < 3; j++) {
355
- matrix[3][i] += translate[j] * matrix[j][i];
356
- }
357
- }
358
-
359
- var x = quat[0],
360
- y = quat[1],
361
- z = quat[2],
362
- w = quat[3];
363
- var rotMatrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
364
- rotMatrix[0][0] = 1 - 2 * (y * y + z * z);
365
- rotMatrix[0][1] = 2 * (x * y - z * w);
366
- rotMatrix[0][2] = 2 * (x * z + y * w);
367
- rotMatrix[1][0] = 2 * (x * y + z * w);
368
- rotMatrix[1][1] = 1 - 2 * (x * x + z * z);
369
- rotMatrix[1][2] = 2 * (y * z - x * w);
370
- rotMatrix[2][0] = 2 * (x * z - y * w);
371
- rotMatrix[2][1] = 2 * (y * z + x * w);
372
- rotMatrix[2][2] = 1 - 2 * (x * x + y * y);
373
- matrix = multiply(matrix, rotMatrix);
374
- var temp = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
375
-
376
- if (skew[2]) {
377
- temp[2][1] = skew[2];
378
- matrix = multiply(matrix, temp);
379
- }
380
-
381
- if (skew[1]) {
382
- temp[2][1] = 0;
383
- temp[2][0] = skew[0];
384
- matrix = multiply(matrix, temp);
385
- }
386
-
387
- if (skew[0]) {
388
- temp[2][0] = 0;
389
- temp[1][0] = skew[0];
390
- matrix = multiply(matrix, temp);
391
- }
392
-
393
- for (var i = 0; i < 3; i++) {
394
- for (var j = 0; j < 3; j++) {
395
- matrix[i][j] *= scale[i];
396
- }
397
- }
398
-
399
- if (is2D(matrix)) {
400
- return [matrix[0][0], matrix[0][1], matrix[1][0], matrix[1][1], matrix[3][0], matrix[3][1]];
401
- }
402
-
403
- return matrix[0].concat(matrix[1], matrix[2], matrix[3]);
404
- }
package/lib/Batch.d.ts DELETED
@@ -1,25 +0,0 @@
1
- import { CustomElement } from './CustomElement';
2
- import { DisplayObjectConfig } from './DisplayObject';
3
- import { BaseStyleProps } from './types';
4
- export interface BatchStyleProps extends BaseStyleProps {
5
- instances: this[];
6
- }
7
- /**
8
- * A container for multiple display objects with the same `style`,
9
- * eg. 1000 Circles with the same stroke color, but their position, radius can be different
10
- *
11
- * @see https://developer.playcanvas.com/en/user-manual/optimization/batching/
12
- */
13
- export declare class Batch extends CustomElement<BatchStyleProps> {
14
- static tag: string;
15
- private batchType?;
16
- /**
17
- * need to reconstruct batch
18
- */
19
- dirty: boolean;
20
- constructor({ style, ...rest }: DisplayObjectConfig<BatchStyleProps>);
21
- getBatchType(): string;
22
- appendChild(child: this): this;
23
- removeChild(child: this): this;
24
- attributeChangedCallback(name: string, value: any): void;
25
- }
package/lib/Batch.js DELETED
@@ -1,91 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Batch = void 0;
7
-
8
- var _tslib = require("tslib");
9
-
10
- var _components = require("./components");
11
-
12
- var _CustomElement = require("./CustomElement");
13
-
14
- /**
15
- * A container for multiple display objects with the same `style`,
16
- * eg. 1000 Circles with the same stroke color, but their position, radius can be different
17
- *
18
- * @see https://developer.playcanvas.com/en/user-manual/optimization/batching/
19
- */
20
- var Batch = function (_super) {
21
- (0, _tslib.__extends)(Batch, _super);
22
-
23
- function Batch(_a) {
24
- var _b = _a.style,
25
- style = _b === void 0 ? {
26
- instances: []
27
- } : _b,
28
- rest = (0, _tslib.__rest)(_a, ["style"]);
29
-
30
- var _this = _super.call(this, (0, _tslib.__assign)({
31
- // @ts-ignore
32
- type: Batch.tag,
33
- style: style
34
- }, rest)) || this;
35
- /**
36
- * need to reconstruct batch
37
- */
38
-
39
-
40
- _this.dirty = true;
41
- _this.getEntity().getComponent(_components.Cullable).enable = false;
42
-
43
- if (style.instances) {
44
- style.instances.forEach(function (instance) {
45
- // @ts-ignore
46
- _this.appendChild(instance);
47
- });
48
- }
49
-
50
- return _this;
51
- }
52
-
53
- Batch.prototype.getBatchType = function () {
54
- return this.batchType;
55
- };
56
-
57
- Batch.prototype.appendChild = function (child) {
58
- if (!this.batchType) {
59
- this.batchType = child.nodeName;
60
- }
61
-
62
- _super.prototype.appendChild.call(this, child);
63
-
64
- child.getEntity().getComponent(_components.Renderable).instanced = true;
65
- var renderable = this.getEntity().getComponent(_components.Renderable);
66
- renderable.aabbDirty = true;
67
- renderable.dirty = true;
68
- this.dirty = true;
69
- return child;
70
- };
71
-
72
- Batch.prototype.removeChild = function (child) {
73
- _super.prototype.removeChild.call(this, child);
74
-
75
- child.getEntity().getComponent(_components.Renderable).instanced = false;
76
- var renderable = this.getEntity().getComponent(_components.Renderable);
77
- renderable.aabbDirty = true;
78
- renderable.dirty = true;
79
- this.dirty = true;
80
- return child;
81
- };
82
-
83
- Batch.prototype.attributeChangedCallback = function (name, value) {
84
- throw new Error('Method not implemented.');
85
- };
86
-
87
- Batch.tag = 'batch';
88
- return Batch;
89
- }(_CustomElement.CustomElement);
90
-
91
- exports.Batch = Batch;
@@ -1,175 +0,0 @@
1
- import type { BaseStyleProps, Cursor, PathCommand } from './types';
2
- export declare const G_CANVAS_ELEMENT: readonly ["Group", "Rect", "Text", "Circle", "Ellipse", "Image", "Line", "Marker", "Path", "Polygon", "Polyline"];
3
- export declare const ELEMENT_PROPS: string[];
4
- export declare const GENERAL_SHAPE_ATTR: readonly ["cursor"];
5
- export declare const COLOR_ATTRS: readonly ["fill", "stroke", "opacity", "fillOpacity", "strokeOpacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "globalCompositeOperation"];
6
- export declare const GENERAL_LINE_ATTRS: readonly ["lineCap", "lineJoin", "lineWidth", "lineAppendWidth", "miterLimit", "lineDash", "startArrow", "endArrow"];
7
- export declare const FONT_ATTRS: readonly ["font", "textAlign", "textBaseline", "fontStyle", "fontVariant", "fontSize", "fontFamily", "fontWeight"];
8
- export declare const CIRCLE_ATTRS: readonly ["x", "y", "r", "lineWidth"];
9
- export declare const DOM_ATTRS: readonly ["x", "y", "width", "height", "html"];
10
- export declare const ELLIPSE_ATTRS: readonly ["x", "y", "rx", "ry"];
11
- export declare const IMAGE_ATTRS: readonly ["x", "y", "width", "height", "img"];
12
- export declare const LINE_ATTRS: readonly ["x1", "y1", "x2", "y2"];
13
- export declare const MARKER_ATTRS: readonly ["x", "y", "r", "symbol"];
14
- export declare const PATH_ATTRS: readonly ["path"];
15
- export declare const POLYGON_ATTRS: readonly ["points"];
16
- export declare const POLYLINE_ATTRS: readonly ["points"];
17
- export declare const RECT_ATTRS: readonly ["x", "y", "width", "height", "radius"];
18
- export declare const TEXT_ATTRS: readonly ["x", "y", "text"];
19
- /**
20
- * event
21
- */
22
- export declare type GEvents = Partial<{
23
- onMousedown: (evt: Event) => void;
24
- onMouseup: (evt: Event) => void;
25
- onClick: (evt: Event) => void;
26
- onDblclick: (evt: Event) => void;
27
- onMousemove: (evt: Event) => void;
28
- onMouseover: (evt: Event) => void;
29
- onMouseout: (evt: Event) => void;
30
- onMouseenter: (evt: Event) => void;
31
- onMouseleave: (evt: Event) => void;
32
- onTouchstart: (evt: Event) => void;
33
- onTouchmove: (evt: Event) => void;
34
- onTouchend: (evt: Event) => void;
35
- onDragstart: (evt: Event) => void;
36
- onDrag: (evt: Event) => void;
37
- onDragend: (evt: Event) => void;
38
- onDragenter: (evt: Event) => void;
39
- onDragleave: (evt: Event) => void;
40
- onDragover: (evt: Event) => void;
41
- onDrop: (evt: Event) => void;
42
- onContextmenu: (evt: Event) => void;
43
- onMousewheel: (evt: Event) => void;
44
- }>;
45
- export declare type Matrix = [number, number, number, number, number, number];
46
- export declare type PathType = string | PathCommand[];
47
- export declare type Point = [number, number];
48
- export declare type Anchor = Point;
49
- export declare type Points = Point[];
50
- export declare type Arrow = {
51
- path: PathType;
52
- d?: number;
53
- stroke?: string;
54
- fill?: string;
55
- lineWidth?: string;
56
- } | boolean;
57
- export declare type ElementProps = Partial<{
58
- id: string;
59
- name: string;
60
- visible: boolean;
61
- capture: boolean;
62
- zIndex: number;
63
- draggable: boolean;
64
- cursor: Cursor;
65
- }>;
66
- export declare type StyleProps = Partial<{
67
- fill: string;
68
- stroke: string;
69
- opacity: number;
70
- strokeOpacity: number;
71
- fillOpacity: number;
72
- shadowColor: string;
73
- shadowBlur: number;
74
- shadowOffsetX: number;
75
- shadowOffsetY: number;
76
- globalCompositeOperation: string;
77
- }>;
78
- export declare type LineSizeProps = Partial<{
79
- lineWidth: number;
80
- lineAppendWidth: number;
81
- }>;
82
- export declare type LineStyleProps = Partial<{
83
- lineCap: 'butt' | 'round' | 'square';
84
- lineJoin: 'bevel' | 'round' | 'miter';
85
- lineDash: number[];
86
- miterLimit: number;
87
- startArrow: Arrow;
88
- endArrow: Arrow;
89
- }> & LineSizeProps;
90
- export declare type Radius = number | [number] | [number, number] | [number, number, number] | [number, number, number, number];
91
- export declare type RectProps = BaseStyleProps & Partial<{
92
- x: number;
93
- y: number;
94
- width: number;
95
- height: number;
96
- radius: Radius;
97
- anchor: Anchor;
98
- opacity: number;
99
- }> & LineStyleProps;
100
- export declare type TextProps = BaseStyleProps & Partial<{
101
- x: number;
102
- y: number;
103
- text: string;
104
- fontSize: number;
105
- fontFamily: string;
106
- fontStyle: 'normal' | 'italic' | 'oblique';
107
- fontWeight: 'normal' | 'bold' | 'bolder' | 'lighter' | number;
108
- fontVariant: 'normal' | 'small-caps' | string;
109
- textAlign: 'start' | 'center' | 'end' | 'left' | 'right';
110
- textBaseline: 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom';
111
- lineWidth: number;
112
- fill?: string;
113
- stroke?: string;
114
- whiteSpace?: string;
115
- wordWrap?: boolean;
116
- wordWrapWidth?: number;
117
- leading?: number;
118
- letterSpacing?: number;
119
- lineHeight?: number;
120
- lineJoin?: string;
121
- lineCap?: string;
122
- miterLimit?: number;
123
- padding?: number;
124
- opacity?: number;
125
- }>;
126
- export declare type CircleProps = BaseStyleProps & Partial<{
127
- x: number;
128
- y: number;
129
- r: number;
130
- opacity: number;
131
- }> & LineSizeProps;
132
- export declare type EllipseProps = BaseStyleProps & Partial<{
133
- x: number;
134
- y: number;
135
- rx: number;
136
- ry: number;
137
- opacity: number;
138
- }> & LineSizeProps;
139
- export declare type ImageProps = BaseStyleProps & {
140
- img: string | HTMLImageElement | HTMLCanvasElement;
141
- } & Partial<{
142
- x: number;
143
- y: number;
144
- width: number;
145
- height: number;
146
- opacity: number;
147
- }>;
148
- export declare type LineProps = BaseStyleProps & Partial<{
149
- x1: number;
150
- y1: number;
151
- x2: number;
152
- y2: number;
153
- anchor: Anchor;
154
- opacity: number;
155
- strokeOpacity: number;
156
- }> & LineStyleProps;
157
- export declare type PathProps = BaseStyleProps & {
158
- path: PathType;
159
- anchor: Anchor;
160
- opacity?: number;
161
- strokeOpacity?: number;
162
- } & LineStyleProps;
163
- export declare type PolygonProps = BaseStyleProps & {
164
- points: Points;
165
- opacity?: number;
166
- strokeOpacity?: number;
167
- };
168
- export declare type PolylineProps = BaseStyleProps & {
169
- points: Points;
170
- anchor: Anchor;
171
- opacity?: number;
172
- strokeOpacity?: number;
173
- } & LineStyleProps;
174
- export declare type AllShapeProps = RectProps & TextProps & CircleProps & EllipseProps & ImageProps & LineProps & PathProps & PolygonProps & PolylineProps;
175
- export declare type ShapeProps = RectProps | TextProps | CircleProps | EllipseProps | ImageProps | LineProps | PathProps | PolygonProps | PolylineProps;