@antv/g 5.0.11 → 5.0.14
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.min.js +2 -2
- package/es/Canvas.js +41 -15
- package/es/display-objects/DisplayObject.d.ts +2 -0
- package/es/display-objects/DisplayObject.js +10 -0
- package/es/display-objects/Polygon.d.ts +2 -5
- package/es/display-objects/Polyline.d.ts +2 -6
- package/es/display-objects/Text.d.ts +0 -2
- package/es/display-objects/Text.js +1 -1
- package/es/dom/Element.js +2 -1
- package/es/dom/FederatedPointerEvent.d.ts +6 -0
- package/es/dom/FederatedPointerEvent.js +8 -0
- package/es/global-module.js +2 -1
- package/es/property-handlers/aabb.js +28 -24
- package/es/services/RenderingService.d.ts +2 -2
- package/es/services/RenderingService.js +2 -2
- package/es/services/SceneGraphService.d.ts +4 -2
- package/es/services/SceneGraphService.js +89 -67
- package/es/services/aabb/RectUpdater.js +3 -0
- package/es/services/aabb/interfaces.d.ts +2 -1
- package/es/services/aabb/interfaces.js +1 -1
- package/es/types.d.ts +2 -7
- package/es/utils/canvas.d.ts +1 -0
- package/es/utils/canvas.js +2 -1
- package/es/utils/raf.d.ts +6 -2
- package/es/utils/raf.js +15 -2
- package/lib/Canvas.js +39 -12
- package/lib/display-objects/DisplayObject.d.ts +2 -0
- package/lib/display-objects/DisplayObject.js +10 -0
- package/lib/display-objects/Polygon.d.ts +2 -5
- package/lib/display-objects/Polyline.d.ts +2 -6
- package/lib/display-objects/Text.d.ts +0 -2
- package/lib/display-objects/Text.js +1 -1
- package/lib/dom/Element.js +2 -1
- package/lib/dom/FederatedPointerEvent.d.ts +6 -0
- package/lib/dom/FederatedPointerEvent.js +8 -0
- package/lib/global-module.js +2 -1
- package/lib/property-handlers/aabb.js +28 -24
- package/lib/services/RenderingService.d.ts +2 -2
- package/lib/services/RenderingService.js +1 -1
- package/lib/services/SceneGraphService.d.ts +4 -2
- package/lib/services/SceneGraphService.js +95 -67
- package/lib/services/aabb/RectUpdater.js +3 -0
- package/lib/services/aabb/interfaces.d.ts +2 -1
- package/lib/services/aabb/interfaces.js +1 -1
- package/lib/types.d.ts +2 -7
- package/lib/utils/canvas.d.ts +1 -0
- package/lib/utils/canvas.js +5 -1
- package/lib/utils/raf.d.ts +6 -2
- package/lib/utils/raf.js +22 -13
- package/package.json +3 -3
package/lib/utils/canvas.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.cleanExistedCanvas = cleanExistedCanvas;
|
|
7
|
+
exports.isBrowser = void 0;
|
|
7
8
|
var canvasMap = {};
|
|
8
9
|
var defaultCanvasIdCounter = 0;
|
|
9
10
|
/**
|
|
@@ -20,4 +21,7 @@ function cleanExistedCanvas(container, canvas) {
|
|
|
20
21
|
|
|
21
22
|
canvasMap[id] = canvas;
|
|
22
23
|
}
|
|
23
|
-
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
27
|
+
exports.isBrowser = isBrowser;
|
package/lib/utils/raf.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* use user-defined raf instead of requestAnimationFrame
|
|
3
|
+
*/
|
|
4
|
+
export declare function patch(requestAFPatch: (callback: Function) => number, cancelAFPatch: (id: number) => void): void;
|
|
5
|
+
export declare const requestAnimationFrame: (callback: Function) => number;
|
|
6
|
+
export declare const cancelAnimationFrame: (id: number) => void;
|
package/lib/utils/raf.js
CHANGED
|
@@ -3,17 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
exports.cancelAnimationFrame = void 0;
|
|
7
|
+
exports.patch = patch;
|
|
8
|
+
exports.requestAnimationFrame = void 0;
|
|
9
|
+
|
|
10
|
+
var _requestAnimationFramePolyfill = require("request-animation-frame-polyfill");
|
|
11
|
+
|
|
12
|
+
// import { requestAnimationFrame, cancelAnimationFrame } from 'request-animation-frame-polyfill';
|
|
13
|
+
// export { requestAnimationFrame, cancelAnimationFrame };
|
|
14
|
+
var requestAF = _requestAnimationFramePolyfill.requestAnimationFrame;
|
|
15
|
+
var cancelAF = _requestAnimationFramePolyfill.cancelAnimationFrame;
|
|
16
|
+
/**
|
|
17
|
+
* use user-defined raf instead of requestAnimationFrame
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
function patch(requestAFPatch, cancelAFPatch) {
|
|
21
|
+
requestAF = requestAFPatch;
|
|
22
|
+
cancelAF = cancelAFPatch;
|
|
23
|
+
}
|
|
18
24
|
|
|
19
|
-
var
|
|
25
|
+
var requestAnimationFrame = requestAF;
|
|
26
|
+
exports.requestAnimationFrame = requestAnimationFrame;
|
|
27
|
+
var cancelAnimationFrame = cancelAF;
|
|
28
|
+
exports.cancelAnimationFrame = cancelAnimationFrame;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.14",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/antvis/g#readme",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@antv/g-math": "^1.0.
|
|
40
|
+
"@antv/g-math": "^1.0.11",
|
|
41
41
|
"@antv/path-util": "^2.0.14",
|
|
42
42
|
"@antv/util": "^2.0.13",
|
|
43
43
|
"@types/offscreencanvas": "^2019.6.4",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"scripts": {
|
|
53
53
|
"umd": "webpack"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "688274a67997224971b11c806a0e363ea1326240"
|
|
56
56
|
}
|