@visactor/vchart 1.6.0 → 1.6.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/build/es5/index.js +1 -1
- package/build/index.js +400 -399
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/map/map.js +1 -0
- package/cjs/chart/map/map.js.map +1 -1
- package/cjs/chart/stack.js +2 -1
- package/cjs/compile/grammar-item.js +1 -2
- package/cjs/compile/mark/compilable-mark.js +2 -2
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -1
- package/cjs/component/axis/base-axis.js +3 -2
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +25 -12
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/time-axis.d.ts +1 -1
- package/cjs/component/axis/cartesian/time-axis.js +4 -4
- package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js +2 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js +4 -2
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +1 -1
- package/cjs/component/axis/polar/axis.js +14 -8
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/axis/polar/band-axis.d.ts +1 -1
- package/cjs/component/axis/polar/band-axis.js +2 -1
- package/cjs/component/axis/polar/band-axis.js.map +1 -1
- package/cjs/component/label/interface.d.ts +5 -1
- package/cjs/component/label/interface.js.map +1 -1
- package/cjs/component/label/util.d.ts +2 -1
- package/cjs/component/label/util.js +3 -1
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +1 -1
- package/cjs/component/tooltip/handler/base.js +6 -4
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/layout/grid-layout/grid-layout.js +4 -4
- package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
- package/cjs/series/heatmap/heatmap.js +4 -3
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/series/pie/pie.js +3 -3
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/util/math.js +10 -2
- package/cjs/util/math.js.map +1 -1
- package/esm/chart/map/map.js +1 -0
- package/esm/chart/map/map.js.map +1 -1
- package/esm/chart/stack.js +2 -1
- package/esm/compile/grammar-item.js +1 -2
- package/esm/compile/mark/compilable-mark.js +2 -2
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -1
- package/esm/component/axis/base-axis.js +4 -3
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +23 -10
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/time-axis.d.ts +1 -1
- package/esm/component/axis/cartesian/time-axis.js +4 -4
- package/esm/component/axis/cartesian/time-axis.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.js +2 -1
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js +4 -2
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +1 -1
- package/esm/component/axis/polar/axis.js +13 -8
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/axis/polar/band-axis.d.ts +1 -1
- package/esm/component/axis/polar/band-axis.js +2 -1
- package/esm/component/axis/polar/band-axis.js.map +1 -1
- package/esm/component/label/interface.d.ts +5 -1
- package/esm/component/label/interface.js.map +1 -1
- package/esm/component/label/util.d.ts +2 -1
- package/esm/component/label/util.js +3 -1
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +1 -1
- package/esm/component/tooltip/handler/base.js +6 -4
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/layout/grid-layout/grid-layout.js +4 -4
- package/esm/layout/grid-layout/grid-layout.js.map +1 -1
- package/esm/series/heatmap/heatmap.js +3 -1
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/series/pie/pie.js +3 -3
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/util/math.js +10 -2
- package/esm/util/math.js.map +1 -1
- package/package.json +16 -16
package/build/index.js
CHANGED
|
@@ -7674,9 +7674,6 @@
|
|
|
7674
7674
|
return encoder.scale && (dependencies = isGrammar(encoder.scale) ? [encoder.scale] : array(view.getScaleById(encoder.scale))), dependencies.concat(parseFunctionType(encoder, view));
|
|
7675
7675
|
}
|
|
7676
7676
|
|
|
7677
|
-
function parseXY(val) {
|
|
7678
|
-
return null === val ? 0 : val;
|
|
7679
|
-
}
|
|
7680
7677
|
function isValidPointsChannel(channels, markType) {
|
|
7681
7678
|
switch (markType) {
|
|
7682
7679
|
case "line":
|
|
@@ -7710,8 +7707,8 @@
|
|
|
7710
7707
|
return items.some(item => isValidPointsChannel(Object.keys(item.nextAttrs), "line")) ? items.map((item, index) => {
|
|
7711
7708
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
7712
7709
|
const attrs = item.nextAttrs,
|
|
7713
|
-
x =
|
|
7714
|
-
y =
|
|
7710
|
+
x = null !== (_a = attrs.x) && void 0 !== _a ? _a : null === (_b = null == lastPoints ? void 0 : lastPoints[index]) || void 0 === _b ? void 0 : _b.x,
|
|
7711
|
+
y = null !== (_c = attrs.y) && void 0 !== _c ? _c : null === (_d = null == lastPoints ? void 0 : lastPoints[index]) || void 0 === _d ? void 0 : _d.y,
|
|
7715
7712
|
defined = null !== (_e = attrs.defined) && void 0 !== _e ? _e : null === (_f = null == lastPoints ? void 0 : lastPoints[index]) || void 0 === _f ? void 0 : _f.defined,
|
|
7716
7713
|
point = {
|
|
7717
7714
|
x: x,
|
|
@@ -7719,8 +7716,8 @@
|
|
|
7719
7716
|
context: item.key
|
|
7720
7717
|
};
|
|
7721
7718
|
if (isArea) {
|
|
7722
|
-
const x1 =
|
|
7723
|
-
y1 =
|
|
7719
|
+
const x1 = null !== (_g = attrs.x1) && void 0 !== _g ? _g : null === (_h = null == lastPoints ? void 0 : lastPoints[index]) || void 0 === _h ? void 0 : _h.x1,
|
|
7720
|
+
y1 = null !== (_j = attrs.y1) && void 0 !== _j ? _j : null === (_k = null == lastPoints ? void 0 : lastPoints[index]) || void 0 === _k ? void 0 : _k.y1;
|
|
7724
7721
|
point.x1 = x1, point.y1 = y1;
|
|
7725
7722
|
}
|
|
7726
7723
|
return !1 === defined && (point.defined = !1), point;
|
|
@@ -7732,10 +7729,10 @@
|
|
|
7732
7729
|
return items.forEach((item, index) => {
|
|
7733
7730
|
var _a, _b, _c, _d;
|
|
7734
7731
|
const attrs = item.nextAttrs,
|
|
7735
|
-
x =
|
|
7736
|
-
y =
|
|
7737
|
-
width =
|
|
7738
|
-
y1 =
|
|
7732
|
+
x = null !== (_a = attrs.x) && void 0 !== _a ? _a : null == lastPoints ? void 0 : lastPoints[4 * index],
|
|
7733
|
+
y = null !== (_b = attrs.y) && void 0 !== _b ? _b : null == lastPoints ? void 0 : lastPoints[4 * index + 1],
|
|
7734
|
+
width = null !== (_c = attrs.width) && void 0 !== _c ? _c : null == lastPoints ? void 0 : lastPoints[4 * index + 2],
|
|
7735
|
+
y1 = null !== (_d = attrs.y1) && void 0 !== _d ? _d : null == lastPoints ? void 0 : lastPoints[4 * index + 3];
|
|
7739
7736
|
arr[4 * index] = x, arr[4 * index + 1] = y, arr[4 * index + 2] = width, arr[4 * index + 3] = y1 - y;
|
|
7740
7737
|
}), arr;
|
|
7741
7738
|
}
|
|
@@ -7745,191 +7742,11 @@
|
|
|
7745
7742
|
return items.forEach((item, index) => {
|
|
7746
7743
|
var _a, _b;
|
|
7747
7744
|
const attrs = item.nextAttrs,
|
|
7748
|
-
x =
|
|
7749
|
-
y =
|
|
7745
|
+
x = null !== (_a = attrs.x) && void 0 !== _a ? _a : null == lastPoints ? void 0 : lastPoints[2 * index],
|
|
7746
|
+
y = null !== (_b = attrs.y) && void 0 !== _b ? _b : null == lastPoints ? void 0 : lastPoints[2 * index + 1];
|
|
7750
7747
|
arr[2 * index] = x, arr[2 * index + 1] = y;
|
|
7751
7748
|
}), arr;
|
|
7752
7749
|
}
|
|
7753
|
-
|
|
7754
|
-
const commonAttributes = ["fillOpacity", "x", "y", "dx", "dy"];
|
|
7755
|
-
const transformCommonAttribute = (graphicAttributes, changedKey, nextAttrs) => {
|
|
7756
|
-
var _a;
|
|
7757
|
-
return "fillOpacity" === changedKey ? (graphicAttributes.fillOpacity = null !== (_a = nextAttrs.fillOpacity) && void 0 !== _a ? _a : 1, ["fillOpacity"]) : "x" === changedKey ? (graphicAttributes.x = parseXY(nextAttrs.x), ["x"]) : "y" === changedKey ? (graphicAttributes.y = parseXY(nextAttrs.y), ["y"]) : "dx" === changedKey ? (graphicAttributes.dx = parseXY(nextAttrs.dx), ["dx"]) : "dy" === changedKey ? (graphicAttributes.dy = parseXY(nextAttrs.dy), ["dy"]) : [];
|
|
7758
|
-
};
|
|
7759
|
-
|
|
7760
|
-
function isPointsMarkType(markType) {
|
|
7761
|
-
return [GrammarMarkType.line, GrammarMarkType.area, GrammarMarkType.largeRects, GrammarMarkType.largeSymbols].includes(markType);
|
|
7762
|
-
}
|
|
7763
|
-
function storeOriginAttributes(name, channels, graphicAttributes, nextAttrs, element, markName) {
|
|
7764
|
-
var _a;
|
|
7765
|
-
const prevStoredAttrs = null !== (_a = element.getGraphicAttribute(name, !1, markName)) && void 0 !== _a ? _a : {},
|
|
7766
|
-
storedAttrs = {};
|
|
7767
|
-
return channels.forEach(channel => {
|
|
7768
|
-
var _a;
|
|
7769
|
-
storedAttrs[channel] = null !== (_a = nextAttrs[channel]) && void 0 !== _a ? _a : prevStoredAttrs[channel];
|
|
7770
|
-
}), graphicAttributes[name] = storedAttrs, storedAttrs;
|
|
7771
|
-
}
|
|
7772
|
-
const transformsByType = {
|
|
7773
|
-
[GrammarMarkType.largeRects]: [{
|
|
7774
|
-
channels: ["x", "y", "y1", "x1", "width", "height"],
|
|
7775
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7776
|
-
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
7777
|
-
}
|
|
7778
|
-
}],
|
|
7779
|
-
[GrammarMarkType.largeSymbols]: [{
|
|
7780
|
-
channels: ["x", "y", "size"],
|
|
7781
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7782
|
-
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
7783
|
-
}
|
|
7784
|
-
}],
|
|
7785
|
-
[GrammarMarkType.area]: [{
|
|
7786
|
-
channels: ["x", "y", "x1", "y1"],
|
|
7787
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7788
|
-
graphicAttributes.x = 0, graphicAttributes.y = 0, graphicAttributes.x1 = 0, graphicAttributes.y1 = 0;
|
|
7789
|
-
}
|
|
7790
|
-
}],
|
|
7791
|
-
[GrammarMarkType.line]: [{
|
|
7792
|
-
channels: ["x", "y", "defined", "enableSegments"],
|
|
7793
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7794
|
-
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
7795
|
-
}
|
|
7796
|
-
}],
|
|
7797
|
-
[GrammarMarkType.rect]: [{
|
|
7798
|
-
channels: ["x", "y", "x1", "y1", "width", "height"],
|
|
7799
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7800
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7801
|
-
isValidNumber$1(nextAttrs.width) || !isValidNumber$1(nextAttrs.x1) && isValidNumber$1(storedAttrs.width) ? (graphicAttributes.x = Math.min(null !== (_a = storedAttrs.x) && void 0 !== _a ? _a : 0, null !== (_b = storedAttrs.x1) && void 0 !== _b ? _b : 1 / 0), graphicAttributes.width = storedAttrs.width) : isValidNumber$1(nextAttrs.x1) || !isValidNumber$1(nextAttrs.width) && isValidNumber$1(storedAttrs.x1) ? (graphicAttributes.x = Math.min(storedAttrs.x, storedAttrs.x1), graphicAttributes.width = Math.abs(storedAttrs.x1 - storedAttrs.x)) : (graphicAttributes.x = Math.min(null !== (_c = storedAttrs.x) && void 0 !== _c ? _c : 0, null !== (_d = storedAttrs.x1) && void 0 !== _d ? _d : 1 / 0), graphicAttributes.width = storedAttrs.width), isValidNumber$1(nextAttrs.height) || !isValidNumber$1(nextAttrs.y1) && isValidNumber$1(storedAttrs.height) ? (graphicAttributes.y = Math.min(null !== (_e = storedAttrs.y) && void 0 !== _e ? _e : 0, null !== (_f = storedAttrs.y1) && void 0 !== _f ? _f : 1 / 0), graphicAttributes.height = storedAttrs.height) : isValidNumber$1(nextAttrs.y1) || !isValidNumber$1(nextAttrs.height) && isValidNumber$1(storedAttrs.y1) ? (graphicAttributes.y = Math.min(storedAttrs.y, storedAttrs.y1), graphicAttributes.height = Math.abs(storedAttrs.y1 - storedAttrs.y)) : (graphicAttributes.y = Math.min(null !== (_g = storedAttrs.y) && void 0 !== _g ? _g : 0, null !== (_h = storedAttrs.y1) && void 0 !== _h ? _h : 1 / 0), graphicAttributes.height = storedAttrs.height);
|
|
7802
|
-
},
|
|
7803
|
-
storedAttrs: "sizeAttrs"
|
|
7804
|
-
}],
|
|
7805
|
-
rect3d: [{
|
|
7806
|
-
channels: ["x", "y", "z", "x1", "y1", "width", "height", "length"],
|
|
7807
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7808
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
7809
|
-
isValidNumber$1(nextAttrs.width) || !isValidNumber$1(nextAttrs.x1) && isValidNumber$1(storedAttrs.width) ? (graphicAttributes.x = Math.min(null !== (_a = storedAttrs.x) && void 0 !== _a ? _a : 0, null !== (_b = storedAttrs.x1) && void 0 !== _b ? _b : 1 / 0), graphicAttributes.width = storedAttrs.width) : isValidNumber$1(nextAttrs.x1) || !isValidNumber$1(nextAttrs.width) && isValidNumber$1(storedAttrs.x1) ? (graphicAttributes.x = Math.min(storedAttrs.x, storedAttrs.x1), graphicAttributes.width = Math.abs(storedAttrs.x1 - storedAttrs.x)) : (graphicAttributes.x = Math.min(null !== (_c = storedAttrs.x) && void 0 !== _c ? _c : 0, null !== (_d = storedAttrs.x1) && void 0 !== _d ? _d : 1 / 0), graphicAttributes.width = storedAttrs.width), isValidNumber$1(nextAttrs.height) || !isValidNumber$1(nextAttrs.y1) && isValidNumber$1(storedAttrs.height) ? (graphicAttributes.y = Math.min(null !== (_e = storedAttrs.y) && void 0 !== _e ? _e : 0, null !== (_f = storedAttrs.y1) && void 0 !== _f ? _f : 1 / 0), graphicAttributes.height = storedAttrs.height) : isValidNumber$1(nextAttrs.y1) || !isValidNumber$1(nextAttrs.height) && isValidNumber$1(storedAttrs.y1) ? (graphicAttributes.y = Math.min(storedAttrs.y, storedAttrs.y1), graphicAttributes.height = Math.abs(storedAttrs.y1 - storedAttrs.y)) : (graphicAttributes.y = Math.min(null !== (_g = storedAttrs.y) && void 0 !== _g ? _g : 0, null !== (_h = storedAttrs.y1) && void 0 !== _h ? _h : 1 / 0), graphicAttributes.height = storedAttrs.height), isValidNumber$1(nextAttrs.length) || !isValidNumber$1(nextAttrs.z1) && isValidNumber$1(storedAttrs.length) ? (graphicAttributes.z = Math.min(null !== (_j = storedAttrs.z) && void 0 !== _j ? _j : 0, null !== (_k = storedAttrs.z1) && void 0 !== _k ? _k : 1 / 0), graphicAttributes.length = storedAttrs.length) : isValidNumber$1(nextAttrs.z1) || !isValidNumber$1(nextAttrs.length) && isValidNumber$1(storedAttrs.z1) ? (graphicAttributes.z = Math.min(storedAttrs.z, storedAttrs.z1), graphicAttributes.length = Math.abs(storedAttrs.z1 - storedAttrs.z)) : (graphicAttributes.z = Math.min(null !== (_l = storedAttrs.z) && void 0 !== _l ? _l : 0, null !== (_m = storedAttrs.z1) && void 0 !== _m ? _m : 1 / 0), graphicAttributes.length = storedAttrs.length);
|
|
7810
|
-
},
|
|
7811
|
-
storedAttrs: "sizeAttrs"
|
|
7812
|
-
}],
|
|
7813
|
-
[GrammarMarkType.text]: [{
|
|
7814
|
-
channels: ["text", "limit", "autoLimit", "maxLineWidth"],
|
|
7815
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7816
|
-
var _a, _b, _c, _d;
|
|
7817
|
-
const limit = null !== (_a = storedAttrs.limit) && void 0 !== _a ? _a : 1 / 0,
|
|
7818
|
-
autoLimit = null !== (_b = storedAttrs.autoLimit) && void 0 !== _b ? _b : 1 / 0,
|
|
7819
|
-
maxWidth = Math.min(limit, autoLimit),
|
|
7820
|
-
isTextConfig = isPlainObject$1(storedAttrs.text) && !isNil$1(storedAttrs.text.text),
|
|
7821
|
-
text = isTextConfig ? storedAttrs.text.text : storedAttrs.text;
|
|
7822
|
-
graphicAttributes.maxLineWidth = maxWidth === 1 / 0 ? storedAttrs.maxLineWidth : maxWidth, isTextConfig ? "html" === storedAttrs.text.type ? (graphicAttributes.html = {
|
|
7823
|
-
dom: text,
|
|
7824
|
-
width: null !== (_c = nextAttrs.width) && void 0 !== _c ? _c : maxWidth,
|
|
7825
|
-
height: null !== (_d = nextAttrs.height) && void 0 !== _d ? _d : nextAttrs.fontSize,
|
|
7826
|
-
anchorType: "position"
|
|
7827
|
-
}, graphicAttributes.text = "") : "rich" === storedAttrs.text.type ? graphicAttributes.textConfig = text : graphicAttributes.text = text : graphicAttributes.text = text;
|
|
7828
|
-
},
|
|
7829
|
-
storedAttrs: "limitAttrs"
|
|
7830
|
-
}],
|
|
7831
|
-
[GrammarMarkType.rule]: [{
|
|
7832
|
-
channels: ["x", "y", "x1", "y1"],
|
|
7833
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7834
|
-
const points = getRulePoints(storedAttrs);
|
|
7835
|
-
graphicAttributes.points = points, graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
7836
|
-
},
|
|
7837
|
-
storedAttrs: "pointAttrs"
|
|
7838
|
-
}],
|
|
7839
|
-
[GrammarMarkType.symbol]: [{
|
|
7840
|
-
channels: ["shape", "symbolType"],
|
|
7841
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7842
|
-
var _a;
|
|
7843
|
-
graphicAttributes.symbolType = null !== (_a = nextAttrs.shape) && void 0 !== _a ? _a : nextAttrs.symbolType;
|
|
7844
|
-
}
|
|
7845
|
-
}, {
|
|
7846
|
-
channels: ["image", "fill", "background"],
|
|
7847
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7848
|
-
nextAttrs.image ? (graphicAttributes.background = nextAttrs.image, graphicAttributes.fill = !1) : storedAttrs.image ? (graphicAttributes.background = storedAttrs.image, graphicAttributes.fill = !1) : (graphicAttributes.fill = storedAttrs.fill, graphicAttributes.background = storedAttrs.background);
|
|
7849
|
-
},
|
|
7850
|
-
storedAttrs: "imageAttrs"
|
|
7851
|
-
}],
|
|
7852
|
-
[GrammarMarkType.richtext]: [{
|
|
7853
|
-
channels: ["text", "textConfig"],
|
|
7854
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
7855
|
-
var _a, _b, _c, _d;
|
|
7856
|
-
graphicAttributes.text = null, "rich" === (null === (_a = nextAttrs.text) || void 0 === _a ? void 0 : _a.type) ? graphicAttributes.textConfig = nextAttrs.text.text : "html" === (null === (_b = nextAttrs.textConfig) || void 0 === _b ? void 0 : _b.type) ? (graphicAttributes.html = {
|
|
7857
|
-
dom: nextAttrs.textConfig.text,
|
|
7858
|
-
width: nextAttrs.width,
|
|
7859
|
-
height: null !== (_c = nextAttrs.height) && void 0 !== _c ? _c : nextAttrs.fontSize,
|
|
7860
|
-
anchorType: "position"
|
|
7861
|
-
}, graphicAttributes.text = "") : "rich" === (null === (_d = nextAttrs.textConfig) || void 0 === _d ? void 0 : _d.type) ? graphicAttributes.textConfig = nextAttrs.textConfig.text : graphicAttributes.textConfig = nextAttrs.textConfig;
|
|
7862
|
-
}
|
|
7863
|
-
}]
|
|
7864
|
-
};
|
|
7865
|
-
function cloneTransformAttributes(markType, attributes) {
|
|
7866
|
-
var _a;
|
|
7867
|
-
return (null !== (_a = transformsByType[markType]) && void 0 !== _a ? _a : []).reduce((clonedAttributes, transform) => (transform.channels.forEach(channel => {
|
|
7868
|
-
has$1(attributes, channel) && (clonedAttributes[channel] = attributes[channel]);
|
|
7869
|
-
}), clonedAttributes), {});
|
|
7870
|
-
}
|
|
7871
|
-
const transformAttributes = (markType, nextAttrs, element, markName) => {
|
|
7872
|
-
const graphicAttributes = {},
|
|
7873
|
-
changedKeys = nextAttrs ? Object.keys(nextAttrs) : [],
|
|
7874
|
-
transforms = isString$1(markType) ? transformsByType[markType] : markType;
|
|
7875
|
-
if (null == transforms ? void 0 : transforms.length) {
|
|
7876
|
-
const tags = [];
|
|
7877
|
-
changedKeys.forEach(key => {
|
|
7878
|
-
let isTransformed = !1;
|
|
7879
|
-
transforms.forEach((transform, index) => {
|
|
7880
|
-
if (transform.channels.includes(key)) {
|
|
7881
|
-
if (!tags[index]) if (transform.storedAttrs) {
|
|
7882
|
-
const storedAttrs = storeOriginAttributes(transform.storedAttrs, transform.channels, graphicAttributes, nextAttrs, element, markName);
|
|
7883
|
-
transform.transform(graphicAttributes, nextAttrs, storedAttrs);
|
|
7884
|
-
} else transform.transform(graphicAttributes, nextAttrs, null);
|
|
7885
|
-
tags[index] = !0, isTransformed = !0;
|
|
7886
|
-
}
|
|
7887
|
-
}), isTransformed || (commonAttributes.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key]);
|
|
7888
|
-
});
|
|
7889
|
-
} else changedKeys.forEach(key => {
|
|
7890
|
-
commonAttributes.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key];
|
|
7891
|
-
});
|
|
7892
|
-
return graphicAttributes;
|
|
7893
|
-
};
|
|
7894
|
-
const isStopsEqual = (prev, next) => {
|
|
7895
|
-
var _a, _b;
|
|
7896
|
-
if (prev === next) return !0;
|
|
7897
|
-
const prevLength = null !== (_a = prev && prev.length) && void 0 !== _a ? _a : 0;
|
|
7898
|
-
return prevLength === (null !== (_b = next && next.length) && void 0 !== _b ? _b : 0) && 0 !== prevLength && prev.every((prevEntry, prevIndex) => !prevEntry && !next[prevIndex] || prevEntry && next[prevIndex] && prevEntry.color === next[prevIndex].color && prevEntry.offset === next[prevIndex].offset);
|
|
7899
|
-
},
|
|
7900
|
-
isColorAttrEqual = (prev, next) => {
|
|
7901
|
-
if (prev === next) return !0;
|
|
7902
|
-
if (typeof prev != typeof next) return !1;
|
|
7903
|
-
if (isString$1(prev)) return !1;
|
|
7904
|
-
if (prev.gradient !== next.gradient) return !1;
|
|
7905
|
-
const prevKeys = Object.keys(prev),
|
|
7906
|
-
nextKeys = Object.keys(next);
|
|
7907
|
-
return prevKeys.length === nextKeys.length && prevKeys.every(key => "stops" === key ? isStopsEqual(prev[key], next[key]) : prev[key] === next[key]);
|
|
7908
|
-
},
|
|
7909
|
-
isLineDashEqual = (prev, next) => prev.length === next.length && prev.join("-") === next.join("-"),
|
|
7910
|
-
isSegmentAttrEqual = (prev, next, key) => !(!isNil$1(prev) || !isNil$1(next)) || !isNil$1(prev) && !isNil$1(next) && ("lineDash" === key ? isLineDashEqual(prev, next) : "stroke" === key || "fill" === key ? isColorAttrEqual(prev, next) : prev === next),
|
|
7911
|
-
fillAttrs = ["fill", "fillOpacity", "background", "texture", "texturePadding", "textureSize", "textureColor"],
|
|
7912
|
-
strokeAttrs = ["stroke", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "lineWidth", "miterLimit"],
|
|
7913
|
-
areaAttrs = fillAttrs.concat(strokeAttrs);
|
|
7914
|
-
function getLineSegmentConfigs(items, points, element) {
|
|
7915
|
-
var _a;
|
|
7916
|
-
if (!items || items.length <= 1) return null;
|
|
7917
|
-
const checkAttributes = "area" === (null === (_a = null == element ? void 0 : element.mark) || void 0 === _a ? void 0 : _a.markType) ? areaAttrs : strokeAttrs,
|
|
7918
|
-
segments = [];
|
|
7919
|
-
let prevSegmentAttrs = null;
|
|
7920
|
-
return items.forEach((item, index) => {
|
|
7921
|
-
prevSegmentAttrs && checkAttributes.every(key => isSegmentAttrEqual(prevSegmentAttrs[key], item[key], key)) || (segments.length && (segments[segments.length - 1].endIndex = index), prevSegmentAttrs = item, segments.push({
|
|
7922
|
-
attrs: prevSegmentAttrs,
|
|
7923
|
-
startIndex: index
|
|
7924
|
-
}));
|
|
7925
|
-
}), segments.length >= 2 ? segments.map(entry => {
|
|
7926
|
-
const res = transformAttributes(GrammarMarkType.line, entry.attrs, element);
|
|
7927
|
-
return res.points = points.slice(entry.startIndex, isNil$1(entry.endIndex) ? points.length : entry.endIndex), res;
|
|
7928
|
-
}) : null;
|
|
7929
|
-
}
|
|
7930
|
-
function getLinePointsFromSegments(segments) {
|
|
7931
|
-
return segments ? segments.reduce((points, segment) => points.concat(segment.points), []) : null;
|
|
7932
|
-
}
|
|
7933
7750
|
function isPositionOrSizeChannel(type, channel) {
|
|
7934
7751
|
if (["x", "y", "dx", "dy"].includes(channel)) return !0;
|
|
7935
7752
|
switch (type) {
|
|
@@ -7957,6 +7774,9 @@
|
|
|
7957
7774
|
}
|
|
7958
7775
|
return !1;
|
|
7959
7776
|
}
|
|
7777
|
+
function isPointsMarkType(markType) {
|
|
7778
|
+
return [GrammarMarkType.line, GrammarMarkType.area, GrammarMarkType.largeRects, GrammarMarkType.largeSymbols].includes(markType);
|
|
7779
|
+
}
|
|
7960
7780
|
|
|
7961
7781
|
class GlyphMeta {
|
|
7962
7782
|
constructor(marks, encoders, defaultEncoder, progressiveChannels) {
|
|
@@ -7999,6 +7819,16 @@
|
|
|
7999
7819
|
if (!Factory._plotMarks[type]) return null;
|
|
8000
7820
|
return new (Factory._plotMarks[type])(id);
|
|
8001
7821
|
}
|
|
7822
|
+
static registerMark(key, mark) {
|
|
7823
|
+
Factory._marks[key] = mark;
|
|
7824
|
+
}
|
|
7825
|
+
static createMark(type, view, group) {
|
|
7826
|
+
if (!Factory._marks[type]) return null;
|
|
7827
|
+
return new (Factory._marks[type])(view, type, group);
|
|
7828
|
+
}
|
|
7829
|
+
static hasMark(type) {
|
|
7830
|
+
return !!Factory._marks[type];
|
|
7831
|
+
}
|
|
8002
7832
|
static registerComponent(key, component) {
|
|
8003
7833
|
Factory._components[key] = component;
|
|
8004
7834
|
}
|
|
@@ -8052,7 +7882,7 @@
|
|
|
8052
7882
|
return Ctor ? new Ctor(view, options) : null;
|
|
8053
7883
|
}
|
|
8054
7884
|
};
|
|
8055
|
-
Factory$1._plotMarks = {}, Factory$1._components = {}, Factory$1._graphicComponents = {}, Factory$1._transforms = {}, Factory$1._grammars = {}, Factory$1._glyphs = {}, Factory$1._animations = {}, Factory$1._interactions = {}, Factory$1.registerGlyph = (glyphType, marks, encoders, defaultEncoder, progressiveChannels) => (Factory$1._glyphs[glyphType] = new GlyphMeta(marks, encoders, defaultEncoder, progressiveChannels), Factory$1._glyphs[glyphType]), Factory$1.registerAnimationType = (animationType, animation) => {
|
|
7885
|
+
Factory$1._plotMarks = {}, Factory$1._marks = {}, Factory$1._components = {}, Factory$1._graphicComponents = {}, Factory$1._transforms = {}, Factory$1._grammars = {}, Factory$1._glyphs = {}, Factory$1._animations = {}, Factory$1._interactions = {}, Factory$1.registerGlyph = (glyphType, marks, encoders, defaultEncoder, progressiveChannels) => (Factory$1._glyphs[glyphType] = new GlyphMeta(marks, encoders, defaultEncoder, progressiveChannels), Factory$1._glyphs[glyphType]), Factory$1.registerAnimationType = (animationType, animation) => {
|
|
8056
7886
|
Factory$1._animations[animationType] = animation;
|
|
8057
7887
|
}, Factory$1.getAnimationType = animationType => Factory$1._animations[animationType], Factory$1.registerInteraction = (interactionType, interaction) => {
|
|
8058
7888
|
Factory$1._interactions[interactionType] = interaction;
|
|
@@ -13912,13 +13742,12 @@
|
|
|
13912
13742
|
};
|
|
13913
13743
|
}
|
|
13914
13744
|
onBind() {
|
|
13915
|
-
var _a, _b, _c, _d, _e, _f;
|
|
13916
|
-
this.fromNumber = isNumber$2(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$2(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1);
|
|
13745
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
13746
|
+
this.fromNumber = isNumber$2(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$2(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
|
|
13917
13747
|
}
|
|
13918
13748
|
onEnd() {}
|
|
13919
13749
|
onUpdate(end, ratio, out) {
|
|
13920
|
-
|
|
13921
|
-
!1 !== this.valid && (out.text = end ? this.toNumber.toFixed() : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fixed) && void 0 !== _b ? _b : 0));
|
|
13750
|
+
!1 !== this.valid && (out.text = end ? this.toNumber : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
|
|
13922
13751
|
}
|
|
13923
13752
|
}
|
|
13924
13753
|
var Direction$1;
|
|
@@ -26288,6 +26117,184 @@
|
|
|
26288
26117
|
graphicItem && (graphicItem[BridgeElementKey] = null, graphicItem.release(), graphicItem.parent && graphicItem.parent.removeChild(graphicItem));
|
|
26289
26118
|
};
|
|
26290
26119
|
|
|
26120
|
+
const commonAttributes = ["fillOpacity"];
|
|
26121
|
+
const transformCommonAttribute = (graphicAttributes, changedKey, nextAttrs) => {
|
|
26122
|
+
var _a;
|
|
26123
|
+
return "fillOpacity" === changedKey ? (graphicAttributes.fillOpacity = null !== (_a = nextAttrs.fillOpacity) && void 0 !== _a ? _a : 1, ["fillOpacity"]) : [];
|
|
26124
|
+
};
|
|
26125
|
+
|
|
26126
|
+
function storeOriginAttributes(name, channels, graphicAttributes, nextAttrs, element, markName) {
|
|
26127
|
+
var _a;
|
|
26128
|
+
const prevStoredAttrs = null !== (_a = element.getGraphicAttribute(name, !1, markName)) && void 0 !== _a ? _a : {},
|
|
26129
|
+
storedAttrs = {};
|
|
26130
|
+
return channels.forEach(channel => {
|
|
26131
|
+
var _a;
|
|
26132
|
+
storedAttrs[channel] = null !== (_a = nextAttrs[channel]) && void 0 !== _a ? _a : prevStoredAttrs[channel];
|
|
26133
|
+
}), graphicAttributes[name] = storedAttrs, storedAttrs;
|
|
26134
|
+
}
|
|
26135
|
+
const transformsByType = {
|
|
26136
|
+
[GrammarMarkType.largeRects]: [{
|
|
26137
|
+
channels: ["x", "y", "y1", "x1", "width", "height"],
|
|
26138
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26139
|
+
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
26140
|
+
}
|
|
26141
|
+
}],
|
|
26142
|
+
[GrammarMarkType.largeSymbols]: [{
|
|
26143
|
+
channels: ["x", "y", "size"],
|
|
26144
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26145
|
+
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
26146
|
+
}
|
|
26147
|
+
}],
|
|
26148
|
+
[GrammarMarkType.area]: [{
|
|
26149
|
+
channels: ["x", "y", "x1", "y1"],
|
|
26150
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26151
|
+
graphicAttributes.x = 0, graphicAttributes.y = 0, graphicAttributes.x1 = 0, graphicAttributes.y1 = 0;
|
|
26152
|
+
}
|
|
26153
|
+
}],
|
|
26154
|
+
[GrammarMarkType.line]: [{
|
|
26155
|
+
channels: ["x", "y", "defined", "enableSegments"],
|
|
26156
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26157
|
+
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
26158
|
+
}
|
|
26159
|
+
}],
|
|
26160
|
+
[GrammarMarkType.rect]: [{
|
|
26161
|
+
channels: ["x", "y", "x1", "y1", "width", "height"],
|
|
26162
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26163
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
26164
|
+
isValidNumber$1(nextAttrs.width) || !isValidNumber$1(nextAttrs.x1) && isValidNumber$1(storedAttrs.width) ? (graphicAttributes.x = Math.min(null !== (_a = storedAttrs.x) && void 0 !== _a ? _a : 0, null !== (_b = storedAttrs.x1) && void 0 !== _b ? _b : 1 / 0), graphicAttributes.width = storedAttrs.width) : isValidNumber$1(nextAttrs.x1) || !isValidNumber$1(nextAttrs.width) && isValidNumber$1(storedAttrs.x1) ? (graphicAttributes.x = Math.min(storedAttrs.x, storedAttrs.x1), graphicAttributes.width = Math.abs(storedAttrs.x1 - storedAttrs.x)) : (graphicAttributes.x = Math.min(null !== (_c = storedAttrs.x) && void 0 !== _c ? _c : 0, null !== (_d = storedAttrs.x1) && void 0 !== _d ? _d : 1 / 0), graphicAttributes.width = storedAttrs.width), isValidNumber$1(nextAttrs.height) || !isValidNumber$1(nextAttrs.y1) && isValidNumber$1(storedAttrs.height) ? (graphicAttributes.y = Math.min(null !== (_e = storedAttrs.y) && void 0 !== _e ? _e : 0, null !== (_f = storedAttrs.y1) && void 0 !== _f ? _f : 1 / 0), graphicAttributes.height = storedAttrs.height) : isValidNumber$1(nextAttrs.y1) || !isValidNumber$1(nextAttrs.height) && isValidNumber$1(storedAttrs.y1) ? (graphicAttributes.y = Math.min(storedAttrs.y, storedAttrs.y1), graphicAttributes.height = Math.abs(storedAttrs.y1 - storedAttrs.y)) : (graphicAttributes.y = Math.min(null !== (_g = storedAttrs.y) && void 0 !== _g ? _g : 0, null !== (_h = storedAttrs.y1) && void 0 !== _h ? _h : 1 / 0), graphicAttributes.height = storedAttrs.height);
|
|
26165
|
+
},
|
|
26166
|
+
storedAttrs: "sizeAttrs"
|
|
26167
|
+
}],
|
|
26168
|
+
rect3d: [{
|
|
26169
|
+
channels: ["x", "y", "z", "x1", "y1", "width", "height", "length"],
|
|
26170
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26171
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
26172
|
+
isValidNumber$1(nextAttrs.width) || !isValidNumber$1(nextAttrs.x1) && isValidNumber$1(storedAttrs.width) ? (graphicAttributes.x = Math.min(null !== (_a = storedAttrs.x) && void 0 !== _a ? _a : 0, null !== (_b = storedAttrs.x1) && void 0 !== _b ? _b : 1 / 0), graphicAttributes.width = storedAttrs.width) : isValidNumber$1(nextAttrs.x1) || !isValidNumber$1(nextAttrs.width) && isValidNumber$1(storedAttrs.x1) ? (graphicAttributes.x = Math.min(storedAttrs.x, storedAttrs.x1), graphicAttributes.width = Math.abs(storedAttrs.x1 - storedAttrs.x)) : (graphicAttributes.x = Math.min(null !== (_c = storedAttrs.x) && void 0 !== _c ? _c : 0, null !== (_d = storedAttrs.x1) && void 0 !== _d ? _d : 1 / 0), graphicAttributes.width = storedAttrs.width), isValidNumber$1(nextAttrs.height) || !isValidNumber$1(nextAttrs.y1) && isValidNumber$1(storedAttrs.height) ? (graphicAttributes.y = Math.min(null !== (_e = storedAttrs.y) && void 0 !== _e ? _e : 0, null !== (_f = storedAttrs.y1) && void 0 !== _f ? _f : 1 / 0), graphicAttributes.height = storedAttrs.height) : isValidNumber$1(nextAttrs.y1) || !isValidNumber$1(nextAttrs.height) && isValidNumber$1(storedAttrs.y1) ? (graphicAttributes.y = Math.min(storedAttrs.y, storedAttrs.y1), graphicAttributes.height = Math.abs(storedAttrs.y1 - storedAttrs.y)) : (graphicAttributes.y = Math.min(null !== (_g = storedAttrs.y) && void 0 !== _g ? _g : 0, null !== (_h = storedAttrs.y1) && void 0 !== _h ? _h : 1 / 0), graphicAttributes.height = storedAttrs.height), isValidNumber$1(nextAttrs.length) || !isValidNumber$1(nextAttrs.z1) && isValidNumber$1(storedAttrs.length) ? (graphicAttributes.z = Math.min(null !== (_j = storedAttrs.z) && void 0 !== _j ? _j : 0, null !== (_k = storedAttrs.z1) && void 0 !== _k ? _k : 1 / 0), graphicAttributes.length = storedAttrs.length) : isValidNumber$1(nextAttrs.z1) || !isValidNumber$1(nextAttrs.length) && isValidNumber$1(storedAttrs.z1) ? (graphicAttributes.z = Math.min(storedAttrs.z, storedAttrs.z1), graphicAttributes.length = Math.abs(storedAttrs.z1 - storedAttrs.z)) : (graphicAttributes.z = Math.min(null !== (_l = storedAttrs.z) && void 0 !== _l ? _l : 0, null !== (_m = storedAttrs.z1) && void 0 !== _m ? _m : 1 / 0), graphicAttributes.length = storedAttrs.length);
|
|
26173
|
+
},
|
|
26174
|
+
storedAttrs: "sizeAttrs"
|
|
26175
|
+
}],
|
|
26176
|
+
[GrammarMarkType.text]: [{
|
|
26177
|
+
channels: ["text", "limit", "autoLimit", "maxLineWidth"],
|
|
26178
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26179
|
+
var _a, _b, _c, _d;
|
|
26180
|
+
const limit = null !== (_a = storedAttrs.limit) && void 0 !== _a ? _a : 1 / 0,
|
|
26181
|
+
autoLimit = null !== (_b = storedAttrs.autoLimit) && void 0 !== _b ? _b : 1 / 0,
|
|
26182
|
+
maxWidth = Math.min(limit, autoLimit),
|
|
26183
|
+
isTextConfig = isPlainObject$1(storedAttrs.text) && !isNil$1(storedAttrs.text.text),
|
|
26184
|
+
text = isTextConfig ? storedAttrs.text.text : storedAttrs.text;
|
|
26185
|
+
graphicAttributes.maxLineWidth = maxWidth === 1 / 0 ? storedAttrs.maxLineWidth : maxWidth, isTextConfig ? "html" === storedAttrs.text.type ? (graphicAttributes.html = {
|
|
26186
|
+
dom: text,
|
|
26187
|
+
width: null !== (_c = nextAttrs.width) && void 0 !== _c ? _c : maxWidth,
|
|
26188
|
+
height: null !== (_d = nextAttrs.height) && void 0 !== _d ? _d : nextAttrs.fontSize,
|
|
26189
|
+
anchorType: "position"
|
|
26190
|
+
}, graphicAttributes.text = "") : "rich" === storedAttrs.text.type ? graphicAttributes.textConfig = text : graphicAttributes.text = text : graphicAttributes.text = text;
|
|
26191
|
+
},
|
|
26192
|
+
storedAttrs: "limitAttrs"
|
|
26193
|
+
}],
|
|
26194
|
+
[GrammarMarkType.rule]: [{
|
|
26195
|
+
channels: ["x", "y", "x1", "y1"],
|
|
26196
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26197
|
+
const points = getRulePoints(storedAttrs);
|
|
26198
|
+
graphicAttributes.points = points, graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
26199
|
+
},
|
|
26200
|
+
storedAttrs: "pointAttrs"
|
|
26201
|
+
}],
|
|
26202
|
+
[GrammarMarkType.symbol]: [{
|
|
26203
|
+
channels: ["shape", "symbolType"],
|
|
26204
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26205
|
+
var _a;
|
|
26206
|
+
graphicAttributes.symbolType = null !== (_a = nextAttrs.shape) && void 0 !== _a ? _a : nextAttrs.symbolType;
|
|
26207
|
+
}
|
|
26208
|
+
}, {
|
|
26209
|
+
channels: ["image", "fill", "background"],
|
|
26210
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26211
|
+
nextAttrs.image ? (graphicAttributes.background = nextAttrs.image, graphicAttributes.fill = !1) : storedAttrs.image ? (graphicAttributes.background = storedAttrs.image, graphicAttributes.fill = !1) : (graphicAttributes.fill = storedAttrs.fill, graphicAttributes.background = storedAttrs.background);
|
|
26212
|
+
},
|
|
26213
|
+
storedAttrs: "imageAttrs"
|
|
26214
|
+
}],
|
|
26215
|
+
[GrammarMarkType.richtext]: [{
|
|
26216
|
+
channels: ["text", "textConfig"],
|
|
26217
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26218
|
+
var _a, _b, _c, _d;
|
|
26219
|
+
graphicAttributes.text = null, "rich" === (null === (_a = nextAttrs.text) || void 0 === _a ? void 0 : _a.type) ? graphicAttributes.textConfig = nextAttrs.text.text : "html" === (null === (_b = nextAttrs.textConfig) || void 0 === _b ? void 0 : _b.type) ? (graphicAttributes.html = {
|
|
26220
|
+
dom: nextAttrs.textConfig.text,
|
|
26221
|
+
width: nextAttrs.width,
|
|
26222
|
+
height: null !== (_c = nextAttrs.height) && void 0 !== _c ? _c : nextAttrs.fontSize,
|
|
26223
|
+
anchorType: "position"
|
|
26224
|
+
}, graphicAttributes.text = "") : "rich" === (null === (_d = nextAttrs.textConfig) || void 0 === _d ? void 0 : _d.type) ? graphicAttributes.textConfig = nextAttrs.textConfig.text : graphicAttributes.textConfig = nextAttrs.textConfig;
|
|
26225
|
+
}
|
|
26226
|
+
}]
|
|
26227
|
+
};
|
|
26228
|
+
function cloneTransformAttributes(markType, attributes) {
|
|
26229
|
+
var _a;
|
|
26230
|
+
return (null !== (_a = transformsByType[markType]) && void 0 !== _a ? _a : []).reduce((clonedAttributes, transform) => (transform.channels.forEach(channel => {
|
|
26231
|
+
has$1(attributes, channel) && (clonedAttributes[channel] = attributes[channel]);
|
|
26232
|
+
}), clonedAttributes), {});
|
|
26233
|
+
}
|
|
26234
|
+
const transformAttributes = (markType, nextAttrs, element, markName) => {
|
|
26235
|
+
const graphicAttributes = {},
|
|
26236
|
+
changedKeys = nextAttrs ? Object.keys(nextAttrs) : [],
|
|
26237
|
+
transforms = isString$1(markType) ? transformsByType[markType] : markType;
|
|
26238
|
+
if (null == transforms ? void 0 : transforms.length) {
|
|
26239
|
+
const tags = [];
|
|
26240
|
+
changedKeys.forEach(key => {
|
|
26241
|
+
let isTransformed = !1;
|
|
26242
|
+
transforms.forEach((transform, index) => {
|
|
26243
|
+
if (transform.channels.includes(key)) {
|
|
26244
|
+
if (!tags[index]) if (transform.storedAttrs) {
|
|
26245
|
+
const storedAttrs = storeOriginAttributes(transform.storedAttrs, transform.channels, graphicAttributes, nextAttrs, element, markName);
|
|
26246
|
+
transform.transform(graphicAttributes, nextAttrs, storedAttrs);
|
|
26247
|
+
} else transform.transform(graphicAttributes, nextAttrs, null);
|
|
26248
|
+
tags[index] = !0, isTransformed = !0;
|
|
26249
|
+
}
|
|
26250
|
+
}), isTransformed || (commonAttributes.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key]);
|
|
26251
|
+
});
|
|
26252
|
+
} else changedKeys.forEach(key => {
|
|
26253
|
+
commonAttributes.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key];
|
|
26254
|
+
});
|
|
26255
|
+
return graphicAttributes;
|
|
26256
|
+
};
|
|
26257
|
+
|
|
26258
|
+
const isStopsEqual = (prev, next) => {
|
|
26259
|
+
var _a, _b;
|
|
26260
|
+
if (prev === next) return !0;
|
|
26261
|
+
const prevLength = null !== (_a = prev && prev.length) && void 0 !== _a ? _a : 0;
|
|
26262
|
+
return prevLength === (null !== (_b = next && next.length) && void 0 !== _b ? _b : 0) && 0 !== prevLength && prev.every((prevEntry, prevIndex) => !prevEntry && !next[prevIndex] || prevEntry && next[prevIndex] && prevEntry.color === next[prevIndex].color && prevEntry.offset === next[prevIndex].offset);
|
|
26263
|
+
},
|
|
26264
|
+
isColorAttrEqual = (prev, next) => {
|
|
26265
|
+
if (prev === next) return !0;
|
|
26266
|
+
if (typeof prev != typeof next) return !1;
|
|
26267
|
+
if (isString$1(prev)) return !1;
|
|
26268
|
+
if (prev.gradient !== next.gradient) return !1;
|
|
26269
|
+
const prevKeys = Object.keys(prev),
|
|
26270
|
+
nextKeys = Object.keys(next);
|
|
26271
|
+
return prevKeys.length === nextKeys.length && prevKeys.every(key => "stops" === key ? isStopsEqual(prev[key], next[key]) : prev[key] === next[key]);
|
|
26272
|
+
},
|
|
26273
|
+
isLineDashEqual = (prev, next) => prev.length === next.length && prev.join("-") === next.join("-"),
|
|
26274
|
+
isSegmentAttrEqual = (prev, next, key) => !(!isNil$1(prev) || !isNil$1(next)) || !isNil$1(prev) && !isNil$1(next) && ("lineDash" === key ? isLineDashEqual(prev, next) : "stroke" === key || "fill" === key ? isColorAttrEqual(prev, next) : prev === next),
|
|
26275
|
+
fillAttrs = ["fill", "fillOpacity", "background", "texture", "texturePadding", "textureSize", "textureColor"],
|
|
26276
|
+
strokeAttrs = ["stroke", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "lineWidth", "miterLimit"],
|
|
26277
|
+
areaAttrs = fillAttrs.concat(strokeAttrs);
|
|
26278
|
+
function getLineSegmentConfigs(items, points, element) {
|
|
26279
|
+
var _a;
|
|
26280
|
+
if (!items || items.length <= 1) return null;
|
|
26281
|
+
const checkAttributes = "area" === (null === (_a = null == element ? void 0 : element.mark) || void 0 === _a ? void 0 : _a.markType) ? areaAttrs : strokeAttrs,
|
|
26282
|
+
segments = [];
|
|
26283
|
+
let prevSegmentAttrs = null;
|
|
26284
|
+
return items.forEach((item, index) => {
|
|
26285
|
+
prevSegmentAttrs && checkAttributes.every(key => isSegmentAttrEqual(prevSegmentAttrs[key], item[key], key)) || (segments.length && (segments[segments.length - 1].endIndex = index), prevSegmentAttrs = item, segments.push({
|
|
26286
|
+
attrs: prevSegmentAttrs,
|
|
26287
|
+
startIndex: index
|
|
26288
|
+
}));
|
|
26289
|
+
}), segments.length >= 2 ? segments.map(entry => {
|
|
26290
|
+
const res = transformAttributes(GrammarMarkType.line, entry.attrs, element);
|
|
26291
|
+
return res.points = points.slice(entry.startIndex, isNil$1(entry.endIndex) ? points.length : entry.endIndex), res;
|
|
26292
|
+
}) : null;
|
|
26293
|
+
}
|
|
26294
|
+
function getLinePointsFromSegments(segments) {
|
|
26295
|
+
return segments ? segments.reduce((points, segment) => points.concat(segment.points), []) : null;
|
|
26296
|
+
}
|
|
26297
|
+
|
|
26291
26298
|
let Element$1 = class Element {
|
|
26292
26299
|
constructor(mark) {
|
|
26293
26300
|
this.data = null, this.states = [], this.diffState = DiffState.enter, this.isReserved = !1, this.runtimeStatesEncoder = null, this.items = [], this.getStateAttrs = (stateName, nextStates) => {
|
|
@@ -31819,7 +31826,7 @@
|
|
|
31819
31826
|
var _a;
|
|
31820
31827
|
this.setAttribute("pickable", !1);
|
|
31821
31828
|
const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
|
|
31822
|
-
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && (this._container ? (this.
|
|
31829
|
+
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && (!this._container && this.isValidPoints() ? (this._initContainer(), this.initMarker(this._container)) : this.isValidPoints() ? (this._updateContainer(), this.updateMarker()) : (this._container = null, this.removeAllChild()));
|
|
31823
31830
|
}
|
|
31824
31831
|
}
|
|
31825
31832
|
|
|
@@ -32078,7 +32085,7 @@
|
|
|
32078
32085
|
return this._label;
|
|
32079
32086
|
}
|
|
32080
32087
|
constructor(attributes) {
|
|
32081
|
-
super(merge$1({}, MarkLine.defaultAttributes, attributes));
|
|
32088
|
+
super(merge$1({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
|
|
32082
32089
|
}
|
|
32083
32090
|
setLabelPos() {
|
|
32084
32091
|
var _a, _b;
|
|
@@ -32170,6 +32177,12 @@
|
|
|
32170
32177
|
dy: 0
|
|
32171
32178
|
}, label)), this.setLabelPos();
|
|
32172
32179
|
}
|
|
32180
|
+
isValidPoints() {
|
|
32181
|
+
const {
|
|
32182
|
+
points: points
|
|
32183
|
+
} = this.attribute;
|
|
32184
|
+
return !(!points || points.length < 2);
|
|
32185
|
+
}
|
|
32173
32186
|
};
|
|
32174
32187
|
MarkLine$1.defaultAttributes = DEFAULT_MARK_LINE_THEME;
|
|
32175
32188
|
|
|
@@ -32181,7 +32194,7 @@
|
|
|
32181
32194
|
return this._label;
|
|
32182
32195
|
}
|
|
32183
32196
|
constructor(attributes) {
|
|
32184
|
-
super(merge$1({}, MarkArea.defaultAttributes, attributes));
|
|
32197
|
+
super(merge$1({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea";
|
|
32185
32198
|
}
|
|
32186
32199
|
_getPositionByDirection(area, direction) {
|
|
32187
32200
|
const {
|
|
@@ -32260,12 +32273,18 @@
|
|
|
32260
32273
|
dy: 0
|
|
32261
32274
|
}, label)), this.setLabelPos();
|
|
32262
32275
|
}
|
|
32276
|
+
isValidPoints() {
|
|
32277
|
+
const {
|
|
32278
|
+
points: points
|
|
32279
|
+
} = this.attribute;
|
|
32280
|
+
return !(!points || points.length < 3);
|
|
32281
|
+
}
|
|
32263
32282
|
};
|
|
32264
32283
|
MarkArea$1.defaultAttributes = DEFAULT_MARK_AREA_THEME;
|
|
32265
32284
|
|
|
32266
32285
|
let MarkPoint$1 = class MarkPoint extends Marker {
|
|
32267
32286
|
constructor(attributes) {
|
|
32268
|
-
super(merge$1({}, MarkPoint.defaultAttributes, attributes));
|
|
32287
|
+
super(merge$1({}, MarkPoint.defaultAttributes, attributes)), this.name = "markPoint";
|
|
32269
32288
|
}
|
|
32270
32289
|
setLabelPos() {}
|
|
32271
32290
|
setItemAttributes(item, itemContent, itemPosition, itemType) {
|
|
@@ -32424,6 +32443,9 @@
|
|
|
32424
32443
|
};
|
|
32425
32444
|
this.setItemLineAttr(itemLine, position, itemPosition, null == itemLine ? void 0 : itemLine.visible), this.setDecorativeLineAttr(itemLine, itemPosition, null === (_a = null == itemLine ? void 0 : itemLine.decorativeLine) || void 0 === _a ? void 0 : _a.visible), this.setItemAttributes(this._item, itemContent, itemPosition, type);
|
|
32426
32445
|
}
|
|
32446
|
+
isValidPoints() {
|
|
32447
|
+
return !0;
|
|
32448
|
+
}
|
|
32427
32449
|
};
|
|
32428
32450
|
MarkPoint$1.defaultAttributes = DEFAULT_MARK_POINT_THEME;
|
|
32429
32451
|
|
|
@@ -33974,8 +33996,8 @@
|
|
|
33974
33996
|
} else niceType = "all";
|
|
33975
33997
|
if (niceType) {
|
|
33976
33998
|
const niceDomain = nice(originalDomain.slice(), {
|
|
33977
|
-
floor: x =>
|
|
33978
|
-
ceil: x =>
|
|
33999
|
+
floor: x => Math.floor(x),
|
|
34000
|
+
ceil: x => Math.ceil(x)
|
|
33979
34001
|
});
|
|
33980
34002
|
return "min" === niceType ? niceDomain[niceDomain.length - 1] = null !== (_a = niceMinMax[1]) && void 0 !== _a ? _a : niceDomain[niceDomain.length - 1] : "max" === niceType && (niceDomain[0] = null !== (_b = niceMinMax[0]) && void 0 !== _b ? _b : niceDomain[0]), this._niceDomain = niceDomain, this.rescale(), this;
|
|
33981
34003
|
}
|
|
@@ -34170,8 +34192,8 @@
|
|
|
34170
34192
|
} else niceType = "all";
|
|
34171
34193
|
if (niceType) {
|
|
34172
34194
|
const niceDomain = nice(originalDomain.slice(), {
|
|
34173
|
-
floor: x =>
|
|
34174
|
-
ceil: x =>
|
|
34195
|
+
floor: x => Math.floor(x),
|
|
34196
|
+
ceil: x => Math.ceil(x)
|
|
34175
34197
|
});
|
|
34176
34198
|
return "min" === niceType ? niceDomain[niceDomain.length - 1] = null !== (_a = niceMinMax[1]) && void 0 !== _a ? _a : niceDomain[niceDomain.length - 1] : "max" === niceType && (niceDomain[0] = null !== (_b = niceMinMax[0]) && void 0 !== _b ? _b : niceDomain[0]), this._niceDomain = niceDomain, this.rescale(), this;
|
|
34177
34199
|
}
|
|
@@ -35164,7 +35186,7 @@
|
|
|
35164
35186
|
subtextWidth = this._subTitle ? null === (_1 = this._subTitle) || void 0 === _1 ? void 0 : _1.AABBBounds.width() : 0;
|
|
35165
35187
|
let titleWidth = Math.max(maintextWidth, subtextWidth),
|
|
35166
35188
|
titleHeight = maintextHeight + (null !== (_2 = null == subtextStyle ? void 0 : subtextStyle.height) && void 0 !== _2 ? _2 : subtextHeight);
|
|
35167
|
-
if (isValid$1(width) && (titleWidth = width, null === (_3 = this._mainTitle) || void 0 === _3 || _3.setAttribute("maxLineWidth", width), null === (_4 = this._subTitle) || void 0 === _4 || _4.setAttribute("maxLineWidth", width)), isValid$1(height) && (titleHeight = height), isValid$1(minWidth) && titleWidth < minWidth && (titleWidth = minWidth), isValid$1(maxWidth) && (null === (_5 = this._mainTitle) || void 0 === _5 || _5.setAttribute("maxLineWidth", maxWidth), null === (_6 = this._subTitle) || void 0 === _6 || _6.setAttribute("maxLineWidth", maxWidth), null === (_7 = this._mainTitle) || void 0 === _7 || _7.setAttribute("maxWidth", maxWidth), null === (_8 = this._subTitle) || void 0 === _8 || _8.setAttribute("maxWidth", maxWidth), titleWidth > maxWidth && (titleWidth = maxWidth)), isValid$1(minHeight) && titleHeight < minHeight && (titleHeight = minHeight), isValid$1(maxHeight) && (null === (_9 = this._mainTitle) || void 0 === _9 || _9.setAttribute("maxHeight", maxHeight), null === (_10 = this._subTitle) || void 0 === _10 || _10.setAttribute("maxHeight", maxHeight - maintextHeight), titleHeight > maxHeight && (titleHeight = maxHeight)), group.attribute.width = titleWidth
|
|
35189
|
+
if (isValid$1(width) && (titleWidth = width, null === (_3 = this._mainTitle) || void 0 === _3 || _3.setAttribute("maxLineWidth", width), null === (_4 = this._subTitle) || void 0 === _4 || _4.setAttribute("maxLineWidth", width)), isValid$1(height) && (titleHeight = height), isValid$1(minWidth) && titleWidth < minWidth && (titleWidth = minWidth), isValid$1(maxWidth) && (null === (_5 = this._mainTitle) || void 0 === _5 || _5.setAttribute("maxLineWidth", maxWidth), null === (_6 = this._subTitle) || void 0 === _6 || _6.setAttribute("maxLineWidth", maxWidth), null === (_7 = this._mainTitle) || void 0 === _7 || _7.setAttribute("maxWidth", maxWidth), null === (_8 = this._subTitle) || void 0 === _8 || _8.setAttribute("maxWidth", maxWidth), titleWidth > maxWidth && (titleWidth = maxWidth)), isValid$1(minHeight) && titleHeight < minHeight && (titleHeight = minHeight), isValid$1(maxHeight) && (null === (_9 = this._mainTitle) || void 0 === _9 || _9.setAttribute("maxHeight", maxHeight), null === (_10 = this._subTitle) || void 0 === _10 || _10.setAttribute("maxHeight", maxHeight - maintextHeight), titleHeight > maxHeight && (titleHeight = maxHeight)), group.attribute.width = titleWidth, group.attribute.height = titleHeight, group.attribute.boundsPadding = parsedPadding, isValid$1(align) || isValid$1(null == textStyle ? void 0 : textStyle.align)) {
|
|
35168
35190
|
const mainTitleAlign = (null == textStyle ? void 0 : textStyle.align) ? null == textStyle ? void 0 : textStyle.align : align,
|
|
35169
35191
|
mainTitleWidth = null !== (_11 = null == textStyle ? void 0 : textStyle.width) && void 0 !== _11 ? _11 : maintextWidth;
|
|
35170
35192
|
"left" === mainTitleAlign ? (null === (_12 = this._mainTitle) || void 0 === _12 || _12.setAttribute("x", 0), null === (_13 = this._mainTitle) || void 0 === _13 || _13.setAttribute("textAlign", "left")) : "center" === mainTitleAlign ? (null === (_14 = this._mainTitle) || void 0 === _14 || _14.setAttribute("x", mainTitleWidth / 2), null === (_15 = this._mainTitle) || void 0 === _15 || _15.setAttribute("textAlign", "center")) : "right" === mainTitleAlign && (null === (_16 = this._mainTitle) || void 0 === _16 || _16.setAttribute("x", mainTitleWidth), null === (_17 = this._mainTitle) || void 0 === _17 || _17.setAttribute("textAlign", "right"));
|
|
@@ -38160,7 +38182,7 @@
|
|
|
38160
38182
|
return 0;
|
|
38161
38183
|
}
|
|
38162
38184
|
getStaticCanvasCount() {
|
|
38163
|
-
return
|
|
38185
|
+
return 999;
|
|
38164
38186
|
}
|
|
38165
38187
|
loadJson(url) {
|
|
38166
38188
|
const jsonPromise = fetch(url).then(data => data.json());
|
|
@@ -41499,7 +41521,7 @@
|
|
|
41499
41521
|
title: viewOptions.rendererTitle,
|
|
41500
41522
|
beforeRender: viewOptions.beforeRender,
|
|
41501
41523
|
afterRender: viewOptions.afterRender,
|
|
41502
|
-
disableDirtyBounds:
|
|
41524
|
+
disableDirtyBounds: !0,
|
|
41503
41525
|
autoRender: !0,
|
|
41504
41526
|
pluginList: viewOptions.pluginList,
|
|
41505
41527
|
enableHtmlAttribute: viewOptions.enableHtmlAttribute
|
|
@@ -41980,7 +42002,7 @@
|
|
|
41980
42002
|
value: null !== (_b = option[SIGNAL_HEIGHT]) && void 0 !== _b ? _b : 0
|
|
41981
42003
|
}, {
|
|
41982
42004
|
id: SIGNAL_PADDING,
|
|
41983
|
-
value: normalizePadding(null !== (_d = null !== (_c = option[SIGNAL_PADDING]) && void 0 !== _c ? _c : config[SIGNAL_PADDING]) && void 0 !== _d ? _d : theme.padding)
|
|
42005
|
+
value: normalizePadding(null !== (_d = null !== (_c = option[SIGNAL_PADDING]) && void 0 !== _c ? _c : config[SIGNAL_PADDING]) && void 0 !== _d ? _d : null == theme ? void 0 : theme.padding)
|
|
41984
42006
|
}, {
|
|
41985
42007
|
id: SIGNAL_VIEW_WIDTH,
|
|
41986
42008
|
update: {
|
|
@@ -43203,7 +43225,7 @@
|
|
|
43203
43225
|
const currentData = null != data ? data : DefaultMarkData;
|
|
43204
43226
|
isCollectionMark || this.differ.setCurrentData(groupData(currentData, datum => `${groupKeyGetter(datum)}-${keyGetter(datum)}`, void 0)), this.differ.doDiff(), enterElements.forEach(element => {
|
|
43205
43227
|
this.elementMap.delete(isCollectionMark ? element.groupKey : `${element.groupKey}-${element.key}`), element.remove(), element.release();
|
|
43206
|
-
}), this.elements = elements, sort && this.elements.sort((elementA, elementB) => sort(elementA.getDatum(), elementB.getDatum()));
|
|
43228
|
+
}), this.elements = elements, sort && this.elements.length >= 2 && this.elements.sort((elementA, elementB) => sort(elementA.getDatum(), elementB.getDatum()));
|
|
43207
43229
|
}
|
|
43208
43230
|
evaluateState(elements, stateSpec, parameters) {
|
|
43209
43231
|
stateSpec && elements.forEach(element => {
|
|
@@ -44401,7 +44423,7 @@
|
|
|
44401
44423
|
|
|
44402
44424
|
class ViewAnimate {
|
|
44403
44425
|
constructor(view) {
|
|
44404
|
-
this._animations = [], this._additionalAnimateMarks = [], this._onAnimationStart = event => {
|
|
44426
|
+
this._animations = [], this._additionalAnimateMarks = [], this.isEnabled = !0, this._onAnimationStart = event => {
|
|
44405
44427
|
this._additionalAnimateMarks = this._additionalAnimateMarks.filter(mark => {
|
|
44406
44428
|
var _a;
|
|
44407
44429
|
return null === (_a = null == mark ? void 0 : mark.animate) || void 0 === _a ? void 0 : _a.isAnimating();
|
|
@@ -44444,13 +44466,13 @@
|
|
|
44444
44466
|
}), this;
|
|
44445
44467
|
}
|
|
44446
44468
|
enable() {
|
|
44447
|
-
return this._view.traverseMarkTree(mark => {
|
|
44469
|
+
return this.isEnabled = !0, this._view.traverseMarkTree(mark => {
|
|
44448
44470
|
var _a, _b;
|
|
44449
44471
|
null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.enable) || void 0 === _b || _b.call(_a);
|
|
44450
44472
|
}), this;
|
|
44451
44473
|
}
|
|
44452
44474
|
disable() {
|
|
44453
|
-
return this._view.traverseMarkTree(mark => {
|
|
44475
|
+
return this.isEnabled = !1, this._view.traverseMarkTree(mark => {
|
|
44454
44476
|
var _a, _b;
|
|
44455
44477
|
null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.disable) || void 0 === _b || _b.call(_a);
|
|
44456
44478
|
}), this._additionalAnimateMarks.forEach(mark => {
|
|
@@ -44477,9 +44499,9 @@
|
|
|
44477
44499
|
});
|
|
44478
44500
|
}
|
|
44479
44501
|
animate() {
|
|
44480
|
-
return this._view.traverseMarkTree(mark => {
|
|
44502
|
+
return this.isEnabled ? (this._view.traverseMarkTree(mark => {
|
|
44481
44503
|
mark.isUpdated && mark.animate && mark.animate.animate(), mark.cleanExitElements(), mark.isUpdated = !1;
|
|
44482
|
-
}, null, !0), this;
|
|
44504
|
+
}, null, !0), this) : this;
|
|
44483
44505
|
}
|
|
44484
44506
|
animateAddition(additionMark) {
|
|
44485
44507
|
return additionMark.animate.animate(), this._additionalAnimateMarks.push(additionMark), this;
|
|
@@ -44489,120 +44511,6 @@
|
|
|
44489
44511
|
}
|
|
44490
44512
|
}
|
|
44491
44513
|
|
|
44492
|
-
class Interval extends Mark {
|
|
44493
|
-
encodeState(state, channel, value) {
|
|
44494
|
-
return super.encodeState(state, channel, value), this._updateComponentEncoders(state), this;
|
|
44495
|
-
}
|
|
44496
|
-
_updateComponentEncoders(state) {
|
|
44497
|
-
this._encoders || (this._encoders = {});
|
|
44498
|
-
const userEncoder = this.spec.encode[state];
|
|
44499
|
-
if (userEncoder && "update" === state) {
|
|
44500
|
-
const params = this.parameters(),
|
|
44501
|
-
scales = isFunctionType(userEncoder) ? null : Object.keys(userEncoder).reduce((res, channel) => (isScaleEncode(userEncoder[channel]) && (res[channel] = getGrammarOutput(userEncoder[channel].scale, params)), res), {});
|
|
44502
|
-
this._encoders[state] = {
|
|
44503
|
-
callback: (datum, element, parameters) => {
|
|
44504
|
-
var _a, _b, _c;
|
|
44505
|
-
const userEncodeRes = invokeEncoder(userEncoder, datum, element, parameters);
|
|
44506
|
-
if (this.disableCoordinateTransform = !1, scales && scales.x && scales.x.type === ScaleEnum.Band) {
|
|
44507
|
-
if (!isNil$1(scales.y)) {
|
|
44508
|
-
const domain = scales.y.domain(),
|
|
44509
|
-
min = Math.min.apply(null, domain),
|
|
44510
|
-
max = Math.max.apply(null, domain),
|
|
44511
|
-
baseValue = min > 0 ? min : max < 0 ? max : 0;
|
|
44512
|
-
userEncodeRes.y1 = scales.y.scale(baseValue);
|
|
44513
|
-
}
|
|
44514
|
-
const bandWidth = scales.x.bandwidth();
|
|
44515
|
-
userEncodeRes.x = userEncodeRes.x + bandWidth / 4, userEncodeRes.x1 = userEncodeRes.x + bandWidth / 2;
|
|
44516
|
-
} else if (scales && scales.y && scales.y.type === ScaleEnum.Band) {
|
|
44517
|
-
if (!isNil$1(scales.x)) {
|
|
44518
|
-
const domain = scales.x.domain(),
|
|
44519
|
-
min = Math.min.apply(null, domain),
|
|
44520
|
-
max = Math.max.apply(null, domain),
|
|
44521
|
-
baseValue = min > 0 ? min : max < 0 ? max : 0;
|
|
44522
|
-
userEncodeRes.x1 = scales.x.scale(baseValue);
|
|
44523
|
-
}
|
|
44524
|
-
const bandWidth = scales.y.bandwidth();
|
|
44525
|
-
userEncodeRes.y = userEncodeRes.y + bandWidth / 4, userEncodeRes.y1 = userEncodeRes.y + bandWidth / 2;
|
|
44526
|
-
}
|
|
44527
|
-
if (scales) {
|
|
44528
|
-
const coord = (null !== (_b = this.view.getScaleById(null === (_a = userEncoder.x) || void 0 === _a ? void 0 : _a.scale)) && void 0 !== _b ? _b : this.view.getScaleById(null === (_c = userEncoder.y) || void 0 === _c ? void 0 : _c.scale)).getCoordinate();
|
|
44529
|
-
if (coord && "polar" === coord.type) {
|
|
44530
|
-
this.disableCoordinateTransform = !0;
|
|
44531
|
-
const origin = coord.origin();
|
|
44532
|
-
userEncodeRes.cx = origin.x, userEncodeRes.cy = origin.y;
|
|
44533
|
-
}
|
|
44534
|
-
}
|
|
44535
|
-
return userEncodeRes;
|
|
44536
|
-
}
|
|
44537
|
-
};
|
|
44538
|
-
} else this._encoders[state] = userEncoder;
|
|
44539
|
-
}
|
|
44540
|
-
_getEncoders() {
|
|
44541
|
-
var _a;
|
|
44542
|
-
return null !== (_a = this._encoders) && void 0 !== _a ? _a : {};
|
|
44543
|
-
}
|
|
44544
|
-
getAttributeTransforms() {
|
|
44545
|
-
return this.coord && "polar" === this.coord.output().type ? [{
|
|
44546
|
-
channels: ["x", "y", "x1", "y1", "cx", "cy"],
|
|
44547
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
44548
|
-
graphicAttributes.x = storedAttrs.cx, graphicAttributes.y = storedAttrs.cy, this.coord.output().isTransposed() ? (graphicAttributes.startAngle = storedAttrs.y, graphicAttributes.endAngle = storedAttrs.y1, graphicAttributes.innerRadius = storedAttrs.x, graphicAttributes.outerRadius = storedAttrs.x1) : (graphicAttributes.startAngle = storedAttrs.x, graphicAttributes.endAngle = storedAttrs.x1, graphicAttributes.innerRadius = storedAttrs.y, graphicAttributes.outerRadius = storedAttrs.y1);
|
|
44549
|
-
},
|
|
44550
|
-
storedAttrs: "sizeAttrs"
|
|
44551
|
-
}] : transformsByType.rect;
|
|
44552
|
-
}
|
|
44553
|
-
addGraphicItem(attrs, groupKey) {
|
|
44554
|
-
const graphicItem = createGraphicItem(this, this.coord && "polar" === this.coord.output().type ? GrammarMarkType.arc : GrammarMarkType.rect, attrs);
|
|
44555
|
-
return super.addGraphicItem(attrs, groupKey, graphicItem);
|
|
44556
|
-
}
|
|
44557
|
-
release() {
|
|
44558
|
-
super.release(), this._encoders = null;
|
|
44559
|
-
}
|
|
44560
|
-
}
|
|
44561
|
-
|
|
44562
|
-
class Cell extends Mark {
|
|
44563
|
-
encodeState(state, channel, value) {
|
|
44564
|
-
return super.encodeState(state, channel, value), this._updateComponentEncoders(state), this;
|
|
44565
|
-
}
|
|
44566
|
-
_updateComponentEncoders(state) {
|
|
44567
|
-
this._encoders || (this._encoders = {});
|
|
44568
|
-
const userEncoder = this.spec.encode[state];
|
|
44569
|
-
if (userEncoder && "update" === state) {
|
|
44570
|
-
const params = this.parameters(),
|
|
44571
|
-
scales = isFunctionType(userEncoder) ? null : Object.keys(userEncoder).reduce((res, channel) => (isScaleEncode(userEncoder[channel]) && (res[channel] = getGrammarOutput(userEncoder[channel].scale, params)), res), {});
|
|
44572
|
-
this._encoders[state] = {
|
|
44573
|
-
callback: (datum, element, parameters) => {
|
|
44574
|
-
const userEncodeRes = invokeEncoder(userEncoder, datum, element, parameters);
|
|
44575
|
-
if (isNil$1(userEncodeRes.size)) {
|
|
44576
|
-
const sizeX = scales.x ? getBandWidthOfScale(scales.x) : void 0,
|
|
44577
|
-
sizeY = scales.y ? getBandWidthOfScale(scales.y) : void 0;
|
|
44578
|
-
isNil$1(sizeX) && isNil$1(sizeY) ? userEncodeRes.size = 10 : isNil$1(sizeX) ? userEncodeRes.size = sizeY : isNil$1(sizeY) && (userEncodeRes.size = sizeX), userEncodeRes.size = [sizeX, sizeY];
|
|
44579
|
-
}
|
|
44580
|
-
return isNil$1(userEncodeRes.shape) && (userEncodeRes.shape = "rect"), userEncodeRes;
|
|
44581
|
-
}
|
|
44582
|
-
};
|
|
44583
|
-
} else this._encoders[state] = userEncoder;
|
|
44584
|
-
}
|
|
44585
|
-
_getEncoders() {
|
|
44586
|
-
var _a;
|
|
44587
|
-
return null !== (_a = this._encoders) && void 0 !== _a ? _a : {};
|
|
44588
|
-
}
|
|
44589
|
-
getAttributeTransforms() {
|
|
44590
|
-
return [{
|
|
44591
|
-
channels: ["size", "padding"],
|
|
44592
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
44593
|
-
if (isNumber$2(storedAttrs.padding) && storedAttrs.padding > 0) graphicAttributes.size = isArray$1(storedAttrs.size) ? storedAttrs.size.map(entry => Math.max(entry - storedAttrs.padding, 1)) : Math.max(storedAttrs.size - storedAttrs.padding, 1);else if (isArray$1(storedAttrs.padding) && 2 === storedAttrs.padding.length) {
|
|
44594
|
-
const arraySize = isArray$1(storedAttrs.size) ? storedAttrs.size : [storedAttrs.size, storedAttrs.size];
|
|
44595
|
-
graphicAttributes.size = [Math.max(arraySize[0] - storedAttrs.padding[0], 1), Math.max(arraySize[1] - storedAttrs.padding[1], 1)];
|
|
44596
|
-
} else graphicAttributes.size = storedAttrs.size;
|
|
44597
|
-
},
|
|
44598
|
-
storedAttrs: "paddingAttrs"
|
|
44599
|
-
}].concat(transformsByType.symbol);
|
|
44600
|
-
}
|
|
44601
|
-
release() {
|
|
44602
|
-
super.release(), this._encoders = null;
|
|
44603
|
-
}
|
|
44604
|
-
}
|
|
44605
|
-
|
|
44606
44514
|
class Text extends Mark {
|
|
44607
44515
|
addGraphicItem(initAttrs, groupKey) {
|
|
44608
44516
|
const textConfig = null == initAttrs ? void 0 : initAttrs.text,
|
|
@@ -44618,6 +44526,7 @@
|
|
|
44618
44526
|
super.release();
|
|
44619
44527
|
}
|
|
44620
44528
|
}
|
|
44529
|
+
Text.markType = GrammarMarkType.text;
|
|
44621
44530
|
|
|
44622
44531
|
const axis = {
|
|
44623
44532
|
label: {
|
|
@@ -45426,17 +45335,11 @@
|
|
|
45426
45335
|
case GrammarMarkType.component:
|
|
45427
45336
|
mark = Factory$1.hasComponent(null == markOptions ? void 0 : markOptions.componentType) ? Factory$1.createComponent(null == markOptions ? void 0 : markOptions.componentType, this, groupMark, null == markOptions ? void 0 : markOptions.mode) : new Component(this, null == markOptions ? void 0 : markOptions.componentType, groupMark, null == markOptions ? void 0 : markOptions.mode);
|
|
45428
45337
|
break;
|
|
45429
|
-
case GrammarMarkType.interval:
|
|
45430
|
-
mark = new Interval(this, type, groupMark);
|
|
45431
|
-
break;
|
|
45432
|
-
case GrammarMarkType.cell:
|
|
45433
|
-
mark = new Cell(this, type, groupMark);
|
|
45434
|
-
break;
|
|
45435
45338
|
case GrammarMarkType.text:
|
|
45436
45339
|
mark = new Text(this, type, groupMark);
|
|
45437
45340
|
break;
|
|
45438
45341
|
default:
|
|
45439
|
-
mark = new Mark(this, type, groupMark);
|
|
45342
|
+
mark = Factory$1.hasMark(type) ? Factory$1.createMark(type, this, groupMark) : new Mark(this, type, groupMark);
|
|
45440
45343
|
}
|
|
45441
45344
|
return this.grammars.record(mark), this._dataflow.add(mark), mark;
|
|
45442
45345
|
}
|
|
@@ -45556,7 +45459,7 @@
|
|
|
45556
45459
|
return this.removeAllInteractions(), this.removeAllGrammars(), this.parseSpec(spec);
|
|
45557
45460
|
}
|
|
45558
45461
|
parseBuiltIn() {
|
|
45559
|
-
builtInSignals(this._options, this._config, this.getCurrentTheme()).
|
|
45462
|
+
builtInSignals(this._options, this._config, this.getCurrentTheme()).forEach(signalSpec => {
|
|
45560
45463
|
const signal = this.signal().parse(signalSpec);
|
|
45561
45464
|
signalSpec.value && signal.set(signalSpec.value);
|
|
45562
45465
|
});
|
|
@@ -45592,8 +45495,8 @@
|
|
|
45592
45495
|
});
|
|
45593
45496
|
}
|
|
45594
45497
|
theme(theme) {
|
|
45595
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45596
|
-
return isString$1(theme) ? this._theme = null !== (_a = ThemeManager$1.getTheme(theme)) && void 0 !== _a ? _a : ThemeManager$1.getDefaultTheme() : this._theme = theme, this.background(null !== (_d = null !== (_c = null === (_b = this._spec) || void 0 === _b ? void 0 : _b.background) && void 0 !== _c ? _c : this._options.background) && void 0 !== _d ? _d : this._theme.background), this.padding(null !== (_g = null !== (_f = null === (_e = this._spec) || void 0 === _e ? void 0 : _e.padding) && void 0 !== _f ? _f : this._options.padding) && void 0 !== _g ? _g : this._theme.padding), null === (_j = null === (_h = this.renderer.stage()) || void 0 === _h ? void 0 : _h.setTheme) || void 0 === _j || _j.call(_h, Object.assign({}, this._theme.marks)), this;
|
|
45498
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
45499
|
+
return isString$1(theme) ? this._theme = null !== (_a = ThemeManager$1.getTheme(theme)) && void 0 !== _a ? _a : ThemeManager$1.getDefaultTheme() : this._theme = theme, this._theme ? (this.background(null !== (_d = null !== (_c = null === (_b = this._spec) || void 0 === _b ? void 0 : _b.background) && void 0 !== _c ? _c : this._options.background) && void 0 !== _d ? _d : this._theme.background), this.padding(null !== (_g = null !== (_f = null === (_e = this._spec) || void 0 === _e ? void 0 : _e.padding) && void 0 !== _f ? _f : this._options.padding) && void 0 !== _g ? _g : this._theme.padding), null === (_j = null === (_h = this.renderer.stage()) || void 0 === _h ? void 0 : _h.setTheme) || void 0 === _j || _j.call(_h, Object.assign({}, this._theme.marks))) : (this.background(null !== (_l = null === (_k = this._spec) || void 0 === _k ? void 0 : _k.background) && void 0 !== _l ? _l : this._options.background), this.padding(null !== (_o = null === (_m = this._spec) || void 0 === _m ? void 0 : _m.padding) && void 0 !== _o ? _o : this._options.padding)), this;
|
|
45597
45500
|
}
|
|
45598
45501
|
getCurrentTheme() {
|
|
45599
45502
|
return this._theme;
|
|
@@ -45718,7 +45621,7 @@
|
|
|
45718
45621
|
const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
|
|
45719
45622
|
this.reuseCachedGrammars(normalizedRunningConfig);
|
|
45720
45623
|
const grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
45721
|
-
this.detachCachedGrammar();
|
|
45624
|
+
grammarWillDetach && this.detachCachedGrammar();
|
|
45722
45625
|
const hasResize = this._resizeRenderer(),
|
|
45723
45626
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45724
45627
|
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), yield this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, yield this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!1), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
|
|
@@ -45731,7 +45634,7 @@
|
|
|
45731
45634
|
const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
|
|
45732
45635
|
this.reuseCachedGrammars(normalizedRunningConfig);
|
|
45733
45636
|
const grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
45734
|
-
this.detachCachedGrammar();
|
|
45637
|
+
grammarWillDetach && this.detachCachedGrammar();
|
|
45735
45638
|
const hasResize = this._resizeRenderer(),
|
|
45736
45639
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45737
45640
|
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), this._dataflow.evaluateSync(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, this._dataflow.evaluateSync()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!0), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
|
|
@@ -45972,12 +45875,9 @@
|
|
|
45972
45875
|
}
|
|
45973
45876
|
initialize() {
|
|
45974
45877
|
var _a;
|
|
45975
|
-
this.grammars = new RecordedGrammars(grammar => grammar.id(), (key, grammar) => this.logger.warn(`Grammar id '${key}' has been occupied`, grammar)), this._cachedGrammars = new RecordedTreeGrammars(grammar => grammar.id()), this._options.logger && Logger.setInstance(this._options.logger), this.logger = Logger.getInstance(null !== (_a = this._options.logLevel) && void 0 !== _a ? _a : 0), this._dataflow = new Dataflow(), this.animate = new ViewAnimate(this), this._morph = new Morph(), this.
|
|
45878
|
+
this.grammars = new RecordedGrammars(grammar => grammar.id(), (key, grammar) => this.logger.warn(`Grammar id '${key}' has been occupied`, grammar)), this._cachedGrammars = new RecordedTreeGrammars(grammar => grammar.id()), this._options.logger && Logger.setInstance(this._options.logger), this.logger = Logger.getInstance(null !== (_a = this._options.logLevel) && void 0 !== _a ? _a : 0), this._dataflow = new Dataflow(), this.animate = new ViewAnimate(this), this._morph = new Morph(), this._options.hooks && (Object.keys(this._options.hooks).forEach(key => {
|
|
45976
45879
|
this.on(key, this._options.hooks[key]);
|
|
45977
|
-
}), this.hooks = this._options.hooks), this.container = null, this.renderer = null, this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig), this._theme = ThemeManager$1.getDefaultTheme(), this.parseBuiltIn(), configureEnvironment(this._options), this.initializeRenderer(), this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(), this._currentDataflow = null, this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this.theme(this._theme);
|
|
45978
|
-
}
|
|
45979
|
-
normalBrowserEnv() {
|
|
45980
|
-
return "browser" === this._options.mode;
|
|
45880
|
+
}), this.hooks = this._options.hooks), this.container = null, this.renderer = null, this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig), this._theme = this._options.disableTheme ? null : ThemeManager$1.getDefaultTheme(), this.parseBuiltIn(), configureEnvironment(this._options), this.initializeRenderer(), this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(), this._currentDataflow = null, this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this.theme(this._theme);
|
|
45981
45881
|
}
|
|
45982
45882
|
pauseProgressive() {
|
|
45983
45883
|
return !1;
|
|
@@ -47935,15 +47835,16 @@
|
|
|
47935
47835
|
});
|
|
47936
47836
|
|
|
47937
47837
|
const moveIn = (element, options, animationParameters) => {
|
|
47938
|
-
var _a, _b, _c
|
|
47838
|
+
var _a, _b, _c;
|
|
47939
47839
|
const offset = null !== (_a = null == options ? void 0 : options.offset) && void 0 !== _a ? _a : 0,
|
|
47940
47840
|
groupBounds = animationParameters.group ? animationParameters.group.getBounds() : null,
|
|
47941
47841
|
groupWidth = null !== (_b = null == groupBounds ? void 0 : groupBounds.width()) && void 0 !== _b ? _b : animationParameters.width,
|
|
47942
47842
|
groupHeight = null !== (_c = null == groupBounds ? void 0 : groupBounds.height()) && void 0 !== _c ? _c : animationParameters.height,
|
|
47943
47843
|
changedX = ("negative" === (null == options ? void 0 : options.orient) ? groupWidth : 0) + offset,
|
|
47944
47844
|
changedY = ("negative" === (null == options ? void 0 : options.orient) ? groupHeight : 0) + offset,
|
|
47945
|
-
|
|
47946
|
-
|
|
47845
|
+
point = isFunction$1(null == options ? void 0 : options.point) ? options.point.call(null, element.getDatum(), element, animationParameters) : null == options ? void 0 : options.point,
|
|
47846
|
+
fromX = isValidNumber$1(null == point ? void 0 : point.x) ? point.x : changedX,
|
|
47847
|
+
fromY = isValidNumber$1(null == point ? void 0 : point.y) ? point.y : changedY;
|
|
47947
47848
|
switch (null == options ? void 0 : options.direction) {
|
|
47948
47849
|
case "x":
|
|
47949
47850
|
return {
|
|
@@ -47977,15 +47878,16 @@
|
|
|
47977
47878
|
}
|
|
47978
47879
|
};
|
|
47979
47880
|
const moveOut = (element, options, animationParameters) => {
|
|
47980
|
-
var _a, _b, _c
|
|
47881
|
+
var _a, _b, _c;
|
|
47981
47882
|
const offset = null !== (_a = null == options ? void 0 : options.offset) && void 0 !== _a ? _a : 0,
|
|
47982
47883
|
groupBounds = animationParameters.group ? animationParameters.group.getBounds() : null,
|
|
47983
47884
|
groupWidth = null !== (_b = null == groupBounds ? void 0 : groupBounds.width()) && void 0 !== _b ? _b : animationParameters.width,
|
|
47984
47885
|
groupHeight = null !== (_c = null == groupBounds ? void 0 : groupBounds.height()) && void 0 !== _c ? _c : animationParameters.height,
|
|
47985
47886
|
changedX = ("negative" === (null == options ? void 0 : options.orient) ? groupWidth : 0) + offset,
|
|
47986
47887
|
changedY = ("negative" === (null == options ? void 0 : options.orient) ? groupHeight : 0) + offset,
|
|
47987
|
-
|
|
47988
|
-
|
|
47888
|
+
point = isFunction$1(null == options ? void 0 : options.point) ? options.point.call(null, element.getDatum(), element, animationParameters) : null == options ? void 0 : options.point,
|
|
47889
|
+
fromX = isValidNumber$1(null == point ? void 0 : point.x) ? point.x : changedX,
|
|
47890
|
+
fromY = isValidNumber$1(null == point ? void 0 : point.y) ? point.y : changedY;
|
|
47989
47891
|
switch (null == options ? void 0 : options.direction) {
|
|
47990
47892
|
case "x":
|
|
47991
47893
|
return {
|
|
@@ -48210,6 +48112,54 @@
|
|
|
48210
48112
|
Factory$1.registerAnimationType("update", update);
|
|
48211
48113
|
};
|
|
48212
48114
|
|
|
48115
|
+
class Cell extends Mark {
|
|
48116
|
+
encodeState(state, channel, value) {
|
|
48117
|
+
return super.encodeState(state, channel, value), this._updateComponentEncoders(state), this;
|
|
48118
|
+
}
|
|
48119
|
+
_updateComponentEncoders(state) {
|
|
48120
|
+
this._encoders || (this._encoders = {});
|
|
48121
|
+
const userEncoder = this.spec.encode[state];
|
|
48122
|
+
if (userEncoder && "update" === state) {
|
|
48123
|
+
const params = this.parameters(),
|
|
48124
|
+
scales = isFunctionType(userEncoder) ? null : Object.keys(userEncoder).reduce((res, channel) => (isScaleEncode(userEncoder[channel]) && (res[channel] = getGrammarOutput(userEncoder[channel].scale, params)), res), {});
|
|
48125
|
+
this._encoders[state] = {
|
|
48126
|
+
callback: (datum, element, parameters) => {
|
|
48127
|
+
const userEncodeRes = invokeEncoder(userEncoder, datum, element, parameters);
|
|
48128
|
+
if (isNil$1(userEncodeRes.size)) {
|
|
48129
|
+
const sizeX = scales.x ? getBandWidthOfScale(scales.x) : void 0,
|
|
48130
|
+
sizeY = scales.y ? getBandWidthOfScale(scales.y) : void 0;
|
|
48131
|
+
isNil$1(sizeX) && isNil$1(sizeY) ? userEncodeRes.size = 10 : isNil$1(sizeX) ? userEncodeRes.size = sizeY : isNil$1(sizeY) && (userEncodeRes.size = sizeX), userEncodeRes.size = [sizeX, sizeY];
|
|
48132
|
+
}
|
|
48133
|
+
return isNil$1(userEncodeRes.shape) && (userEncodeRes.shape = "rect"), userEncodeRes;
|
|
48134
|
+
}
|
|
48135
|
+
};
|
|
48136
|
+
} else this._encoders[state] = userEncoder;
|
|
48137
|
+
}
|
|
48138
|
+
_getEncoders() {
|
|
48139
|
+
var _a;
|
|
48140
|
+
return null !== (_a = this._encoders) && void 0 !== _a ? _a : {};
|
|
48141
|
+
}
|
|
48142
|
+
getAttributeTransforms() {
|
|
48143
|
+
return [{
|
|
48144
|
+
channels: ["size", "padding"],
|
|
48145
|
+
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
48146
|
+
if (isNumber$2(storedAttrs.padding) && storedAttrs.padding > 0) graphicAttributes.size = isArray$1(storedAttrs.size) ? storedAttrs.size.map(entry => Math.max(entry - storedAttrs.padding, 1)) : Math.max(storedAttrs.size - storedAttrs.padding, 1);else if (isArray$1(storedAttrs.padding) && 2 === storedAttrs.padding.length) {
|
|
48147
|
+
const arraySize = isArray$1(storedAttrs.size) ? storedAttrs.size : [storedAttrs.size, storedAttrs.size];
|
|
48148
|
+
graphicAttributes.size = [Math.max(arraySize[0] - storedAttrs.padding[0], 1), Math.max(arraySize[1] - storedAttrs.padding[1], 1)];
|
|
48149
|
+
} else graphicAttributes.size = storedAttrs.size;
|
|
48150
|
+
},
|
|
48151
|
+
storedAttrs: "paddingAttrs"
|
|
48152
|
+
}].concat(transformsByType.symbol);
|
|
48153
|
+
}
|
|
48154
|
+
release() {
|
|
48155
|
+
super.release(), this._encoders = null;
|
|
48156
|
+
}
|
|
48157
|
+
}
|
|
48158
|
+
Cell.markType = GrammarMarkType.cell;
|
|
48159
|
+
const registerCellMark = () => {
|
|
48160
|
+
Factory$1.registerMark(GrammarMarkType.cell, Cell);
|
|
48161
|
+
};
|
|
48162
|
+
|
|
48213
48163
|
const BASE_EVENTS = [
|
|
48214
48164
|
'pointerdown',
|
|
48215
48165
|
'pointerup',
|
|
@@ -50897,10 +50847,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50897
50847
|
return bounds.x1 > x || bounds.x2 < x || bounds.y1 > y || bounds.y2 < y;
|
|
50898
50848
|
}
|
|
50899
50849
|
function min(data, field) {
|
|
50900
|
-
|
|
50850
|
+
const dataArray = [];
|
|
50851
|
+
data.forEach(d => {
|
|
50852
|
+
const value = +d[field];
|
|
50853
|
+
if (isValidNumber$1(value)) {
|
|
50854
|
+
dataArray.push(value);
|
|
50855
|
+
}
|
|
50856
|
+
});
|
|
50857
|
+
if (dataArray.length === 0) {
|
|
50858
|
+
return null;
|
|
50859
|
+
}
|
|
50860
|
+
return minInArray(dataArray);
|
|
50901
50861
|
}
|
|
50902
50862
|
function max(data, field) {
|
|
50903
|
-
|
|
50863
|
+
const dataArray = [];
|
|
50864
|
+
data.forEach(d => {
|
|
50865
|
+
const value = +d[field];
|
|
50866
|
+
if (isValidNumber$1(value)) {
|
|
50867
|
+
dataArray.push(value);
|
|
50868
|
+
}
|
|
50869
|
+
});
|
|
50870
|
+
if (dataArray.length === 0) {
|
|
50871
|
+
return null;
|
|
50872
|
+
}
|
|
50873
|
+
return maxInArray(dataArray);
|
|
50904
50874
|
}
|
|
50905
50875
|
function sum(data, field) {
|
|
50906
50876
|
return data.reduce((pre, _cur) => {
|
|
@@ -55937,7 +55907,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
55937
55907
|
return;
|
|
55938
55908
|
}
|
|
55939
55909
|
const { enterStyles } = this._separateStyle();
|
|
55940
|
-
this._product.encodeState(
|
|
55910
|
+
this._product.encodeState('group', enterStyles);
|
|
55941
55911
|
}
|
|
55942
55912
|
_separateStyle() {
|
|
55943
55913
|
const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL, normalStyle = _a[_b]; __rest$8(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
@@ -55966,7 +55936,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
55966
55936
|
const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL; _a[_b]; const temp = __rest$8(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
55967
55937
|
const { enterStyles, updateStyles } = this._separateStyle();
|
|
55968
55938
|
this._product.encode(updateStyles);
|
|
55969
|
-
this._product.encodeState(
|
|
55939
|
+
this._product.encodeState('group', enterStyles);
|
|
55970
55940
|
Object.keys(temp).forEach(state => {
|
|
55971
55941
|
const styles = {};
|
|
55972
55942
|
Object.keys(temp[state]).forEach(key => {
|
|
@@ -57812,7 +57782,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57812
57782
|
};
|
|
57813
57783
|
registerVChartCore();
|
|
57814
57784
|
|
|
57815
|
-
const version = "1.6.
|
|
57785
|
+
const version = "1.6.1";
|
|
57816
57786
|
|
|
57817
57787
|
class ChartData {
|
|
57818
57788
|
get dataList() {
|
|
@@ -64767,7 +64737,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64767
64737
|
this.seriesType = exports.SeriesTypeEnum.map;
|
|
64768
64738
|
}
|
|
64769
64739
|
_getDefaultSeriesSpec(spec) {
|
|
64770
|
-
const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { type: spec.type, nameField: spec.nameField, valueField: spec.valueField, seriesField: spec.seriesField, map: spec.map, nameProperty: spec.nameProperty, nameMap: spec.nameMap, area: spec.area, defaultFillColor: spec.defaultFillColor });
|
|
64740
|
+
const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { type: spec.type, nameField: spec.nameField, valueField: spec.valueField, seriesField: spec.seriesField, map: spec.map, nameProperty: spec.nameProperty, centroidProperty: spec.centroidProperty, nameMap: spec.nameMap, area: spec.area, defaultFillColor: spec.defaultFillColor });
|
|
64771
64741
|
return series;
|
|
64772
64742
|
}
|
|
64773
64743
|
isValidSeries(type) {
|
|
@@ -65518,7 +65488,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65518
65488
|
var _a, _b, _c;
|
|
65519
65489
|
const animationParams = {
|
|
65520
65490
|
growFrom: (datum, element, state) => {
|
|
65521
|
-
var _a
|
|
65491
|
+
var _a;
|
|
65522
65492
|
if (state === AnimationStateEnum.appear) {
|
|
65523
65493
|
return this._startAngle;
|
|
65524
65494
|
}
|
|
@@ -65535,11 +65505,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65535
65505
|
if (markElements.find(e => { var _a; return ((_a = e.data[0]) === null || _a === void 0 ? void 0 : _a[DEFAULT_DATA_INDEX]) > dataIndex; }) === undefined) {
|
|
65536
65506
|
return this._endAngle;
|
|
65537
65507
|
}
|
|
65538
|
-
const prevMarkElement = markElements.
|
|
65508
|
+
const prevMarkElement = [...markElements].reverse().find(e => { var _a; return ((_a = e.data[0]) === null || _a === void 0 ? void 0 : _a[DEFAULT_DATA_INDEX]) < dataIndex; });
|
|
65539
65509
|
if (outState.includes(state)) {
|
|
65540
|
-
return (_a = prevMarkElement === null || prevMarkElement === void 0 ? void 0 : prevMarkElement.
|
|
65510
|
+
return (_a = prevMarkElement === null || prevMarkElement === void 0 ? void 0 : prevMarkElement.getNextGraphicAttributes()) === null || _a === void 0 ? void 0 : _a.endAngle;
|
|
65541
65511
|
}
|
|
65542
|
-
return
|
|
65512
|
+
return prevMarkElement === null || prevMarkElement === void 0 ? void 0 : prevMarkElement.getGraphicAttribute('endAngle', true);
|
|
65543
65513
|
}
|
|
65544
65514
|
};
|
|
65545
65515
|
const appearPreset = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.animationAppear) === null || _b === void 0 ? void 0 : _b.preset;
|
|
@@ -75368,7 +75338,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75368
75338
|
const attr = labelMark.getAttribute(key, datum);
|
|
75369
75339
|
textAttribute[key] = attr;
|
|
75370
75340
|
if (key === 'text' && formatMethod) {
|
|
75371
|
-
textAttribute[key] = formatMethod(textAttribute[key], datum);
|
|
75341
|
+
textAttribute[key] = formatMethod(textAttribute[key], datum, { series });
|
|
75372
75342
|
}
|
|
75373
75343
|
}
|
|
75374
75344
|
return textAttribute;
|
|
@@ -78545,6 +78515,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78545
78515
|
HeatmapSeries.type = exports.SeriesTypeEnum.heatmap;
|
|
78546
78516
|
HeatmapSeries.mark = heatmapSeriesMark;
|
|
78547
78517
|
const registerHeatmapSeries = () => {
|
|
78518
|
+
registerCellMark();
|
|
78548
78519
|
Factory.registerMark(CellMark.type, CellMark);
|
|
78549
78520
|
Factory.registerMark(TextMark.type, TextMark);
|
|
78550
78521
|
Factory.registerSeries(HeatmapSeries.type, HeatmapSeries);
|
|
@@ -79503,9 +79474,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79503
79474
|
}
|
|
79504
79475
|
updateScaleDomain() {
|
|
79505
79476
|
}
|
|
79506
|
-
computeData() {
|
|
79507
|
-
this.
|
|
79508
|
-
|
|
79477
|
+
computeData(updateType) {
|
|
79478
|
+
if (updateType === 'force' || !isEqual$1(this._scale.range(), [0, 1])) {
|
|
79479
|
+
this._tickData.getDataView().reRunAllTransform();
|
|
79480
|
+
this._tickData.updateData();
|
|
79481
|
+
}
|
|
79509
79482
|
}
|
|
79510
79483
|
initScales() {
|
|
79511
79484
|
this._scales = [this._scale];
|
|
@@ -79731,8 +79704,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79731
79704
|
this._tick = undefined;
|
|
79732
79705
|
this._layoutCache = { width: 0, height: 0, _lastComputeOutBounds: { x1: 0, x2: 0, y1: 0, y2: 0 } };
|
|
79733
79706
|
this.effect = {
|
|
79734
|
-
scaleUpdate:
|
|
79735
|
-
this.computeData();
|
|
79707
|
+
scaleUpdate: params => {
|
|
79708
|
+
this.computeData(params === null || params === void 0 ? void 0 : params.value);
|
|
79736
79709
|
eachSeries(this._regions, s => {
|
|
79737
79710
|
if (isXAxis(this.getOrient())) {
|
|
79738
79711
|
s.setXAxisHelper(this.axisHelper());
|
|
@@ -80015,7 +79988,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80015
79988
|
onLayoutEnd(ctx) {
|
|
80016
79989
|
const isRangeChange = this.updateScaleRange();
|
|
80017
79990
|
if (isRangeChange) {
|
|
80018
|
-
this.event.emit(ChartEvent.scaleUpdate, { model: this });
|
|
79991
|
+
this.event.emit(ChartEvent.scaleUpdate, { model: this, value: 'range' });
|
|
80019
79992
|
}
|
|
80020
79993
|
else {
|
|
80021
79994
|
this.updateSeriesScale();
|
|
@@ -80150,8 +80123,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80150
80123
|
}
|
|
80151
80124
|
this._verticalLimitSize = isXAxis(this.getOrient()) ? rect.height : rect.width;
|
|
80152
80125
|
this.setLayoutRect(rect);
|
|
80153
|
-
this.updateScaleRange();
|
|
80154
|
-
|
|
80126
|
+
const isChanged = this.updateScaleRange();
|
|
80127
|
+
if (isChanged) {
|
|
80128
|
+
this.computeData('range');
|
|
80129
|
+
}
|
|
80155
80130
|
const context = { skipLayout: false };
|
|
80156
80131
|
const isX = isXAxis(this.getOrient());
|
|
80157
80132
|
if (this.pluginService) {
|
|
@@ -80164,29 +80139,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80164
80139
|
});
|
|
80165
80140
|
}
|
|
80166
80141
|
const product = this._axisMark.getProduct();
|
|
80167
|
-
|
|
80142
|
+
let hasBounds = false;
|
|
80168
80143
|
{
|
|
80169
80144
|
const attrs = this._getUpdateAttribute(true);
|
|
80170
80145
|
const axisComponent = product.getGroupGraphicItem();
|
|
80171
|
-
const
|
|
80146
|
+
const spec = mergeSpec(Object.assign({}, this.getLayoutStartPoint()), this._axisStyle, attrs, { line: { visible: false } });
|
|
80147
|
+
const updateBounds = axisComponent.getBoundsWithoutRender(spec);
|
|
80172
80148
|
if (isFinite(updateBounds.width())) {
|
|
80173
80149
|
result = this._appendAxisUnit(updateBounds, isX);
|
|
80150
|
+
hasBounds = true;
|
|
80174
80151
|
this._latestBounds = updateBounds;
|
|
80175
80152
|
}
|
|
80176
80153
|
}
|
|
80154
|
+
if (!hasBounds) {
|
|
80155
|
+
this._latestBounds = product.getBounds();
|
|
80156
|
+
}
|
|
80177
80157
|
return result;
|
|
80178
80158
|
}
|
|
80179
80159
|
updateLayoutAttribute() {
|
|
80180
80160
|
if (!this.visible) {
|
|
80181
80161
|
return;
|
|
80182
80162
|
}
|
|
80163
|
+
const startPoint = this.getLayoutStartPoint();
|
|
80183
80164
|
const _a = this._getUpdateAttribute(false), { grid: updateGridAttrs } = _a, updateAxisAttrs = __rest$8(_a, ["grid"]);
|
|
80184
80165
|
const axisProduct = this._axisMark.getProduct();
|
|
80185
|
-
const axisAttrs = mergeSpec(
|
|
80166
|
+
const axisAttrs = mergeSpec({ x: startPoint.x, y: startPoint.y }, this._axisStyle, updateAxisAttrs);
|
|
80186
80167
|
axisProduct.encode(axisAttrs);
|
|
80187
80168
|
if (this._gridMark) {
|
|
80188
80169
|
const gridProduct = this._gridMark.getProduct();
|
|
80189
|
-
gridProduct.encode(mergeSpec(
|
|
80170
|
+
gridProduct.encode(mergeSpec({ x: startPoint.x, y: startPoint.y }, this._getGridAttributes(), updateGridAttrs));
|
|
80190
80171
|
}
|
|
80191
80172
|
super.updateLayoutAttribute();
|
|
80192
80173
|
}
|
|
@@ -80555,7 +80536,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80555
80536
|
this.niceDomain(domain);
|
|
80556
80537
|
this._scale.domain(domain, this._nice);
|
|
80557
80538
|
this.setScaleNice();
|
|
80558
|
-
this.event.emit(ChartEvent.scaleUpdate, { model: this });
|
|
80539
|
+
this.event.emit(ChartEvent.scaleUpdate, { model: this, value: 'domain' });
|
|
80559
80540
|
}
|
|
80560
80541
|
extendDomain(domain) {
|
|
80561
80542
|
let temp;
|
|
@@ -80604,7 +80585,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80604
80585
|
this._scale.domain(domain, this._nice);
|
|
80605
80586
|
this.setScaleNice();
|
|
80606
80587
|
this.event.emit(ChartEvent.scaleDomainUpdate, { model: this });
|
|
80607
|
-
this.event.emit(ChartEvent.scaleUpdate, { model: this });
|
|
80588
|
+
this.event.emit(ChartEvent.scaleUpdate, { model: this, value: 'domain' });
|
|
80608
80589
|
}
|
|
80609
80590
|
}
|
|
80610
80591
|
|
|
@@ -80729,7 +80710,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80729
80710
|
}
|
|
80730
80711
|
this.transformScaleDomain();
|
|
80731
80712
|
this.event.emit(ChartEvent.scaleDomainUpdate, { model: this });
|
|
80732
|
-
this.event.emit(ChartEvent.scaleUpdate, { model: this });
|
|
80713
|
+
this.event.emit(ChartEvent.scaleUpdate, { model: this, value: 'domain' });
|
|
80733
80714
|
}
|
|
80734
80715
|
}
|
|
80735
80716
|
|
|
@@ -80811,8 +80792,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80811
80792
|
this.type = ComponentTypeEnum.cartesianTimeAxis;
|
|
80812
80793
|
this._zero = false;
|
|
80813
80794
|
this.effect = {
|
|
80814
|
-
scaleUpdate:
|
|
80815
|
-
this.computeData();
|
|
80795
|
+
scaleUpdate: params => {
|
|
80796
|
+
this.computeData(params === null || params === void 0 ? void 0 : params.value);
|
|
80816
80797
|
eachSeries(this._regions, s => {
|
|
80817
80798
|
if (isXAxis(this.getOrient())) {
|
|
80818
80799
|
s.setXAxisHelper(this.axisHelper());
|
|
@@ -80860,8 +80841,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80860
80841
|
this._layerTickData = new CompilableData(this._option, layerTickData);
|
|
80861
80842
|
}
|
|
80862
80843
|
}
|
|
80863
|
-
computeData() {
|
|
80864
|
-
super.computeData();
|
|
80844
|
+
computeData(updateType) {
|
|
80845
|
+
super.computeData(updateType);
|
|
80865
80846
|
if (this._layerTickData) {
|
|
80866
80847
|
this._layerTickData.getDataView().reRunAllTransform();
|
|
80867
80848
|
this._layerTickData.updateData();
|
|
@@ -80983,8 +80964,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80983
80964
|
this._orient = 'radius';
|
|
80984
80965
|
this._groupScales = [];
|
|
80985
80966
|
this.effect = {
|
|
80986
|
-
scaleUpdate:
|
|
80987
|
-
this.computeData();
|
|
80967
|
+
scaleUpdate: param => {
|
|
80968
|
+
this.computeData(param === null || param === void 0 ? void 0 : param.value);
|
|
80988
80969
|
eachSeries(this._regions, s => {
|
|
80989
80970
|
if (this.getOrient() === 'radius') {
|
|
80990
80971
|
s.radiusAxisHelper = this.axisHelper();
|
|
@@ -81094,9 +81075,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81094
81075
|
super.setLayoutStartPosition(startPoint);
|
|
81095
81076
|
}
|
|
81096
81077
|
onLayoutEnd(ctx) {
|
|
81097
|
-
this.updateScaleRange();
|
|
81098
|
-
|
|
81099
|
-
|
|
81078
|
+
const isChanged = this.updateScaleRange();
|
|
81079
|
+
if (isChanged) {
|
|
81080
|
+
this.updateSeriesScale();
|
|
81081
|
+
this.event.emit(ChartEvent.scaleUpdate, { model: this, value: 'range' });
|
|
81082
|
+
}
|
|
81100
81083
|
super.onLayoutEnd(ctx);
|
|
81101
81084
|
}
|
|
81102
81085
|
onRender(ctx) {
|
|
@@ -81147,14 +81130,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81147
81130
|
}
|
|
81148
81131
|
updateScaleRange() {
|
|
81149
81132
|
const inverse = this._spec.inverse;
|
|
81133
|
+
const prevRange = this._scale.range();
|
|
81134
|
+
let newRange;
|
|
81150
81135
|
if (this.getOrient() === 'radius') {
|
|
81151
|
-
|
|
81136
|
+
newRange = inverse
|
|
81152
81137
|
? [this.computeLayoutOuterRadius(), this.computeLayoutInnerRadius()]
|
|
81153
|
-
: [this.computeLayoutInnerRadius(), this.computeLayoutOuterRadius()]
|
|
81138
|
+
: [this.computeLayoutInnerRadius(), this.computeLayoutOuterRadius()];
|
|
81154
81139
|
}
|
|
81155
81140
|
else {
|
|
81156
|
-
|
|
81141
|
+
newRange = inverse ? [this._endAngle, this._startAngle] : [this._startAngle, this._endAngle];
|
|
81142
|
+
}
|
|
81143
|
+
if (prevRange && newRange && prevRange[0] === newRange[0] && prevRange[1] === newRange[1]) {
|
|
81144
|
+
return false;
|
|
81157
81145
|
}
|
|
81146
|
+
this._scale.range(newRange);
|
|
81147
|
+
return true;
|
|
81158
81148
|
}
|
|
81159
81149
|
collectData(depth) {
|
|
81160
81150
|
const data = [];
|
|
@@ -81281,6 +81271,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81281
81271
|
return this.computeLayoutInnerRadius();
|
|
81282
81272
|
}
|
|
81283
81273
|
tickValues() {
|
|
81274
|
+
const latestData = this._tickData.getLatestData();
|
|
81275
|
+
if (latestData && !isArray$1(latestData)) {
|
|
81276
|
+
this.computeData('force');
|
|
81277
|
+
}
|
|
81284
81278
|
return this._tickData.getLatestData() || [];
|
|
81285
81279
|
}
|
|
81286
81280
|
updateLayoutAttribute() {
|
|
@@ -81451,8 +81445,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81451
81445
|
return this.computeBandDomain(data);
|
|
81452
81446
|
}
|
|
81453
81447
|
updateScaleRange() {
|
|
81454
|
-
super.updateScaleRange();
|
|
81448
|
+
const isChanged = super.updateScaleRange();
|
|
81455
81449
|
this.updateGroupScaleRange();
|
|
81450
|
+
return isChanged;
|
|
81456
81451
|
}
|
|
81457
81452
|
axisHelper() {
|
|
81458
81453
|
const helper = super.axisHelper();
|
|
@@ -82893,7 +82888,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82893
82888
|
this._cacheActualTooltip = undefined;
|
|
82894
82889
|
}
|
|
82895
82890
|
if (changePositionOnly && this._cacheViewSpec && this._cacheActualTooltip) {
|
|
82896
|
-
return this.changeTooltipPosition(changePositionOnly,
|
|
82891
|
+
return this.changeTooltipPosition(changePositionOnly, data, params);
|
|
82897
82892
|
}
|
|
82898
82893
|
return this.changeTooltip(true, params, changePositionOnly, activeType, data);
|
|
82899
82894
|
};
|
|
@@ -82946,14 +82941,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82946
82941
|
return TooltipResult.failed;
|
|
82947
82942
|
}
|
|
82948
82943
|
this._cacheActualTooltip = actualTooltip;
|
|
82949
|
-
return this._changeTooltipPosition(!!changePositionOnly,
|
|
82944
|
+
return this._changeTooltipPosition(!!changePositionOnly, data, params);
|
|
82950
82945
|
};
|
|
82951
|
-
this._changeTooltipPosition = (changePositionOnly,
|
|
82946
|
+
this._changeTooltipPosition = (changePositionOnly, data, params) => {
|
|
82952
82947
|
var _a, _b, _c;
|
|
82953
82948
|
if (this._isReleased) {
|
|
82954
82949
|
return TooltipResult.failed;
|
|
82955
82950
|
}
|
|
82956
82951
|
const event = params.event;
|
|
82952
|
+
const spec = this._cacheViewSpec;
|
|
82953
|
+
const actualTooltip = this._cacheActualTooltip;
|
|
82954
|
+
if (!spec || !actualTooltip) {
|
|
82955
|
+
return TooltipResult.failed;
|
|
82956
|
+
}
|
|
82957
|
+
const activeType = actualTooltip.activeType;
|
|
82957
82958
|
if (spec.handler) {
|
|
82958
82959
|
return (_c = (_b = (_a = spec.handler).showTooltip) === null || _b === void 0 ? void 0 : _b.call(_a, activeType, data, params)) !== null && _c !== void 0 ? _c : TooltipResult.success;
|
|
82959
82960
|
}
|
|
@@ -90501,13 +90502,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90501
90502
|
return result;
|
|
90502
90503
|
}
|
|
90503
90504
|
getSizeFromUser(spec, type) {
|
|
90504
|
-
var _a;
|
|
90505
|
+
var _a, _b;
|
|
90505
90506
|
const sizeList = type === 'col' ? this._colSize : this._rowSize;
|
|
90506
|
-
if (!sizeList[spec[type]].isUserSetting) {
|
|
90507
|
+
if (!((_a = sizeList[spec[type]]) === null || _a === void 0 ? void 0 : _a.isUserSetting)) {
|
|
90507
90508
|
return undefined;
|
|
90508
90509
|
}
|
|
90509
90510
|
let result = 0;
|
|
90510
|
-
for (let index = spec[type]; index < spec[type] + ((
|
|
90511
|
+
for (let index = spec[type]; index < spec[type] + ((_b = spec[`${type}Span`]) !== null && _b !== void 0 ? _b : 1); index++) {
|
|
90511
90512
|
if (!sizeList[index].isUserSetting) {
|
|
90512
90513
|
return undefined;
|
|
90513
90514
|
}
|
|
@@ -90585,7 +90586,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90585
90586
|
this._chartViewBox = chartViewBox;
|
|
90586
90587
|
this.clearLayoutSize();
|
|
90587
90588
|
items.sort((a, b) => b.layoutLevel - a.layoutLevel);
|
|
90588
|
-
const normalItems = items.filter(item => item.layoutType === 'normal');
|
|
90589
|
+
const normalItems = items.filter(item => item.layoutType === 'normal' && item.getVisible() !== false);
|
|
90589
90590
|
const normalItemsCol = normalItems.filter(item => isColItem(item));
|
|
90590
90591
|
const normalItemsRow = normalItems.filter(item => !isColItem(item));
|
|
90591
90592
|
normalItems.forEach(item => {
|