@antv/g 5.0.1 → 5.0.5
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/LICENSE +21 -0
- package/dist/index.umd.js +2 -2
- package/es/AbstractRenderer.d.ts +7 -7
- package/es/Canvas.d.ts +15 -5
- package/es/Canvas.js +10 -5
- package/es/camera/Camera.js +3 -5
- package/es/components/Geometry.d.ts +1 -1
- package/es/components/Renderable.d.ts +1 -1
- package/es/display-objects/CustomElement.d.ts +7 -8
- package/es/display-objects/CustomElement.js +24 -11
- package/es/display-objects/DisplayObject.d.ts +5 -7
- package/es/display-objects/DisplayObject.js +20 -12
- package/es/display-objects/Group.d.ts +1 -1
- package/es/display-objects/HTML.d.ts +1 -1
- package/es/display-objects/Image.d.ts +1 -1
- package/es/display-objects/Path.d.ts +1 -1
- package/es/display-objects/Polygon.d.ts +1 -1
- package/es/display-objects/Polyline.d.ts +1 -1
- package/es/display-objects/Text.d.ts +1 -1
- package/es/display-objects/Text.js +1 -1
- package/es/dom/Animation.js +9 -4
- package/es/dom/AnimationEffectTiming.d.ts +0 -1
- package/es/dom/AnimationTimeline.js +2 -1
- package/es/dom/CustomElementRegistry.d.ts +1 -1
- package/es/dom/CustomEvent.js +2 -1
- package/es/dom/Document.d.ts +3 -3
- package/es/dom/Document.js +13 -6
- package/es/dom/Element.d.ts +11 -12
- package/es/dom/Element.js +12 -8
- package/es/dom/EventTarget.js +1 -0
- package/es/dom/FederatedEvent.d.ts +1 -1
- package/es/dom/KeyframeEffect.js +1 -1
- package/es/dom/Node.d.ts +10 -10
- package/es/dom/Node.js +11 -5
- package/es/dom/interfaces.d.ts +63 -63
- package/es/global-module.d.ts +4 -0
- package/es/global-module.js +57 -69
- package/es/plugins/CullingPlugin.d.ts +3 -3
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/EventPlugin.d.ts +2 -1
- package/es/plugins/FrustumCullingStrategy.d.ts +1 -2
- package/es/plugins/FrustumCullingStrategy.js +31 -32
- package/es/plugins/PrepareRendererPlugin.d.ts +1 -1
- package/es/plugins/PrepareRendererPlugin.js +7 -20
- package/es/property-handlers/aabb.js +16 -19
- package/es/property-handlers/anchor.d.ts +2 -1
- package/es/property-handlers/anchor.js +2 -2
- package/es/property-handlers/clipPath.js +2 -2
- package/es/property-handlers/color.d.ts +3 -4
- package/es/property-handlers/color.js +2 -2
- package/es/property-handlers/filter.d.ts +3 -4
- package/es/property-handlers/filter.js +2 -2
- package/es/property-handlers/interfaces.d.ts +1 -1
- package/es/property-handlers/lineDash.d.ts +1 -2
- package/es/property-handlers/lineDash.js +1 -1
- package/es/property-handlers/path.d.ts +2 -3
- package/es/property-handlers/path.js +2 -2
- package/es/property-handlers/points.d.ts +1 -2
- package/es/property-handlers/points.js +1 -1
- package/es/property-handlers/transform.d.ts +1 -1
- package/es/property-handlers/transform.js +0 -5
- package/es/services/ContextService.d.ts +8 -8
- package/es/services/EventService.d.ts +2 -2
- package/es/services/RenderingContext.d.ts +2 -2
- package/es/services/RenderingService.d.ts +23 -18
- package/es/services/RenderingService.js +18 -4
- package/es/services/SceneGraphSelector.d.ts +5 -5
- package/es/services/SceneGraphSelector.js +3 -2
- package/es/services/SceneGraphService.d.ts +36 -34
- package/es/services/SceneGraphService.js +33 -4
- package/es/services/aabb/PathUpdater.d.ts +1 -2
- package/es/services/aabb/PathUpdater.js +1 -1
- package/es/services/aabb/interfaces.d.ts +1 -1
- package/es/services/text/index.js +1 -1
- package/es/shapes/AABB.d.ts +3 -2
- package/es/shapes/Frustum.d.ts +1 -1
- package/es/shapes/Polygon.d.ts +1 -1
- package/es/shapes/Ray.d.ts +3 -3
- package/es/types.d.ts +1 -2
- package/es/utils/custom-easing.d.ts +3 -5
- package/es/utils/custom-easing.js +2 -1
- package/es/utils/event.d.ts +1 -1
- package/es/utils/interpolation.js +16 -16
- package/es/utils/math.d.ts +2 -1
- package/es/utils/math.js +1 -2
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +4 -7
- package/es/utils/raf.js +2 -1
- package/lib/AbstractRenderer.d.ts +7 -7
- package/lib/Canvas.d.ts +15 -5
- package/lib/Canvas.js +10 -5
- package/lib/camera/Camera.js +4 -5
- package/lib/components/Geometry.d.ts +1 -1
- package/lib/components/Renderable.d.ts +1 -1
- package/lib/display-objects/CustomElement.d.ts +7 -8
- package/lib/display-objects/CustomElement.js +24 -11
- package/lib/display-objects/DisplayObject.d.ts +5 -7
- package/lib/display-objects/DisplayObject.js +19 -11
- package/lib/display-objects/Group.d.ts +1 -1
- package/lib/display-objects/HTML.d.ts +1 -1
- package/lib/display-objects/Image.d.ts +1 -1
- package/lib/display-objects/Path.d.ts +1 -1
- package/lib/display-objects/Polygon.d.ts +1 -1
- package/lib/display-objects/Polyline.d.ts +1 -1
- package/lib/display-objects/Text.d.ts +1 -1
- package/lib/display-objects/Text.js +1 -1
- package/lib/dom/Animation.js +9 -4
- package/lib/dom/AnimationEffectTiming.d.ts +0 -1
- package/lib/dom/AnimationTimeline.js +2 -1
- package/lib/dom/CustomElementRegistry.d.ts +1 -1
- package/lib/dom/CustomEvent.js +1 -1
- package/lib/dom/Document.d.ts +3 -3
- package/lib/dom/Document.js +13 -6
- package/lib/dom/Element.d.ts +11 -12
- package/lib/dom/Element.js +12 -8
- package/lib/dom/EventTarget.js +1 -0
- package/lib/dom/FederatedEvent.d.ts +1 -1
- package/lib/dom/KeyframeEffect.js +1 -1
- package/lib/dom/Node.d.ts +10 -10
- package/lib/dom/Node.js +11 -5
- package/lib/dom/interfaces.d.ts +63 -63
- package/lib/global-module.d.ts +4 -0
- package/lib/global-module.js +57 -69
- package/lib/plugins/CullingPlugin.d.ts +3 -3
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/EventPlugin.d.ts +2 -1
- package/lib/plugins/FrustumCullingStrategy.d.ts +1 -2
- package/lib/plugins/FrustumCullingStrategy.js +28 -30
- package/lib/plugins/PrepareRendererPlugin.d.ts +1 -1
- package/lib/plugins/PrepareRendererPlugin.js +6 -19
- package/lib/property-handlers/aabb.js +15 -19
- package/lib/property-handlers/anchor.d.ts +2 -1
- package/lib/property-handlers/anchor.js +2 -2
- package/lib/property-handlers/clipPath.js +2 -2
- package/lib/property-handlers/color.d.ts +3 -4
- package/lib/property-handlers/color.js +2 -2
- package/lib/property-handlers/filter.d.ts +3 -4
- package/lib/property-handlers/filter.js +2 -2
- package/lib/property-handlers/interfaces.d.ts +1 -1
- package/lib/property-handlers/lineDash.d.ts +1 -2
- package/lib/property-handlers/lineDash.js +1 -1
- package/lib/property-handlers/path.d.ts +2 -3
- package/lib/property-handlers/path.js +2 -2
- package/lib/property-handlers/points.d.ts +1 -2
- package/lib/property-handlers/points.js +1 -1
- package/lib/property-handlers/transform.d.ts +1 -1
- package/lib/property-handlers/transform.js +0 -4
- package/lib/services/ContextService.d.ts +8 -8
- package/lib/services/EventService.d.ts +2 -2
- package/lib/services/RenderingContext.d.ts +2 -2
- package/lib/services/RenderingService.d.ts +23 -18
- package/lib/services/RenderingService.js +18 -4
- package/lib/services/SceneGraphSelector.d.ts +5 -5
- package/lib/services/SceneGraphSelector.js +3 -2
- package/lib/services/SceneGraphService.d.ts +36 -34
- package/lib/services/SceneGraphService.js +35 -4
- package/lib/services/aabb/PathUpdater.d.ts +1 -2
- package/lib/services/aabb/PathUpdater.js +1 -1
- package/lib/services/aabb/interfaces.d.ts +1 -1
- package/lib/services/text/index.js +1 -1
- package/lib/shapes/AABB.d.ts +3 -2
- package/lib/shapes/Frustum.d.ts +1 -1
- package/lib/shapes/Polygon.d.ts +1 -1
- package/lib/shapes/Ray.d.ts +3 -3
- package/lib/types.d.ts +1 -2
- package/lib/utils/custom-easing.d.ts +3 -5
- package/lib/utils/custom-easing.js +2 -1
- package/lib/utils/event.d.ts +1 -1
- package/lib/utils/interpolation.js +13 -18
- package/lib/utils/math.d.ts +2 -1
- package/lib/utils/math.js +1 -2
- package/lib/utils/path.d.ts +2 -2
- package/lib/utils/path.js +4 -7
- package/lib/utils/raf.js +2 -1
- package/package.json +6 -6
- package/lib/dom/__tests__/utils/easing.d.ts +0 -14
- package/lib/dom/__tests__/utils/keyframe.d.ts +0 -38
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DisplayObject } from '../../display-objects/DisplayObject';
|
|
1
|
+
import type { DisplayObject } from '../../display-objects/DisplayObject';
|
|
2
2
|
import type { ParsedBaseStyleProps } from '../../types';
|
|
3
3
|
export declare const GeometryUpdaterFactory = "GeometryUpdaterFactory";
|
|
4
4
|
export declare const GeometryAABBUpdater = "GeometryAABBGenerator";
|
package/lib/shapes/AABB.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { mat4
|
|
2
|
-
import {
|
|
1
|
+
import type { mat4 } from 'gl-matrix';
|
|
2
|
+
import { vec3 } from 'gl-matrix';
|
|
3
|
+
import type { Plane } from './Plane';
|
|
3
4
|
/**
|
|
4
5
|
* Axis-Aligned Bounding Box
|
|
5
6
|
* 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex
|
package/lib/shapes/Frustum.d.ts
CHANGED
package/lib/shapes/Polygon.d.ts
CHANGED
package/lib/shapes/Ray.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { vec3 } from 'gl-matrix';
|
|
2
|
-
import { AABB } from './AABB';
|
|
3
|
-
import { BoundingSphere } from './BoundingSphere';
|
|
4
|
-
import { Plane } from './Plane';
|
|
2
|
+
import type { AABB } from './AABB';
|
|
3
|
+
import type { BoundingSphere } from './BoundingSphere';
|
|
4
|
+
import type { Plane } from './Plane';
|
|
5
5
|
/**
|
|
6
6
|
* 包含求交方法:
|
|
7
7
|
* * intersectsShape(Shape, intersection) 返回交点和求交结果
|
package/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { vec2, vec3 } from 'gl-matrix';
|
|
2
|
-
import { ParsedPathStyleProps, ParsedPolylineStyleProps } from './display-objects';
|
|
2
|
+
import type { ParsedPathStyleProps, ParsedPolylineStyleProps } from './display-objects';
|
|
3
3
|
import type { DisplayObject } from './display-objects';
|
|
4
4
|
import type { ParsedColorStyleProperty } from './property-handlers';
|
|
5
5
|
import type { IRenderer } from './AbstractRenderer';
|
|
@@ -192,7 +192,6 @@ export interface CanvasConfig {
|
|
|
192
192
|
cursor?: Cursor;
|
|
193
193
|
[key: string]: any;
|
|
194
194
|
}
|
|
195
|
-
export declare type ChangeType = 'changeSize' | 'add' | 'sort' | 'clear' | 'attr' | 'show' | 'hide' | 'zIndex' | 'remove' | 'matrix' | 'clip';
|
|
196
195
|
declare type A = ['a' | 'A', number, number, number, number, number, number, number];
|
|
197
196
|
declare type C = ['c' | 'C', number, number, number, number, number, number];
|
|
198
197
|
declare type O = ['o' | 'O', number, number];
|
|
@@ -4,7 +4,7 @@ export declare const limit: (value: number, min: number, max: number) => number;
|
|
|
4
4
|
* The format to use when defining custom easing functions
|
|
5
5
|
*/
|
|
6
6
|
export declare type TypeEasingFunction = (t: number, params?: (string | number)[], duration?: number) => number;
|
|
7
|
-
export declare type TypeColor = string | number |
|
|
7
|
+
export declare type TypeColor = string | number | (string | number)[];
|
|
8
8
|
export declare type TypeRGBAFunction = (color: TypeColor) => number[];
|
|
9
9
|
/**
|
|
10
10
|
Easing Functions from anime.js, they are tried and true, so, its better to use them instead of other alternatives
|
|
@@ -56,9 +56,7 @@ export declare const EaseOutIn: (ease: TypeEasingFunction) => TypeEasingFunction
|
|
|
56
56
|
/**
|
|
57
57
|
* The default list of easing functions, do note this is different from {@link EASING}
|
|
58
58
|
*/
|
|
59
|
-
export declare const EasingFunctions:
|
|
60
|
-
[key: string]: TypeEasingFunction;
|
|
61
|
-
};
|
|
59
|
+
export declare const EasingFunctions: Record<string, TypeEasingFunction>;
|
|
62
60
|
/**
|
|
63
61
|
* Convert string easing to their proper form
|
|
64
62
|
*/
|
|
@@ -72,4 +70,4 @@ export declare const registerEasingFunction: (key: string, fn: TypeEasingFunctio
|
|
|
72
70
|
/**
|
|
73
71
|
* Allows you to register multiple new easing functions
|
|
74
72
|
*/
|
|
75
|
-
export declare const registerEasingFunctions: (...obj:
|
|
73
|
+
export declare const registerEasingFunctions: (...obj: (typeof EasingFunctions)[]) => void;
|
|
@@ -186,7 +186,8 @@ var getEasingDuration = function getEasingDuration(easing) {
|
|
|
186
186
|
easing = 'spring';
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
if (EasingDurationCache.has(easing)) return EasingDurationCache.get(easing);
|
|
189
|
+
if (EasingDurationCache.has(easing)) return EasingDurationCache.get(easing); // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
190
|
+
|
|
190
191
|
var easingFunction = typeof easing == 'function' ? easing : getEasingFunction(easing);
|
|
191
192
|
var params = typeof easing == 'function' ? [] : parseEasingParameters(easing);
|
|
192
193
|
var frame = 1 / 6;
|
package/lib/utils/event.d.ts
CHANGED
|
@@ -9,10 +9,12 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _globalModule = require("../global-module");
|
|
11
11
|
|
|
12
|
-
var _interfaces = require("../property-handlers/interfaces");
|
|
13
|
-
|
|
14
12
|
var _animation = require("./animation");
|
|
15
13
|
|
|
14
|
+
// import {
|
|
15
|
+
// StylePropertyMergerFactory,
|
|
16
|
+
// StylePropertyParserFactory,
|
|
17
|
+
// } from '../property-handlers/interfaces';
|
|
16
18
|
function convertEffectInput(keyframes, timing, target) {
|
|
17
19
|
var propertySpecificKeyframeGroups = makePropertySpecificKeyframeGroups(keyframes, timing);
|
|
18
20
|
var interpolations = makeInterpolations(propertySpecificKeyframeGroups, target);
|
|
@@ -115,15 +117,11 @@ function makeInterpolations(propertySpecificKeyframeGroups, target) {
|
|
|
115
117
|
|
|
116
118
|
function propertyInterpolation(property, left, right, target) {
|
|
117
119
|
var parsedLeft = left;
|
|
118
|
-
var parsedRight = right;
|
|
119
|
-
|
|
120
|
-
var parserFactory = _globalModule.globalContainer.get(_interfaces.StylePropertyParserFactory);
|
|
120
|
+
var parsedRight = right; // const parserFactory = globalContainer.get<StylePropertyParserFactory>(StylePropertyParserFactory);
|
|
121
121
|
|
|
122
|
-
var parser =
|
|
122
|
+
var parser = _globalModule.stylePropertyParserFactory[property]; // const mergerFactory = globalContainer.get<StylePropertyMergerFactory>(StylePropertyMergerFactory);
|
|
123
123
|
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
var merger = mergerFactory(property); // if (left == 'initial' || right == 'initial') {
|
|
124
|
+
var merger = _globalModule.stylePropertyMergerFactory[property]; // if (left == 'initial' || right == 'initial') {
|
|
127
125
|
// if (left == 'initial')
|
|
128
126
|
// left = initialValues[ucProperty];
|
|
129
127
|
// if (right == 'initial')
|
|
@@ -141,24 +139,20 @@ function propertyInterpolation(property, left, right, target) {
|
|
|
141
139
|
var interpolationArgs = merger && merger(parsedLeft, parsedRight, target);
|
|
142
140
|
|
|
143
141
|
if (interpolationArgs) {
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
144
143
|
var interp_1 = InterpolationFactory.apply(void 0, (0, _tslib.__spreadArray)([], (0, _tslib.__read)(interpolationArgs), false));
|
|
145
144
|
return function (t) {
|
|
146
145
|
if (t === 0) return left;
|
|
147
146
|
if (t === 1) return right;
|
|
148
147
|
return interp_1(t);
|
|
149
148
|
};
|
|
150
|
-
}
|
|
149
|
+
} // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
150
|
+
|
|
151
151
|
|
|
152
152
|
return InterpolationFactory(false, true, function (bool) {
|
|
153
153
|
return bool ? right : left;
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
function toCamelCase(property) {
|
|
158
|
-
return property.replace(/-(.)/g, function (_, c) {
|
|
159
|
-
return c.toUpperCase();
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
156
|
/**
|
|
163
157
|
* interpolate with number, boolean, number[], boolean[]
|
|
164
158
|
*/
|
|
@@ -187,10 +181,11 @@ function interpolate(from, to, f) {
|
|
|
187
181
|
}
|
|
188
182
|
}
|
|
189
183
|
|
|
190
|
-
throw 'Mismatched interpolation arguments ' + from + ':' + to;
|
|
184
|
+
throw new Error('Mismatched interpolation arguments ' + from + ':' + to);
|
|
191
185
|
}
|
|
192
186
|
|
|
193
|
-
var InterpolationFactory = function InterpolationFactory(from, to,
|
|
187
|
+
var InterpolationFactory = function InterpolationFactory(from, to, // eslint-disable-next-line @typescript-eslint/ban-types
|
|
188
|
+
convertToString) {
|
|
194
189
|
return function (f) {
|
|
195
190
|
return convertToString(interpolate(from, to, f));
|
|
196
191
|
};
|
package/lib/utils/math.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { quat, vec2, vec4 } from 'gl-matrix';
|
|
2
|
+
import { mat3, mat4, vec3 } from 'gl-matrix';
|
|
2
3
|
export declare function getAngle(angle: number | undefined): number;
|
|
3
4
|
export declare function createVec3(x: number | vec2 | vec3 | vec4, y?: number, z?: number): vec3;
|
|
4
5
|
export declare function deg2rad(deg: number): number;
|
package/lib/utils/math.js
CHANGED
|
@@ -115,7 +115,6 @@ function getEulerFromQuat(out, quat) {
|
|
|
115
115
|
|
|
116
116
|
function getEulerFromMat4(out, m) {
|
|
117
117
|
var x;
|
|
118
|
-
var y;
|
|
119
118
|
var z;
|
|
120
119
|
var halfPi = Math.PI * 0.5;
|
|
121
120
|
|
|
@@ -124,7 +123,7 @@ function getEulerFromMat4(out, m) {
|
|
|
124
123
|
sy = _a[1],
|
|
125
124
|
sz = _a[2];
|
|
126
125
|
|
|
127
|
-
y = Math.asin(-m[2] / sx);
|
|
126
|
+
var y = Math.asin(-m[2] / sx);
|
|
128
127
|
|
|
129
128
|
if (y < halfPi) {
|
|
130
129
|
if (y > -halfPi) {
|
package/lib/utils/path.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { DisplayObject } from '../display-objects/DisplayObject';
|
|
2
|
-
import { PathCommand } from '../types';
|
|
2
|
+
import type { PathCommand } from '../types';
|
|
3
3
|
export declare function equalizeSegments(path1: PathCommand[], path2: PathCommand[], TL?: number): PathCommand[][];
|
|
4
4
|
export declare function getDrawDirection(pathArray: PathCommand[]): boolean;
|
|
5
5
|
export declare function getPathArea(pathArray: PathCommand[]): number;
|
|
6
6
|
export declare function reverseCurve(pathArray: PathCommand[]): PathCommand[];
|
|
7
7
|
export declare function clonePath(pathArray: PathCommand[]): PathCommand[];
|
|
8
|
-
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["
|
|
8
|
+
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["M" | "m", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[];
|
|
9
9
|
/**
|
|
10
10
|
* convert object to path, should account for:
|
|
11
11
|
* * transform & origin
|
package/lib/utils/path.js
CHANGED
|
@@ -225,9 +225,7 @@ function getRotatedCurve(a, b) {
|
|
|
225
225
|
|
|
226
226
|
function commandsToPathString(commands, localTransform, anchor, parsedStyle) {
|
|
227
227
|
var x = parsedStyle.x,
|
|
228
|
-
y = parsedStyle.y
|
|
229
|
-
width = parsedStyle.width,
|
|
230
|
-
height = parsedStyle.height;
|
|
228
|
+
y = parsedStyle.y;
|
|
231
229
|
return commands.reduce(function (prev, cur) {
|
|
232
230
|
var path = '';
|
|
233
231
|
|
|
@@ -280,7 +278,7 @@ function polygonToCommands(points) {
|
|
|
280
278
|
});
|
|
281
279
|
}
|
|
282
280
|
|
|
283
|
-
function rectToCommands(width, height, x, y
|
|
281
|
+
function rectToCommands(width, height, x, y) {
|
|
284
282
|
// FIXME: account for radius
|
|
285
283
|
return [['M', x, y], ['L', x + width, y], ['L', x + width, y + height], ['L', x, y + height], ['Z']];
|
|
286
284
|
}
|
|
@@ -343,9 +341,8 @@ function convertToPath(object) {
|
|
|
343
341
|
width = _h.width,
|
|
344
342
|
height = _h.height,
|
|
345
343
|
x = _h.x,
|
|
346
|
-
y = _h.y
|
|
347
|
-
|
|
348
|
-
commands = rectToCommands(width, height, x, y, radius);
|
|
344
|
+
y = _h.y;
|
|
345
|
+
commands = rectToCommands(width, height, x, y);
|
|
349
346
|
break;
|
|
350
347
|
|
|
351
348
|
case _types.SHAPE.Path:
|
package/lib/utils/raf.js
CHANGED
|
@@ -9,7 +9,8 @@ exports.requestAnimationFrame = requestAnimationFrame;
|
|
|
9
9
|
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); }
|
|
10
10
|
|
|
11
11
|
function requestAnimationFrame(fn) {
|
|
12
|
-
var method = (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && window.requestAnimationFrame ? window.requestAnimationFrame :
|
|
12
|
+
var method = (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && window.requestAnimationFrame ? window.requestAnimationFrame : // eslint-disable-next-line @typescript-eslint/ban-types
|
|
13
|
+
function (f) {
|
|
13
14
|
return setTimeout(f, 16);
|
|
14
15
|
};
|
|
15
16
|
return method(fn);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.5",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/gl-matrix": "^2.4.5",
|
|
36
|
-
"@types/offscreencanvas": "^2019.6.1"
|
|
37
|
-
"npm-run-all": "^4.1.5"
|
|
36
|
+
"@types/offscreencanvas": "^2019.6.1"
|
|
38
37
|
},
|
|
39
38
|
"homepage": "https://github.com/antvis/g#readme",
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"@antv/g-math": "^1.0.
|
|
40
|
+
"@antv/g-math": "^1.0.5",
|
|
42
41
|
"@antv/path-util": "^2.0.14",
|
|
43
42
|
"@antv/util": "^2.0.13",
|
|
44
43
|
"d3-color": "^1.4.0",
|
|
45
44
|
"eventemitter3": "^4.0.0",
|
|
46
45
|
"gl-matrix": "^3.1.0",
|
|
47
46
|
"mana-syringe": "^0.2.2",
|
|
48
|
-
"tapable": "
|
|
47
|
+
"tapable": "^2.2.1",
|
|
48
|
+
"tslib": "^2.3.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"umd": "webpack"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "039cea4e9baf6988a7d6105bb3a907ed816a2fd9"
|
|
54
54
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const gEasingTests: ({
|
|
2
|
-
desc: string;
|
|
3
|
-
easing: string;
|
|
4
|
-
easingFunction: (x: number) => number;
|
|
5
|
-
serialization: string;
|
|
6
|
-
} | {
|
|
7
|
-
desc: string;
|
|
8
|
-
easing: string;
|
|
9
|
-
easingFunction: (x: number) => number;
|
|
10
|
-
serialization?: undefined;
|
|
11
|
-
})[];
|
|
12
|
-
export declare const gEasingParsingTests: string[][];
|
|
13
|
-
export declare const gInvalidEasings: string[];
|
|
14
|
-
export declare const gRoundtripEasings: string[];
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare const gGoodKeyframeCompositeValueTests: CompositeOperationOrAuto[];
|
|
2
|
-
export declare const gBadKeyframeCompositeValueTests: string[];
|
|
3
|
-
export declare const gGoodOptionsCompositeValueTests: string[];
|
|
4
|
-
export declare const gBadOptionsCompositeValueTests: string[];
|
|
5
|
-
export declare const gEmptyKeyframeListTests: any[][];
|
|
6
|
-
export declare const gKeyframesTests: ({
|
|
7
|
-
desc: string;
|
|
8
|
-
input: {
|
|
9
|
-
left: string[];
|
|
10
|
-
margin?: undefined;
|
|
11
|
-
top?: undefined;
|
|
12
|
-
};
|
|
13
|
-
output: Partial<ComputedKeyframe>[];
|
|
14
|
-
} | {
|
|
15
|
-
desc: string;
|
|
16
|
-
input: {
|
|
17
|
-
margin: string[];
|
|
18
|
-
left?: undefined;
|
|
19
|
-
top?: undefined;
|
|
20
|
-
};
|
|
21
|
-
output: Partial<ComputedKeyframe>[];
|
|
22
|
-
} | {
|
|
23
|
-
desc: string;
|
|
24
|
-
input: {
|
|
25
|
-
left: string[];
|
|
26
|
-
top: string[];
|
|
27
|
-
margin?: undefined;
|
|
28
|
-
};
|
|
29
|
-
output: Partial<ComputedKeyframe>[];
|
|
30
|
-
} | {
|
|
31
|
-
desc: string;
|
|
32
|
-
input: {
|
|
33
|
-
left: string;
|
|
34
|
-
margin?: undefined;
|
|
35
|
-
top?: undefined;
|
|
36
|
-
};
|
|
37
|
-
output: Partial<ComputedKeyframe>[];
|
|
38
|
-
})[];
|