@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.
Files changed (177) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.umd.js +2 -2
  3. package/es/AbstractRenderer.d.ts +7 -7
  4. package/es/Canvas.d.ts +15 -5
  5. package/es/Canvas.js +10 -5
  6. package/es/camera/Camera.js +3 -5
  7. package/es/components/Geometry.d.ts +1 -1
  8. package/es/components/Renderable.d.ts +1 -1
  9. package/es/display-objects/CustomElement.d.ts +7 -8
  10. package/es/display-objects/CustomElement.js +24 -11
  11. package/es/display-objects/DisplayObject.d.ts +5 -7
  12. package/es/display-objects/DisplayObject.js +20 -12
  13. package/es/display-objects/Group.d.ts +1 -1
  14. package/es/display-objects/HTML.d.ts +1 -1
  15. package/es/display-objects/Image.d.ts +1 -1
  16. package/es/display-objects/Path.d.ts +1 -1
  17. package/es/display-objects/Polygon.d.ts +1 -1
  18. package/es/display-objects/Polyline.d.ts +1 -1
  19. package/es/display-objects/Text.d.ts +1 -1
  20. package/es/display-objects/Text.js +1 -1
  21. package/es/dom/Animation.js +9 -4
  22. package/es/dom/AnimationEffectTiming.d.ts +0 -1
  23. package/es/dom/AnimationTimeline.js +2 -1
  24. package/es/dom/CustomElementRegistry.d.ts +1 -1
  25. package/es/dom/CustomEvent.js +2 -1
  26. package/es/dom/Document.d.ts +3 -3
  27. package/es/dom/Document.js +13 -6
  28. package/es/dom/Element.d.ts +11 -12
  29. package/es/dom/Element.js +12 -8
  30. package/es/dom/EventTarget.js +1 -0
  31. package/es/dom/FederatedEvent.d.ts +1 -1
  32. package/es/dom/KeyframeEffect.js +1 -1
  33. package/es/dom/Node.d.ts +10 -10
  34. package/es/dom/Node.js +11 -5
  35. package/es/dom/interfaces.d.ts +63 -63
  36. package/es/global-module.d.ts +4 -0
  37. package/es/global-module.js +57 -69
  38. package/es/plugins/CullingPlugin.d.ts +3 -3
  39. package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
  40. package/es/plugins/EventPlugin.d.ts +2 -1
  41. package/es/plugins/FrustumCullingStrategy.d.ts +1 -2
  42. package/es/plugins/FrustumCullingStrategy.js +31 -32
  43. package/es/plugins/PrepareRendererPlugin.d.ts +1 -1
  44. package/es/plugins/PrepareRendererPlugin.js +7 -20
  45. package/es/property-handlers/aabb.js +16 -19
  46. package/es/property-handlers/anchor.d.ts +2 -1
  47. package/es/property-handlers/anchor.js +2 -2
  48. package/es/property-handlers/clipPath.js +2 -2
  49. package/es/property-handlers/color.d.ts +3 -4
  50. package/es/property-handlers/color.js +2 -2
  51. package/es/property-handlers/filter.d.ts +3 -4
  52. package/es/property-handlers/filter.js +2 -2
  53. package/es/property-handlers/interfaces.d.ts +1 -1
  54. package/es/property-handlers/lineDash.d.ts +1 -2
  55. package/es/property-handlers/lineDash.js +1 -1
  56. package/es/property-handlers/path.d.ts +2 -3
  57. package/es/property-handlers/path.js +2 -2
  58. package/es/property-handlers/points.d.ts +1 -2
  59. package/es/property-handlers/points.js +1 -1
  60. package/es/property-handlers/transform.d.ts +1 -1
  61. package/es/property-handlers/transform.js +0 -5
  62. package/es/services/ContextService.d.ts +8 -8
  63. package/es/services/EventService.d.ts +2 -2
  64. package/es/services/RenderingContext.d.ts +2 -2
  65. package/es/services/RenderingService.d.ts +23 -18
  66. package/es/services/RenderingService.js +18 -4
  67. package/es/services/SceneGraphSelector.d.ts +5 -5
  68. package/es/services/SceneGraphSelector.js +3 -2
  69. package/es/services/SceneGraphService.d.ts +36 -34
  70. package/es/services/SceneGraphService.js +33 -4
  71. package/es/services/aabb/PathUpdater.d.ts +1 -2
  72. package/es/services/aabb/PathUpdater.js +1 -1
  73. package/es/services/aabb/interfaces.d.ts +1 -1
  74. package/es/services/text/index.js +1 -1
  75. package/es/shapes/AABB.d.ts +3 -2
  76. package/es/shapes/Frustum.d.ts +1 -1
  77. package/es/shapes/Polygon.d.ts +1 -1
  78. package/es/shapes/Ray.d.ts +3 -3
  79. package/es/types.d.ts +1 -2
  80. package/es/utils/custom-easing.d.ts +3 -5
  81. package/es/utils/custom-easing.js +2 -1
  82. package/es/utils/event.d.ts +1 -1
  83. package/es/utils/interpolation.js +16 -16
  84. package/es/utils/math.d.ts +2 -1
  85. package/es/utils/math.js +1 -2
  86. package/es/utils/path.d.ts +1 -1
  87. package/es/utils/path.js +4 -7
  88. package/es/utils/raf.js +2 -1
  89. package/lib/AbstractRenderer.d.ts +7 -7
  90. package/lib/Canvas.d.ts +15 -5
  91. package/lib/Canvas.js +10 -5
  92. package/lib/camera/Camera.js +4 -5
  93. package/lib/components/Geometry.d.ts +1 -1
  94. package/lib/components/Renderable.d.ts +1 -1
  95. package/lib/display-objects/CustomElement.d.ts +7 -8
  96. package/lib/display-objects/CustomElement.js +24 -11
  97. package/lib/display-objects/DisplayObject.d.ts +5 -7
  98. package/lib/display-objects/DisplayObject.js +19 -11
  99. package/lib/display-objects/Group.d.ts +1 -1
  100. package/lib/display-objects/HTML.d.ts +1 -1
  101. package/lib/display-objects/Image.d.ts +1 -1
  102. package/lib/display-objects/Path.d.ts +1 -1
  103. package/lib/display-objects/Polygon.d.ts +1 -1
  104. package/lib/display-objects/Polyline.d.ts +1 -1
  105. package/lib/display-objects/Text.d.ts +1 -1
  106. package/lib/display-objects/Text.js +1 -1
  107. package/lib/dom/Animation.js +9 -4
  108. package/lib/dom/AnimationEffectTiming.d.ts +0 -1
  109. package/lib/dom/AnimationTimeline.js +2 -1
  110. package/lib/dom/CustomElementRegistry.d.ts +1 -1
  111. package/lib/dom/CustomEvent.js +1 -1
  112. package/lib/dom/Document.d.ts +3 -3
  113. package/lib/dom/Document.js +13 -6
  114. package/lib/dom/Element.d.ts +11 -12
  115. package/lib/dom/Element.js +12 -8
  116. package/lib/dom/EventTarget.js +1 -0
  117. package/lib/dom/FederatedEvent.d.ts +1 -1
  118. package/lib/dom/KeyframeEffect.js +1 -1
  119. package/lib/dom/Node.d.ts +10 -10
  120. package/lib/dom/Node.js +11 -5
  121. package/lib/dom/interfaces.d.ts +63 -63
  122. package/lib/global-module.d.ts +4 -0
  123. package/lib/global-module.js +57 -69
  124. package/lib/plugins/CullingPlugin.d.ts +3 -3
  125. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
  126. package/lib/plugins/EventPlugin.d.ts +2 -1
  127. package/lib/plugins/FrustumCullingStrategy.d.ts +1 -2
  128. package/lib/plugins/FrustumCullingStrategy.js +28 -30
  129. package/lib/plugins/PrepareRendererPlugin.d.ts +1 -1
  130. package/lib/plugins/PrepareRendererPlugin.js +6 -19
  131. package/lib/property-handlers/aabb.js +15 -19
  132. package/lib/property-handlers/anchor.d.ts +2 -1
  133. package/lib/property-handlers/anchor.js +2 -2
  134. package/lib/property-handlers/clipPath.js +2 -2
  135. package/lib/property-handlers/color.d.ts +3 -4
  136. package/lib/property-handlers/color.js +2 -2
  137. package/lib/property-handlers/filter.d.ts +3 -4
  138. package/lib/property-handlers/filter.js +2 -2
  139. package/lib/property-handlers/interfaces.d.ts +1 -1
  140. package/lib/property-handlers/lineDash.d.ts +1 -2
  141. package/lib/property-handlers/lineDash.js +1 -1
  142. package/lib/property-handlers/path.d.ts +2 -3
  143. package/lib/property-handlers/path.js +2 -2
  144. package/lib/property-handlers/points.d.ts +1 -2
  145. package/lib/property-handlers/points.js +1 -1
  146. package/lib/property-handlers/transform.d.ts +1 -1
  147. package/lib/property-handlers/transform.js +0 -4
  148. package/lib/services/ContextService.d.ts +8 -8
  149. package/lib/services/EventService.d.ts +2 -2
  150. package/lib/services/RenderingContext.d.ts +2 -2
  151. package/lib/services/RenderingService.d.ts +23 -18
  152. package/lib/services/RenderingService.js +18 -4
  153. package/lib/services/SceneGraphSelector.d.ts +5 -5
  154. package/lib/services/SceneGraphSelector.js +3 -2
  155. package/lib/services/SceneGraphService.d.ts +36 -34
  156. package/lib/services/SceneGraphService.js +35 -4
  157. package/lib/services/aabb/PathUpdater.d.ts +1 -2
  158. package/lib/services/aabb/PathUpdater.js +1 -1
  159. package/lib/services/aabb/interfaces.d.ts +1 -1
  160. package/lib/services/text/index.js +1 -1
  161. package/lib/shapes/AABB.d.ts +3 -2
  162. package/lib/shapes/Frustum.d.ts +1 -1
  163. package/lib/shapes/Polygon.d.ts +1 -1
  164. package/lib/shapes/Ray.d.ts +3 -3
  165. package/lib/types.d.ts +1 -2
  166. package/lib/utils/custom-easing.d.ts +3 -5
  167. package/lib/utils/custom-easing.js +2 -1
  168. package/lib/utils/event.d.ts +1 -1
  169. package/lib/utils/interpolation.js +13 -18
  170. package/lib/utils/math.d.ts +2 -1
  171. package/lib/utils/math.js +1 -2
  172. package/lib/utils/path.d.ts +2 -2
  173. package/lib/utils/path.js +4 -7
  174. package/lib/utils/raf.js +2 -1
  175. package/package.json +6 -6
  176. package/lib/dom/__tests__/utils/easing.d.ts +0 -14
  177. 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";
@@ -294,7 +294,7 @@ function () {
294
294
  return lines.join('\n');
295
295
  };
296
296
 
297
- TextService.prototype.isBreakingSpace = function (char, _nextChar) {
297
+ TextService.prototype.isBreakingSpace = function (char) {
298
298
  if (typeof char !== 'string') {
299
299
  return false;
300
300
  }
@@ -1,5 +1,6 @@
1
- import { mat4, vec3 } from 'gl-matrix';
2
- import { Plane } from './Plane';
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
@@ -1,4 +1,4 @@
1
- import { mat4 } from 'gl-matrix';
1
+ import type { mat4 } from 'gl-matrix';
2
2
  import { Plane } from './Plane';
3
3
  export declare enum Mask {
4
4
  OUTSIDE = 4294967295,
@@ -1,4 +1,4 @@
1
- import { Point } from './Point';
1
+ import type { Point } from './Point';
2
2
  export declare class PolygonShape {
3
3
  points: number[];
4
4
  closeStroke: boolean;
@@ -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 | Array<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: Array<typeof EasingFunctions>) => void;
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;
@@ -1,4 +1,4 @@
1
- import { InteractivePointerEvent } from '../types';
1
+ import type { InteractivePointerEvent } from '../types';
2
2
  export declare const supportsTouchEvents: boolean;
3
3
  export declare const supportsPointerEvents: boolean;
4
4
  export declare const MOUSE_POINTER_ID = 1;
@@ -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 = parserFactory(property);
122
+ var parser = _globalModule.stylePropertyParserFactory[property]; // const mergerFactory = globalContainer.get<StylePropertyMergerFactory>(StylePropertyMergerFactory);
123
123
 
124
- var mergerFactory = _globalModule.globalContainer.get(_interfaces.StylePropertyMergerFactory);
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, convertToString) {
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
  };
@@ -1,4 +1,5 @@
1
- import { mat3, mat4, quat, vec2, vec3, vec4 } from 'gl-matrix';
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) {
@@ -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] | ["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])[];
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, radius) {
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
- radius = _h.radius;
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 : function (f) {
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.1",
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.0-alpha.12",
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": "1.1.3"
47
+ "tapable": "^2.2.1",
48
+ "tslib": "^2.3.1"
49
49
  },
50
50
  "scripts": {
51
51
  "umd": "webpack"
52
52
  },
53
- "gitHead": "d09726ac85b8738d53c97002a98848b4a450bfcd"
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
- })[];