@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.
- package/es/Canvas.d.ts +40 -18
- package/es/Canvas.js +121 -65
- package/es/DisplayObjectPool.d.ts +2 -1
- package/es/DisplayObjectPool.js +4 -0
- package/{lib → es/camera}/Camera.d.ts +6 -3
- package/es/{Camera.js → camera/Camera.js} +22 -16
- package/es/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/es/{Landmark.js → camera/Landmark.js} +1 -1
- package/es/camera/index.d.ts +2 -0
- package/es/camera/index.js +2 -0
- package/es/components/Cullable.js +1 -1
- package/es/components/Geometry.d.ts +8 -1
- package/es/components/Renderable.d.ts +9 -8
- package/es/components/Renderable.js +2 -6
- package/es/components/Sortable.d.ts +6 -2
- package/es/display-objects/Circle.d.ts +2 -3
- package/es/display-objects/Circle.js +2 -5
- package/es/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/es/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{lib → es/display-objects}/DisplayObject.d.ts +136 -141
- package/es/{DisplayObject.js → display-objects/DisplayObject.js} +408 -292
- package/es/display-objects/Ellipse.d.ts +2 -3
- package/es/display-objects/Ellipse.js +2 -5
- package/es/display-objects/Group.d.ts +2 -1
- package/es/display-objects/Group.js +13 -5
- package/es/display-objects/HTML.d.ts +2 -2
- package/es/display-objects/HTML.js +4 -7
- package/es/display-objects/Image.d.ts +2 -2
- package/es/display-objects/Image.js +2 -6
- package/es/display-objects/Line.d.ts +2 -2
- package/es/display-objects/Line.js +8 -8
- package/es/display-objects/Path.d.ts +3 -2
- package/es/display-objects/Path.js +8 -8
- package/es/display-objects/Polygon.d.ts +2 -2
- package/es/display-objects/Polygon.js +2 -6
- package/es/display-objects/Polyline.d.ts +2 -2
- package/es/display-objects/Polyline.js +8 -8
- package/es/display-objects/Rect.d.ts +2 -2
- package/es/display-objects/Rect.js +2 -6
- package/es/display-objects/Text.d.ts +2 -3
- package/es/display-objects/Text.js +8 -7
- package/es/display-objects/index.d.ts +2 -0
- package/es/display-objects/index.js +2 -0
- package/es/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/es/{Animation.js → dom/Animation.js} +2 -3
- package/{lib → es/dom}/AnimationEffectTiming.d.ts +2 -0
- package/es/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -2
- package/es/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/es/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/es/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/es/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/es/dom/CustomElementRegistry.d.ts +15 -0
- package/es/dom/CustomElementRegistry.js +40 -0
- package/{lib → es/dom}/CustomEvent.d.ts +1 -1
- package/es/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/es/dom/Document.d.ts +36 -17
- package/es/dom/Document.js +98 -14
- package/es/dom/Element.d.ts +71 -92
- package/es/dom/Element.js +179 -195
- package/es/dom/EventTarget.d.ts +11 -6
- package/es/dom/EventTarget.js +12 -4
- package/es/dom/FederatedEvent.d.ts +15 -7
- package/es/dom/FederatedEvent.js +33 -0
- package/es/dom/FederatedMouseEvent.d.ts +1 -1
- package/es/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/es/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/es/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/es/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/es/dom/Node.d.ts +38 -23
- package/es/dom/Node.js +37 -33
- package/es/dom/index.d.ts +15 -2
- package/es/dom/index.js +16 -3
- package/es/dom/interfaces.d.ts +301 -0
- package/es/dom/interfaces.js +1 -0
- package/es/global-module.d.ts +0 -2
- package/es/global-module.js +31 -29
- package/es/index.d.ts +7 -14
- package/es/index.js +8 -15
- package/es/plugins/CullingPlugin.d.ts +2 -2
- package/es/plugins/CullingPlugin.js +13 -16
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/DirtyCheckPlugin.js +8 -7
- package/es/plugins/EventPlugin.js +52 -31
- package/es/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/es/plugins/FrustumCullingStrategy.js +5 -4
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/es/plugins/PrepareRendererPlugin.js +42 -38
- package/es/property-handlers/aabb.d.ts +2 -3
- package/es/property-handlers/aabb.js +29 -21
- package/es/property-handlers/anchor.d.ts +3 -0
- package/es/property-handlers/anchor.js +21 -0
- package/es/property-handlers/clipPath.d.ts +1 -1
- package/es/property-handlers/clipPath.js +3 -4
- package/es/property-handlers/color.d.ts +1 -1
- package/es/property-handlers/dimension.d.ts +1 -1
- package/es/property-handlers/dimension.js +6 -9
- package/es/property-handlers/filter.d.ts +1 -1
- package/es/property-handlers/index.d.ts +5 -4
- package/es/property-handlers/index.js +1 -0
- package/es/property-handlers/localPosition.d.ts +1 -1
- package/es/property-handlers/localPosition.js +1 -6
- package/es/property-handlers/offsetDistance.d.ts +1 -1
- package/es/property-handlers/offsetPath.d.ts +1 -1
- package/es/property-handlers/origin.d.ts +1 -1
- package/es/property-handlers/origin.js +9 -2
- package/es/property-handlers/path.d.ts +2 -2
- package/es/property-handlers/path.js +8 -4
- package/es/property-handlers/points.d.ts +1 -1
- package/es/property-handlers/transform.d.ts +1 -1
- package/es/property-handlers/zIndex.d.ts +1 -1
- package/es/services/ContextService.d.ts +3 -2
- package/es/services/EventService.d.ts +18 -13
- package/es/services/EventService.js +604 -384
- package/es/services/RenderingContext.d.ts +1 -1
- package/es/services/RenderingService.d.ts +23 -29
- package/es/services/RenderingService.js +63 -54
- package/es/services/SceneGraphSelector.d.ts +7 -7
- package/es/services/SceneGraphSelector.js +10 -6
- package/es/services/SceneGraphService.d.ts +73 -78
- package/es/services/SceneGraphService.js +165 -78
- package/es/services/aabb/PathUpdater.d.ts +1 -1
- package/es/services/aabb/RectUpdater.d.ts +2 -2
- package/es/services/aabb/interfaces.d.ts +1 -1
- package/es/shapes/Point.d.ts +4 -0
- package/es/shapes/Polygon.d.ts +9 -0
- package/es/shapes/Polygon.js +62 -0
- package/es/shapes/index.d.ts +1 -0
- package/es/shapes/index.js +2 -1
- package/es/types.d.ts +18 -6
- package/es/utils/animation.d.ts +1 -2
- package/es/utils/animation.js +5 -10
- package/es/utils/canvas.d.ts +1 -1
- package/es/utils/custom-easing.d.ts +3 -2
- package/es/utils/custom-easing.js +12 -6
- package/es/utils/event.js +1 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.d.ts +3 -4
- package/es/utils/interpolation.js +0 -16
- package/es/utils/path.d.ts +2 -2
- package/lib/Canvas.d.ts +40 -18
- package/lib/Canvas.js +131 -74
- package/lib/DisplayObjectPool.d.ts +2 -1
- package/lib/DisplayObjectPool.js +4 -0
- package/{es → lib/camera}/Camera.d.ts +6 -3
- package/lib/{Camera.js → camera/Camera.js} +25 -20
- package/lib/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/lib/{Landmark.js → camera/Landmark.js} +2 -3
- package/lib/camera/index.d.ts +2 -0
- package/lib/camera/index.js +31 -0
- package/lib/components/Cullable.js +1 -1
- package/lib/components/Geometry.d.ts +8 -1
- package/lib/components/Renderable.d.ts +9 -8
- package/lib/components/Renderable.js +2 -6
- package/lib/components/Sortable.d.ts +6 -2
- package/lib/display-objects/Circle.d.ts +2 -3
- package/lib/display-objects/Circle.js +3 -6
- package/lib/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/lib/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{es → lib/display-objects}/DisplayObject.d.ts +136 -141
- package/lib/{DisplayObject.js → display-objects/DisplayObject.js} +418 -299
- package/lib/display-objects/Ellipse.d.ts +2 -3
- package/lib/display-objects/Ellipse.js +3 -6
- package/lib/display-objects/Group.d.ts +2 -1
- package/lib/display-objects/Group.js +12 -4
- package/lib/display-objects/HTML.d.ts +2 -2
- package/lib/display-objects/HTML.js +4 -7
- package/lib/display-objects/Image.d.ts +2 -2
- package/lib/display-objects/Image.js +2 -6
- package/lib/display-objects/Line.d.ts +2 -2
- package/lib/display-objects/Line.js +8 -8
- package/lib/display-objects/Path.d.ts +3 -2
- package/lib/display-objects/Path.js +8 -8
- package/lib/display-objects/Polygon.d.ts +2 -2
- package/lib/display-objects/Polygon.js +2 -6
- package/lib/display-objects/Polyline.d.ts +2 -2
- package/lib/display-objects/Polyline.js +8 -8
- package/lib/display-objects/Rect.d.ts +2 -2
- package/lib/display-objects/Rect.js +2 -6
- package/lib/display-objects/Text.d.ts +2 -3
- package/lib/display-objects/Text.js +9 -8
- package/lib/display-objects/index.d.ts +2 -0
- package/lib/display-objects/index.js +26 -0
- package/lib/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/lib/{Animation.js → dom/Animation.js} +2 -3
- package/{es → lib/dom}/AnimationEffectTiming.d.ts +2 -0
- package/lib/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -3
- package/lib/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/lib/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/lib/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/lib/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/lib/dom/CustomElementRegistry.d.ts +15 -0
- package/lib/dom/CustomElementRegistry.js +48 -0
- package/{es → lib/dom}/CustomEvent.d.ts +1 -1
- package/lib/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/lib/dom/Document.d.ts +36 -17
- package/lib/dom/Document.js +99 -15
- package/lib/dom/Element.d.ts +71 -92
- package/lib/dom/Element.js +180 -198
- package/lib/dom/EventTarget.d.ts +11 -6
- package/lib/dom/EventTarget.js +20 -10
- package/lib/dom/FederatedEvent.d.ts +15 -7
- package/lib/dom/FederatedEvent.js +33 -0
- package/lib/dom/FederatedMouseEvent.d.ts +1 -1
- package/lib/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/lib/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/lib/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/lib/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/lib/dom/Node.d.ts +38 -23
- package/lib/dom/Node.js +37 -33
- package/lib/dom/index.d.ts +15 -2
- package/lib/dom/index.js +177 -8
- package/lib/dom/interfaces.d.ts +301 -0
- package/lib/dom/interfaces.js +5 -0
- package/lib/global-module.d.ts +0 -2
- package/lib/global-module.js +30 -30
- package/lib/index.d.ts +7 -14
- package/lib/index.js +44 -135
- package/lib/plugins/CullingPlugin.d.ts +2 -2
- package/lib/plugins/CullingPlugin.js +14 -16
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/DirtyCheckPlugin.js +9 -7
- package/lib/plugins/EventPlugin.js +52 -30
- package/lib/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/lib/plugins/FrustumCullingStrategy.js +5 -4
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/lib/plugins/PrepareRendererPlugin.js +41 -37
- package/lib/property-handlers/aabb.d.ts +2 -3
- package/lib/property-handlers/aabb.js +28 -22
- package/lib/property-handlers/anchor.d.ts +3 -0
- package/lib/property-handlers/anchor.js +34 -0
- package/lib/property-handlers/clipPath.d.ts +1 -1
- package/lib/property-handlers/clipPath.js +3 -4
- package/lib/property-handlers/color.d.ts +1 -1
- package/lib/property-handlers/dimension.d.ts +1 -1
- package/lib/property-handlers/dimension.js +6 -9
- package/lib/property-handlers/filter.d.ts +1 -1
- package/lib/property-handlers/index.d.ts +5 -4
- package/lib/property-handlers/index.js +14 -0
- package/lib/property-handlers/localPosition.d.ts +1 -1
- package/lib/property-handlers/localPosition.js +1 -7
- package/lib/property-handlers/offsetDistance.d.ts +1 -1
- package/lib/property-handlers/offsetPath.d.ts +1 -1
- package/lib/property-handlers/origin.d.ts +1 -1
- package/lib/property-handlers/origin.js +10 -2
- package/lib/property-handlers/path.d.ts +2 -2
- package/lib/property-handlers/path.js +8 -4
- package/lib/property-handlers/points.d.ts +1 -1
- package/lib/property-handlers/transform.d.ts +1 -1
- package/lib/property-handlers/zIndex.d.ts +1 -1
- package/lib/services/ContextService.d.ts +3 -2
- package/lib/services/EventService.d.ts +18 -13
- package/lib/services/EventService.js +616 -385
- package/lib/services/RenderingContext.d.ts +1 -1
- package/lib/services/RenderingService.d.ts +23 -29
- package/lib/services/RenderingService.js +66 -56
- package/lib/services/SceneGraphSelector.d.ts +7 -7
- package/lib/services/SceneGraphSelector.js +10 -6
- package/lib/services/SceneGraphService.d.ts +73 -78
- package/lib/services/SceneGraphService.js +166 -79
- package/lib/services/aabb/PathUpdater.d.ts +1 -1
- package/lib/services/aabb/RectUpdater.d.ts +2 -2
- package/lib/services/aabb/interfaces.d.ts +1 -1
- package/lib/shapes/Point.d.ts +4 -0
- package/lib/shapes/Polygon.d.ts +9 -0
- package/lib/shapes/Polygon.js +69 -0
- package/lib/shapes/index.d.ts +1 -0
- package/lib/shapes/index.js +13 -0
- package/lib/types.d.ts +18 -6
- package/lib/utils/animation.d.ts +1 -2
- package/lib/utils/animation.js +8 -16
- package/lib/utils/canvas.d.ts +1 -1
- package/lib/utils/custom-easing.d.ts +3 -2
- package/lib/utils/custom-easing.js +16 -8
- package/lib/utils/event.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/interpolation.d.ts +3 -4
- package/lib/utils/interpolation.js +0 -17
- package/lib/utils/path.d.ts +2 -2
- package/package.json +6 -6
- package/es/Batch.d.ts +0 -25
- package/es/Batch.js +0 -82
- package/es/shapes-type.d.ts +0 -175
- package/es/shapes-type.js +0 -18
- package/es/utils/matrix-decompose.d.ts +0 -3
- package/es/utils/matrix-decompose.js +0 -404
- package/lib/Batch.d.ts +0 -25
- package/lib/Batch.js +0 -91
- package/lib/shapes-type.d.ts +0 -175
- package/lib/shapes-type.js +0 -41
- package/lib/utils/matrix-decompose.d.ts +0 -3
- 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
|
|
14
|
+
var _Landmark = require("./Landmark");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _shapes = require("../shapes");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _math = require("../utils/math");
|
|
19
19
|
|
|
20
|
-
var
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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
|
-
|
|
74
|
-
exports.default = _default;
|
|
73
|
+
exports.Landmark = 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
|
+
});
|
|
@@ -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
|
-
|
|
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
|
-
|
|
11
|
-
|
|
10
|
+
bounds: AABB | undefined;
|
|
11
|
+
boundsDirty: boolean;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* account for hierarchy, also including extra rendering effects
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
renderBounds: AABB | undefined;
|
|
16
|
+
renderBoundsDirty: boolean;
|
|
16
17
|
/**
|
|
17
|
-
* dirty
|
|
18
|
+
* dirty render bounds in last render frame
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
dirtyRenderBounds: AABB;
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* dirty rectangle flag
|
|
22
23
|
*/
|
|
23
|
-
|
|
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.
|
|
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 {
|
|
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:
|
|
12
|
+
sorted: INode[];
|
|
13
|
+
/**
|
|
14
|
+
* index in parent's children
|
|
15
|
+
*/
|
|
16
|
+
lastSortedIndex: number;
|
|
13
17
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DisplayObject } from '
|
|
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
|
|
10
|
+
var _ = require("..");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
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:
|
|
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
|
|
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 (
|
|
39
|
-
|
|
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 (
|
|
48
|
-
|
|
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 (
|
|
54
|
-
|
|
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.
|
|
67
|
+
_this.addEventListener(_.ElementEvent.CHILD_INSERTED, _this.handleChildInserted);
|
|
58
68
|
|
|
59
|
-
_this.
|
|
69
|
+
_this.addEventListener(_.ElementEvent.CHILD_REMOVED, _this.handleChildRemoved);
|
|
60
70
|
|
|
61
71
|
if (_this.attributeChangedCallback) {
|
|
62
|
-
_this.
|
|
72
|
+
_this.addEventListener(_.ElementEvent.ATTRIBUTE_CHANGED, _this.handleAttributeChanged);
|
|
63
73
|
}
|
|
64
74
|
|
|
65
75
|
if (_this.connectedCallback) {
|
|
66
|
-
_this.
|
|
76
|
+
_this.addEventListener(_.ElementEvent.INSERTED, _this.handleMounted);
|
|
67
77
|
}
|
|
68
78
|
|
|
69
79
|
if (_this.disconnectedCallback) {
|
|
70
|
-
_this.
|
|
80
|
+
_this.addEventListener(_.ElementEvent.REMOVED, _this.disconnectedCallback.bind(_this));
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
return _this;
|