@antv/g 5.0.14 → 5.0.17
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/AbstractRenderer.js +1 -3
- package/es/Canvas.d.ts +3 -0
- package/es/Canvas.js +10 -12
- package/es/DisplayObjectPool.js +1 -3
- package/es/camera/Camera.d.ts +3 -2
- package/es/camera/Camera.js +17 -11
- package/es/camera/Landmark.js +1 -3
- package/es/canvas-module.js +11 -17
- package/es/components/Cullable.js +1 -3
- package/es/components/Geometry.js +1 -3
- package/es/components/Renderable.js +1 -3
- package/es/components/Sortable.js +1 -3
- package/es/components/Transform.d.ts +0 -1
- package/es/components/Transform.js +1 -4
- package/es/display-objects/Circle.d.ts +4 -2
- package/es/display-objects/Circle.js +9 -6
- package/es/display-objects/CustomElement.d.ts +3 -2
- package/es/display-objects/CustomElement.js +10 -9
- package/es/display-objects/DisplayObject.d.ts +9 -3
- package/es/display-objects/DisplayObject.js +98 -50
- package/es/display-objects/Ellipse.d.ts +6 -3
- package/es/display-objects/Ellipse.js +9 -6
- package/es/display-objects/Group.d.ts +18 -2
- package/es/display-objects/Group.js +15 -12
- package/es/display-objects/HTML.d.ts +6 -1
- package/es/display-objects/HTML.js +8 -6
- package/es/display-objects/Image.d.ts +12 -7
- package/es/display-objects/Image.js +11 -6
- package/es/display-objects/Line.d.ts +1 -1
- package/es/display-objects/Line.js +13 -7
- package/es/display-objects/Path.d.ts +3 -2
- package/es/display-objects/Path.js +11 -8
- package/es/display-objects/Polygon.d.ts +1 -1
- package/es/display-objects/Polygon.js +10 -6
- package/es/display-objects/Polyline.d.ts +1 -1
- package/es/display-objects/Polyline.js +11 -8
- package/es/display-objects/Rect.d.ts +8 -5
- package/es/display-objects/Rect.js +10 -7
- package/es/display-objects/TSpan.d.ts +1 -0
- package/es/display-objects/TSpan.js +0 -0
- package/es/display-objects/Text.d.ts +32 -4
- package/es/display-objects/Text.js +71 -14
- package/es/dom/Animation.js +2 -4
- package/es/dom/AnimationEffectTiming.js +1 -3
- package/es/dom/AnimationEvent.js +1 -3
- package/es/dom/AnimationTimeline.js +2 -5
- package/es/dom/CustomElementRegistry.js +13 -15
- package/es/dom/CustomEvent.js +1 -3
- package/es/dom/Document.d.ts +2 -1
- package/es/dom/Document.js +23 -5
- package/es/dom/Element.d.ts +36 -9
- package/es/dom/Element.js +103 -15
- package/es/dom/EventTarget.d.ts +2 -2
- package/es/dom/EventTarget.js +3 -4
- package/es/dom/FederatedEvent.d.ts +5 -2
- package/es/dom/FederatedEvent.js +1 -3
- package/es/dom/FederatedMouseEvent.js +1 -3
- package/es/dom/FederatedPointerEvent.js +1 -3
- package/es/dom/FederatedWheelEvent.js +1 -3
- package/es/dom/KeyframeEffect.js +1 -3
- package/es/dom/MutationEvent.d.ts +15 -0
- package/es/dom/MutationEvent.js +27 -0
- package/es/dom/MutationObserver.d.ts +36 -0
- package/es/dom/MutationObserver.js +406 -0
- package/es/dom/MutationRecord.d.ts +14 -0
- package/es/dom/MutationRecord.js +29 -0
- package/es/dom/Node.d.ts +35 -3
- package/es/dom/Node.js +185 -20
- package/es/dom/index.d.ts +3 -0
- package/es/dom/index.js +3 -0
- package/es/dom/interfaces.d.ts +36 -8
- package/es/dom/interfaces.js +23 -5
- package/es/global-module.d.ts +4 -1
- package/es/global-module.js +36 -79
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/plugins/CullingPlugin.d.ts +0 -2
- package/es/plugins/CullingPlugin.js +4 -27
- package/es/plugins/DirtyCheckPlugin.js +3 -5
- package/es/plugins/EventPlugin.d.ts +2 -1
- package/es/plugins/EventPlugin.js +16 -8
- package/es/plugins/FrustumCullingStrategy.d.ts +1 -0
- package/es/plugins/FrustumCullingStrategy.js +40 -35
- package/es/plugins/PrepareRendererPlugin.js +22 -8
- package/es/property-handlers/aabb.js +22 -24
- package/es/property-handlers/anchor.js +2 -1
- package/es/property-handlers/color.js +3 -0
- package/es/property-handlers/dimension.d.ts +15 -2
- package/es/property-handlers/dimension.js +77 -8
- package/es/property-handlers/index.d.ts +3 -0
- package/es/property-handlers/index.js +4 -1
- package/es/property-handlers/inherit.d.ts +6 -0
- package/es/property-handlers/inherit.js +25 -0
- package/es/property-handlers/interfaces.d.ts +2 -2
- package/es/property-handlers/lineDash.d.ts +6 -1
- package/es/property-handlers/lineDash.js +23 -4
- package/es/property-handlers/offsetDistance.js +2 -2
- package/es/property-handlers/path.d.ts +1 -1
- package/es/property-handlers/text.d.ts +2 -0
- package/es/property-handlers/text.js +3 -0
- package/es/property-handlers/textTransform.d.ts +6 -0
- package/es/property-handlers/textTransform.js +19 -0
- package/es/services/EventService.js +2 -6
- package/es/services/RenderingContext.d.ts +5 -8
- package/es/services/RenderingContext.js +6 -7
- package/es/services/RenderingService.js +3 -11
- package/es/services/SceneGraphSelector.d.ts +3 -2
- package/es/services/SceneGraphSelector.js +9 -7
- package/es/services/SceneGraphService.d.ts +7 -14
- package/es/services/SceneGraphService.js +15 -85
- package/es/services/aabb/CircleUpdater.d.ts +2 -2
- package/es/services/aabb/CircleUpdater.js +22 -14
- package/es/services/aabb/EllipseUpdater.d.ts +2 -2
- package/es/services/aabb/EllipseUpdater.js +29 -16
- package/es/services/aabb/LineUpdater.js +3 -5
- package/es/services/aabb/PathUpdater.js +3 -5
- package/es/services/aabb/PolylineUpdater.js +4 -6
- package/es/services/aabb/RectUpdater.d.ts +2 -2
- package/es/services/aabb/RectUpdater.js +32 -21
- package/es/services/aabb/TextUpdater.js +20 -13
- package/es/services/text/OffscreenCanvasCreator.js +1 -3
- package/es/services/text/index.js +18 -22
- package/es/shapes/AABB.d.ts +1 -0
- package/es/shapes/AABB.js +9 -3
- package/es/shapes/BoundingSphere.js +1 -3
- package/es/shapes/Frustum.js +1 -3
- package/es/shapes/Plane.js +1 -3
- package/es/shapes/Point.js +1 -3
- package/es/shapes/Polygon.js +1 -3
- package/es/shapes/Ray.js +1 -3
- package/es/shapes/Rect.js +1 -3
- package/es/shapes/Rectangle.js +1 -3
- package/es/types.d.ts +48 -26
- package/es/types.js +50 -31
- package/es/utils/animation.js +1 -1
- package/es/utils/event.js +5 -3
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.d.ts +1 -0
- package/es/utils/interpolation.js +41 -8
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +13 -13
- package/es/utils/raf.d.ts +1 -1
- package/es/utils/raf.js +0 -2
- package/es/utils/string.d.ts +1 -0
- package/es/utils/string.js +9 -0
- package/es/utils/text.js +1 -1
- package/lib/AbstractRenderer.js +1 -3
- package/lib/Canvas.d.ts +3 -0
- package/lib/Canvas.js +9 -11
- package/lib/DisplayObjectPool.js +1 -3
- package/lib/camera/Camera.d.ts +3 -2
- package/lib/camera/Camera.js +21 -13
- package/lib/camera/Landmark.js +1 -3
- package/lib/canvas-module.js +10 -15
- package/lib/components/Cullable.js +2 -4
- package/lib/components/Geometry.js +1 -3
- package/lib/components/Renderable.js +1 -3
- package/lib/components/Sortable.js +1 -3
- package/lib/components/Transform.d.ts +0 -1
- package/lib/components/Transform.js +1 -4
- package/lib/display-objects/Circle.d.ts +4 -2
- package/lib/display-objects/Circle.js +8 -5
- package/lib/display-objects/CustomElement.d.ts +3 -2
- package/lib/display-objects/CustomElement.js +10 -9
- package/lib/display-objects/DisplayObject.d.ts +9 -3
- package/lib/display-objects/DisplayObject.js +98 -47
- package/lib/display-objects/Ellipse.d.ts +6 -3
- package/lib/display-objects/Ellipse.js +8 -5
- package/lib/display-objects/Group.d.ts +18 -2
- package/lib/display-objects/Group.js +14 -12
- package/lib/display-objects/HTML.d.ts +6 -1
- package/lib/display-objects/HTML.js +7 -5
- package/lib/display-objects/Image.d.ts +12 -7
- package/lib/display-objects/Image.js +10 -5
- package/lib/display-objects/Line.d.ts +1 -1
- package/lib/display-objects/Line.js +12 -6
- package/lib/display-objects/Path.d.ts +3 -2
- package/lib/display-objects/Path.js +10 -7
- package/lib/display-objects/Polygon.d.ts +1 -1
- package/lib/display-objects/Polygon.js +9 -5
- package/lib/display-objects/Polyline.d.ts +1 -1
- package/lib/display-objects/Polyline.js +10 -7
- package/lib/display-objects/Rect.d.ts +8 -5
- package/lib/display-objects/Rect.js +9 -6
- package/lib/display-objects/TSpan.d.ts +1 -0
- package/lib/display-objects/TSpan.js +1 -0
- package/lib/display-objects/Text.d.ts +32 -4
- package/lib/display-objects/Text.js +71 -13
- package/lib/dom/Animation.js +2 -4
- package/lib/dom/AnimationEffectTiming.js +1 -3
- package/lib/dom/AnimationEvent.js +1 -3
- package/lib/dom/AnimationTimeline.js +3 -6
- package/lib/dom/CustomElementRegistry.js +12 -14
- package/lib/dom/CustomEvent.js +1 -3
- package/lib/dom/Document.d.ts +2 -1
- package/lib/dom/Document.js +25 -6
- package/lib/dom/Element.d.ts +36 -9
- package/lib/dom/Element.js +105 -15
- package/lib/dom/EventTarget.d.ts +2 -2
- package/lib/dom/EventTarget.js +3 -4
- package/lib/dom/FederatedEvent.d.ts +5 -2
- package/lib/dom/FederatedEvent.js +1 -3
- package/lib/dom/FederatedMouseEvent.js +1 -3
- package/lib/dom/FederatedPointerEvent.js +1 -3
- package/lib/dom/FederatedWheelEvent.js +1 -3
- package/lib/dom/KeyframeEffect.js +2 -4
- package/lib/dom/MutationEvent.d.ts +15 -0
- package/lib/dom/MutationEvent.js +35 -0
- package/lib/dom/MutationObserver.d.ts +36 -0
- package/lib/dom/MutationObserver.js +417 -0
- package/lib/dom/MutationRecord.d.ts +14 -0
- package/lib/dom/MutationRecord.js +36 -0
- package/lib/dom/Node.d.ts +35 -3
- package/lib/dom/Node.js +186 -19
- package/lib/dom/index.d.ts +3 -0
- package/lib/dom/index.js +39 -0
- package/lib/dom/interfaces.d.ts +36 -8
- package/lib/dom/interfaces.js +23 -5
- package/lib/global-module.d.ts +4 -1
- package/lib/global-module.js +42 -76
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/plugins/CullingPlugin.d.ts +0 -2
- package/lib/plugins/CullingPlugin.js +4 -27
- package/lib/plugins/DirtyCheckPlugin.js +2 -4
- package/lib/plugins/EventPlugin.d.ts +2 -1
- package/lib/plugins/EventPlugin.js +14 -8
- package/lib/plugins/FrustumCullingStrategy.d.ts +1 -0
- package/lib/plugins/FrustumCullingStrategy.js +41 -35
- package/lib/plugins/PrepareRendererPlugin.js +25 -7
- package/lib/property-handlers/aabb.js +21 -23
- package/lib/property-handlers/anchor.js +3 -1
- package/lib/property-handlers/color.js +5 -2
- package/lib/property-handlers/dimension.d.ts +15 -2
- package/lib/property-handlers/dimension.js +84 -12
- package/lib/property-handlers/index.d.ts +3 -0
- package/lib/property-handlers/index.js +39 -0
- package/lib/property-handlers/inherit.d.ts +6 -0
- package/lib/property-handlers/inherit.js +34 -0
- package/lib/property-handlers/interfaces.d.ts +2 -2
- package/lib/property-handlers/interfaces.js +1 -1
- package/lib/property-handlers/lineDash.d.ts +6 -1
- package/lib/property-handlers/lineDash.js +25 -4
- package/lib/property-handlers/numeric.js +3 -3
- package/lib/property-handlers/offsetDistance.js +1 -1
- package/lib/property-handlers/path.d.ts +1 -1
- package/lib/property-handlers/path.js +1 -1
- package/lib/property-handlers/text.d.ts +2 -0
- package/lib/property-handlers/text.js +10 -0
- package/lib/property-handlers/textTransform.d.ts +6 -0
- package/lib/property-handlers/textTransform.js +27 -0
- package/lib/property-handlers/transform.js +1 -1
- package/lib/services/EventService.js +2 -6
- package/lib/services/RenderingContext.d.ts +5 -8
- package/lib/services/RenderingContext.js +8 -9
- package/lib/services/RenderingService.js +2 -10
- package/lib/services/SceneGraphSelector.d.ts +3 -2
- package/lib/services/SceneGraphSelector.js +12 -7
- package/lib/services/SceneGraphService.d.ts +7 -14
- package/lib/services/SceneGraphService.js +18 -87
- package/lib/services/aabb/CircleUpdater.d.ts +2 -2
- package/lib/services/aabb/CircleUpdater.js +21 -13
- package/lib/services/aabb/EllipseUpdater.d.ts +2 -2
- package/lib/services/aabb/EllipseUpdater.js +28 -15
- package/lib/services/aabb/LineUpdater.js +2 -4
- package/lib/services/aabb/PathUpdater.js +2 -4
- package/lib/services/aabb/PolylineUpdater.js +3 -5
- package/lib/services/aabb/RectUpdater.d.ts +2 -2
- package/lib/services/aabb/RectUpdater.js +31 -20
- package/lib/services/aabb/TextUpdater.js +19 -12
- package/lib/services/aabb/index.js +10 -10
- package/lib/services/aabb/interfaces.js +1 -1
- package/lib/services/text/OffscreenCanvasCreator.js +1 -3
- package/lib/services/text/index.js +18 -22
- package/lib/shapes/AABB.d.ts +1 -0
- package/lib/shapes/AABB.js +9 -3
- package/lib/shapes/BoundingSphere.js +1 -3
- package/lib/shapes/Frustum.js +2 -4
- package/lib/shapes/Plane.js +1 -3
- package/lib/shapes/Point.js +1 -3
- package/lib/shapes/Polygon.js +1 -3
- package/lib/shapes/Ray.js +1 -3
- package/lib/shapes/Rect.js +1 -3
- package/lib/shapes/Rectangle.js +1 -3
- package/lib/types.d.ts +48 -26
- package/lib/types.js +56 -35
- package/lib/utils/animation.js +3 -4
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.js +1 -1
- package/lib/utils/event.js +7 -6
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/interpolation.d.ts +1 -0
- package/lib/utils/interpolation.js +43 -7
- package/lib/utils/math.js +5 -5
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +15 -15
- package/lib/utils/raf.d.ts +1 -1
- package/lib/utils/raf.js +1 -4
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +16 -0
- package/lib/utils/text.js +1 -1
- package/package.json +6 -4
- package/dist/index.umd.min.js +0 -15
|
@@ -39,9 +39,7 @@ var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
|
|
|
39
39
|
var regexCannotStart = new RegExp(regexCannotStartZhCn.source + "|" + regexCannotStartZhTw.source + "|" + regexCannotStartJaJp.source + "|" + regexCannotStartKoKr.source);
|
|
40
40
|
var regexCannotEnd = new RegExp(regexCannotEndZhCn.source + "|" + regexCannotEndZhTw.source + "|" + regexCannotEndJaJp.source + "|" + regexCannotEndKoKr.source);
|
|
41
41
|
|
|
42
|
-
var TextService =
|
|
43
|
-
/** @class */
|
|
44
|
-
function () {
|
|
42
|
+
var TextService = function () {
|
|
45
43
|
function TextService() {
|
|
46
44
|
var _this = this;
|
|
47
45
|
|
|
@@ -104,7 +102,7 @@ function () {
|
|
|
104
102
|
context.textBaseline = 'alphabetic';
|
|
105
103
|
context.fillStyle = '#000';
|
|
106
104
|
context.fillText(metricsString, 0, baseline);
|
|
107
|
-
var imagedata = context.getImageData(0, 0, width, height).data;
|
|
105
|
+
var imagedata = context.getImageData(0, 0, width || 1, height || 1).data;
|
|
108
106
|
var pixels = imagedata.length;
|
|
109
107
|
var line = width * 4;
|
|
110
108
|
var i = 0;
|
|
@@ -152,29 +150,27 @@ function () {
|
|
|
152
150
|
};
|
|
153
151
|
|
|
154
152
|
TextService.prototype.measureText = function (text, attributes) {
|
|
155
|
-
var
|
|
156
|
-
fontSize = _a === void 0 ? 0 : _a,
|
|
153
|
+
var fontSize = attributes.fontSize,
|
|
157
154
|
wordWrap = attributes.wordWrap,
|
|
158
|
-
|
|
159
|
-
strokeHeight =
|
|
160
|
-
|
|
161
|
-
lineWidth = _c === void 0 ? 0 : _c,
|
|
155
|
+
_a = attributes.lineHeight,
|
|
156
|
+
strokeHeight = _a === void 0 ? 0 : _a,
|
|
157
|
+
lineWidth = attributes.lineWidth,
|
|
162
158
|
textBaseline = attributes.textBaseline,
|
|
163
159
|
textAlign = attributes.textAlign,
|
|
164
|
-
|
|
165
|
-
letterSpacing =
|
|
160
|
+
_b = attributes.letterSpacing,
|
|
161
|
+
letterSpacing = _b === void 0 ? 0 : _b,
|
|
166
162
|
dropShadow = attributes.dropShadow,
|
|
167
|
-
|
|
168
|
-
dropShadowDistance =
|
|
169
|
-
|
|
170
|
-
leading =
|
|
163
|
+
_c = attributes.dropShadowDistance,
|
|
164
|
+
dropShadowDistance = _c === void 0 ? 0 : _c,
|
|
165
|
+
_d = attributes.leading,
|
|
166
|
+
leading = _d === void 0 ? 0 : _d;
|
|
171
167
|
var font = (0, _text.toFontString)(attributes);
|
|
172
168
|
var fontProperties = this.measureFont(font); // fallback in case UA disallow canvas data extraction
|
|
173
169
|
// (toDataURI, getImageData functions)
|
|
174
170
|
|
|
175
171
|
if (fontProperties.fontSize === 0) {
|
|
176
|
-
fontProperties.fontSize = fontSize;
|
|
177
|
-
fontProperties.ascent = fontSize;
|
|
172
|
+
fontProperties.fontSize = fontSize.value;
|
|
173
|
+
fontProperties.ascent = fontSize.value;
|
|
178
174
|
}
|
|
179
175
|
|
|
180
176
|
var context = this.offscreenCanvas.getOrCreateContext();
|
|
@@ -190,14 +186,14 @@ function () {
|
|
|
190
186
|
maxLineWidth = Math.max(maxLineWidth, lineWidth_1);
|
|
191
187
|
}
|
|
192
188
|
|
|
193
|
-
var width = maxLineWidth + lineWidth;
|
|
189
|
+
var width = maxLineWidth + lineWidth.value;
|
|
194
190
|
|
|
195
191
|
if (dropShadow) {
|
|
196
192
|
width += dropShadowDistance;
|
|
197
193
|
}
|
|
198
194
|
|
|
199
|
-
var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth;
|
|
200
|
-
var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth) + (lines.length - 1) * (lineHeight + leading);
|
|
195
|
+
var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth.value;
|
|
196
|
+
var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth.value) + (lines.length - 1) * (lineHeight + leading);
|
|
201
197
|
|
|
202
198
|
if (dropShadow) {
|
|
203
199
|
height += dropShadowDistance;
|
|
@@ -233,7 +229,7 @@ function () {
|
|
|
233
229
|
offsetX -= width;
|
|
234
230
|
}
|
|
235
231
|
|
|
236
|
-
return new _shapes.Rectangle(offsetX - lineWidth / 2, offsetY + i * lineHeight, width + lineWidth, lineHeight);
|
|
232
|
+
return new _shapes.Rectangle(offsetX - lineWidth.value / 2, offsetY + i * lineHeight, width + lineWidth.value, lineHeight);
|
|
237
233
|
})
|
|
238
234
|
};
|
|
239
235
|
};
|
package/lib/shapes/AABB.d.ts
CHANGED
package/lib/shapes/AABB.js
CHANGED
|
@@ -12,15 +12,17 @@ var _glMatrix = require("gl-matrix");
|
|
|
12
12
|
* 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex
|
|
13
13
|
* @see https://github.com/antvis/GWebGPUEngine/issues/3
|
|
14
14
|
*/
|
|
15
|
-
var AABB =
|
|
16
|
-
/** @class */
|
|
17
|
-
function () {
|
|
15
|
+
var AABB = function () {
|
|
18
16
|
function AABB(center, halfExtents) {
|
|
19
17
|
this.min = _glMatrix.vec3.create();
|
|
20
18
|
this.max = _glMatrix.vec3.create();
|
|
21
19
|
this.update(center, halfExtents);
|
|
22
20
|
}
|
|
23
21
|
|
|
22
|
+
AABB.isEmpty = function (aabb) {
|
|
23
|
+
return !aabb || aabb.halfExtents[0] === 0 && aabb.halfExtents[1] === 0 && aabb.halfExtents[2] === 0;
|
|
24
|
+
};
|
|
25
|
+
|
|
24
26
|
AABB.prototype.update = function (center, halfExtents) {
|
|
25
27
|
this.center = _glMatrix.vec3.copy(_glMatrix.vec3.create(), center || _glMatrix.vec3.create());
|
|
26
28
|
this.halfExtents = _glMatrix.vec3.copy(_glMatrix.vec3.create(), halfExtents || _glMatrix.vec3.fromValues(0, 0, 0));
|
|
@@ -51,6 +53,10 @@ function () {
|
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
AABB.prototype.add = function (aabb) {
|
|
56
|
+
if (AABB.isEmpty(aabb)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
var tc = this.center;
|
|
55
61
|
var tcx = tc[0];
|
|
56
62
|
var tcy = tc[1];
|
|
@@ -9,9 +9,7 @@ var _glMatrix = require("gl-matrix");
|
|
|
9
9
|
|
|
10
10
|
var tmpVecA = _glMatrix.vec3.create();
|
|
11
11
|
|
|
12
|
-
var BoundingSphere =
|
|
13
|
-
/** @class */
|
|
14
|
-
function () {
|
|
12
|
+
var BoundingSphere = function () {
|
|
15
13
|
function BoundingSphere(center, radius) {
|
|
16
14
|
this.center = center || _glMatrix.vec3.create();
|
|
17
15
|
this.radius = radius || 0.5;
|
package/lib/shapes/Frustum.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Frustum = exports.Mask = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -20,9 +20,7 @@ exports.Mask = Mask;
|
|
|
20
20
|
Mask[Mask["INDETERMINATE"] = 2147483647] = "INDETERMINATE";
|
|
21
21
|
})(Mask || (exports.Mask = Mask = {}));
|
|
22
22
|
|
|
23
|
-
var Frustum =
|
|
24
|
-
/** @class */
|
|
25
|
-
function () {
|
|
23
|
+
var Frustum = function () {
|
|
26
24
|
function Frustum(planes) {
|
|
27
25
|
this.planes = [];
|
|
28
26
|
|
package/lib/shapes/Plane.js
CHANGED
|
@@ -7,9 +7,7 @@ exports.Plane = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _glMatrix = require("gl-matrix");
|
|
9
9
|
|
|
10
|
-
var Plane =
|
|
11
|
-
/** @class */
|
|
12
|
-
function () {
|
|
10
|
+
var Plane = function () {
|
|
13
11
|
function Plane(distance, normal) {
|
|
14
12
|
this.distance = distance || 0;
|
|
15
13
|
this.normal = normal || _glMatrix.vec3.fromValues(0, 1, 0);
|
package/lib/shapes/Point.js
CHANGED
package/lib/shapes/Polygon.js
CHANGED
package/lib/shapes/Ray.js
CHANGED
|
@@ -24,9 +24,7 @@ var tmpVecE = _glMatrix.vec3.create();
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var Ray =
|
|
28
|
-
/** @class */
|
|
29
|
-
function () {
|
|
27
|
+
var Ray = function () {
|
|
30
28
|
function Ray(origin, direction) {
|
|
31
29
|
this.origin = origin || _glMatrix.vec3.create();
|
|
32
30
|
this.direction = direction || _glMatrix.vec3.fromValues(0, 0, -1);
|
package/lib/shapes/Rect.js
CHANGED
package/lib/shapes/Rectangle.js
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import type { vec2, vec3 } from 'gl-matrix';
|
|
3
3
|
import type { ParsedPathStyleProps, ParsedPolylineStyleProps } from './display-objects';
|
|
4
4
|
import type { DisplayObject } from './display-objects';
|
|
5
|
-
import type { ParsedColorStyleProperty } from './property-handlers';
|
|
5
|
+
import type { ParsedColorStyleProperty, ParsedElement } from './property-handlers';
|
|
6
6
|
import type { IRenderer } from './AbstractRenderer';
|
|
7
|
-
export declare enum
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
export declare enum Shape {
|
|
8
|
+
GROUP = "g",
|
|
9
|
+
CIRCLE = "circle",
|
|
10
|
+
ELLIPSE = "ellipse",
|
|
11
|
+
IMAGE = "image",
|
|
12
|
+
RECT = "rect",
|
|
13
|
+
LINE = "line",
|
|
14
|
+
POLYLINE = "polyline",
|
|
15
|
+
POLYGON = "polygon",
|
|
16
|
+
TEXT = "text",
|
|
17
|
+
PATH = "path",
|
|
18
18
|
HTML = "html"
|
|
19
19
|
}
|
|
20
20
|
declare type ColorType = string | null;
|
|
@@ -26,17 +26,31 @@ export interface EventPosition {
|
|
|
26
26
|
x: number;
|
|
27
27
|
y: number;
|
|
28
28
|
}
|
|
29
|
-
export declare enum
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
export declare enum LineCap {
|
|
30
|
+
BUTT = "butt",
|
|
31
|
+
ROUND = "round",
|
|
32
|
+
SQUARE = "square"
|
|
33
33
|
}
|
|
34
|
-
export declare enum
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
export declare enum LineJoin {
|
|
35
|
+
BEVEL = "bevel",
|
|
36
|
+
ROUND = "round",
|
|
37
|
+
MITER = "miter"
|
|
38
|
+
}
|
|
39
|
+
export declare enum TextTransform {
|
|
40
|
+
CAPITALIZE = "capitalize",
|
|
41
|
+
UPPERCASE = "uppercase",
|
|
42
|
+
LOWERCASE = "lowercase",
|
|
43
|
+
NONE = "none"
|
|
44
|
+
}
|
|
45
|
+
export declare enum TextAlign {
|
|
46
|
+
START = "start",
|
|
47
|
+
CENTER = "center",
|
|
48
|
+
END = "end",
|
|
49
|
+
LEFT = "left",
|
|
50
|
+
RIGHT = "right"
|
|
38
51
|
}
|
|
39
52
|
export interface BaseStyleProps {
|
|
53
|
+
class?: string;
|
|
40
54
|
/**
|
|
41
55
|
* x in local space
|
|
42
56
|
*/
|
|
@@ -100,11 +114,11 @@ export interface BaseStyleProps {
|
|
|
100
114
|
/** 整体透明度 */
|
|
101
115
|
opacity?: number;
|
|
102
116
|
/** 线宽 */
|
|
103
|
-
lineWidth?: number;
|
|
117
|
+
lineWidth?: string | number;
|
|
104
118
|
/** 指定如何绘制每一条线段末端 */
|
|
105
|
-
lineCap?:
|
|
119
|
+
lineCap?: LineCap;
|
|
106
120
|
/** 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性(长度为0的变形部分,其指定的末端和控制点在同一位置,会被忽略) */
|
|
107
|
-
lineJoin?:
|
|
121
|
+
lineJoin?: LineJoin;
|
|
108
122
|
/**
|
|
109
123
|
* 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。这个属性取决于浏览器是否支持 setLineDash() 函数。
|
|
110
124
|
*/
|
|
@@ -126,16 +140,23 @@ export interface BaseStyleProps {
|
|
|
126
140
|
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter
|
|
127
141
|
*/
|
|
128
142
|
filter?: string;
|
|
143
|
+
/**
|
|
144
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/text-transform
|
|
145
|
+
*/
|
|
146
|
+
textTransform?: TextTransform;
|
|
147
|
+
/**
|
|
148
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit
|
|
149
|
+
*/
|
|
150
|
+
miterLimit?: number;
|
|
129
151
|
}
|
|
130
|
-
export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'fill' | 'stroke' | 'path' | 'points'> {
|
|
152
|
+
export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'fill' | 'stroke' | 'path' | 'points' | 'lineWidth' | 'shadowColor'> {
|
|
131
153
|
fill?: ParsedColorStyleProperty;
|
|
132
154
|
stroke?: ParsedColorStyleProperty;
|
|
133
155
|
path?: ParsedPathStyleProps;
|
|
134
156
|
points?: ParsedPolylineStyleProps;
|
|
135
157
|
x?: number;
|
|
136
158
|
y?: number;
|
|
137
|
-
|
|
138
|
-
height?: number;
|
|
159
|
+
lineWidth?: ParsedElement;
|
|
139
160
|
/**
|
|
140
161
|
* x according to definition, eg. Line's x1/x2, Polyline's points
|
|
141
162
|
*/
|
|
@@ -146,6 +167,7 @@ export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'fill' | 'str
|
|
|
146
167
|
*/
|
|
147
168
|
offsetX?: number;
|
|
148
169
|
offsetY?: number;
|
|
170
|
+
shadowColor?: ParsedColorStyleProperty;
|
|
149
171
|
}
|
|
150
172
|
export declare type Cursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'all-scroll' | 'col-resize' | 'row-resize' | 'n-resize' | 'e-resize' | 's-resize' | 'w-resize' | 'ne-resize' | 'nw-resize' | 'se-resize' | 'sw-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'zoom-in' | 'zoom-out';
|
|
151
173
|
export interface RendererConfig {
|
package/lib/types.js
CHANGED
|
@@ -3,41 +3,62 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
(function (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})(
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
exports.
|
|
26
|
-
|
|
27
|
-
(function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})(
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
exports.
|
|
35
|
-
|
|
36
|
-
(function (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})(
|
|
6
|
+
exports.CanvasConfig = exports.TextAlign = exports.TextTransform = exports.LineJoin = exports.LineCap = exports.Shape = void 0;
|
|
7
|
+
var Shape;
|
|
8
|
+
exports.Shape = Shape;
|
|
9
|
+
|
|
10
|
+
(function (Shape) {
|
|
11
|
+
Shape["GROUP"] = "g";
|
|
12
|
+
Shape["CIRCLE"] = "circle";
|
|
13
|
+
Shape["ELLIPSE"] = "ellipse";
|
|
14
|
+
Shape["IMAGE"] = "image";
|
|
15
|
+
Shape["RECT"] = "rect";
|
|
16
|
+
Shape["LINE"] = "line";
|
|
17
|
+
Shape["POLYLINE"] = "polyline";
|
|
18
|
+
Shape["POLYGON"] = "polygon";
|
|
19
|
+
Shape["TEXT"] = "text";
|
|
20
|
+
Shape["PATH"] = "path";
|
|
21
|
+
Shape["HTML"] = "html";
|
|
22
|
+
})(Shape || (exports.Shape = Shape = {}));
|
|
23
|
+
|
|
24
|
+
var LineCap;
|
|
25
|
+
exports.LineCap = LineCap;
|
|
26
|
+
|
|
27
|
+
(function (LineCap) {
|
|
28
|
+
LineCap["BUTT"] = "butt";
|
|
29
|
+
LineCap["ROUND"] = "round";
|
|
30
|
+
LineCap["SQUARE"] = "square";
|
|
31
|
+
})(LineCap || (exports.LineCap = LineCap = {}));
|
|
32
|
+
|
|
33
|
+
var LineJoin;
|
|
34
|
+
exports.LineJoin = LineJoin;
|
|
35
|
+
|
|
36
|
+
(function (LineJoin) {
|
|
37
|
+
LineJoin["BEVEL"] = "bevel";
|
|
38
|
+
LineJoin["ROUND"] = "round";
|
|
39
|
+
LineJoin["MITER"] = "miter";
|
|
40
|
+
})(LineJoin || (exports.LineJoin = LineJoin = {}));
|
|
41
|
+
|
|
42
|
+
var TextTransform;
|
|
43
|
+
exports.TextTransform = TextTransform;
|
|
44
|
+
|
|
45
|
+
(function (TextTransform) {
|
|
46
|
+
TextTransform["CAPITALIZE"] = "capitalize";
|
|
47
|
+
TextTransform["UPPERCASE"] = "uppercase";
|
|
48
|
+
TextTransform["LOWERCASE"] = "lowercase";
|
|
49
|
+
TextTransform["NONE"] = "none";
|
|
50
|
+
})(TextTransform || (exports.TextTransform = TextTransform = {}));
|
|
51
|
+
|
|
52
|
+
var TextAlign;
|
|
53
|
+
exports.TextAlign = TextAlign;
|
|
54
|
+
|
|
55
|
+
(function (TextAlign) {
|
|
56
|
+
TextAlign["START"] = "start";
|
|
57
|
+
TextAlign["CENTER"] = "center";
|
|
58
|
+
TextAlign["END"] = "end";
|
|
59
|
+
TextAlign["LEFT"] = "left";
|
|
60
|
+
TextAlign["RIGHT"] = "right";
|
|
61
|
+
})(TextAlign || (exports.TextAlign = TextAlign = {}));
|
|
41
62
|
|
|
42
63
|
var CanvasConfig = 'CanvasConfig';
|
|
43
64
|
exports.CanvasConfig = CanvasConfig;
|
package/lib/utils/animation.js
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.parseEasingFunction = parseEasingFunction;
|
|
7
7
|
exports.calculateActiveDuration = calculateActiveDuration;
|
|
8
8
|
exports.calculateIterationProgress = calculateIterationProgress;
|
|
9
|
-
exports.
|
|
10
|
-
exports.parseEasingFunction = parseEasingFunction;
|
|
9
|
+
exports.getEase = exports.EasingKeys = exports.EASINGS = exports.linear = void 0;
|
|
11
10
|
|
|
12
11
|
var _tslib = require("tslib");
|
|
13
12
|
|
|
@@ -100,7 +99,7 @@ function calculatePhase(activeDuration, localTime, timing) {
|
|
|
100
99
|
return PhaseNone;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
var endTime = timing.
|
|
102
|
+
var endTime = timing.endTime;
|
|
104
103
|
|
|
105
104
|
if (localTime < Math.min(timing.delay, endTime)) {
|
|
106
105
|
return PhaseBefore;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.bezier = exports.newtonRaphsonIterate = exports.binarySubdivide = exports.getSlope = exports.calcBezier = exports.C = exports.B = exports.A = exports.float32ArraySupported = exports.kSampleStepSize = exports.kSplineTableSize = exports.SUBDIVISION_MAX_ITERATIONS = exports.SUBDIVISION_PRECISION = exports.NEWTON_MIN_SLOPE = exports.NEWTON_ITERATIONS = void 0;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* https://github.com/gre/bezier-easing
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.registerEasingFunctions = exports.registerEasingFunction = exports.
|
|
6
|
+
exports.registerEasingFunctions = exports.registerEasingFunction = exports.getEasingFunction = exports.complexEasingSyntax = exports.EasingFunctions = exports.EaseOutIn = exports.EaseInOut = exports.EaseOut = exports.easein = exports.Bezier = exports.Steps = exports.getEasingDuration = exports.parseEasingParameters = exports.INTINITE_LOOP_LIMIT = exports.EasingDurationCache = exports.Spring = exports.Elastic = exports.Bounce = exports.Back = exports.Circ = exports.Sine = exports.Expo = exports.Quint = exports.Quart = exports.Cubic = exports.Quad = exports.limit = exports.convertToDash = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
package/lib/utils/event.js
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TOUCH_TO_POINTER = exports.MOUSE_POINTER_ID = void 0;
|
|
7
|
-
exports.isMouseEvent = isMouseEvent;
|
|
8
6
|
exports.isTouchEvent = isTouchEvent;
|
|
7
|
+
exports.isMouseEvent = isMouseEvent;
|
|
9
8
|
exports.normalizeToPointerEvent = normalizeToPointerEvent;
|
|
10
|
-
exports.
|
|
9
|
+
exports.TOUCH_TO_POINTER = exports.MOUSE_POINTER_ID = exports.supportsPointerEvents = exports.supportsTouchEvents = void 0;
|
|
11
10
|
|
|
12
11
|
var _util = require("@antv/util");
|
|
13
12
|
|
|
@@ -45,9 +44,11 @@ function normalizeToPointerEvent(event) {
|
|
|
45
44
|
|
|
46
45
|
if (isTouchEvent(event)) {
|
|
47
46
|
for (var i = 0; i < event.changedTouches.length; i++) {
|
|
48
|
-
var touch = event.changedTouches[i];
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
var touch = event.changedTouches[i]; // use changedTouches instead of touches since touchend has no touches
|
|
48
|
+
// @see https://stackoverflow.com/a/10079076
|
|
49
|
+
|
|
50
|
+
if ((0, _util.isUndefined)(touch.button)) touch.button = event.changedTouches.length ? 1 : 0;
|
|
51
|
+
if ((0, _util.isUndefined)(touch.buttons)) touch.buttons = event.changedTouches.length ? 1 : 0;
|
|
51
52
|
|
|
52
53
|
if ((0, _util.isUndefined)(touch.isPrimary)) {
|
|
53
54
|
touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -67,4 +67,17 @@ Object.keys(_text).forEach(function (key) {
|
|
|
67
67
|
return _text[key];
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
var _string = require("./string");
|
|
73
|
+
|
|
74
|
+
Object.keys(_string).forEach(function (key) {
|
|
75
|
+
if (key === "default" || key === "__esModule") return;
|
|
76
|
+
if (key in exports && exports[key] === _string[key]) return;
|
|
77
|
+
Object.defineProperty(exports, key, {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function get() {
|
|
80
|
+
return _string[key];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
70
83
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AnimationEffectTiming } from '../dom';
|
|
2
2
|
import type { IElement } from '../dom/interfaces';
|
|
3
3
|
export declare function convertEffectInput(keyframes: ComputedKeyframe[], timing: AnimationEffectTiming, target: IElement | null): (target: IElement, fraction: number) => void;
|
|
4
|
+
export declare function formatAttribute(name: string, value: any): [string, any];
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.convertEffectInput = convertEffectInput;
|
|
7
|
+
exports.formatAttribute = formatAttribute;
|
|
7
8
|
|
|
8
9
|
var _tslib = require("tslib");
|
|
9
10
|
|
|
@@ -11,10 +12,8 @@ var _globalModule = require("../global-module");
|
|
|
11
12
|
|
|
12
13
|
var _animation = require("./animation");
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// StylePropertyParserFactory,
|
|
17
|
-
// } from '../property-handlers/interfaces';
|
|
15
|
+
var _string = require("./string");
|
|
16
|
+
|
|
18
17
|
function convertEffectInput(keyframes, timing, target) {
|
|
19
18
|
var propertySpecificKeyframeGroups = makePropertySpecificKeyframeGroups(keyframes, timing);
|
|
20
19
|
var interpolations = makeInterpolations(propertySpecificKeyframeGroups, target);
|
|
@@ -130,9 +129,9 @@ function propertyInterpolation(property, left, right, target) {
|
|
|
130
129
|
|
|
131
130
|
if (parser) {
|
|
132
131
|
// @ts-ignore
|
|
133
|
-
parsedLeft = parser(left, target); // @ts-ignore
|
|
132
|
+
parsedLeft = parser(left, target, property); // @ts-ignore
|
|
134
133
|
|
|
135
|
-
parsedRight = parser(right, target);
|
|
134
|
+
parsedRight = parser(right, target, property);
|
|
136
135
|
} // merger [left, right, n2string()]
|
|
137
136
|
|
|
138
137
|
|
|
@@ -189,4 +188,41 @@ convertToString) {
|
|
|
189
188
|
return function (f) {
|
|
190
189
|
return convertToString(interpolate(from, to, f));
|
|
191
190
|
};
|
|
192
|
-
};
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
var FORMAT_ATTR_MAP = {
|
|
194
|
+
d: {
|
|
195
|
+
alias: 'path'
|
|
196
|
+
},
|
|
197
|
+
cx: {
|
|
198
|
+
alias: 'x'
|
|
199
|
+
},
|
|
200
|
+
cy: {
|
|
201
|
+
alias: 'y'
|
|
202
|
+
},
|
|
203
|
+
strokeDasharray: {
|
|
204
|
+
alias: 'lineDash'
|
|
205
|
+
},
|
|
206
|
+
strokeWidth: {
|
|
207
|
+
alias: 'lineWidth'
|
|
208
|
+
},
|
|
209
|
+
textAnchor: {
|
|
210
|
+
alias: 'textAlign',
|
|
211
|
+
values: {
|
|
212
|
+
middle: 'center'
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
src: {
|
|
216
|
+
alias: 'img'
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
function formatAttribute(name, value) {
|
|
221
|
+
var _a;
|
|
222
|
+
|
|
223
|
+
var attributeName = (0, _string.camelCase)(name);
|
|
224
|
+
var map = FORMAT_ATTR_MAP[attributeName];
|
|
225
|
+
attributeName = (map === null || map === void 0 ? void 0 : map.alias) || attributeName;
|
|
226
|
+
var attributeValue = ((_a = map === null || map === void 0 ? void 0 : map.values) === null || _a === void 0 ? void 0 : _a[value]) || value;
|
|
227
|
+
return [attributeName, attributeValue];
|
|
228
|
+
}
|
package/lib/utils/math.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getAngle = getAngle;
|
|
6
7
|
exports.createVec3 = createVec3;
|
|
7
8
|
exports.deg2rad = deg2rad;
|
|
8
|
-
exports.
|
|
9
|
-
exports.getAngle = getAngle;
|
|
10
|
-
exports.getEuler = getEuler;
|
|
11
|
-
exports.getRotationInRadians = getRotationInRadians;
|
|
9
|
+
exports.rad2deg = rad2deg;
|
|
12
10
|
exports.getScaling = getScaling;
|
|
13
11
|
exports.getTranslation = getTranslation;
|
|
12
|
+
exports.getRotationInRadians = getRotationInRadians;
|
|
13
|
+
exports.getEuler = getEuler;
|
|
14
|
+
exports.fromRotationTranslationScale = fromRotationTranslationScale;
|
|
14
15
|
exports.makePerspective = makePerspective;
|
|
15
|
-
exports.rad2deg = rad2deg;
|
|
16
16
|
|
|
17
17
|
var _tslib = require("tslib");
|
|
18
18
|
|