@antv/g 1.0.0-alpha.27 → 1.0.0-alpha.28
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/dist/index.umd.js +4238 -0
- package/lib/index.js +222 -0
- package/package.json +11 -10
- package/dist/AbstractRenderer.d.ts +0 -26
- package/dist/Canvas.d.ts +0 -96
- package/dist/DisplayObjectPool.d.ts +0 -7
- package/dist/__tests__/canvas.spec.d.ts +0 -1
- package/dist/__tests__/custom-element.spec.d.ts +0 -3
- package/dist/__tests__/event.spec.d.ts +0 -1
- package/dist/camera/Camera.d.ts +0 -279
- package/dist/camera/Landmark.d.ts +0 -28
- package/dist/camera/__tests__/camera.spec.d.ts +0 -1
- package/dist/camera/__tests__/landmark.spec.d.ts +0 -1
- package/dist/camera/index.d.ts +0 -2
- package/dist/canvas-module.d.ts +0 -3
- package/dist/components/Cullable.d.ts +0 -15
- package/dist/components/Geometry.d.ts +0 -13
- package/dist/components/Renderable.d.ts +0 -25
- package/dist/components/Sortable.d.ts +0 -17
- package/dist/components/Transform.d.ts +0 -28
- package/dist/components/index.d.ts +0 -5
- package/dist/display-objects/Circle.d.ts +0 -12
- package/dist/display-objects/CustomElement.d.ts +0 -25
- package/dist/display-objects/DisplayObject.d.ts +0 -258
- package/dist/display-objects/Ellipse.d.ts +0 -14
- package/dist/display-objects/Group.d.ts +0 -6
- package/dist/display-objects/HTML.d.ts +0 -36
- package/dist/display-objects/Image.d.ts +0 -16
- package/dist/display-objects/Line.d.ts +0 -23
- package/dist/display-objects/Path.d.ts +0 -47
- package/dist/display-objects/Polygon.d.ts +0 -12
- package/dist/display-objects/Polyline.d.ts +0 -21
- package/dist/display-objects/Rect.d.ts +0 -16
- package/dist/display-objects/Text.d.ts +0 -65
- package/dist/display-objects/__tests__/circle.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.bounds.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.node.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.transformable.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.visible.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/ellipse.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/line.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/path.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/polygon.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/polyline.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/text.spec.d.ts +0 -1
- package/dist/display-objects/index.d.ts +0 -13
- package/dist/dom/Animation.d.ts +0 -132
- package/dist/dom/AnimationEffectTiming.d.ts +0 -59
- package/dist/dom/AnimationEvent.d.ts +0 -11
- package/dist/dom/AnimationTimeline.d.ts +0 -37
- package/dist/dom/CustomElementRegistry.d.ts +0 -15
- package/dist/dom/CustomEvent.d.ts +0 -16
- package/dist/dom/Document.d.ts +0 -59
- package/dist/dom/Element.d.ts +0 -143
- package/dist/dom/EventTarget.d.ts +0 -47
- package/dist/dom/FederatedEvent.d.ts +0 -146
- package/dist/dom/FederatedMouseEvent.d.ts +0 -52
- package/dist/dom/FederatedPointerEvent.d.ts +0 -69
- package/dist/dom/FederatedWheelEvent.d.ts +0 -20
- package/dist/dom/KeyframeEffect.d.ts +0 -48
- package/dist/dom/KeyframeList.d.ts +0 -2
- package/dist/dom/Node.d.ts +0 -106
- package/dist/dom/__tests__/animation.computed-timing.spec.d.ts +0 -1
- package/dist/dom/__tests__/animation.keyframe-effect.spec.d.ts +0 -1
- package/dist/dom/__tests__/animation.timeline.spec.d.ts +0 -1
- package/dist/dom/__tests__/document.spec.d.ts +0 -1
- package/dist/dom/__tests__/element.spec.d.ts +0 -1
- package/dist/dom/__tests__/event.spec.d.ts +0 -1
- package/dist/dom/__tests__/utils/easing.d.ts +0 -14
- package/dist/dom/__tests__/utils/keyframe.d.ts +0 -38
- package/dist/dom/index.d.ts +0 -17
- package/dist/dom/interfaces.d.ts +0 -327
- package/dist/global-module.d.ts +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.esm.js +0 -13165
- package/dist/index.js +0 -13659
- package/dist/plugins/CullingPlugin.d.ts +0 -19
- package/dist/plugins/DirtyCheckPlugin.d.ts +0 -10
- package/dist/plugins/EventPlugin.d.ts +0 -26
- package/dist/plugins/FrustumCullingStrategy.d.ts +0 -21
- package/dist/plugins/PrepareRendererPlugin.d.ts +0 -6
- package/dist/property-handlers/__tests__/color.spec.d.ts +0 -1
- package/dist/property-handlers/__tests__/dimension.spec.d.ts +0 -1
- package/dist/property-handlers/__tests__/filter.spec.d.ts +0 -1
- package/dist/property-handlers/__tests__/transform.spec.d.ts +0 -1
- package/dist/property-handlers/aabb.d.ts +0 -2
- package/dist/property-handlers/anchor.d.ts +0 -3
- package/dist/property-handlers/clipPath.d.ts +0 -19
- package/dist/property-handlers/color.d.ts +0 -32
- package/dist/property-handlers/dimension.d.ts +0 -18
- package/dist/property-handlers/filter.d.ts +0 -9
- package/dist/property-handlers/index.d.ts +0 -17
- package/dist/property-handlers/interfaces.d.ts +0 -20
- package/dist/property-handlers/localPosition.d.ts +0 -2
- package/dist/property-handlers/numeric.d.ts +0 -5
- package/dist/property-handlers/offsetDistance.d.ts +0 -5
- package/dist/property-handlers/offsetPath.d.ts +0 -5
- package/dist/property-handlers/origin.d.ts +0 -11
- package/dist/property-handlers/path.d.ts +0 -5
- package/dist/property-handlers/points.d.ts +0 -6
- package/dist/property-handlers/transform.d.ts +0 -45
- package/dist/property-handlers/zIndex.d.ts +0 -2
- package/dist/services/ContextService.d.ts +0 -12
- package/dist/services/EventService.d.ts +0 -64
- package/dist/services/RenderingContext.d.ts +0 -28
- package/dist/services/RenderingService.d.ts +0 -51
- package/dist/services/SceneGraphSelector.d.ts +0 -20
- package/dist/services/SceneGraphService.d.ts +0 -146
- package/dist/services/aabb/CircleUpdater.d.ts +0 -10
- package/dist/services/aabb/EllipseUpdater.d.ts +0 -10
- package/dist/services/aabb/LineUpdater.d.ts +0 -10
- package/dist/services/aabb/PathUpdater.d.ts +0 -11
- package/dist/services/aabb/PolylineUpdater.d.ts +0 -10
- package/dist/services/aabb/RectUpdater.d.ts +0 -10
- package/dist/services/aabb/TextUpdater.d.ts +0 -13
- package/dist/services/aabb/index.d.ts +0 -8
- package/dist/services/aabb/interfaces.d.ts +0 -16
- package/dist/services/index.d.ts +0 -10
- package/dist/services/text/OffscreenCanvasCreator.d.ts +0 -6
- package/dist/services/text/index.d.ts +0 -35
- package/dist/shapes/AABB.d.ts +0 -33
- package/dist/shapes/BoundingSphere.d.ts +0 -8
- package/dist/shapes/Frustum.d.ts +0 -16
- package/dist/shapes/Plane.d.ts +0 -14
- package/dist/shapes/Point.d.ts +0 -11
- package/dist/shapes/Polygon.d.ts +0 -9
- package/dist/shapes/Ray.d.ts +0 -24
- package/dist/shapes/Rect.d.ts +0 -12
- package/dist/shapes/Rectangle.d.ts +0 -12
- package/dist/shapes/__tests__/aabb.spec.d.ts +0 -1
- package/dist/shapes/__tests__/boundingSphere.spec.d.ts +0 -1
- package/dist/shapes/__tests__/frustum.spec.d.ts +0 -1
- package/dist/shapes/__tests__/plane.spec.d.ts +0 -1
- package/dist/shapes/__tests__/ray.spec.d.ts +0 -1
- package/dist/shapes/index.d.ts +0 -8
- package/dist/types.d.ts +0 -219
- package/dist/utils/__tests__/event.spec.d.ts +0 -1
- package/dist/utils/__tests__/path.spec.d.ts +0 -1
- package/dist/utils/__tests__/raf.spec.d.ts +0 -1
- package/dist/utils/__tests__/text.spec.d.ts +0 -1
- package/dist/utils/animation.d.ts +0 -15
- package/dist/utils/bezier-easing.d.ts +0 -20
- package/dist/utils/canvas.d.ts +0 -5
- package/dist/utils/custom-easing.d.ts +0 -75
- package/dist/utils/event.d.ts +0 -11
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/interpolation.d.ts +0 -3
- package/dist/utils/math.d.ts +0 -22
- package/dist/utils/path.d.ts +0 -15
- package/dist/utils/raf.d.ts +0 -3
- package/dist/utils/text.d.ts +0 -2
package/lib/index.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
world: true,
|
|
10
|
+
Component: true,
|
|
11
|
+
ManaSyringe: true
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "Component", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _gEcs.Component;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
exports.ManaSyringe = exports.world = void 0;
|
|
20
|
+
|
|
21
|
+
var _gEcs = require("@antv/g-ecs");
|
|
22
|
+
|
|
23
|
+
var ManaSyringe = _interopRequireWildcard(require("mana-syringe"));
|
|
24
|
+
|
|
25
|
+
exports.ManaSyringe = ManaSyringe;
|
|
26
|
+
|
|
27
|
+
var _globalModule = require("./global-module");
|
|
28
|
+
|
|
29
|
+
Object.keys(_globalModule).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
32
|
+
if (key in exports && exports[key] === _globalModule[key]) return;
|
|
33
|
+
Object.defineProperty(exports, key, {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function get() {
|
|
36
|
+
return _globalModule[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var _components = require("./components");
|
|
42
|
+
|
|
43
|
+
Object.keys(_components).forEach(function (key) {
|
|
44
|
+
if (key === "default" || key === "__esModule") return;
|
|
45
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
46
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
47
|
+
Object.defineProperty(exports, key, {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function get() {
|
|
50
|
+
return _components[key];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
var _types = require("./types");
|
|
56
|
+
|
|
57
|
+
Object.keys(_types).forEach(function (key) {
|
|
58
|
+
if (key === "default" || key === "__esModule") return;
|
|
59
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
60
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
61
|
+
Object.defineProperty(exports, key, {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _types[key];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
var _dom = require("./dom");
|
|
70
|
+
|
|
71
|
+
Object.keys(_dom).forEach(function (key) {
|
|
72
|
+
if (key === "default" || key === "__esModule") return;
|
|
73
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
74
|
+
if (key in exports && exports[key] === _dom[key]) return;
|
|
75
|
+
Object.defineProperty(exports, key, {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function get() {
|
|
78
|
+
return _dom[key];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var _AbstractRenderer = require("./AbstractRenderer");
|
|
84
|
+
|
|
85
|
+
Object.keys(_AbstractRenderer).forEach(function (key) {
|
|
86
|
+
if (key === "default" || key === "__esModule") return;
|
|
87
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
88
|
+
if (key in exports && exports[key] === _AbstractRenderer[key]) return;
|
|
89
|
+
Object.defineProperty(exports, key, {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function get() {
|
|
92
|
+
return _AbstractRenderer[key];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
var _Canvas = require("./Canvas");
|
|
98
|
+
|
|
99
|
+
Object.keys(_Canvas).forEach(function (key) {
|
|
100
|
+
if (key === "default" || key === "__esModule") return;
|
|
101
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
102
|
+
if (key in exports && exports[key] === _Canvas[key]) return;
|
|
103
|
+
Object.defineProperty(exports, key, {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function get() {
|
|
106
|
+
return _Canvas[key];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
var _DisplayObjectPool = require("./DisplayObjectPool");
|
|
112
|
+
|
|
113
|
+
Object.keys(_DisplayObjectPool).forEach(function (key) {
|
|
114
|
+
if (key === "default" || key === "__esModule") return;
|
|
115
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
116
|
+
if (key in exports && exports[key] === _DisplayObjectPool[key]) return;
|
|
117
|
+
Object.defineProperty(exports, key, {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function get() {
|
|
120
|
+
return _DisplayObjectPool[key];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
var _camera = require("./camera");
|
|
126
|
+
|
|
127
|
+
Object.keys(_camera).forEach(function (key) {
|
|
128
|
+
if (key === "default" || key === "__esModule") return;
|
|
129
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
130
|
+
if (key in exports && exports[key] === _camera[key]) return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function get() {
|
|
134
|
+
return _camera[key];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
var _services = require("./services");
|
|
140
|
+
|
|
141
|
+
Object.keys(_services).forEach(function (key) {
|
|
142
|
+
if (key === "default" || key === "__esModule") return;
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
144
|
+
if (key in exports && exports[key] === _services[key]) return;
|
|
145
|
+
Object.defineProperty(exports, key, {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function get() {
|
|
148
|
+
return _services[key];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
var _shapes = require("./shapes");
|
|
154
|
+
|
|
155
|
+
Object.keys(_shapes).forEach(function (key) {
|
|
156
|
+
if (key === "default" || key === "__esModule") return;
|
|
157
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
158
|
+
if (key in exports && exports[key] === _shapes[key]) return;
|
|
159
|
+
Object.defineProperty(exports, key, {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function get() {
|
|
162
|
+
return _shapes[key];
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
var _utils = require("./utils");
|
|
168
|
+
|
|
169
|
+
Object.keys(_utils).forEach(function (key) {
|
|
170
|
+
if (key === "default" || key === "__esModule") return;
|
|
171
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
172
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
173
|
+
Object.defineProperty(exports, key, {
|
|
174
|
+
enumerable: true,
|
|
175
|
+
get: function get() {
|
|
176
|
+
return _utils[key];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
var _propertyHandlers = require("./property-handlers");
|
|
182
|
+
|
|
183
|
+
Object.keys(_propertyHandlers).forEach(function (key) {
|
|
184
|
+
if (key === "default" || key === "__esModule") return;
|
|
185
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
186
|
+
if (key in exports && exports[key] === _propertyHandlers[key]) return;
|
|
187
|
+
Object.defineProperty(exports, key, {
|
|
188
|
+
enumerable: true,
|
|
189
|
+
get: function get() {
|
|
190
|
+
return _propertyHandlers[key];
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
var _displayObjects = require("./display-objects");
|
|
196
|
+
|
|
197
|
+
Object.keys(_displayObjects).forEach(function (key) {
|
|
198
|
+
if (key === "default" || key === "__esModule") return;
|
|
199
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
200
|
+
if (key in exports && exports[key] === _displayObjects[key]) return;
|
|
201
|
+
Object.defineProperty(exports, key, {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function get() {
|
|
204
|
+
return _displayObjects[key];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
210
|
+
|
|
211
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
212
|
+
|
|
213
|
+
// bind ECS
|
|
214
|
+
_globalModule.globalContainer.load(_gEcs.containerModule);
|
|
215
|
+
|
|
216
|
+
_globalModule.globalContainer.load(_globalModule.containerModule); // register components & systems
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
var world = _globalModule.globalContainer.get(_gEcs.World);
|
|
220
|
+
|
|
221
|
+
exports.world = world;
|
|
222
|
+
world.registerComponent(_components.Transform).registerComponent(_components.Sortable).registerComponent(_components.Cullable).registerComponent(_components.Geometry).registerComponent(_components.Renderable);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.28",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
7
|
-
"types": "
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"module": "es/index.esm.js",
|
|
7
|
+
"types": "es/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"package.json",
|
|
10
10
|
"dist",
|
|
@@ -35,17 +35,18 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/antvis/g#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@antv/g-ecs": "^1.0.0-alpha.
|
|
39
|
-
"@antv/g-math": "^1.0.0-alpha.
|
|
38
|
+
"@antv/g-ecs": "^1.0.0-alpha.12",
|
|
39
|
+
"@antv/g-math": "^1.0.0-alpha.8",
|
|
40
40
|
"@antv/path-util": "^2.0.14",
|
|
41
41
|
"@antv/util": "^2.0.13",
|
|
42
|
-
"@babel/runtime": "^7.16.0",
|
|
43
42
|
"d3-color": "^1.4.0",
|
|
44
43
|
"eventemitter3": "^4.0.0",
|
|
45
44
|
"gl-matrix": "^3.1.0",
|
|
46
|
-
"mana-syringe": "^0.1
|
|
47
|
-
"reflect-metadata": "^0.1.13",
|
|
45
|
+
"mana-syringe": "^0.2.1",
|
|
48
46
|
"tapable": "2.2.1"
|
|
49
47
|
},
|
|
50
|
-
"
|
|
48
|
+
"scripts": {
|
|
49
|
+
"umd": "webpack"
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "b8af919853fa578b4aa6c5e84715948085ac0170"
|
|
51
52
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Syringe } from 'mana-syringe';
|
|
2
|
-
import { RendererConfig } from './types';
|
|
3
|
-
export interface RendererPlugin {
|
|
4
|
-
init(container: Syringe.Container): void;
|
|
5
|
-
destroy(container: Syringe.Container): void;
|
|
6
|
-
}
|
|
7
|
-
export interface IRenderer {
|
|
8
|
-
getConfig(): RendererConfig;
|
|
9
|
-
/**
|
|
10
|
-
* register plugin at runtime
|
|
11
|
-
*/
|
|
12
|
-
registerPlugin(plugin: RendererPlugin): void;
|
|
13
|
-
/**
|
|
14
|
-
* return all registered plugins
|
|
15
|
-
*/
|
|
16
|
-
getPlugins(): RendererPlugin[];
|
|
17
|
-
}
|
|
18
|
-
export declare class AbstractRenderer implements IRenderer {
|
|
19
|
-
private plugins;
|
|
20
|
-
private config;
|
|
21
|
-
constructor(config?: Partial<RendererConfig>);
|
|
22
|
-
registerPlugin(plugin: RendererPlugin): void;
|
|
23
|
-
getPlugins(): RendererPlugin[];
|
|
24
|
-
getConfig(): RendererConfig;
|
|
25
|
-
setConfig(config: Partial<RendererConfig>): void;
|
|
26
|
-
}
|
package/dist/Canvas.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { CanvasConfig } from './types';
|
|
2
|
-
import { DisplayObject } from './display-objects/DisplayObject';
|
|
3
|
-
import { ContextService } from './services';
|
|
4
|
-
import { RenderingService } from './services/RenderingService';
|
|
5
|
-
import { RenderingContext } from './services/RenderingContext';
|
|
6
|
-
import { EventService } from './services/EventService';
|
|
7
|
-
import { Camera } from './camera';
|
|
8
|
-
import { AbstractRenderer } from './AbstractRenderer';
|
|
9
|
-
import type { PointLike } from './shapes';
|
|
10
|
-
import { Document, EventTarget } from './dom';
|
|
11
|
-
import type { IElement, INode, ICanvas } from './dom/interfaces';
|
|
12
|
-
import { CustomElementRegistry } from './dom/CustomElementRegistry';
|
|
13
|
-
export declare enum CanvasEvent {
|
|
14
|
-
READY = "ready",
|
|
15
|
-
BEFORE_RENDER = "beforerender",
|
|
16
|
-
AFTER_RENDER = "afterrender",
|
|
17
|
-
BEFORE_DESTROY = "beforedestroy",
|
|
18
|
-
AFTER_DESTROY = "afterdestroy"
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* can be treated like Window in DOM
|
|
22
|
-
*
|
|
23
|
-
* prototype chains: Canvas(Window) -> EventTarget
|
|
24
|
-
*/
|
|
25
|
-
export declare class Canvas extends EventTarget implements ICanvas {
|
|
26
|
-
/**
|
|
27
|
-
* child container of current canvas, use hierarchy container
|
|
28
|
-
*/
|
|
29
|
-
container: import("mana-syringe").Syringe.Container;
|
|
30
|
-
/**
|
|
31
|
-
* window.document
|
|
32
|
-
*/
|
|
33
|
-
document: Document;
|
|
34
|
-
/**
|
|
35
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
36
|
-
*/
|
|
37
|
-
customElements: CustomElementRegistry;
|
|
38
|
-
Element: typeof DisplayObject;
|
|
39
|
-
/**
|
|
40
|
-
* rAF in auto rendering
|
|
41
|
-
*/
|
|
42
|
-
private frameId?;
|
|
43
|
-
constructor(config: CanvasConfig);
|
|
44
|
-
private initRenderingContext;
|
|
45
|
-
private initDefaultCamera;
|
|
46
|
-
getConfig(): Partial<CanvasConfig>;
|
|
47
|
-
getContainer(): import("mana-syringe").Syringe.Container;
|
|
48
|
-
/**
|
|
49
|
-
* get the root displayObject in scenegraph
|
|
50
|
-
* @alias this.document.documentElement
|
|
51
|
-
*/
|
|
52
|
-
getRoot(): import(".").Group;
|
|
53
|
-
/**
|
|
54
|
-
* get the camera of canvas
|
|
55
|
-
*/
|
|
56
|
-
getCamera(): Camera;
|
|
57
|
-
getContextService(): ContextService<unknown>;
|
|
58
|
-
getEventService(): EventService;
|
|
59
|
-
getRenderingService(): RenderingService;
|
|
60
|
-
getRenderingContext(): RenderingContext;
|
|
61
|
-
getComputedStyle(node: DisplayObject): any;
|
|
62
|
-
destroy(destroyScenegraph?: boolean): void;
|
|
63
|
-
/**
|
|
64
|
-
* compatible with G 3.0
|
|
65
|
-
* @deprecated
|
|
66
|
-
* @alias resize
|
|
67
|
-
*/
|
|
68
|
-
changeSize(width: number, height: number): void;
|
|
69
|
-
resize(width: number, height: number): void;
|
|
70
|
-
appendChild<T extends INode>(child: T, index?: number): T;
|
|
71
|
-
insertBefore<T extends INode>(newChild: T, refChild: IElement | null): T;
|
|
72
|
-
removeChild<T extends INode>(child: T, destroy?: boolean): T;
|
|
73
|
-
removeChildren(destroy?: boolean): void;
|
|
74
|
-
render(): void;
|
|
75
|
-
private run;
|
|
76
|
-
private initRenderer;
|
|
77
|
-
private loadCommonContainerModule;
|
|
78
|
-
private loadRendererContainerModule;
|
|
79
|
-
setRenderer(renderer: AbstractRenderer): void;
|
|
80
|
-
private unmountChildren;
|
|
81
|
-
private mountChildren;
|
|
82
|
-
client2Viewport(client: PointLike): PointLike;
|
|
83
|
-
viewport2Client(canvas: PointLike): PointLike;
|
|
84
|
-
viewport2Canvas(viewport: PointLike): PointLike;
|
|
85
|
-
canvas2Viewport(canvas: PointLike): PointLike;
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated
|
|
88
|
-
* @alias client2Viewport
|
|
89
|
-
*/
|
|
90
|
-
getPointByClient(clientX: number, clientY: number): PointLike;
|
|
91
|
-
/**
|
|
92
|
-
* @deprecated
|
|
93
|
-
* @alias viewport2Client
|
|
94
|
-
*/
|
|
95
|
-
getClientByPoint(x: number, y: number): PointLike;
|
|
96
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/camera/Camera.d.ts
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { mat4, vec3 } from 'gl-matrix';
|
|
3
|
-
import { Landmark } from './Landmark';
|
|
4
|
-
import { Frustum } from '../shapes';
|
|
5
|
-
export declare const DefaultCamera = "DefaultCamera";
|
|
6
|
-
export declare enum CAMERA_TYPE {
|
|
7
|
-
ORBITING = "ORBITING",
|
|
8
|
-
EXPLORING = "EXPLORING",
|
|
9
|
-
TRACKING = "TRACKING"
|
|
10
|
-
}
|
|
11
|
-
export declare enum CAMERA_TRACKING_MODE {
|
|
12
|
-
DEFAULT = "DEFAULT",
|
|
13
|
-
ROTATIONAL = "ROTATIONAL",
|
|
14
|
-
TRANSLATIONAL = "TRANSLATIONAL",
|
|
15
|
-
CINEMATIC = "CINEMATIC"
|
|
16
|
-
}
|
|
17
|
-
export declare enum CAMERA_PROJECTION_MODE {
|
|
18
|
-
ORTHOGRAPHIC = "ORTHOGRAPHIC",
|
|
19
|
-
PERSPECTIVE = "PERSPECTIVE"
|
|
20
|
-
}
|
|
21
|
-
export declare const CAMERA_EVENT: {
|
|
22
|
-
Updated: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* 参考「WebGL Insights - 23.Designing Cameras for WebGL Applications」,基于 Responsible Camera 思路设计
|
|
26
|
-
* 保存相机参数,定义相机动作:
|
|
27
|
-
* 1. dolly 沿 n 轴移动
|
|
28
|
-
* 2. pan 沿 u v 轴移动
|
|
29
|
-
* 3. rotate 以方位角旋转
|
|
30
|
-
* 4. 移动到 Landmark,具有平滑的动画效果,其间禁止其他用户交互
|
|
31
|
-
*/
|
|
32
|
-
export declare class Camera extends EventEmitter {
|
|
33
|
-
static ProjectionMode: {
|
|
34
|
-
ORTHOGRAPHIC: string;
|
|
35
|
-
PERSPECTIVE: string;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* 相机矩阵
|
|
39
|
-
*/
|
|
40
|
-
matrix: mat4;
|
|
41
|
-
/**
|
|
42
|
-
* u 轴
|
|
43
|
-
* @see http://learnwebgl.brown37.net/07_cameras/camera_introduction.html#a-camera-definition
|
|
44
|
-
*/
|
|
45
|
-
right: vec3;
|
|
46
|
-
/**
|
|
47
|
-
* v 轴 +Y is down
|
|
48
|
-
*/
|
|
49
|
-
up: vec3;
|
|
50
|
-
/**
|
|
51
|
-
* n 轴 +Z is inside
|
|
52
|
-
*/
|
|
53
|
-
forward: vec3;
|
|
54
|
-
/**
|
|
55
|
-
* 相机位置
|
|
56
|
-
*/
|
|
57
|
-
position: vec3;
|
|
58
|
-
/**
|
|
59
|
-
* 视点位置
|
|
60
|
-
*/
|
|
61
|
-
focalPoint: vec3;
|
|
62
|
-
/**
|
|
63
|
-
* 相机位置到视点向量
|
|
64
|
-
* focalPoint - position
|
|
65
|
-
*/
|
|
66
|
-
distanceVector: vec3;
|
|
67
|
-
/**
|
|
68
|
-
* 相机位置到视点距离
|
|
69
|
-
* length(focalPoint - position)
|
|
70
|
-
*/
|
|
71
|
-
distance: number;
|
|
72
|
-
/**
|
|
73
|
-
* @see https://en.wikipedia.org/wiki/Azimuth
|
|
74
|
-
*/
|
|
75
|
-
azimuth: number;
|
|
76
|
-
elevation: number;
|
|
77
|
-
roll: number;
|
|
78
|
-
relAzimuth: number;
|
|
79
|
-
relElevation: number;
|
|
80
|
-
relRoll: number;
|
|
81
|
-
/**
|
|
82
|
-
* 沿 n 轴移动时,保证移动速度从快到慢
|
|
83
|
-
*/
|
|
84
|
-
dollyingStep: number;
|
|
85
|
-
maxDistance: number;
|
|
86
|
-
minDistance: number;
|
|
87
|
-
/**
|
|
88
|
-
* zoom factor of the camera, default is 1
|
|
89
|
-
* eg. https://threejs.org/docs/#api/en/cameras/OrthographicCamera.zoom
|
|
90
|
-
*/
|
|
91
|
-
zoom: number;
|
|
92
|
-
/**
|
|
93
|
-
* invert the horizontal coordinate system HCS
|
|
94
|
-
*/
|
|
95
|
-
rotateWorld: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* 投影矩阵参数
|
|
98
|
-
*/
|
|
99
|
-
/**
|
|
100
|
-
* field of view [0-360]
|
|
101
|
-
* @see http://en.wikipedia.org/wiki/Angle_of_view
|
|
102
|
-
*/
|
|
103
|
-
private fov;
|
|
104
|
-
private near;
|
|
105
|
-
private far;
|
|
106
|
-
private aspect;
|
|
107
|
-
private left;
|
|
108
|
-
private rright;
|
|
109
|
-
private top;
|
|
110
|
-
private bottom;
|
|
111
|
-
private projectionMatrix;
|
|
112
|
-
private projectionMatrixInverse;
|
|
113
|
-
private jitteredProjectionMatrix;
|
|
114
|
-
private view;
|
|
115
|
-
private following;
|
|
116
|
-
private type;
|
|
117
|
-
private trackingMode;
|
|
118
|
-
private projectionMode;
|
|
119
|
-
/**
|
|
120
|
-
* for culling use
|
|
121
|
-
*/
|
|
122
|
-
private frustum;
|
|
123
|
-
/**
|
|
124
|
-
* switch between multiple landmarks
|
|
125
|
-
*/
|
|
126
|
-
private landmarks;
|
|
127
|
-
private landmarkAnimationID;
|
|
128
|
-
/**
|
|
129
|
-
* ortho matrix for Canvas2D & SVG
|
|
130
|
-
*/
|
|
131
|
-
private orthoMatrix;
|
|
132
|
-
clone(): Camera;
|
|
133
|
-
getProjectionMode(): CAMERA_PROJECTION_MODE;
|
|
134
|
-
getPerspective(): mat4;
|
|
135
|
-
getPerspectiveInverse(): mat4;
|
|
136
|
-
getFrustum(): Frustum;
|
|
137
|
-
getPosition(): vec3;
|
|
138
|
-
getFocalPoint(): vec3;
|
|
139
|
-
getNear(): number;
|
|
140
|
-
getFar(): number;
|
|
141
|
-
getZoom(): number;
|
|
142
|
-
getOrthoMatrix(): mat4;
|
|
143
|
-
setType(type: CAMERA_TYPE, trackingMode: CAMERA_TRACKING_MODE | undefined): this;
|
|
144
|
-
setProjectionMode(projectionMode: CAMERA_PROJECTION_MODE): this;
|
|
145
|
-
setTrackingMode(trackingMode: CAMERA_TRACKING_MODE): this;
|
|
146
|
-
/**
|
|
147
|
-
* If flag is true, it reverses the azimuth and elevation angles.
|
|
148
|
-
* Subsequent calls to rotate, setAzimuth, setElevation,
|
|
149
|
-
* changeAzimuth or changeElevation will cause the inverted effect.
|
|
150
|
-
* setRoll or changeRoll is not affected by this method.
|
|
151
|
-
*
|
|
152
|
-
* This inversion is useful when one wants to simulate that the world
|
|
153
|
-
* is moving, instead of the camera.
|
|
154
|
-
*
|
|
155
|
-
* By default the camera angles are not reversed.
|
|
156
|
-
* @param {Boolean} flag the boolean flag to reverse the angles.
|
|
157
|
-
*/
|
|
158
|
-
setWorldRotation(flag: boolean): void;
|
|
159
|
-
/**
|
|
160
|
-
* 计算 MV 矩阵,为相机矩阵的逆矩阵
|
|
161
|
-
*/
|
|
162
|
-
getViewTransform(): mat4;
|
|
163
|
-
getWorldTransform(): mat4;
|
|
164
|
-
jitterProjectionMatrix(x: number, y: number): void;
|
|
165
|
-
clearJitterProjectionMatrix(): void;
|
|
166
|
-
/**
|
|
167
|
-
* 设置相机矩阵
|
|
168
|
-
*/
|
|
169
|
-
setMatrix(matrix: mat4): this;
|
|
170
|
-
setFov(fov: number): void;
|
|
171
|
-
setAspect(aspect: number): this;
|
|
172
|
-
setNear(near: number): this;
|
|
173
|
-
setFar(far: number): this;
|
|
174
|
-
/**
|
|
175
|
-
* Sets an offset in a larger frustum, used in PixelPicking
|
|
176
|
-
*/
|
|
177
|
-
setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): this;
|
|
178
|
-
clearViewOffset(): this;
|
|
179
|
-
setZoom(zoom: number): this;
|
|
180
|
-
setPerspective(near: number, far: number, fov: number, aspect: number): this;
|
|
181
|
-
setOrthographic(l: number, r: number, t: number, b: number, near: number, far: number): this;
|
|
182
|
-
/**
|
|
183
|
-
* 设置相机位置
|
|
184
|
-
*/
|
|
185
|
-
setPosition(x: number | vec3, y?: number, z?: number): this;
|
|
186
|
-
/**
|
|
187
|
-
* 设置视点位置
|
|
188
|
-
*/
|
|
189
|
-
setFocalPoint(x: number | vec3, y?: number, z?: number): this;
|
|
190
|
-
/**
|
|
191
|
-
* 固定当前视点,按指定距离放置相机
|
|
192
|
-
*/
|
|
193
|
-
setDistance(d: number): this;
|
|
194
|
-
setMaxDistance(d: number): this;
|
|
195
|
-
setMinDistance(d: number): this;
|
|
196
|
-
/**
|
|
197
|
-
* Changes the initial azimuth of the camera
|
|
198
|
-
*/
|
|
199
|
-
changeAzimuth(az: number): this;
|
|
200
|
-
/**
|
|
201
|
-
* Changes the initial elevation of the camera
|
|
202
|
-
*/
|
|
203
|
-
changeElevation(el: number): this;
|
|
204
|
-
/**
|
|
205
|
-
* Changes the initial roll of the camera
|
|
206
|
-
*/
|
|
207
|
-
changeRoll(rl: number): this;
|
|
208
|
-
/**
|
|
209
|
-
* 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
|
|
210
|
-
* @param {Number} el the azimuth in degrees
|
|
211
|
-
*/
|
|
212
|
-
setAzimuth(az: number): this;
|
|
213
|
-
getAzimuth(): number;
|
|
214
|
-
/**
|
|
215
|
-
* 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
|
|
216
|
-
* @param {Number} el the elevation in degrees
|
|
217
|
-
*/
|
|
218
|
-
setElevation(el: number): this;
|
|
219
|
-
/**
|
|
220
|
-
* 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
|
|
221
|
-
* @param {Number} angle the roll angle
|
|
222
|
-
*/
|
|
223
|
-
setRoll(angle: number): this;
|
|
224
|
-
/**
|
|
225
|
-
* Changes the azimuth and elevation with respect to the current camera axes
|
|
226
|
-
* @param {Number} azimuth the relative azimuth
|
|
227
|
-
* @param {Number} elevation the relative elevation
|
|
228
|
-
* @param {Number} roll the relative roll
|
|
229
|
-
*/
|
|
230
|
-
rotate(azimuth: number, elevation: number, roll: number): this;
|
|
231
|
-
/**
|
|
232
|
-
* 沿水平(right) & 垂直(up)平移相机
|
|
233
|
-
*/
|
|
234
|
-
pan(tx: number, ty: number): this;
|
|
235
|
-
/**
|
|
236
|
-
* 沿 n 轴移动,当距离视点远时移动速度较快,离视点越近速度越慢
|
|
237
|
-
*/
|
|
238
|
-
dolly(value: number): this;
|
|
239
|
-
createLandmark(name: string, params: {
|
|
240
|
-
position: vec3;
|
|
241
|
-
focalPoint: vec3;
|
|
242
|
-
roll?: number;
|
|
243
|
-
}): Landmark;
|
|
244
|
-
setLandmark(name: string): this;
|
|
245
|
-
gotoLandmark(name: string, duration?: number): void;
|
|
246
|
-
/**
|
|
247
|
-
* 根据相机矩阵重新计算各种相机参数
|
|
248
|
-
*/
|
|
249
|
-
private _update;
|
|
250
|
-
/**
|
|
251
|
-
* 计算相机矩阵
|
|
252
|
-
*/
|
|
253
|
-
private computeMatrix;
|
|
254
|
-
/**
|
|
255
|
-
* Sets the camera position in the camera matrix
|
|
256
|
-
*/
|
|
257
|
-
private _setPosition;
|
|
258
|
-
/**
|
|
259
|
-
* Recalculates axes based on the current matrix
|
|
260
|
-
*/
|
|
261
|
-
private _getAxes;
|
|
262
|
-
/**
|
|
263
|
-
* Recalculates euler angles based on the current state
|
|
264
|
-
*/
|
|
265
|
-
private _getAngles;
|
|
266
|
-
/**
|
|
267
|
-
* 重新计算相机位置,只有 ORBITING 模式相机位置才会发生变化
|
|
268
|
-
*/
|
|
269
|
-
private _getPosition;
|
|
270
|
-
/**
|
|
271
|
-
* 重新计算视点,只有 TRACKING 模式视点才会发生变化
|
|
272
|
-
*/
|
|
273
|
-
private _getFocalPoint;
|
|
274
|
-
/**
|
|
275
|
-
* 重新计算视距
|
|
276
|
-
*/
|
|
277
|
-
private _getDistance;
|
|
278
|
-
private _getOrthoMatrix;
|
|
279
|
-
}
|