@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
@@ -11,17 +11,13 @@ var _eventemitter = require("eventemitter3");
11
11
 
12
12
  var _glMatrix = require("gl-matrix");
13
13
 
14
- var _inversify = require("inversify");
14
+ var _Landmark = require("./Landmark");
15
15
 
16
- var _Landmark = _interopRequireDefault(require("./Landmark"));
16
+ var _shapes = require("../shapes");
17
17
 
18
- var _shapes = require("./shapes");
18
+ var _math = require("../utils/math");
19
19
 
20
- var _math = require("./utils/math");
21
-
22
- var _raf = require("./utils/raf");
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+ var _raf = require("../utils/raf");
25
21
 
26
22
  var DefaultCamera = 'DefaultCamera';
27
23
  exports.DefaultCamera = DefaultCamera;
@@ -159,7 +155,8 @@ var Camera = function (_super) {
159
155
  _this.near = 0.1;
160
156
  _this.far = 10000;
161
157
  _this.aspect = 1;
162
- _this.perspective = _glMatrix.mat4.create();
158
+ _this.projectionMatrix = _glMatrix.mat4.create();
159
+ _this.projectionMatrixInverse = _glMatrix.mat4.create();
163
160
  _this.jitteredProjectionMatrix = undefined;
164
161
  _this.following = undefined;
165
162
  _this.type = CAMERA_TYPE.EXPLORING;
@@ -183,10 +180,8 @@ var Camera = function (_super) {
183
180
  return _this;
184
181
  }
185
182
 
186
- Camera_1 = Camera;
187
-
188
183
  Camera.prototype.clone = function () {
189
- var camera = new Camera_1();
184
+ var camera = new Camera();
190
185
  camera.setType(this.type, undefined); // camera.interactor = this.interactor;
191
186
 
192
187
  return camera;
@@ -198,7 +193,11 @@ var Camera = function (_super) {
198
193
 
199
194
  Camera.prototype.getPerspective = function () {
200
195
  // account for TAA
201
- return this.jitteredProjectionMatrix || this.perspective;
196
+ return this.jitteredProjectionMatrix || this.projectionMatrix;
197
+ };
198
+
199
+ Camera.prototype.getPerspectiveInverse = function () {
200
+ return this.projectionMatrixInverse;
202
201
  };
203
202
 
204
203
  Camera.prototype.getFrustum = function () {
@@ -209,6 +208,10 @@ var Camera = function (_super) {
209
208
  return this.position;
210
209
  };
211
210
 
211
+ Camera.prototype.getFocalPoint = function () {
212
+ return this.focalPoint;
213
+ };
214
+
212
215
  Camera.prototype.getNear = function () {
213
216
  return this.near;
214
217
  };
@@ -291,7 +294,7 @@ var Camera = function (_super) {
291
294
  Camera.prototype.jitterProjectionMatrix = function (x, y) {
292
295
  var translation = _glMatrix.mat4.fromTranslation(_glMatrix.mat4.create(), [x, y, 0]);
293
296
 
294
- this.jitteredProjectionMatrix = _glMatrix.mat4.multiply(_glMatrix.mat4.create(), translation, this.perspective);
297
+ this.jitteredProjectionMatrix = _glMatrix.mat4.multiply(_glMatrix.mat4.create(), translation, this.projectionMatrix);
295
298
  };
296
299
 
297
300
  Camera.prototype.clearJitterProjectionMatrix = function () {
@@ -418,7 +421,9 @@ var Camera = function (_super) {
418
421
  // }
419
422
  // flip Y
420
423
 
421
- _glMatrix.mat4.perspective(this.perspective, -this.fov * DEG_2_RAD, -this.aspect, this.near, this.far);
424
+ _glMatrix.mat4.perspective(this.projectionMatrix, -this.fov * DEG_2_RAD, -this.aspect, this.near, this.far);
425
+
426
+ _glMatrix.mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
422
427
 
423
428
  this.emit(CAMERA_EVENT.Updated);
424
429
  return this;
@@ -450,7 +455,9 @@ var Camera = function (_super) {
450
455
  bottom = top - scaleH * this.view.height;
451
456
  }
452
457
 
453
- _glMatrix.mat4.ortho(this.perspective, left, right, bottom, top, near, far);
458
+ _glMatrix.mat4.ortho(this.projectionMatrix, left, right, bottom, top, near, far);
459
+
460
+ _glMatrix.mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
454
461
 
455
462
  this._getOrthoMatrix();
456
463
 
@@ -755,13 +762,13 @@ var Camera = function (_super) {
755
762
  camera.setRoll(params.roll);
756
763
  }
757
764
 
758
- var landmark = new _Landmark.default(name, camera);
765
+ var landmark = new _Landmark.Landmark(name, camera);
759
766
  this.landmarks.push(landmark);
760
767
  return landmark;
761
768
  };
762
769
 
763
770
  Camera.prototype.setLandmark = function (name) {
764
- var landmark = new _Landmark.default(name, this);
771
+ var landmark = new _Landmark.Landmark(name, this);
765
772
  this.landmarks.push(landmark);
766
773
  return this;
767
774
  };
@@ -1016,12 +1023,10 @@ var Camera = function (_super) {
1016
1023
  _glMatrix.mat4.fromRotationTranslationScaleOrigin(this.orthoMatrix, rotZ, _glMatrix.vec3.fromValues((this.rright - this.left) / 2 - position[0], (this.bottom - this.top) / 2 - position[1], 0), _glMatrix.vec3.fromValues(this.zoom, this.zoom, 1), position);
1017
1024
  };
1018
1025
 
1019
- var Camera_1;
1020
1026
  Camera.ProjectionMode = {
1021
1027
  ORTHOGRAPHIC: 'ORTHOGRAPHIC',
1022
1028
  PERSPECTIVE: 'PERSPECTIVE'
1023
1029
  };
1024
- Camera = Camera_1 = (0, _tslib.__decorate)([(0, _inversify.injectable)()], Camera);
1025
1030
  return Camera;
1026
1031
  }(_eventemitter.EventEmitter);
1027
1032
 
@@ -1,9 +1,9 @@
1
1
  import { vec3 } from 'gl-matrix';
2
- import { Camera } from './Camera';
2
+ import type { Camera } from './Camera';
3
3
  /**
4
4
  * 保存相机状态,便于后续在多个 Landmark 间移动
5
5
  */
6
- export default class Landmark {
6
+ export declare class Landmark {
7
7
  name: string;
8
8
  private matrix;
9
9
  private right;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.Landmark = void 0;
7
7
 
8
8
  var _glMatrix = require("gl-matrix");
9
9
 
@@ -70,5 +70,4 @@ var Landmark = function () {
70
70
  return Landmark;
71
71
  }();
72
72
 
73
- var _default = Landmark;
74
- exports.default = _default;
73
+ exports.Landmark = Landmark;
@@ -0,0 +1,2 @@
1
+ export * from './Camera';
2
+ export * from './Landmark';
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _Camera = require("./Camera");
8
+
9
+ Object.keys(_Camera).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _Camera[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _Camera[key];
16
+ }
17
+ });
18
+ });
19
+
20
+ var _Landmark = require("./Landmark");
21
+
22
+ Object.keys(_Landmark).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _Landmark[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _Landmark[key];
29
+ }
30
+ });
31
+ });
@@ -27,7 +27,7 @@ var Cullable = function (_super) {
27
27
 
28
28
  _this.strategy = Strategy.Standard;
29
29
  _this.visibilityPlaneMask = -1;
30
- _this.visible = false;
30
+ _this.visible = true;
31
31
  _this.enable = true;
32
32
  return _this;
33
33
  }
@@ -2,5 +2,12 @@ import { Component } from '@antv/g-ecs';
2
2
  import { AABB } from '../shapes';
3
3
  export declare class Geometry extends Component {
4
4
  static tag: string;
5
- aabb: AABB | undefined;
5
+ /**
6
+ * excluding all children
7
+ */
8
+ contentBounds: AABB | undefined;
9
+ /**
10
+ * including extra rendering effects, eg. shadowBlur filters(drop-shadow, blur)
11
+ */
12
+ renderBounds: AABB | undefined;
6
13
  }
@@ -7,18 +7,19 @@ export declare class Renderable extends Component {
7
7
  * 1. 包围盒会受 transform 影响。例如每次 transform 之后应该重新计算包围盒(center 发生偏移)。
8
8
  * 2. 多个 Mesh 可以共享一个 Geometry,但可以各自拥有不同的 aabb
9
9
  */
10
- aabb: AABB | undefined;
11
- aabbDirty: boolean;
10
+ bounds: AABB | undefined;
11
+ boundsDirty: boolean;
12
12
  /**
13
- * dirty rectangle(aabb) in last render frame
13
+ * account for hierarchy, also including extra rendering effects
14
14
  */
15
- dirtyAABB: AABB;
15
+ renderBounds: AABB | undefined;
16
+ renderBoundsDirty: boolean;
16
17
  /**
17
- * dirty rectangle flag
18
+ * dirty render bounds in last render frame
18
19
  */
19
- dirty: boolean;
20
+ dirtyRenderBounds: AABB;
20
21
  /**
21
- * is instanced
22
+ * dirty rectangle flag
22
23
  */
23
- instanced: boolean;
24
+ dirty: boolean;
24
25
  }
@@ -15,17 +15,13 @@ var Renderable = function (_super) {
15
15
  function Renderable() {
16
16
  var _this = _super !== null && _super.apply(this, arguments) || this;
17
17
 
18
- _this.aabbDirty = true;
18
+ _this.boundsDirty = true;
19
+ _this.renderBoundsDirty = true;
19
20
  /**
20
21
  * dirty rectangle flag
21
22
  */
22
23
 
23
24
  _this.dirty = false;
24
- /**
25
- * is instanced
26
- */
27
-
28
- _this.instanced = false;
29
25
  return _this;
30
26
  }
31
27
 
@@ -1,5 +1,5 @@
1
1
  import { Component } from '@antv/g-ecs';
2
- import type { Element } from '../dom/Element';
2
+ import type { INode } from '../dom/interfaces';
3
3
  export declare class Sortable extends Component {
4
4
  static tag: string;
5
5
  /**
@@ -9,5 +9,9 @@ export declare class Sortable extends Component {
9
9
  /**
10
10
  * sorted child entities
11
11
  */
12
- sorted: Element[];
12
+ sorted: INode[];
13
+ /**
14
+ * index in parent's children
15
+ */
16
+ lastSortedIndex: number;
13
17
  }
@@ -1,6 +1,5 @@
1
- import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
1
+ import { BaseStyleProps, DisplayObjectConfig, ParsedBaseStyleProps } from '..';
2
+ import { DisplayObject } from './DisplayObject';
4
3
  export interface CircleStyleProps extends BaseStyleProps {
5
4
  r: number;
6
5
  }
@@ -7,9 +7,9 @@ exports.Circle = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
10
- var _types = require("../types");
10
+ var _ = require("..");
11
11
 
12
- var _DisplayObject = require("../DisplayObject");
12
+ var _DisplayObject = require("./DisplayObject");
13
13
 
14
14
  var Circle = function (_super) {
15
15
  (0, _tslib.__extends)(Circle, _super);
@@ -18,12 +18,9 @@ var Circle = function (_super) {
18
18
  var style = _a.style,
19
19
  rest = (0, _tslib.__rest)(_a, ["style"]);
20
20
  return _super.call(this, (0, _tslib.__assign)({
21
- type: _types.SHAPE.Circle,
21
+ type: _.SHAPE.Circle,
22
22
  style: (0, _tslib.__assign)({
23
23
  r: 0,
24
- opacity: 1,
25
- fillOpacity: 1,
26
- strokeOpacity: 1,
27
24
  anchor: [0.5, 0.5]
28
25
  }, style)
29
26
  }, rest)) || this;
@@ -1,5 +1,5 @@
1
- import type { DisplayObjectConfig } from './DisplayObject';
2
1
  import { DisplayObject } from './DisplayObject';
2
+ import type { DisplayObjectConfig } from '..';
3
3
  export interface CustomElement<CustomElementStyleProps> {
4
4
  /**
5
5
  * fired after element insert into DOM tree
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _DisplayObject = require("./DisplayObject");
11
11
 
12
- var _Element = require("./dom/Element");
12
+ var _ = require("..");
13
13
 
14
14
  /**
15
15
  * shadow root
@@ -35,8 +35,8 @@ var CustomElement = function (_super) {
35
35
  }
36
36
  };
37
37
 
38
- _this.handleChildInserted = function (child) {
39
- child.forEach(function (node) {
38
+ _this.handleChildInserted = function (e) {
39
+ e.target.forEach(function (node) {
40
40
  // append children like other shapes after mounted
41
41
  if (!_this.isConnected) {
42
42
  _this.shadowNodes.push(node);
@@ -44,30 +44,40 @@ var CustomElement = function (_super) {
44
44
  });
45
45
  };
46
46
 
47
- _this.handleChildRemoved = function (child) {
48
- child.forEach(function (node) {
47
+ _this.handleChildRemoved = function (e) {
48
+ e.target.forEach(function (node) {
49
49
  node.shadow = false;
50
50
  });
51
51
  };
52
52
 
53
- _this.handleAttributeChanged = function (name, oldValue, value) {
54
- _this.attributeChangedCallback && _this.attributeChangedCallback(name, oldValue, value);
53
+ _this.handleAttributeChanged = function (e) {
54
+ // only listen itself
55
+ // RangeError: Maximum call stack size exceeded
56
+ if (e.target !== _this) {
57
+ return;
58
+ }
59
+
60
+ var _a = e.detail,
61
+ attributeName = _a.attributeName,
62
+ oldValue = _a.oldValue,
63
+ newValue = _a.newValue;
64
+ _this.attributeChangedCallback && _this.attributeChangedCallback(attributeName, oldValue, newValue);
55
65
  };
56
66
 
57
- _this.on(_Element.DISPLAY_OBJECT_EVENT.ChildInserted, _this.handleChildInserted);
67
+ _this.addEventListener(_.ElementEvent.CHILD_INSERTED, _this.handleChildInserted);
58
68
 
59
- _this.on(_Element.DISPLAY_OBJECT_EVENT.ChildRemoved, _this.handleChildRemoved);
69
+ _this.addEventListener(_.ElementEvent.CHILD_REMOVED, _this.handleChildRemoved);
60
70
 
61
71
  if (_this.attributeChangedCallback) {
62
- _this.on(_Element.DISPLAY_OBJECT_EVENT.AttributeChanged, _this.handleAttributeChanged);
72
+ _this.addEventListener(_.ElementEvent.ATTRIBUTE_CHANGED, _this.handleAttributeChanged);
63
73
  }
64
74
 
65
75
  if (_this.connectedCallback) {
66
- _this.on(_Element.DISPLAY_OBJECT_EVENT.Inserted, _this.handleMounted);
76
+ _this.addEventListener(_.ElementEvent.INSERTED, _this.handleMounted);
67
77
  }
68
78
 
69
79
  if (_this.disconnectedCallback) {
70
- _this.on(_Element.DISPLAY_OBJECT_EVENT.Removed, _this.disconnectedCallback.bind(_this));
80
+ _this.addEventListener(_.ElementEvent.REMOVED, _this.disconnectedCallback.bind(_this));
71
81
  }
72
82
 
73
83
  return _this;