@antv/g2 5.1.6 → 5.1.8-beta.1
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/README.md +2 -2
- package/README.zh-CN.md +1 -1
- package/dist/g2.full.min.js +1 -1
- package/dist/g2.lite.min.js +1 -1
- package/dist/g2.min.js +1 -1
- package/esm/animation/growInX.js +0 -4
- package/esm/animation/growInX.js.map +1 -1
- package/esm/animation/growInY.js +0 -4
- package/esm/animation/growInY.js.map +1 -1
- package/esm/animation/scaleInX.js +5 -7
- package/esm/animation/scaleInX.js.map +1 -1
- package/esm/animation/scaleInY.js +5 -7
- package/esm/animation/scaleInY.js.map +1 -1
- package/esm/animation/scaleOutX.js +5 -7
- package/esm/animation/scaleOutX.js.map +1 -1
- package/esm/animation/scaleOutY.js +5 -7
- package/esm/animation/scaleOutY.js.map +1 -1
- package/esm/animation/zoomIn.js +4 -5
- package/esm/animation/zoomIn.js.map +1 -1
- package/esm/animation/zoomOut.js +4 -6
- package/esm/animation/zoomOut.js.map +1 -1
- package/esm/component/axis.js +1 -5
- package/esm/component/axis.js.map +1 -1
- package/esm/component/index.d.ts +0 -1
- package/esm/component/index.js +0 -1
- package/esm/component/index.js.map +1 -1
- package/esm/component/legendContinuous.js +1 -1
- package/esm/component/legendContinuous.js.map +1 -1
- package/esm/coordinate/index.d.ts +0 -2
- package/esm/coordinate/index.js +0 -1
- package/esm/coordinate/index.js.map +1 -1
- package/esm/exports.d.ts +6 -1
- package/esm/exports.js +4 -0
- package/esm/exports.js.map +1 -1
- package/esm/index.d.ts +114 -114
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/lib/builtinlib.d.ts +7 -7
- package/esm/lib/core.d.ts +32 -32
- package/esm/lib/index.d.ts +0 -2
- package/esm/lib/index.js +0 -2
- package/esm/lib/index.js.map +1 -1
- package/esm/lib/lite.d.ts +18 -18
- package/esm/lib/std.d.ts +56 -56
- package/esm/mark/index.d.ts +0 -4
- package/esm/mark/index.js +0 -4
- package/esm/mark/index.js.map +1 -1
- package/esm/mark/liquid.js +2 -1
- package/esm/mark/liquid.js.map +1 -1
- package/esm/runtime/component.js +1 -3
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/types/component.d.ts +1 -6
- package/esm/shape/index.d.ts +0 -4
- package/esm/shape/index.js +0 -4
- package/esm/shape/index.js.map +1 -1
- package/esm/shape/interval/color.d.ts +4 -0
- package/esm/shape/interval/color.js +10 -7
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/interval/rect.d.ts +4 -0
- package/esm/shape/interval/rect.js.map +1 -1
- package/esm/shape/line/smooth.js +8 -4
- package/esm/shape/line/smooth.js.map +1 -1
- package/esm/spec/coordinate.d.ts +1 -4
- package/esm/spec/mark.d.ts +1 -3
- package/esm/theme/create.d.ts +1 -0
- package/esm/theme/create.js +1 -0
- package/esm/theme/create.js.map +1 -1
- package/esm/transform/filter.js +3 -1
- package/esm/transform/filter.js.map +1 -1
- package/esm/transform/maybeTitle.js +6 -1
- package/esm/transform/maybeTitle.js.map +1 -1
- package/esm/utils/dateFormat.d.ts +1 -0
- package/esm/utils/dateFormat.js +18 -0
- package/esm/utils/dateFormat.js.map +1 -0
- package/esm/utils/number.d.ts +4 -0
- package/esm/utils/number.js +8 -0
- package/esm/utils/number.js.map +1 -1
- package/lib/animation/growInX.js +0 -4
- package/lib/animation/growInX.js.map +1 -1
- package/lib/animation/growInY.js +0 -4
- package/lib/animation/growInY.js.map +1 -1
- package/lib/animation/scaleInX.js +5 -7
- package/lib/animation/scaleInX.js.map +1 -1
- package/lib/animation/scaleInY.js +5 -7
- package/lib/animation/scaleInY.js.map +1 -1
- package/lib/animation/scaleOutX.js +5 -7
- package/lib/animation/scaleOutX.js.map +1 -1
- package/lib/animation/scaleOutY.js +5 -7
- package/lib/animation/scaleOutY.js.map +1 -1
- package/lib/animation/zoomIn.js +4 -5
- package/lib/animation/zoomIn.js.map +1 -1
- package/lib/animation/zoomOut.js +4 -6
- package/lib/animation/zoomOut.js.map +1 -1
- package/lib/component/axis.js +3 -7
- package/lib/component/axis.js.map +1 -1
- package/lib/component/index.d.ts +0 -1
- package/lib/component/index.js +1 -3
- package/lib/component/index.js.map +1 -1
- package/lib/component/legendContinuous.js +1 -1
- package/lib/component/legendContinuous.js.map +1 -1
- package/lib/coordinate/index.d.ts +0 -2
- package/lib/coordinate/index.js +1 -3
- package/lib/coordinate/index.js.map +1 -1
- package/lib/exports.d.ts +6 -1
- package/lib/exports.js +13 -1
- package/lib/exports.js.map +1 -1
- package/lib/index.d.ts +114 -114
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/lib/builtinlib.d.ts +7 -7
- package/lib/lib/core.d.ts +32 -32
- package/lib/lib/index.d.ts +0 -2
- package/lib/lib/index.js +1 -5
- package/lib/lib/index.js.map +1 -1
- package/lib/lib/lite.d.ts +18 -18
- package/lib/lib/std.d.ts +56 -56
- package/lib/mark/index.d.ts +0 -4
- package/lib/mark/index.js +1 -9
- package/lib/mark/index.js.map +1 -1
- package/lib/mark/liquid.js +2 -1
- package/lib/mark/liquid.js.map +1 -1
- package/lib/runtime/component.js +2 -4
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/types/component.d.ts +1 -6
- package/lib/shape/index.d.ts +0 -4
- package/lib/shape/index.js +6 -14
- package/lib/shape/index.js.map +1 -1
- package/lib/shape/interval/color.d.ts +4 -0
- package/lib/shape/interval/color.js +10 -7
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/interval/rect.d.ts +4 -0
- package/lib/shape/interval/rect.js.map +1 -1
- package/lib/shape/line/smooth.js +6 -2
- package/lib/shape/line/smooth.js.map +1 -1
- package/lib/spec/coordinate.d.ts +1 -4
- package/lib/spec/mark.d.ts +1 -3
- package/lib/theme/create.d.ts +1 -0
- package/lib/theme/create.js +1 -0
- package/lib/theme/create.js.map +1 -1
- package/lib/transform/filter.js +3 -1
- package/lib/transform/filter.js.map +1 -1
- package/lib/transform/maybeTitle.js +6 -1
- package/lib/transform/maybeTitle.js.map +1 -1
- package/lib/utils/dateFormat.d.ts +1 -0
- package/lib/utils/dateFormat.js +22 -0
- package/lib/utils/dateFormat.js.map +1 -0
- package/lib/utils/number.d.ts +4 -0
- package/lib/utils/number.js +10 -1
- package/lib/utils/number.js.map +1 -1
- package/package.json +10 -17
- package/src/animation/growInX.ts +1 -6
- package/src/animation/growInY.ts +1 -6
- package/src/animation/scaleInX.ts +8 -11
- package/src/animation/scaleInY.ts +8 -11
- package/src/animation/scaleOutX.ts +8 -11
- package/src/animation/scaleOutY.ts +8 -11
- package/src/animation/zoomIn.ts +4 -6
- package/src/animation/zoomOut.ts +4 -7
- package/src/component/axis.ts +1 -5
- package/src/component/index.ts +0 -1
- package/src/component/legendContinuous.ts +1 -1
- package/src/coordinate/index.ts +0 -2
- package/src/exports.ts +18 -2
- package/src/index.ts +2 -2
- package/src/lib/index.ts +0 -2
- package/src/mark/index.ts +0 -4
- package/src/mark/liquid.ts +2 -1
- package/src/runtime/component.ts +1 -4
- package/src/runtime/types/component.ts +2 -9
- package/src/shape/index.ts +0 -4
- package/src/shape/interval/color.ts +16 -4
- package/src/shape/interval/rect.ts +5 -0
- package/src/shape/line/smooth.ts +12 -4
- package/src/spec/coordinate.ts +0 -5
- package/src/spec/mark.ts +0 -3
- package/src/theme/create.ts +1 -0
- package/src/transform/filter.ts +3 -1
- package/src/transform/maybeTitle.ts +8 -1
- package/src/utils/dateFormat.ts +22 -0
- package/src/utils/number.ts +8 -0
- package/CHANGELOG.md +0 -417
- package/esm/component/axisZ.d.ts +0 -8
- package/esm/component/axisZ.js +0 -14
- package/esm/component/axisZ.js.map +0 -1
- package/esm/coordinate/cartesian3D.d.ts +0 -7
- package/esm/coordinate/cartesian3D.js +0 -6
- package/esm/coordinate/cartesian3D.js.map +0 -1
- package/esm/lib/auto.d.ts +0 -3
- package/esm/lib/auto.js +0 -7
- package/esm/lib/auto.js.map +0 -1
- package/esm/lib/threed.d.ts +0 -7
- package/esm/lib/threed.js +0 -13
- package/esm/lib/threed.js.map +0 -1
- package/esm/mark/auto.d.ts +0 -1
- package/esm/mark/auto.js +0 -26
- package/esm/mark/auto.js.map +0 -1
- package/esm/mark/interval3D.d.ts +0 -8
- package/esm/mark/interval3D.js +0 -65
- package/esm/mark/interval3D.js.map +0 -1
- package/esm/mark/line3D.d.ts +0 -7
- package/esm/mark/line3D.js +0 -65
- package/esm/mark/line3D.js.map +0 -1
- package/esm/mark/point3D.d.ts +0 -9
- package/esm/mark/point3D.js +0 -76
- package/esm/mark/point3D.js.map +0 -1
- package/esm/shape/interval3D/cube.d.ts +0 -6
- package/esm/shape/interval3D/cube.js +0 -71
- package/esm/shape/interval3D/cube.js.map +0 -1
- package/esm/shape/line3D/line.d.ts +0 -3
- package/esm/shape/line3D/line.js +0 -30
- package/esm/shape/line3D/line.js.map +0 -1
- package/esm/shape/point3D/cube.d.ts +0 -6
- package/esm/shape/point3D/cube.js +0 -70
- package/esm/shape/point3D/cube.js.map +0 -1
- package/esm/shape/point3D/sphere.d.ts +0 -6
- package/esm/shape/point3D/sphere.js +0 -70
- package/esm/shape/point3D/sphere.js.map +0 -1
- package/lib/component/axisZ.d.ts +0 -8
- package/lib/component/axisZ.js +0 -19
- package/lib/component/axisZ.js.map +0 -1
- package/lib/coordinate/cartesian3D.d.ts +0 -7
- package/lib/coordinate/cartesian3D.js +0 -10
- package/lib/coordinate/cartesian3D.js.map +0 -1
- package/lib/lib/auto.d.ts +0 -3
- package/lib/lib/auto.js +0 -11
- package/lib/lib/auto.js.map +0 -1
- package/lib/lib/threed.d.ts +0 -7
- package/lib/lib/threed.js +0 -17
- package/lib/lib/threed.js.map +0 -1
- package/lib/mark/auto.d.ts +0 -1
- package/lib/mark/auto.js +0 -30
- package/lib/mark/auto.js.map +0 -1
- package/lib/mark/interval3D.d.ts +0 -8
- package/lib/mark/interval3D.js +0 -69
- package/lib/mark/interval3D.js.map +0 -1
- package/lib/mark/line3D.d.ts +0 -7
- package/lib/mark/line3D.js +0 -69
- package/lib/mark/line3D.js.map +0 -1
- package/lib/mark/point3D.d.ts +0 -9
- package/lib/mark/point3D.js +0 -80
- package/lib/mark/point3D.js.map +0 -1
- package/lib/shape/interval3D/cube.d.ts +0 -6
- package/lib/shape/interval3D/cube.js +0 -75
- package/lib/shape/interval3D/cube.js.map +0 -1
- package/lib/shape/line3D/line.d.ts +0 -3
- package/lib/shape/line3D/line.js +0 -34
- package/lib/shape/line3D/line.js.map +0 -1
- package/lib/shape/point3D/cube.d.ts +0 -6
- package/lib/shape/point3D/cube.js +0 -74
- package/lib/shape/point3D/cube.js.map +0 -1
- package/lib/shape/point3D/sphere.d.ts +0 -6
- package/lib/shape/point3D/sphere.js +0 -74
- package/lib/shape/point3D/sphere.js.map +0 -1
- package/src/component/axisZ.ts +0 -25
- package/src/coordinate/cartesian3D.ts +0 -11
- package/src/lib/auto.ts +0 -7
- package/src/lib/threed.ts +0 -13
- package/src/mark/auto.ts +0 -22
- package/src/mark/interval3D.ts +0 -100
- package/src/mark/line3D.ts +0 -81
- package/src/mark/point3D.ts +0 -90
- package/src/shape/interval3D/cube.ts +0 -69
- package/src/shape/line3D/line.ts +0 -29
- package/src/shape/point3D/cube.ts +0 -68
- package/src/shape/point3D/sphere.ts +0 -68
package/lib/utils/number.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clamp = void 0;
|
|
3
|
+
exports.prettyNumber = exports.clamp = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Clamp number within the inclusive range within the lower and upper bounds.
|
|
6
6
|
*/
|
|
@@ -8,4 +8,13 @@ function clamp(v, lower, upper) {
|
|
|
8
8
|
return Math.max(lower, Math.min(v, upper));
|
|
9
9
|
}
|
|
10
10
|
exports.clamp = clamp;
|
|
11
|
+
/**
|
|
12
|
+
* Precision conversion
|
|
13
|
+
*/
|
|
14
|
+
function prettyNumber(n, precision = 10) {
|
|
15
|
+
if (typeof n !== 'number')
|
|
16
|
+
return n;
|
|
17
|
+
return Math.abs(n) < 1e-15 ? n : parseFloat(n.toFixed(precision));
|
|
18
|
+
}
|
|
19
|
+
exports.prettyNumber = prettyNumber;
|
|
11
20
|
//# sourceMappingURL=number.js.map
|
package/lib/utils/number.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"src/","sources":["utils/number.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,KAAK,CAAC,CAAS,EAAE,KAAa,EAAE,KAAa;IAC3D,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC"}
|
|
1
|
+
{"version":3,"file":"number.js","sourceRoot":"src/","sources":["utils/number.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,KAAK,CAAC,CAAS,EAAE,KAAa,EAAE,KAAa;IAC3D,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,CAAS,EAAE,SAAS,GAAG,EAAE;IACpD,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AACpE,CAAC;AAHD,oCAGC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g2",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.8-beta.1",
|
|
4
4
|
"description": "the Grammar of Graphics in Javascript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"dev": "vite",
|
|
26
|
+
"dev": "TZ=Asia/Shanghai vite",
|
|
27
27
|
"dev:link": "cross-env LINK=1 vite",
|
|
28
28
|
"clean": "rimraf lib esm dist",
|
|
29
29
|
"lint-staged": "lint-staged",
|
|
30
30
|
"size": "limit-size",
|
|
31
31
|
"lint": "eslint ./src ./__tests__ && prettier ./src ./__tests__ --check ",
|
|
32
32
|
"fix": "eslint ./src ./__tests__ --fix && prettier ./src ./__tests__ --write ",
|
|
33
|
-
"test": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__
|
|
34
|
-
"test:unit": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/unit/ --coverage
|
|
35
|
-
"test:integration": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/integration/ --coverage
|
|
33
|
+
"test": "TZ=Asia/Shanghai node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__ --logHeapUsage",
|
|
34
|
+
"test:unit": "TZ=Asia/Shanghai node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/unit/ --coverage --logHeapUsage",
|
|
35
|
+
"test:integration": "TZ=Asia/Shanghai node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/integration/ --coverage --logHeapUsage",
|
|
36
36
|
"preview": "vite preview",
|
|
37
37
|
"build:umd": "rimraf ./dist && node --expose-gc --max-old-space-size=4096 node_modules/rollup/dist/bin/rollup -c && npm run size",
|
|
38
38
|
"build:cjs": "rimraf ./lib && tsc --module commonjs --outDir lib",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"build": "run-p build:*",
|
|
41
41
|
"bundle-vis": "cross-env BUNDLE_VIS=1 run-p build:umd",
|
|
42
42
|
"ci": "run-s lint test build",
|
|
43
|
-
"prepublishOnly": "npm run ci",
|
|
44
43
|
"prepare": "husky install",
|
|
45
44
|
"upload": "node scripts/upload/snapshot.js",
|
|
46
45
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
@@ -57,14 +56,11 @@
|
|
|
57
56
|
"animation"
|
|
58
57
|
],
|
|
59
58
|
"dependencies": {
|
|
60
|
-
"@antv/ava": "^3.0.7",
|
|
61
59
|
"@antv/coord": "^0.4.1",
|
|
62
60
|
"@antv/event-emitter": "^0.1.3",
|
|
63
61
|
"@antv/g": "^5.18.6",
|
|
64
62
|
"@antv/g-canvas": "^1.11.5",
|
|
65
|
-
"@antv/
|
|
66
|
-
"@antv/g-plugin-dragndrop": "^1.8.3",
|
|
67
|
-
"@antv/component": "^1.0.0-beta.1",
|
|
63
|
+
"@antv/component": "^1.0.0-beta.2",
|
|
68
64
|
"@antv/path-util": "^3.0.1",
|
|
69
65
|
"@antv/scale": "^0.4.7",
|
|
70
66
|
"@antv/util": "^3.3.2",
|
|
@@ -84,13 +80,12 @@
|
|
|
84
80
|
},
|
|
85
81
|
"devDependencies": {
|
|
86
82
|
"@antv/data-set": "^0.11.8",
|
|
87
|
-
"@antv/g-plugin-3d": "^1.9.5",
|
|
88
|
-
"@antv/g-plugin-control": "^1.9.5",
|
|
89
83
|
"@antv/g-plugin-rough-canvas-renderer": "^1.7.9",
|
|
90
84
|
"@antv/g-plugin-rough-svg-renderer": "^1.7.9",
|
|
85
|
+
"@antv/g-svg": "^1.10.20",
|
|
86
|
+
"@antv/g2-extension-ava": "^0.1.1",
|
|
87
|
+
"@antv/g2-extension-3d": "^0.1.0",
|
|
91
88
|
"@antv/translator": "^1.0.0",
|
|
92
|
-
"@antv/g-svg": "^1.10.7",
|
|
93
|
-
"@antv/g-webgl": "^1.9.8",
|
|
94
89
|
"@commitlint/cli": "^11.0.0",
|
|
95
90
|
"@commitlint/config-conventional": "^17.4.4",
|
|
96
91
|
"@optimize-lodash/rollup-plugin": "^4.0.3",
|
|
@@ -101,14 +96,12 @@
|
|
|
101
96
|
"@types/d3-array": "3.0.5",
|
|
102
97
|
"@types/d3-path": "^3.0.0",
|
|
103
98
|
"@types/d3-shape": "^3.0.2",
|
|
99
|
+
"@types/diff": "^5.0.0",
|
|
104
100
|
"@types/jest": "^26.0.20",
|
|
105
101
|
"@types/pixelmatch": "^5.2.4",
|
|
106
102
|
"@types/pngjs": "^6.0.1",
|
|
107
103
|
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
|
108
104
|
"@typescript-eslint/parser": "^4.18.0",
|
|
109
|
-
"ali-oss": "^6.17.1",
|
|
110
|
-
"archiver": "^5.3.1",
|
|
111
|
-
"canvas": "2.11.0",
|
|
112
105
|
"conventional-changelog-cli": "^2.2.2",
|
|
113
106
|
"cross-env": "^7.0.3",
|
|
114
107
|
"d3-dsv": "^3.0.1",
|
package/src/animation/growInX.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Path } from '@antv/g';
|
|
2
2
|
import { AnimationComponent as AC } from '../runtime';
|
|
3
3
|
import { Animation } from './types';
|
|
4
4
|
import { ScaleInX } from './scaleInX';
|
|
@@ -22,11 +22,6 @@ export const GrowInX: AC<GrowInXOptions> = (options, context) => {
|
|
|
22
22
|
|
|
23
23
|
const animation = ScaleInX(options, context)([clipPath], to, defaults);
|
|
24
24
|
|
|
25
|
-
(animation as IAnimation).finished.then(() => {
|
|
26
|
-
clipPath.remove();
|
|
27
|
-
shape.style.clipPath = null;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
25
|
return animation;
|
|
31
26
|
};
|
|
32
27
|
};
|
package/src/animation/growInY.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Path } from '@antv/g';
|
|
2
2
|
import { AnimationComponent as AC } from '../runtime';
|
|
3
3
|
import { Animation } from './types';
|
|
4
4
|
import { ScaleInY } from './scaleInY';
|
|
@@ -22,11 +22,6 @@ export const GrowInY: AC<GrowInYOptions> = (options, context) => {
|
|
|
22
22
|
|
|
23
23
|
const animation = ScaleInY(options, context)([clipPath], to, defaults);
|
|
24
24
|
|
|
25
|
-
(animation as IAnimation).finished.then(() => {
|
|
26
|
-
clipPath.remove();
|
|
27
|
-
shape.style.clipPath = null;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
25
|
return animation;
|
|
31
26
|
};
|
|
32
27
|
};
|
|
@@ -16,29 +16,31 @@ export const ScaleInX: AC<ScaleInXOptions> = (options, context) => {
|
|
|
16
16
|
|
|
17
17
|
return (from, _, defaults) => {
|
|
18
18
|
const [shape] = from;
|
|
19
|
-
const { height } = shape.getBoundingClientRect();
|
|
20
19
|
const {
|
|
21
20
|
transform: prefix = '',
|
|
22
21
|
fillOpacity = 1,
|
|
23
22
|
strokeOpacity = 1,
|
|
24
23
|
opacity = 1,
|
|
25
24
|
} = shape.style;
|
|
26
|
-
const [transformOrigin, transform]: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const [transformOrigin, transform]: [string, string] = isTranspose(
|
|
26
|
+
coordinate,
|
|
27
|
+
)
|
|
28
|
+
? [`left bottom`, `scale(1, ${ZERO})`] // left-bottom corner
|
|
29
|
+
: [`left top`, `scale(${ZERO}, 1)`]; // left-top corner
|
|
30
30
|
|
|
31
31
|
// Using a short fadeIn transition to hide element with scale(0.001)
|
|
32
32
|
// which is still visible.
|
|
33
33
|
const keyframes = [
|
|
34
34
|
{
|
|
35
35
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
36
|
+
transformOrigin,
|
|
36
37
|
fillOpacity: 0,
|
|
37
38
|
strokeOpacity: 0,
|
|
38
39
|
opacity: 0,
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
43
|
+
transformOrigin,
|
|
42
44
|
fillOpacity,
|
|
43
45
|
strokeOpacity,
|
|
44
46
|
opacity,
|
|
@@ -46,20 +48,15 @@ export const ScaleInX: AC<ScaleInXOptions> = (options, context) => {
|
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
50
|
transform: `${prefix} scale(1, 1)`.trimStart(),
|
|
51
|
+
transformOrigin,
|
|
49
52
|
fillOpacity,
|
|
50
53
|
strokeOpacity,
|
|
51
54
|
opacity,
|
|
52
55
|
},
|
|
53
56
|
];
|
|
54
57
|
|
|
55
|
-
// Change transform origin for correct transform.
|
|
56
|
-
shape.setOrigin(transformOrigin);
|
|
57
|
-
|
|
58
58
|
const animation = shape.animate(keyframes, { ...defaults, ...options });
|
|
59
59
|
|
|
60
|
-
// Reset transform origin to eliminate side effect for following animations.
|
|
61
|
-
animation.finished.then(() => shape.setOrigin(0, 0));
|
|
62
|
-
|
|
63
60
|
return animation;
|
|
64
61
|
};
|
|
65
62
|
};
|
|
@@ -16,29 +16,31 @@ export const ScaleInY: AC<ScaleInYOptions> = (options, context) => {
|
|
|
16
16
|
|
|
17
17
|
return (from, _, defaults) => {
|
|
18
18
|
const [shape] = from;
|
|
19
|
-
const { height } = shape.getBoundingClientRect();
|
|
20
19
|
const {
|
|
21
20
|
transform: prefix = '',
|
|
22
21
|
fillOpacity = 1,
|
|
23
22
|
strokeOpacity = 1,
|
|
24
23
|
opacity = 1,
|
|
25
24
|
} = shape.style;
|
|
26
|
-
const [transformOrigin, transform]: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const [transformOrigin, transform]: [string, string] = isTranspose(
|
|
26
|
+
coordinate,
|
|
27
|
+
)
|
|
28
|
+
? [`left top`, `scale(${ZERO}, 1)`] // left-top corner
|
|
29
|
+
: [`left bottom`, `scale(1, ${ZERO})`]; // left-bottom corner
|
|
30
30
|
|
|
31
31
|
// Using a short fadeIn transition to hide element with scale(0.001)
|
|
32
32
|
// which is still visible.
|
|
33
33
|
const keyframes = [
|
|
34
34
|
{
|
|
35
35
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
36
|
+
transformOrigin,
|
|
36
37
|
fillOpacity: 0,
|
|
37
38
|
strokeOpacity: 0,
|
|
38
39
|
opacity: 0,
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
43
|
+
transformOrigin,
|
|
42
44
|
fillOpacity,
|
|
43
45
|
strokeOpacity,
|
|
44
46
|
opacity,
|
|
@@ -46,20 +48,15 @@ export const ScaleInY: AC<ScaleInYOptions> = (options, context) => {
|
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
50
|
transform: `${prefix} scale(1, 1)`.trimStart(),
|
|
51
|
+
transformOrigin,
|
|
49
52
|
fillOpacity,
|
|
50
53
|
strokeOpacity,
|
|
51
54
|
opacity,
|
|
52
55
|
},
|
|
53
56
|
];
|
|
54
57
|
|
|
55
|
-
// Change transform origin for correct transform.
|
|
56
|
-
shape.setOrigin(transformOrigin);
|
|
57
|
-
|
|
58
58
|
const animation = shape.animate(keyframes, { ...defaults, ...options });
|
|
59
59
|
|
|
60
|
-
// Reset transform origin to eliminate side effect for following animations.
|
|
61
|
-
animation.finished.then(() => shape.setOrigin(0, 0));
|
|
62
|
-
|
|
63
60
|
return animation;
|
|
64
61
|
};
|
|
65
62
|
};
|
|
@@ -16,26 +16,28 @@ export const ScaleOutX: AC<ScaleOutXOptions> = (options, context) => {
|
|
|
16
16
|
|
|
17
17
|
return (from, _, defaults) => {
|
|
18
18
|
const [shape] = from;
|
|
19
|
-
const { height } = shape.getBoundingClientRect();
|
|
20
19
|
const {
|
|
21
20
|
transform: prefix = '',
|
|
22
21
|
fillOpacity = 1,
|
|
23
22
|
strokeOpacity = 1,
|
|
24
23
|
opacity = 1,
|
|
25
24
|
} = shape.style;
|
|
26
|
-
const [transformOrigin, transform]: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const [transformOrigin, transform]: [string, string] = isTranspose(
|
|
26
|
+
coordinate,
|
|
27
|
+
)
|
|
28
|
+
? [`left bottom`, `scale(1, ${ZERO})`] // left-bottom corner
|
|
29
|
+
: [`left top`, `scale(${ZERO}, 1)`]; // left-top corner
|
|
30
30
|
|
|
31
31
|
// Using a short fadeIn transition to hide element with scale(0.001)
|
|
32
32
|
// which is still visible.
|
|
33
33
|
const keyframes = [
|
|
34
34
|
{
|
|
35
35
|
transform: `${prefix} scale(1, 1)`.trimStart(),
|
|
36
|
+
transformOrigin,
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
40
|
+
transformOrigin,
|
|
39
41
|
fillOpacity,
|
|
40
42
|
strokeOpacity,
|
|
41
43
|
opacity,
|
|
@@ -43,20 +45,15 @@ export const ScaleOutX: AC<ScaleOutXOptions> = (options, context) => {
|
|
|
43
45
|
},
|
|
44
46
|
{
|
|
45
47
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
48
|
+
transformOrigin,
|
|
46
49
|
fillOpacity: 0,
|
|
47
50
|
strokeOpacity: 0,
|
|
48
51
|
opacity: 0,
|
|
49
52
|
},
|
|
50
53
|
];
|
|
51
54
|
|
|
52
|
-
// Change transform origin for correct transform.
|
|
53
|
-
shape.setOrigin(transformOrigin);
|
|
54
|
-
|
|
55
55
|
const animation = shape.animate(keyframes, { ...defaults, ...options });
|
|
56
56
|
|
|
57
|
-
// Reset transform origin to eliminate side effect for following animations.
|
|
58
|
-
animation.finished.then(() => shape.setOrigin(0, 0));
|
|
59
|
-
|
|
60
57
|
return animation;
|
|
61
58
|
};
|
|
62
59
|
};
|
|
@@ -16,26 +16,28 @@ export const ScaleOutY: AC<ScaleOutYOptions> = (options, context) => {
|
|
|
16
16
|
|
|
17
17
|
return (from, _, defaults) => {
|
|
18
18
|
const [shape] = from;
|
|
19
|
-
const { height } = shape.getBoundingClientRect();
|
|
20
19
|
const {
|
|
21
20
|
transform: prefix = '',
|
|
22
21
|
fillOpacity = 1,
|
|
23
22
|
strokeOpacity = 1,
|
|
24
23
|
opacity = 1,
|
|
25
24
|
} = shape.style;
|
|
26
|
-
const [transformOrigin, transform]: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const [transformOrigin, transform]: [string, string] = isTranspose(
|
|
26
|
+
coordinate,
|
|
27
|
+
)
|
|
28
|
+
? [`left top`, `scale(${ZERO}, 1)`] // left-top corner
|
|
29
|
+
: [`left bottom`, `scale(1, ${ZERO})`]; // left-bottom corner
|
|
30
30
|
|
|
31
31
|
// Using a short fadeIn transition to hide element with scale(0.001)
|
|
32
32
|
// which is still visible.
|
|
33
33
|
const keyframes = [
|
|
34
34
|
{
|
|
35
35
|
transform: `${prefix} scale(1, 1)`.trimStart(),
|
|
36
|
+
transformOrigin,
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
40
|
+
transformOrigin,
|
|
39
41
|
fillOpacity,
|
|
40
42
|
strokeOpacity,
|
|
41
43
|
opacity,
|
|
@@ -43,20 +45,15 @@ export const ScaleOutY: AC<ScaleOutYOptions> = (options, context) => {
|
|
|
43
45
|
},
|
|
44
46
|
{
|
|
45
47
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
48
|
+
transformOrigin,
|
|
46
49
|
fillOpacity: 0,
|
|
47
50
|
strokeOpacity: 0,
|
|
48
51
|
opacity: 0,
|
|
49
52
|
},
|
|
50
53
|
];
|
|
51
54
|
|
|
52
|
-
// Change transform origin for correct transform.
|
|
53
|
-
shape.setOrigin(transformOrigin);
|
|
54
|
-
|
|
55
55
|
const animation = shape.animate(keyframes, { ...defaults, ...options });
|
|
56
56
|
|
|
57
|
-
// Reset transform origin to eliminate side effect for following animations.
|
|
58
|
-
animation.finished.then(() => shape.setOrigin(0, 0));
|
|
59
|
-
|
|
60
57
|
return animation;
|
|
61
58
|
};
|
|
62
59
|
};
|
package/src/animation/zoomIn.ts
CHANGED
|
@@ -16,15 +16,18 @@ export const ZoomIn: AC<ZoomInOptions> = (options) => {
|
|
|
16
16
|
strokeOpacity = 1,
|
|
17
17
|
opacity = 1,
|
|
18
18
|
} = shape.style;
|
|
19
|
+
const transformOrigin = 'center center';
|
|
19
20
|
const keyframes = [
|
|
20
21
|
{
|
|
21
22
|
transform: `${prefix} scale(${ZERO})`.trimStart(),
|
|
23
|
+
transformOrigin,
|
|
22
24
|
fillOpacity: 0,
|
|
23
25
|
strokeOpacity: 0,
|
|
24
26
|
opacity: 0,
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
29
|
transform: `${prefix} scale(${ZERO})`.trimStart(),
|
|
30
|
+
transformOrigin,
|
|
28
31
|
fillOpacity,
|
|
29
32
|
strokeOpacity,
|
|
30
33
|
opacity,
|
|
@@ -32,20 +35,15 @@ export const ZoomIn: AC<ZoomInOptions> = (options) => {
|
|
|
32
35
|
},
|
|
33
36
|
{
|
|
34
37
|
transform: `${prefix} scale(1)`.trimStart(),
|
|
38
|
+
transformOrigin,
|
|
35
39
|
fillOpacity,
|
|
36
40
|
strokeOpacity,
|
|
37
41
|
opacity,
|
|
38
42
|
},
|
|
39
43
|
];
|
|
40
|
-
const { width, height } = shape.getBoundingClientRect();
|
|
41
|
-
// Change transform origin for correct transform.
|
|
42
|
-
shape.setOrigin([width / 2, height / 2]);
|
|
43
44
|
|
|
44
45
|
const animation = shape.animate(keyframes, { ...defaults, ...options });
|
|
45
46
|
|
|
46
|
-
// Reset transform origin to eliminate side effect for following animations.
|
|
47
|
-
animation.finished.then(() => shape.setOrigin(0, 0));
|
|
48
|
-
|
|
49
47
|
return animation;
|
|
50
48
|
};
|
|
51
49
|
};
|
package/src/animation/zoomOut.ts
CHANGED
|
@@ -16,10 +16,12 @@ export const ZoomOut: AC<ZoomOutOptions> = (options) => {
|
|
|
16
16
|
strokeOpacity = 1,
|
|
17
17
|
opacity = 1,
|
|
18
18
|
} = shape.style;
|
|
19
|
+
const transformOrigin = 'center center';
|
|
19
20
|
const keyframes = [
|
|
20
|
-
{ transform: `${prefix} scale(1)`.trimStart() },
|
|
21
|
+
{ transform: `${prefix} scale(1)`.trimStart(), transformOrigin },
|
|
21
22
|
{
|
|
22
23
|
transform: `${prefix} scale(${ZERO})`.trimStart(),
|
|
24
|
+
transformOrigin,
|
|
23
25
|
fillOpacity,
|
|
24
26
|
strokeOpacity,
|
|
25
27
|
opacity,
|
|
@@ -27,20 +29,15 @@ export const ZoomOut: AC<ZoomOutOptions> = (options) => {
|
|
|
27
29
|
},
|
|
28
30
|
{
|
|
29
31
|
transform: `${prefix} scale(${ZERO})`.trimStart(),
|
|
32
|
+
transformOrigin,
|
|
30
33
|
fillOpacity: 0,
|
|
31
34
|
strokeOpacity: 0,
|
|
32
35
|
opacity: 0,
|
|
33
36
|
},
|
|
34
37
|
];
|
|
35
38
|
|
|
36
|
-
const { width, height } = shape.getBoundingClientRect();
|
|
37
|
-
// Change transform origin for correct transform.
|
|
38
|
-
shape.setOrigin([width / 2, height / 2]);
|
|
39
39
|
const animation = shape.animate(keyframes, { ...defaults, ...options });
|
|
40
40
|
|
|
41
|
-
// Reset transform origin to eliminate side effect for following animations.
|
|
42
|
-
animation.finished.then(() => shape.setOrigin(0, 0));
|
|
43
|
-
|
|
44
41
|
return animation;
|
|
45
42
|
};
|
|
46
43
|
};
|
package/src/component/axis.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
isTranspose,
|
|
26
26
|
radiusOf,
|
|
27
27
|
} from '../utils/coordinate';
|
|
28
|
+
import { prettyNumber } from '../utils/number';
|
|
28
29
|
import { capitalizeFirst } from '../utils/helper';
|
|
29
30
|
import { adaptor, isVertical, titleContent } from './utils';
|
|
30
31
|
|
|
@@ -116,11 +117,6 @@ function ticksOf(
|
|
|
116
117
|
return tickMethod(min, max, tickCount);
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
function prettyNumber(n: number) {
|
|
120
|
-
if (typeof n !== 'number') return n;
|
|
121
|
-
return Math.abs(n) < 1e-15 ? n : parseFloat(n.toFixed(15));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
120
|
// Set inset for axis.
|
|
125
121
|
function createInset(position, coordinate) {
|
|
126
122
|
if (isPolar(coordinate)) return (d) => d;
|
package/src/component/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { LinearAxis as AxisLinear, ArcAxis as AxisArc } from './axis';
|
|
2
2
|
export { AxisX } from './axisX';
|
|
3
3
|
export { AxisY } from './axisY';
|
|
4
|
-
export { AxisZ } from './axisZ';
|
|
5
4
|
export { AxisRadar } from './axisRadar';
|
|
6
5
|
export { LegendCategory } from './legendCategory';
|
|
7
6
|
export { LegendContinuous } from './legendContinuous';
|
|
@@ -161,7 +161,7 @@ function getLinearConfig(
|
|
|
161
161
|
data: scale.getTicks().map((value) => ({ value })),
|
|
162
162
|
color: new Array(Math.floor(length)).fill(0).map((d, i) => {
|
|
163
163
|
const value = ((max - min) / (length - 1)) * i + min;
|
|
164
|
-
const color = scale.map(value);
|
|
164
|
+
const color = scale.map(value) || defaultColor;
|
|
165
165
|
const opacity = opacityScale ? opacityScale.map(value) : 1;
|
|
166
166
|
return color.replace(
|
|
167
167
|
/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,
|
package/src/coordinate/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { Cartesian } from './cartesian';
|
|
2
|
-
export { Cartesian3D } from './cartesian3D';
|
|
3
2
|
export { Polar, getPolarOptions } from './polar';
|
|
4
3
|
export { Helix } from './helix';
|
|
5
4
|
export { Transpose } from './transpose';
|
|
@@ -10,7 +9,6 @@ export { Fisheye } from './fisheye';
|
|
|
10
9
|
export { Radar } from './radar';
|
|
11
10
|
|
|
12
11
|
export type { CartesianOptions } from './cartesian';
|
|
13
|
-
export type { Cartesian3DOptions } from './cartesian3D';
|
|
14
12
|
export type { PolarOptions } from './polar';
|
|
15
13
|
export type { HelixOptions } from './helix';
|
|
16
14
|
export type { TransposeOptions } from './transpose';
|
package/src/exports.ts
CHANGED
|
@@ -27,6 +27,22 @@ export {
|
|
|
27
27
|
|
|
28
28
|
export { ChartEvent } from './utils/event';
|
|
29
29
|
|
|
30
|
-
export type { G2Context } from './runtime';
|
|
31
|
-
|
|
32
30
|
export * from './spec';
|
|
31
|
+
|
|
32
|
+
export type {
|
|
33
|
+
G2Context,
|
|
34
|
+
ShapeComponent,
|
|
35
|
+
MarkComponent,
|
|
36
|
+
GuideComponentComponent,
|
|
37
|
+
SingleMark,
|
|
38
|
+
G2BaseComponent,
|
|
39
|
+
Vector2,
|
|
40
|
+
Vector3,
|
|
41
|
+
Channel,
|
|
42
|
+
} from './runtime';
|
|
43
|
+
export { select, Selection } from './utils/selection';
|
|
44
|
+
export * from './transform';
|
|
45
|
+
export { LinearAxis } from './component/axis';
|
|
46
|
+
export type { AxisOptions } from './component/axis';
|
|
47
|
+
|
|
48
|
+
export { Light, Dark, Academy, Classic, ClassicDark } from './theme';
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { corelib, plotlib, graphlib, geolib, stdlib
|
|
1
|
+
import { corelib, plotlib, graphlib, geolib, stdlib } from './lib';
|
|
2
2
|
import { extend, Runtime } from './api';
|
|
3
3
|
import { API, CompositionAPI } from './api/extend';
|
|
4
4
|
import { G2Spec } from './spec';
|
|
5
5
|
|
|
6
|
-
export { corelib, plotlib, graphlib, geolib, stdlib
|
|
6
|
+
export { corelib, plotlib, graphlib, geolib, stdlib };
|
|
7
7
|
|
|
8
8
|
export * from './exports';
|
|
9
9
|
|
package/src/lib/index.ts
CHANGED
|
@@ -2,7 +2,5 @@ export { corelib } from './core';
|
|
|
2
2
|
export { geolib } from './geo';
|
|
3
3
|
export { graphlib } from './graph';
|
|
4
4
|
export { plotlib } from './plot';
|
|
5
|
-
export { threedlib } from './threed';
|
|
6
5
|
export { stdlib } from './std';
|
|
7
6
|
export { litelib } from './lite';
|
|
8
|
-
export { autolib } from './auto';
|
package/src/mark/index.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
export { Interval } from './interval';
|
|
2
2
|
export { Rect } from './rect';
|
|
3
3
|
export { Line } from './line';
|
|
4
|
-
export { Line3D } from './line3D';
|
|
5
4
|
export { Point } from './point';
|
|
6
|
-
export { Point3D } from './point3D';
|
|
7
|
-
export { Interval3D } from './interval3D';
|
|
8
5
|
export { Text } from './text';
|
|
9
6
|
export { Cell } from './cell';
|
|
10
7
|
export { Area } from './area';
|
|
@@ -32,7 +29,6 @@ export { Gauge } from './gauge';
|
|
|
32
29
|
export { Density } from './density';
|
|
33
30
|
export { Heatmap } from './heatmap';
|
|
34
31
|
export { Liquid } from './liquid';
|
|
35
|
-
export { Auto } from './auto';
|
|
36
32
|
|
|
37
33
|
export type { IntervalOptions } from './interval';
|
|
38
34
|
export type { RectOptions } from './rect';
|
package/src/mark/liquid.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { deepMix, isNumber } from '@antv/util';
|
|
2
2
|
import { subObject } from '../utils/helper';
|
|
3
|
+
import { prettyNumber } from '../utils/number';
|
|
3
4
|
import { CompositeMarkComponent as CC } from '../runtime';
|
|
4
5
|
import { LiquidMark } from '../spec';
|
|
5
6
|
import { LiquidShape } from '../shape';
|
|
@@ -89,7 +90,7 @@ export const Liquid: CC<LiquidOptions> = (options) => {
|
|
|
89
90
|
}),
|
|
90
91
|
deepMix({}, DEFAULT_TEXT_OPTIONS, {
|
|
91
92
|
style: {
|
|
92
|
-
text: `${percent * 100} %`,
|
|
93
|
+
text: `${prettyNumber(percent * 100)} %`,
|
|
93
94
|
...textStyle,
|
|
94
95
|
},
|
|
95
96
|
animate,
|
package/src/runtime/component.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
type RadialOptions,
|
|
14
14
|
} from '../coordinate';
|
|
15
15
|
import { combine } from '../utils/array';
|
|
16
|
+
import { prettyNumber } from '../utils/number';
|
|
16
17
|
import { capitalizeFirst, defined, subObject } from '../utils/helper';
|
|
17
18
|
import { LEGEND_INFER_STRATEGIES } from '../component/constant';
|
|
18
19
|
import {
|
|
@@ -1115,7 +1116,3 @@ function normalizeLabel(d: string | DisplayObject): DisplayObject {
|
|
|
1115
1116
|
if (d instanceof DisplayObject) return d;
|
|
1116
1117
|
return new Text({ style: { text: `${d}` } });
|
|
1117
1118
|
}
|
|
1118
|
-
|
|
1119
|
-
function prettyNumber(n: number) {
|
|
1120
|
-
return Math.abs(n) < 1e-15 ? n : parseFloat(n.toFixed(15));
|
|
1121
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Coordinate, Transformation
|
|
1
|
+
import { Coordinate, Transformation } from '@antv/coord';
|
|
2
2
|
import EventEmitter from '@antv/event-emitter';
|
|
3
3
|
import { DisplayObject, IAnimation as GAnimation, IDocument } from '@antv/g';
|
|
4
4
|
import {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { DataComponent } from './data';
|
|
15
15
|
import { Encode, EncodeComponent } from './encode';
|
|
16
16
|
import { Mark, MarkComponent } from './mark';
|
|
17
|
-
import { G2ViewTree, G2Library, G2Mark
|
|
17
|
+
import { G2ViewTree, G2Library, G2Mark } from './options';
|
|
18
18
|
import { Transform, TransformComponent } from './transform';
|
|
19
19
|
|
|
20
20
|
export type G2ComponentNamespaces =
|
|
@@ -116,13 +116,6 @@ export type CoordinateComponent<O = Record<string, unknown>> = G2BaseComponent<
|
|
|
116
116
|
CoordinateProps
|
|
117
117
|
>;
|
|
118
118
|
|
|
119
|
-
export type Coordinate3DTransform = Transformation3D[];
|
|
120
|
-
export type Coordinate3DProps = {
|
|
121
|
-
transform?: boolean;
|
|
122
|
-
};
|
|
123
|
-
export type Coordinate3DComponent<O = Record<string, unknown>> =
|
|
124
|
-
G2BaseComponent<Coordinate3DTransform, O, Coordinate3DProps>;
|
|
125
|
-
|
|
126
119
|
export type Palette = string[];
|
|
127
120
|
export type PaletteComponent<O = Record<string, unknown>> = G2BaseComponent<
|
|
128
121
|
Palette,
|
package/src/shape/index.ts
CHANGED
|
@@ -10,7 +10,6 @@ export { HV as LineHV } from './line/hv';
|
|
|
10
10
|
export { VH as LineVH } from './line/vh';
|
|
11
11
|
export { HVH as LineHVH } from './line/hvh';
|
|
12
12
|
export { Trail as LineTrail } from './line/trail';
|
|
13
|
-
export { Line as Line3DShape } from './line3D/line';
|
|
14
13
|
export { HollowBowtie as PointHollowBowtie } from './point/hollowBowtie';
|
|
15
14
|
export { HollowDiamond as PointHollowDiamond } from './point/hollowDiamond';
|
|
16
15
|
export { HollowHexagon as PointHollowHexagon } from './point/hollowHexagon';
|
|
@@ -30,9 +29,6 @@ export { Square as PointSquare } from './point/square';
|
|
|
30
29
|
export { Tick as PointTick } from './point/tick';
|
|
31
30
|
export { Triangle as PointTriangle } from './point/triangle';
|
|
32
31
|
export { TriangleDown as PointTriangleDown } from './point/triangleDown';
|
|
33
|
-
export { Sphere } from './point3D/sphere';
|
|
34
|
-
export { Cube } from './point3D/cube';
|
|
35
|
-
export { Cube as IntervalCube } from './interval3D/cube';
|
|
36
32
|
export { Vector as VectorShape } from './vector/vector';
|
|
37
33
|
export { Text as TextShape } from './text/text';
|
|
38
34
|
export { Badge as TextBadge } from './text/badge';
|