@antv/g2 5.0.0-alpha.4 → 5.0.0-beta.2
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 +29 -27
- package/dist/g2-lite.min.js +2 -2
- package/dist/g2.min.js +2 -2
- package/esm/animation/morphing.js +10 -8
- package/esm/animation/morphing.js.map +1 -1
- package/esm/api/chart.js +2 -5
- package/esm/api/chart.js.map +1 -1
- package/esm/component/axis.d.ts +1 -2
- package/esm/component/axis.js +81 -198
- package/esm/component/axis.js.map +1 -1
- package/esm/component/legendCategory.d.ts +0 -1
- package/esm/component/legendCategory.js +36 -49
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/legendContinuous.js +29 -19
- package/esm/component/legendContinuous.js.map +1 -1
- package/esm/component/utils.d.ts +1 -0
- package/esm/component/utils.js +3 -0
- package/esm/component/utils.js.map +1 -1
- package/esm/composition/facetRect.js +2 -4
- package/esm/composition/facetRect.js.map +1 -1
- package/esm/composition/repeatMatrix.js +2 -2
- package/esm/composition/repeatMatrix.js.map +1 -1
- package/esm/interaction/action/service/legendItemSelection.js.map +1 -1
- package/esm/interaction/action/transformer/setItemState.js.map +1 -1
- package/esm/mark/cell.js +1 -1
- package/esm/mark/pack.js +2 -2
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/sankey.js +1 -0
- package/esm/mark/sankey.js.map +1 -1
- package/esm/mark/treemap.js +2 -2
- package/esm/mark/treemap.js.map +1 -1
- package/esm/mark/wordCloud.js +2 -2
- package/esm/mark/wordCloud.js.map +1 -1
- package/esm/shape/area/curve.js +2 -9
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/interval/color.js +2 -2
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/line/curve.js +23 -12
- package/esm/shape/line/curve.js.map +1 -1
- package/esm/shape/line/line.js +6 -2
- package/esm/shape/line/line.js.map +1 -1
- package/esm/shape/line/smooth.js +6 -2
- package/esm/shape/line/smooth.js.map +1 -1
- package/esm/shape/text/advance.js +2 -2
- package/esm/shape/text/advance.js.map +1 -1
- package/esm/shape/utils.d.ts +1 -0
- package/esm/shape/utils.js +8 -1
- package/esm/shape/utils.js.map +1 -1
- package/esm/spec/geometry.d.ts +2 -2
- package/esm/spec/transform.d.ts +10 -2
- package/esm/stdlib/index.js +2 -2
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/dark.js +78 -65
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/light.js +84 -74
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/groupN.js +2 -0
- package/esm/transform/groupN.js.map +1 -1
- package/esm/transform/index.d.ts +8 -6
- package/esm/transform/index.js +4 -3
- package/esm/transform/index.js.map +1 -1
- package/esm/transform/sample.d.ts +8 -0
- package/esm/transform/sample.js +48 -0
- package/esm/transform/sample.js.map +1 -0
- package/esm/transform/{Select.d.ts → select.d.ts} +0 -0
- package/esm/transform/{Select.js → select.js} +1 -1
- package/esm/transform/{Select.js.map → select.js.map} +1 -1
- package/esm/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/esm/transform/{SelectX.js → selectX.js} +1 -1
- package/esm/transform/{SelectX.js.map → selectX.js.map} +1 -1
- package/esm/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- package/esm/transform/{SelectY.js → selectY.js} +1 -1
- package/esm/transform/{SelectY.js.map → selectY.js.map} +1 -1
- package/esm/transform/sort.d.ts +1 -1
- package/esm/transform/sort.js +39 -21
- package/esm/transform/sort.js.map +1 -1
- package/lib/animation/morphing.js +10 -8
- package/lib/animation/morphing.js.map +1 -1
- package/lib/api/chart.js +2 -5
- package/lib/api/chart.js.map +1 -1
- package/lib/component/axis.d.ts +1 -2
- package/lib/component/axis.js +80 -197
- package/lib/component/axis.js.map +1 -1
- package/lib/component/legendCategory.d.ts +0 -1
- package/lib/component/legendCategory.js +36 -49
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/legendContinuous.js +29 -19
- package/lib/component/legendContinuous.js.map +1 -1
- package/lib/component/utils.d.ts +1 -0
- package/lib/component/utils.js +5 -1
- package/lib/component/utils.js.map +1 -1
- package/lib/composition/facetRect.js +2 -4
- package/lib/composition/facetRect.js.map +1 -1
- package/lib/composition/repeatMatrix.js +2 -2
- package/lib/composition/repeatMatrix.js.map +1 -1
- package/lib/interaction/action/service/legendItemSelection.js.map +1 -1
- package/lib/interaction/action/transformer/setItemState.js.map +1 -1
- package/lib/mark/cell.js +1 -1
- package/lib/mark/pack.js +2 -2
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/sankey.js +1 -0
- package/lib/mark/sankey.js.map +1 -1
- package/lib/mark/treemap.js +2 -2
- package/lib/mark/treemap.js.map +1 -1
- package/lib/mark/wordCloud.js +2 -2
- package/lib/mark/wordCloud.js.map +1 -1
- package/lib/shape/area/curve.js +2 -9
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/interval/color.js +2 -2
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/line/curve.js +21 -10
- package/lib/shape/line/curve.js.map +1 -1
- package/lib/shape/line/line.js +5 -1
- package/lib/shape/line/line.js.map +1 -1
- package/lib/shape/line/smooth.js +5 -1
- package/lib/shape/line/smooth.js.map +1 -1
- package/lib/shape/text/advance.js +2 -2
- package/lib/shape/text/advance.js.map +1 -1
- package/lib/shape/utils.d.ts +1 -0
- package/lib/shape/utils.js +9 -1
- package/lib/shape/utils.js.map +1 -1
- package/lib/spec/geometry.d.ts +2 -2
- package/lib/spec/transform.d.ts +10 -2
- package/lib/stdlib/index.js +1 -1
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/dark.js +78 -65
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/light.js +84 -74
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/groupN.js +2 -0
- package/lib/transform/groupN.js.map +1 -1
- package/lib/transform/index.d.ts +8 -6
- package/lib/transform/index.js +9 -7
- package/lib/transform/index.js.map +1 -1
- package/lib/transform/sample.d.ts +8 -0
- package/lib/transform/sample.js +52 -0
- package/lib/transform/sample.js.map +1 -0
- package/lib/transform/{Select.d.ts → select.d.ts} +0 -0
- package/lib/transform/{Select.js → select.js} +1 -1
- package/lib/transform/{Select.js.map → select.js.map} +1 -1
- package/lib/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/lib/transform/{SelectX.js → selectX.js} +1 -1
- package/lib/transform/{SelectX.js.map → selectX.js.map} +1 -1
- package/lib/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- package/lib/transform/{SelectY.js → selectY.js} +1 -1
- package/lib/transform/{SelectY.js.map → selectY.js.map} +1 -1
- package/lib/transform/sort.d.ts +1 -1
- package/lib/transform/sort.js +38 -20
- package/lib/transform/sort.js.map +1 -1
- package/package.json +3 -3
- package/src/animation/morphing.ts +12 -8
- package/src/api/chart.ts +2 -5
- package/src/component/axis.ts +233 -310
- package/src/component/legendCategory.ts +52 -68
- package/src/component/legendContinuous.ts +24 -25
- package/src/component/utils.ts +4 -0
- package/src/composition/facetRect.ts +2 -4
- package/src/composition/repeatMatrix.ts +2 -2
- package/src/interaction/action/service/legendItemSelection.ts +1 -2
- package/src/interaction/action/transformer/setItemState.ts +2 -3
- package/src/mark/cell.ts +1 -1
- package/src/mark/pack.ts +1 -0
- package/src/mark/sankey.ts +1 -0
- package/src/mark/treemap.ts +1 -0
- package/src/mark/wordCloud.ts +1 -0
- package/src/shape/area/curve.ts +7 -9
- package/src/shape/interval/color.ts +7 -7
- package/src/shape/line/curve.ts +27 -12
- package/src/shape/line/line.ts +6 -2
- package/src/shape/line/smooth.ts +11 -2
- package/src/shape/text/advance.ts +2 -2
- package/src/shape/utils.ts +8 -1
- package/src/spec/geometry.ts +2 -1
- package/src/spec/transform.ts +10 -1
- package/src/stdlib/index.ts +2 -0
- package/src/theme/dark.ts +78 -66
- package/src/theme/light.ts +84 -75
- package/src/transform/groupN.ts +2 -0
- package/src/transform/index.ts +8 -6
- package/src/transform/sample.ts +45 -0
- package/src/transform/sort.ts +53 -21
package/lib/transform/sort.js
CHANGED
|
@@ -36,31 +36,49 @@ function createReducer(channel, options, encode) {
|
|
|
36
36
|
return (GI) => V[GI[GI.length - 1]];
|
|
37
37
|
throw new Error(`Unknown reducer: ${reducer}`);
|
|
38
38
|
}
|
|
39
|
+
function sortQuantitative(I, mark, options) {
|
|
40
|
+
const { reverse, slice, channel } = options;
|
|
41
|
+
const { encode } = mark;
|
|
42
|
+
const [V] = (0, helper_1.columnOf)(encode, channel);
|
|
43
|
+
const sortedI = (0, d3_array_1.sort)(I, (i) => V[i]);
|
|
44
|
+
if (reverse)
|
|
45
|
+
sortedI.reverse();
|
|
46
|
+
// const s = typeof slice === 'number' ? [0, slice] : slice;
|
|
47
|
+
return [sortedI, mark];
|
|
48
|
+
}
|
|
49
|
+
function sortOrdinal(I, mark, options) {
|
|
50
|
+
const { reverse, slice, channel } = options, rest = __rest(options, ["reverse", "slice", "channel"]);
|
|
51
|
+
const { encode } = mark;
|
|
52
|
+
const [T] = (0, helper_1.columnOf)(encode, channel);
|
|
53
|
+
const normalizeReducer = createReducer(channel, rest, encode);
|
|
54
|
+
const sortedDomain = (0, d3_array_1.groupSort)(I, normalizeReducer, (i) => T[i]);
|
|
55
|
+
if (reverse)
|
|
56
|
+
sortedDomain.reverse();
|
|
57
|
+
const s = typeof slice === 'number' ? [0, slice] : slice;
|
|
58
|
+
const slicedDomain = slice ? sortedDomain.slice(...s) : sortedDomain;
|
|
59
|
+
return [
|
|
60
|
+
I,
|
|
61
|
+
(0, util_1.deepMix)(mark, {
|
|
62
|
+
scale: {
|
|
63
|
+
[channel]: {
|
|
64
|
+
domain: slicedDomain,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
];
|
|
69
|
+
}
|
|
39
70
|
/**
|
|
40
71
|
* Sort marks groups by groups.
|
|
41
|
-
* @todo Add more reducers: first, last, etc,.
|
|
42
72
|
*/
|
|
43
73
|
const Sort = (options = {}) => {
|
|
44
|
-
const { reverse = false, slice, channel } = options, rest = __rest(options, ["reverse", "slice", "channel"]);
|
|
74
|
+
const { reverse = false, slice, channel, ordinal = true } = options, rest = __rest(options, ["reverse", "slice", "channel", "ordinal"]);
|
|
45
75
|
return (I, mark) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const s = typeof slice === 'number' ? [0, slice] : slice;
|
|
53
|
-
const slicedDomain = slice ? sortedDomain.slice(...s) : sortedDomain;
|
|
54
|
-
return [
|
|
55
|
-
I,
|
|
56
|
-
(0, util_1.deepMix)(mark, {
|
|
57
|
-
scale: {
|
|
58
|
-
[channel]: {
|
|
59
|
-
domain: slicedDomain,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
}),
|
|
63
|
-
];
|
|
76
|
+
if (!ordinal) {
|
|
77
|
+
return sortQuantitative(I, mark, Object.assign({ reverse,
|
|
78
|
+
slice,
|
|
79
|
+
channel }, rest));
|
|
80
|
+
}
|
|
81
|
+
return sortOrdinal(I, mark, Object.assign({ reverse, slice, channel }, rest));
|
|
64
82
|
};
|
|
65
83
|
};
|
|
66
84
|
exports.Sort = Sort;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort.js","sourceRoot":"src/","sources":["transform/sort.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"sort.js","sourceRoot":"src/","sources":["transform/sort.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,uCASkB;AAElB,2CAA0C;AAE1C,SAAS,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM;IAC7C,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAClD,MAAM,CAAC,CAAC,CAAC,GAAG,IAAA,iBAAQ,EAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACj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AK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACzD,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IACrE,OAAO;QACL,CAAC;QACD,IAAA,cAAO,EAAC,IAAI,EAAE;YACZ,KAAK,EAAE;gBACL,CAAC,OAAO,CAAC,EAAE;oBACT,MAAM,EAAE,YAAY;iBACrB;aACF;SACF,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACI,MAAM,IAAI,GAAoB,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE;IACpD,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,KAAc,OAAO,EAAhB,IAAI,UAAK,OAAO,EAAtE,0CAA4D,CAAU,CAAC;IAC7E,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;QACjB,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,gBAAgB,CAAC,CAAC,EAAE,IAAI,kBAC7B,OAAO;gBACP,KAAK;gBACL,OAAO,IACJ,IAAI,EACP,CAAC;SACJ;QACD,OAAO,WAAW,CAAC,CAAC,EAAE,IAAI,kBAAI,OAAO,EAAE,KAAK,EAAE,OAAO,IAAK,IAAI,EAAG,CAAC;IACpE,CAAC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,IAAI,QAaf;AAEF,YAAI,CAAC,KAAK,GAAG,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g2",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-beta.2",
|
|
4
4
|
"description": "the Grammar of Graphics in Javascript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"build": "run-p build:*",
|
|
30
30
|
"bundle-vis": "cross-env BUNDLE_VIS=1 run-p build:umd",
|
|
31
31
|
"ci": "run-s lint test build",
|
|
32
|
-
"prepublishOnly": "",
|
|
32
|
+
"prepublishOnly": "npm run ci",
|
|
33
33
|
"prepare": "husky install"
|
|
34
34
|
},
|
|
35
35
|
"keywords": [
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@antv/g": "^5.7.4",
|
|
124
124
|
"@antv/g-canvas": "^1.7.4",
|
|
125
125
|
"@antv/g-plugin-dragndrop": "^1.6.1",
|
|
126
|
-
"@antv/gui": "0.4.3-alpha.
|
|
126
|
+
"@antv/gui": "^0.4.3-alpha.53",
|
|
127
127
|
"@antv/path-util": "^3.0.1",
|
|
128
128
|
"@antv/scale": "^0.4.7",
|
|
129
129
|
"@antv/util": "^2.0.17",
|
|
@@ -73,23 +73,27 @@ function shapeToShape(
|
|
|
73
73
|
timeEffect: Record<string, any>,
|
|
74
74
|
): GAnimation {
|
|
75
75
|
const [x0, y0, w0, h0] = localBBoxOf(from);
|
|
76
|
+
|
|
77
|
+
// Replace first to get right bbox after mounting.
|
|
78
|
+
replaceChild(to, from);
|
|
79
|
+
|
|
80
|
+
// Apply translate and scale transform.
|
|
76
81
|
const [x1, y1, w1, h1] = localBBoxOf(to);
|
|
77
|
-
const dx =
|
|
78
|
-
const dy =
|
|
79
|
-
const sx =
|
|
80
|
-
const sy =
|
|
82
|
+
const dx = x0 - x1;
|
|
83
|
+
const dy = y0 - y1;
|
|
84
|
+
const sx = w0 / w1;
|
|
85
|
+
const sy = h0 / h1;
|
|
81
86
|
const keyframes = [
|
|
82
87
|
{
|
|
83
|
-
transform: `translate(
|
|
88
|
+
transform: `translate(${dx}, ${dy}) scale(${sx}, ${sy})`,
|
|
84
89
|
...attributeOf(from, attributeKeys),
|
|
85
90
|
},
|
|
86
91
|
{
|
|
87
|
-
transform: `translate(
|
|
92
|
+
transform: `translate(0, 0) scale(1, 1)`,
|
|
88
93
|
...attributeOf(to, attributeKeys),
|
|
89
94
|
},
|
|
90
95
|
];
|
|
91
|
-
const animation =
|
|
92
|
-
animation.finished.then(() => replaceChild(to, from));
|
|
96
|
+
const animation = to.animate(keyframes, timeEffect);
|
|
93
97
|
return animation;
|
|
94
98
|
}
|
|
95
99
|
|
package/src/api/chart.ts
CHANGED
|
@@ -192,7 +192,7 @@ export class Chart extends Node<ChartOptions> {
|
|
|
192
192
|
|
|
193
193
|
// Create canvas if it does not exist.
|
|
194
194
|
this._context.canvas = Canvas(
|
|
195
|
-
|
|
195
|
+
this._container,
|
|
196
196
|
width,
|
|
197
197
|
height,
|
|
198
198
|
renderer,
|
|
@@ -200,10 +200,7 @@ export class Chart extends Node<ChartOptions> {
|
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
if (node.parentNode !== this._container) {
|
|
205
|
-
this._container.append(node);
|
|
206
|
-
}
|
|
203
|
+
render(this.options(), this._context);
|
|
207
204
|
|
|
208
205
|
return this;
|
|
209
206
|
}
|