@visactor/vchart 1.11.3-alpha.0 → 1.11.4
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.es.js +268 -182
- package/build/index.js +268 -182
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.js +3 -3
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/sankey/sankey.js +5 -3
- package/cjs/chart/sankey/sankey.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.js +4 -2
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/axis/cartesian/band-axis.d.ts +2 -2
- package/cjs/component/axis/cartesian/band-axis.js +2 -2
- package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +1 -1
- package/cjs/component/axis/polar/axis.js +1 -1
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/axis/polar/band-axis.d.ts +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/series/gauge/gauge-pointer.js +3 -1
- package/cjs/series/gauge/gauge-pointer.js.map +1 -1
- package/cjs/series/polar/progress-like/progress-like.js +2 -2
- package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
- package/esm/chart/base/base-chart.js +3 -3
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/sankey/sankey.js +5 -3
- package/esm/chart/sankey/sankey.js.map +1 -1
- package/esm/compile/mark/compilable-mark.js +4 -2
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/axis/cartesian/band-axis.d.ts +2 -2
- package/esm/component/axis/cartesian/band-axis.js +2 -2
- package/esm/component/axis/cartesian/band-axis.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +1 -1
- package/esm/component/axis/polar/axis.js +1 -1
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/axis/polar/band-axis.d.ts +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/series/gauge/gauge-pointer.js +3 -2
- package/esm/series/gauge/gauge-pointer.js.map +1 -1
- package/esm/series/polar/progress-like/progress-like.js +2 -2
- package/esm/series/polar/progress-like/progress-like.js.map +1 -1
- package/package.json +15 -15
package/build/index.js
CHANGED
|
@@ -13241,6 +13241,12 @@
|
|
|
13241
13241
|
return Array.isArray(color) && isNumber$1(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
|
|
13242
13242
|
}
|
|
13243
13243
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
13244
|
+
if (Array.isArray(from) && !isNumber$1(from[0]) || Array.isArray(to) && !isNumber$1(to[0])) {
|
|
13245
|
+
return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$1(from) ? from[index] : from, isArray$1(to) ? to[index] : to, ratio, alphaChannel));
|
|
13246
|
+
}
|
|
13247
|
+
return _interpolateColor(from, to, ratio, alphaChannel, cb);
|
|
13248
|
+
}
|
|
13249
|
+
function _interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
13244
13250
|
if (!from || !to) return from && colorArrayToString(from) || to && colorArrayToString(to) || !1;
|
|
13245
13251
|
let fromArray,
|
|
13246
13252
|
toArray,
|
|
@@ -14040,7 +14046,7 @@
|
|
|
14040
14046
|
animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
|
|
14041
14047
|
type: AttributeUpdateType.STATE
|
|
14042
14048
|
});
|
|
14043
|
-
} else this.setAttributes(attrs, !1, {
|
|
14049
|
+
} else this.stopStateAnimates(), this.setAttributes(attrs, !1, {
|
|
14044
14050
|
type: AttributeUpdateType.STATE
|
|
14045
14051
|
});
|
|
14046
14052
|
}
|
|
@@ -14070,7 +14076,7 @@
|
|
|
14070
14076
|
}), value;
|
|
14071
14077
|
}
|
|
14072
14078
|
clearStates(hasAnimation) {
|
|
14073
|
-
this.
|
|
14079
|
+
this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
14074
14080
|
}
|
|
14075
14081
|
removeState(stateName, hasAnimation) {
|
|
14076
14082
|
if ((this.currentStates ? this.currentStates.indexOf(stateName) : -1) >= 0) {
|
|
@@ -14096,7 +14102,6 @@
|
|
|
14096
14102
|
var _a;
|
|
14097
14103
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
14098
14104
|
if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
|
|
14099
|
-
this.stopStateAnimates();
|
|
14100
14105
|
const stateAttrs = {};
|
|
14101
14106
|
states.forEach(stateName => {
|
|
14102
14107
|
var _a;
|
|
@@ -16858,6 +16863,7 @@
|
|
|
16858
16863
|
var _a;
|
|
16859
16864
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
16860
16865
|
if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
|
|
16866
|
+
this.stopStateAnimates();
|
|
16861
16867
|
const stateAttrs = {},
|
|
16862
16868
|
subAttrs = this.subGraphic.map(() => ({}));
|
|
16863
16869
|
states.forEach(stateName => {
|
|
@@ -16871,9 +16877,9 @@
|
|
|
16871
16877
|
}), this.updateNormalAttrs(stateAttrs), this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation);
|
|
16872
16878
|
}
|
|
16873
16879
|
clearStates(hasAnimation) {
|
|
16874
|
-
this.hasState() && this.normalAttrs
|
|
16880
|
+
this.stopStateAnimates(), this.hasState() && this.normalAttrs ? (this.currentStates = [], this.subGraphic.forEach(graphic => {
|
|
16875
16881
|
graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, !0), graphic.normalAttrs = null;
|
|
16876
|
-
}), this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)
|
|
16882
|
+
}), this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
16877
16883
|
}
|
|
16878
16884
|
clone() {
|
|
16879
16885
|
const glyph = new Glyph(Object.assign({}, this.attribute));
|
|
@@ -18388,7 +18394,7 @@
|
|
|
18388
18394
|
onClearIncremental: new SyncHook(["graphic", "group", "stage"]),
|
|
18389
18395
|
beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
|
|
18390
18396
|
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"])
|
|
18391
|
-
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds(), this._rectBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._symbolBoundsContribitions = [new DefaultSymbolOuterBorderBoundsContribution()], this._circleBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._arcBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._pathBoundsContribitions = [new DefaultOuterBorderBoundsContribution()];
|
|
18397
|
+
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds(), this._rectBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._symbolBoundsContribitions = [new DefaultSymbolOuterBorderBoundsContribution()], this._imageBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._circleBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._arcBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._pathBoundsContribitions = [new DefaultOuterBorderBoundsContribution()];
|
|
18392
18398
|
}
|
|
18393
18399
|
onAttributeUpdate(graphic) {
|
|
18394
18400
|
this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
|
|
@@ -18789,7 +18795,9 @@
|
|
|
18789
18795
|
}
|
|
18790
18796
|
const tb1 = this.tempAABBBounds1,
|
|
18791
18797
|
tb2 = this.tempAABBBounds2;
|
|
18792
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.
|
|
18798
|
+
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._imageBoundsContribitions.length && this._imageBoundsContribitions.forEach(c => {
|
|
18799
|
+
c.updateBounds(attribute, imageTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
18800
|
+
}), this.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, graphic), aabbBounds;
|
|
18793
18801
|
}
|
|
18794
18802
|
combindShadowAABBBounds(bounds, graphic) {
|
|
18795
18803
|
if (graphic && graphic.shadowRoot) {
|
|
@@ -19720,70 +19728,6 @@
|
|
|
19720
19728
|
return path.closePath(), path;
|
|
19721
19729
|
}
|
|
19722
19730
|
|
|
19723
|
-
class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution {
|
|
19724
|
-
constructor() {
|
|
19725
|
-
super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
|
|
19726
|
-
}
|
|
19727
|
-
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
19728
|
-
const {
|
|
19729
|
-
background: background,
|
|
19730
|
-
backgroundMode = graphicAttribute.backgroundMode,
|
|
19731
|
-
backgroundFit = graphicAttribute.backgroundFit
|
|
19732
|
-
} = graphic.attribute;
|
|
19733
|
-
if (background) if (graphic.backgroundImg) {
|
|
19734
|
-
const res = graphic.resources.get(background);
|
|
19735
|
-
if ("success" !== res.state || !res.data) return;
|
|
19736
|
-
if (context.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
19737
|
-
const groupAttribute = getTheme$1(graphic.parent).group,
|
|
19738
|
-
{
|
|
19739
|
-
scrollX = groupAttribute.scrollX,
|
|
19740
|
-
scrollY = groupAttribute.scrollY
|
|
19741
|
-
} = graphic.parent.attribute;
|
|
19742
|
-
context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
|
|
19743
|
-
}
|
|
19744
|
-
const b = graphic.AABBBounds;
|
|
19745
|
-
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
19746
|
-
} else if (isObject$2(background)) {
|
|
19747
|
-
const {
|
|
19748
|
-
stroke: stroke,
|
|
19749
|
-
fill: fill,
|
|
19750
|
-
lineWidth = 1,
|
|
19751
|
-
cornerRadius = 0,
|
|
19752
|
-
expandX = 0,
|
|
19753
|
-
expandY = 0
|
|
19754
|
-
} = background;
|
|
19755
|
-
if (!stroke && !fill) return;
|
|
19756
|
-
context.beginPath();
|
|
19757
|
-
const {
|
|
19758
|
-
x: x,
|
|
19759
|
-
y: y,
|
|
19760
|
-
width: width,
|
|
19761
|
-
height: height
|
|
19762
|
-
} = getActualPosition(graphic);
|
|
19763
|
-
cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
19764
|
-
} else {
|
|
19765
|
-
context.beginPath();
|
|
19766
|
-
const b = graphic.AABBBounds;
|
|
19767
|
-
context.rect(x, y, b.width(), b.height()), context.fillStyle = background, context.globalAlpha = 1, context.fill();
|
|
19768
|
-
}
|
|
19769
|
-
}
|
|
19770
|
-
}
|
|
19771
|
-
function getActualPosition(graphic) {
|
|
19772
|
-
const boundsPadding = parsePadding(graphic.attribute.boundsPadding),
|
|
19773
|
-
bounds = graphic.AABBBounds;
|
|
19774
|
-
let x = bounds.x1,
|
|
19775
|
-
y = bounds.y1,
|
|
19776
|
-
width = bounds.width(),
|
|
19777
|
-
height = bounds.height();
|
|
19778
|
-
return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
|
|
19779
|
-
x: x,
|
|
19780
|
-
y: y,
|
|
19781
|
-
width: width,
|
|
19782
|
-
height: height
|
|
19783
|
-
};
|
|
19784
|
-
}
|
|
19785
|
-
const defaultImageBackgroundRenderContribution = new DefaultImageBackgroundRenderContribution();
|
|
19786
|
-
|
|
19787
19731
|
var __decorate$1w = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19788
19732
|
var d,
|
|
19789
19733
|
c = arguments.length,
|
|
@@ -19890,6 +19834,79 @@
|
|
|
19890
19834
|
const defaultRectTextureRenderContribution = defaultBaseTextureRenderContribution;
|
|
19891
19835
|
const defaultRectBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
19892
19836
|
|
|
19837
|
+
class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution {
|
|
19838
|
+
constructor() {
|
|
19839
|
+
super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
|
|
19840
|
+
}
|
|
19841
|
+
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
19842
|
+
const {
|
|
19843
|
+
background: background,
|
|
19844
|
+
backgroundMode = graphicAttribute.backgroundMode,
|
|
19845
|
+
backgroundFit = graphicAttribute.backgroundFit
|
|
19846
|
+
} = graphic.attribute;
|
|
19847
|
+
if (background) if (graphic.backgroundImg) {
|
|
19848
|
+
const res = graphic.resources.get(background);
|
|
19849
|
+
if ("success" !== res.state || !res.data) return;
|
|
19850
|
+
if (context.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
19851
|
+
const groupAttribute = getTheme$1(graphic.parent).group,
|
|
19852
|
+
{
|
|
19853
|
+
scrollX = groupAttribute.scrollX,
|
|
19854
|
+
scrollY = groupAttribute.scrollY
|
|
19855
|
+
} = graphic.parent.attribute;
|
|
19856
|
+
context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
|
|
19857
|
+
}
|
|
19858
|
+
const b = graphic.AABBBounds;
|
|
19859
|
+
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
19860
|
+
} else if (isObject$2(background)) {
|
|
19861
|
+
const {
|
|
19862
|
+
stroke: stroke,
|
|
19863
|
+
fill: fill,
|
|
19864
|
+
lineWidth = 1,
|
|
19865
|
+
cornerRadius = 0,
|
|
19866
|
+
expandX = 0,
|
|
19867
|
+
expandY = 0
|
|
19868
|
+
} = background;
|
|
19869
|
+
if (!stroke && !fill) return;
|
|
19870
|
+
context.beginPath();
|
|
19871
|
+
const {
|
|
19872
|
+
x: x,
|
|
19873
|
+
y: y,
|
|
19874
|
+
width: width,
|
|
19875
|
+
height: height
|
|
19876
|
+
} = getActualPosition(graphic);
|
|
19877
|
+
cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
19878
|
+
} else {
|
|
19879
|
+
context.beginPath();
|
|
19880
|
+
const b = graphic.AABBBounds;
|
|
19881
|
+
context.rect(x, y, b.width(), b.height()), context.fillStyle = background, context.globalAlpha = 1, context.fill();
|
|
19882
|
+
}
|
|
19883
|
+
}
|
|
19884
|
+
}
|
|
19885
|
+
function getActualPosition(graphic) {
|
|
19886
|
+
const boundsPadding = parsePadding(graphic.attribute.boundsPadding),
|
|
19887
|
+
bounds = graphic.AABBBounds;
|
|
19888
|
+
let x = bounds.x1,
|
|
19889
|
+
y = bounds.y1,
|
|
19890
|
+
width = bounds.width(),
|
|
19891
|
+
height = bounds.height();
|
|
19892
|
+
return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
|
|
19893
|
+
x: x,
|
|
19894
|
+
y: y,
|
|
19895
|
+
width: width,
|
|
19896
|
+
height: height
|
|
19897
|
+
};
|
|
19898
|
+
}
|
|
19899
|
+
class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
19900
|
+
constructor() {
|
|
19901
|
+
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
19902
|
+
}
|
|
19903
|
+
drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
19904
|
+
return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
19905
|
+
}
|
|
19906
|
+
}
|
|
19907
|
+
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
19908
|
+
const defaultImageBackgroundRenderContribution = new DefaultImageBackgroundRenderContribution();
|
|
19909
|
+
|
|
19893
19910
|
class DefaultSymbolRenderContribution {
|
|
19894
19911
|
constructor() {
|
|
19895
19912
|
this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
@@ -21459,15 +21476,17 @@
|
|
|
21459
21476
|
const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
|
|
21460
21477
|
let DefaultCanvasImageRender = class extends BaseRender {
|
|
21461
21478
|
constructor(imageRenderContribitions) {
|
|
21462
|
-
super(), this.imageRenderContribitions = imageRenderContribitions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageBackgroundRenderContribution], this.init(imageRenderContribitions);
|
|
21479
|
+
super(), this.imageRenderContribitions = imageRenderContribitions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(imageRenderContribitions);
|
|
21463
21480
|
}
|
|
21464
|
-
drawShape(image, context, x, y, drawContext, params, fillCb) {
|
|
21481
|
+
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
21465
21482
|
const imageAttribute = getTheme$1(image).image,
|
|
21466
21483
|
{
|
|
21467
21484
|
width = imageAttribute.width,
|
|
21468
21485
|
height = imageAttribute.height,
|
|
21469
21486
|
repeatX = imageAttribute.repeatX,
|
|
21470
21487
|
repeatY = imageAttribute.repeatY,
|
|
21488
|
+
x: originX = imageAttribute.x,
|
|
21489
|
+
y: originY = imageAttribute.y,
|
|
21471
21490
|
cornerRadius = imageAttribute.cornerRadius,
|
|
21472
21491
|
image: url
|
|
21473
21492
|
} = image.attribute,
|
|
@@ -21492,7 +21511,7 @@
|
|
|
21492
21511
|
} else context.drawImage(res.data, x, y, width, height);
|
|
21493
21512
|
needRestore && context.restore();
|
|
21494
21513
|
}
|
|
21495
|
-
this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
21514
|
+
doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke())), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
21496
21515
|
}
|
|
21497
21516
|
draw(image, renderService, drawContext) {
|
|
21498
21517
|
const {
|
|
@@ -21543,7 +21562,8 @@
|
|
|
21543
21562
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21544
21563
|
};
|
|
21545
21564
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
21546
|
-
const tempDirtyBounds = new AABBBounds()
|
|
21565
|
+
const tempDirtyBounds = new AABBBounds(),
|
|
21566
|
+
tempBackupDirtyBounds = new AABBBounds();
|
|
21547
21567
|
class ShadowRootDrawItemInterceptorContribution {
|
|
21548
21568
|
constructor() {
|
|
21549
21569
|
this.order = 1;
|
|
@@ -21560,11 +21580,11 @@
|
|
|
21560
21580
|
context: context
|
|
21561
21581
|
} = drawContext;
|
|
21562
21582
|
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21563
|
-
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21583
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds), tempBackupDirtyBounds.copy(drawContribution.backupDirtyBounds);
|
|
21564
21584
|
const m = graphic.globalTransMatrix.getInverse();
|
|
21565
|
-
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21585
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21566
21586
|
}
|
|
21567
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21587
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && (drawContribution.dirtyBounds.copy(tempDirtyBounds), drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds)), !0;
|
|
21568
21588
|
}
|
|
21569
21589
|
}
|
|
21570
21590
|
class DebugDrawItemInterceptorContribution {
|
|
@@ -23524,7 +23544,9 @@
|
|
|
23524
23544
|
let _isBrowserEnv;
|
|
23525
23545
|
function initIsBrowserEnv() {
|
|
23526
23546
|
if (null == _isBrowserEnv) try {
|
|
23527
|
-
|
|
23547
|
+
const canvas = document.createElement("canvas"),
|
|
23548
|
+
ctx = canvas.getContext("2d");
|
|
23549
|
+
_isBrowserEnv = !!(window && canvas.getBoundingClientRect && requestAnimationFrame && window.devicePixelRatio && ctx && ctx.isPointInPath && ctx.isPointInStroke), _isBrowserEnv && (_isBrowserEnv = !!document.createElement);
|
|
23528
23550
|
} catch (err) {
|
|
23529
23551
|
_isBrowserEnv = !1;
|
|
23530
23552
|
}
|
|
@@ -31227,6 +31249,9 @@
|
|
|
31227
31249
|
const textType = getTextType(textAttributes, typeKey);
|
|
31228
31250
|
return "rich" === textType ? graphicCreator.richtext(richTextAttributeTransform(textAttributes)) : ("html" === textType ? textAttributes = htmlAttributeTransform(textAttributes) : "react" === textType && (textAttributes = reactAttributeTransform(textAttributes)), graphicCreator.text(textAttributes));
|
|
31229
31251
|
}
|
|
31252
|
+
function alignTextInLine(layoutAlign, graphic, textAlign, pos, textWidth) {
|
|
31253
|
+
"right" === layoutAlign ? "center" === textAlign ? graphic.setAttribute("x", pos - textWidth / 2) : "right" === textAlign || "end" === textAlign ? graphic.setAttribute("x", pos) : graphic.setAttribute("x", pos - textWidth) : "center" === textAlign ? graphic.setAttribute("x", pos + textWidth / 2) : "right" === textAlign || "end" === textAlign ? graphic.setAttribute("x", pos + textWidth) : graphic.setAttribute("x", pos);
|
|
31254
|
+
}
|
|
31230
31255
|
|
|
31231
31256
|
const deltaXYToAngle = (y, x) => {
|
|
31232
31257
|
const angle = Math.atan2(y, x);
|
|
@@ -37404,11 +37429,11 @@
|
|
|
37404
37429
|
start: start,
|
|
37405
37430
|
end: end
|
|
37406
37431
|
} = this.state;
|
|
37407
|
-
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
|
|
37432
|
+
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
|
|
37408
37433
|
start: start,
|
|
37409
37434
|
end: end,
|
|
37410
37435
|
tag: this._activeTag
|
|
37411
|
-
});
|
|
37436
|
+
}));
|
|
37412
37437
|
}, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap$2[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
|
|
37413
37438
|
e.preventDefault();
|
|
37414
37439
|
const {
|
|
@@ -37421,11 +37446,11 @@
|
|
|
37421
37446
|
const pos = this.eventPosToStagePos(e);
|
|
37422
37447
|
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
37423
37448
|
}
|
|
37424
|
-
this._activeState = !1, brushSelect && this.renderDragMask(), start === this.state.start && end === this.state.end || this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
|
|
37449
|
+
this._activeState = !1, brushSelect && this.renderDragMask(), start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
|
|
37425
37450
|
start: this.state.start,
|
|
37426
37451
|
end: this.state.end,
|
|
37427
37452
|
tag: this._activeTag
|
|
37428
|
-
}), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37453
|
+
})), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37429
37454
|
capture: !0
|
|
37430
37455
|
}), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37431
37456
|
capture: !0
|
|
@@ -41515,6 +41540,7 @@
|
|
|
41515
41540
|
return inverse && (isHorizontal ? (res.x0 = 1, res.x1 = 0) : (res.y0 = 1, res.y1 = 0)), res;
|
|
41516
41541
|
}
|
|
41517
41542
|
_updateColor() {
|
|
41543
|
+
var _a;
|
|
41518
41544
|
const {
|
|
41519
41545
|
layout = "horizontal",
|
|
41520
41546
|
colors: colors,
|
|
@@ -41524,7 +41550,8 @@
|
|
|
41524
41550
|
{
|
|
41525
41551
|
startHandler: startHandler,
|
|
41526
41552
|
endHandler: endHandler,
|
|
41527
|
-
track: track
|
|
41553
|
+
track: track,
|
|
41554
|
+
attribute: attribute
|
|
41528
41555
|
} = this._slider,
|
|
41529
41556
|
{
|
|
41530
41557
|
startValue: startValue,
|
|
@@ -41532,9 +41559,15 @@
|
|
|
41532
41559
|
startPos: startPos,
|
|
41533
41560
|
endPos: endPos
|
|
41534
41561
|
} = this._slider.currentValue,
|
|
41535
|
-
|
|
41536
|
-
|
|
41537
|
-
|
|
41562
|
+
handlerColor = null === (_a = attribute.handlerStyle) || void 0 === _a ? void 0 : _a.fill;
|
|
41563
|
+
if (startHandler && !handlerColor) {
|
|
41564
|
+
const startHandlerColor = this._colorScale.scale(startValue);
|
|
41565
|
+
startHandler.setAttribute("fill", startHandlerColor);
|
|
41566
|
+
}
|
|
41567
|
+
if (endHandler && !handlerColor) {
|
|
41568
|
+
const endHandlerColor = this._colorScale.scale(endValue);
|
|
41569
|
+
endHandler.setAttribute("fill", endHandlerColor);
|
|
41570
|
+
}
|
|
41538
41571
|
const railLen = "horizontal" === layout ? railWidth : railHeight;
|
|
41539
41572
|
if (Math.abs(startPos - endPos) !== railLen && colors && colors.length > 1) {
|
|
41540
41573
|
const stops = this._color.stops,
|
|
@@ -41579,6 +41612,7 @@
|
|
|
41579
41612
|
},
|
|
41580
41613
|
handlerSize: 10,
|
|
41581
41614
|
handlerStyle: {
|
|
41615
|
+
fill: null,
|
|
41582
41616
|
lineWidth: 4,
|
|
41583
41617
|
stroke: "#fff",
|
|
41584
41618
|
outerBorder: {
|
|
@@ -42671,6 +42705,7 @@
|
|
|
42671
42705
|
this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
|
|
42672
42706
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
42673
42707
|
var _a;
|
|
42708
|
+
if (!this._activeDrawState && !this._activeMoveState) return;
|
|
42674
42709
|
e.preventDefault();
|
|
42675
42710
|
const {
|
|
42676
42711
|
removeOnClick = !0
|
|
@@ -43018,7 +43053,8 @@
|
|
|
43018
43053
|
valueWidth: valueWidth,
|
|
43019
43054
|
hasContentShape: hasContentShape,
|
|
43020
43055
|
autoCalculatePosition: autoCalculatePosition,
|
|
43021
|
-
autoMeasure: autoMeasure
|
|
43056
|
+
autoMeasure: autoMeasure,
|
|
43057
|
+
align: align
|
|
43022
43058
|
} = this.attribute;
|
|
43023
43059
|
if (!visible) return void this.hideAll();
|
|
43024
43060
|
autoMeasure && Tooltip.measureTooltip(this.attribute), autoCalculatePosition && Tooltip.calculateTooltipPosition(this.attribute);
|
|
@@ -43069,7 +43105,6 @@
|
|
|
43069
43105
|
this._tooltipContent.setAttribute("x", padding[3]), this._tooltipContent.setAttribute("y", padding[0] + titleHeight);
|
|
43070
43106
|
let lastYPos = 0;
|
|
43071
43107
|
content.forEach((item, i) => {
|
|
43072
|
-
var _a, _b, _c;
|
|
43073
43108
|
const itemAttr = Tooltip.getContentAttr(this.attribute, i);
|
|
43074
43109
|
if (!isVisible(itemAttr)) return;
|
|
43075
43110
|
const itemGroupName = `tooltip-content-${i}`,
|
|
@@ -43077,68 +43112,81 @@
|
|
|
43077
43112
|
visible: !0,
|
|
43078
43113
|
x: 0,
|
|
43079
43114
|
y: lastYPos
|
|
43080
|
-
}, "group")
|
|
43081
|
-
|
|
43082
|
-
|
|
43083
|
-
|
|
43084
|
-
|
|
43085
|
-
|
|
43086
|
-
|
|
43087
|
-
|
|
43088
|
-
element = itemAttr.key.multiLine ? itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
43089
|
-
visible: !0
|
|
43090
|
-
}, getRichTextAttribute(itemAttr.key)), {
|
|
43091
|
-
textBaseline: "top"
|
|
43092
|
-
}), "richtext") : "object" != typeof itemAttr.key.text || null === itemAttr.key.text || "rich" !== itemAttr.key.text.type && "html" !== itemAttr.key.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
43093
|
-
visible: !0,
|
|
43094
|
-
text: null !== (_b = itemAttr.key.text) && void 0 !== _b ? _b : ""
|
|
43095
|
-
}, itemAttr.key), {
|
|
43096
|
-
textBaseline: "top"
|
|
43097
|
-
}), "text") : "rich" === itemAttr.key.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43098
|
-
visible: !0
|
|
43099
|
-
}, getRichTextAttribute(itemAttr.key)), {
|
|
43100
|
-
textBaseline: "top"
|
|
43101
|
-
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-value`, {
|
|
43102
|
-
html: Object.assign(Object.assign({
|
|
43103
|
-
dom: itemAttr.key.text.text
|
|
43104
|
-
}, DEFAULT_HTML_TEXT_SPEC), itemAttr.key)
|
|
43105
|
-
}, "richtext");
|
|
43106
|
-
const {
|
|
43107
|
-
textAlign: textAlign
|
|
43108
|
-
} = itemAttr.key;
|
|
43109
|
-
"center" === textAlign ? element.setAttribute("x", x + keyWidth / 2) : "right" === textAlign || "end" === textAlign ? element.setAttribute("x", x + keyWidth) : element.setAttribute("x", x), element.setAttribute("y", 0), x += keyWidth + itemAttr.key.spacing;
|
|
43110
|
-
}
|
|
43111
|
-
if (isVisible(itemAttr.value)) {
|
|
43112
|
-
let element;
|
|
43113
|
-
element = itemAttr.value.multiLine ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43114
|
-
visible: !0
|
|
43115
|
-
}, getRichTextAttribute(itemAttr.value)), {
|
|
43116
|
-
textBaseline: "top"
|
|
43117
|
-
}), "richtext") : "object" != typeof itemAttr.value.text || null === itemAttr.value.text || "rich" !== itemAttr.value.text.type && "html" !== itemAttr.value.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43118
|
-
visible: !0,
|
|
43119
|
-
text: null !== (_c = itemAttr.value.text) && void 0 !== _c ? _c : ""
|
|
43120
|
-
}, itemAttr.value), {
|
|
43121
|
-
textBaseline: "top"
|
|
43122
|
-
}), "text") : "rich" === itemAttr.value.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43123
|
-
visible: !0
|
|
43124
|
-
}, getRichTextAttribute(itemAttr.value)), {
|
|
43125
|
-
textBaseline: "top"
|
|
43126
|
-
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-value`, {
|
|
43127
|
-
html: Object.assign({
|
|
43128
|
-
dom: itemAttr.value.text.text,
|
|
43129
|
-
container: "",
|
|
43130
|
-
width: 30,
|
|
43131
|
-
height: 30,
|
|
43132
|
-
style: {}
|
|
43133
|
-
}, itemAttr.value)
|
|
43134
|
-
}, "richtext");
|
|
43115
|
+
}, "group"),
|
|
43116
|
+
shapeOffsetWidth = itemAttr.shape.size + itemAttr.shape.spacing;
|
|
43117
|
+
let x = "right" === align ? (hasContentShape ? shapeOffsetWidth : 0) + (isVisible(itemAttr.key) ? keyWidth + itemAttr.key.spacing : 0) + (isVisible(itemAttr.value) ? valueWidth : 0) : 0;
|
|
43118
|
+
this._createShape("right" === align ? x - itemAttr.shape.size / 2 : x + itemAttr.shape.size / 2, itemAttr, itemGroup, itemGroupName), hasContentShape && ("right" === align ? x -= shapeOffsetWidth : x += shapeOffsetWidth);
|
|
43119
|
+
const keyGraphic = this._createKey(itemAttr, itemGroup, itemGroupName);
|
|
43120
|
+
keyGraphic && (alignTextInLine(align, keyGraphic, itemAttr.key.textAlign, x, keyWidth), keyGraphic.setAttribute("y", 0), "right" === align ? x -= keyWidth + itemAttr.key.spacing : x += keyWidth + itemAttr.key.spacing);
|
|
43121
|
+
const valueGraphic = this._createValue(itemAttr, itemGroup, itemGroupName);
|
|
43122
|
+
if (valueGraphic) {
|
|
43135
43123
|
let textAlign = "right";
|
|
43136
|
-
isValid$1(itemAttr.value.textAlign) ? textAlign = itemAttr.value.textAlign : isVisible(itemAttr.key) || (textAlign = "left"),
|
|
43124
|
+
isValid$1(itemAttr.value.textAlign) ? textAlign = itemAttr.value.textAlign : isVisible(itemAttr.key) || "right" === align || (textAlign = "left"), valueGraphic.setAttribute("textAlign", textAlign), alignTextInLine(align, valueGraphic, textAlign, x, valueWidth), valueGraphic.setAttribute("y", 0);
|
|
43137
43125
|
}
|
|
43138
43126
|
lastYPos += itemAttr.height + itemAttr.spaceRow;
|
|
43139
43127
|
});
|
|
43140
43128
|
}
|
|
43141
43129
|
}
|
|
43130
|
+
_createShape(x, itemAttr, itemGroup, itemGroupName) {
|
|
43131
|
+
var _a;
|
|
43132
|
+
if (isVisible(itemAttr.shape)) return itemGroup.createOrUpdateChild(`${itemGroupName}-shape`, Object.assign({
|
|
43133
|
+
visible: !0,
|
|
43134
|
+
x: x,
|
|
43135
|
+
y: itemAttr.shape.size / 2 + ((null !== (_a = calculateLineHeight(itemAttr.key.lineHeight, itemAttr.key.fontSize)) && void 0 !== _a ? _a : itemAttr.key.fontSize) - itemAttr.shape.size) / 2
|
|
43136
|
+
}, itemAttr.shape), "symbol");
|
|
43137
|
+
}
|
|
43138
|
+
_createKey(itemAttr, itemGroup, itemGroupName) {
|
|
43139
|
+
var _a;
|
|
43140
|
+
if (isVisible(itemAttr.key)) {
|
|
43141
|
+
let element;
|
|
43142
|
+
return element = itemAttr.key.multiLine ? itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
43143
|
+
visible: !0
|
|
43144
|
+
}, getRichTextAttribute(itemAttr.key)), {
|
|
43145
|
+
textBaseline: "top"
|
|
43146
|
+
}), "richtext") : "object" != typeof itemAttr.key.text || null === itemAttr.key.text || "rich" !== itemAttr.key.text.type && "html" !== itemAttr.key.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
43147
|
+
visible: !0,
|
|
43148
|
+
text: null !== (_a = itemAttr.key.text) && void 0 !== _a ? _a : ""
|
|
43149
|
+
}, itemAttr.key), {
|
|
43150
|
+
textBaseline: "top"
|
|
43151
|
+
}), "text") : "rich" === itemAttr.key.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43152
|
+
visible: !0
|
|
43153
|
+
}, getRichTextAttribute(itemAttr.key)), {
|
|
43154
|
+
textBaseline: "top"
|
|
43155
|
+
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-value`, {
|
|
43156
|
+
html: Object.assign(Object.assign({
|
|
43157
|
+
dom: itemAttr.key.text.text
|
|
43158
|
+
}, DEFAULT_HTML_TEXT_SPEC), itemAttr.key)
|
|
43159
|
+
}, "richtext"), element;
|
|
43160
|
+
}
|
|
43161
|
+
}
|
|
43162
|
+
_createValue(itemAttr, itemGroup, itemGroupName) {
|
|
43163
|
+
var _a;
|
|
43164
|
+
if (isVisible(itemAttr.value)) {
|
|
43165
|
+
let element;
|
|
43166
|
+
return element = itemAttr.value.multiLine ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43167
|
+
visible: !0
|
|
43168
|
+
}, getRichTextAttribute(itemAttr.value)), {
|
|
43169
|
+
textBaseline: "top"
|
|
43170
|
+
}), "richtext") : "object" != typeof itemAttr.value.text || null === itemAttr.value.text || "rich" !== itemAttr.value.text.type && "html" !== itemAttr.value.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43171
|
+
visible: !0,
|
|
43172
|
+
text: null !== (_a = itemAttr.value.text) && void 0 !== _a ? _a : ""
|
|
43173
|
+
}, itemAttr.value), {
|
|
43174
|
+
textBaseline: "top"
|
|
43175
|
+
}), "text") : "rich" === itemAttr.value.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
43176
|
+
visible: !0
|
|
43177
|
+
}, getRichTextAttribute(itemAttr.value)), {
|
|
43178
|
+
textBaseline: "top"
|
|
43179
|
+
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-value`, {
|
|
43180
|
+
html: Object.assign({
|
|
43181
|
+
dom: itemAttr.value.text.text,
|
|
43182
|
+
container: "",
|
|
43183
|
+
width: 30,
|
|
43184
|
+
height: 30,
|
|
43185
|
+
style: {}
|
|
43186
|
+
}, itemAttr.value)
|
|
43187
|
+
}, "richtext"), element;
|
|
43188
|
+
}
|
|
43189
|
+
}
|
|
43142
43190
|
setAttributes(params, forceUpdateTag) {
|
|
43143
43191
|
const keys = Object.keys(params);
|
|
43144
43192
|
this.attribute.autoCalculatePosition && keys.every(key => TOOLTIP_POSITION_ATTRIBUTES.includes(key)) ? (this._mergeAttributes(params, keys), isNil$1(this.attribute.panel.width) && this.attribute.autoMeasure && Tooltip.measureTooltip(this.attribute), Tooltip.calculateTooltipPosition(this.attribute), super.setAttributes({
|
|
@@ -44259,12 +44307,12 @@
|
|
|
44259
44307
|
let Element$1 = class Element {
|
|
44260
44308
|
constructor(mark) {
|
|
44261
44309
|
this.data = null, this.states = [], this.diffState = DiffState.enter, this.isReserved = !1, this.runtimeStatesEncoder = null, this.items = [], this.getStateAttrs = (stateName, nextStates) => {
|
|
44262
|
-
var _a, _b, _c;
|
|
44310
|
+
var _a, _b, _c, _d;
|
|
44263
44311
|
const isRuntimeState = !isNil$1(null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[stateName]),
|
|
44264
|
-
encoder = isRuntimeState ? this.runtimeStatesEncoder[stateName] : null === (
|
|
44312
|
+
encoder = isRuntimeState ? Object.assign(Object.assign({}, null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName]), this.runtimeStatesEncoder[stateName]) : null === (_c = this.mark.getSpec().encode) || void 0 === _c ? void 0 : _c[stateName];
|
|
44265
44313
|
if (!encoder) return {};
|
|
44266
44314
|
if (isFunction$1(encoder)) return encoder(this.getDatum(), this, stateName, nextStates);
|
|
44267
|
-
if (!isRuntimeState && (null === (
|
|
44315
|
+
if (!isRuntimeState && (null === (_d = this.graphicItem.states) || void 0 === _d ? void 0 : _d[stateName])) return this.graphicItem.states[stateName];
|
|
44268
44316
|
const stateItems = this.items.map(item => Object.assign({}, item, {
|
|
44269
44317
|
nextAttrs: {}
|
|
44270
44318
|
}));
|
|
@@ -46060,13 +46108,13 @@
|
|
|
46060
46108
|
class GlyphElement extends Element$1 {
|
|
46061
46109
|
constructor(mark) {
|
|
46062
46110
|
super(mark), this.getStateAttrs = (stateName, nextStates) => {
|
|
46063
|
-
var _a, _b, _c;
|
|
46111
|
+
var _a, _b, _c, _d;
|
|
46064
46112
|
const isRuntimeState = !isNil$1(null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[stateName]),
|
|
46065
|
-
encoder = isRuntimeState ? this.runtimeStatesEncoder[stateName] : null === (
|
|
46113
|
+
encoder = isRuntimeState ? Object.assign(Object.assign({}, null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName]), this.runtimeStatesEncoder[stateName]) : null === (_c = this.mark.getSpec().encode) || void 0 === _c ? void 0 : _c[stateName],
|
|
46066
46114
|
glyphStateAttributes = {};
|
|
46067
46115
|
if (!encoder) return glyphStateAttributes;
|
|
46068
46116
|
if (isFunction$1(encoder)) return glyphStateAttributes.attributes = encoder(this.getDatum(), this, stateName, nextStates), glyphStateAttributes;
|
|
46069
|
-
if (!isRuntimeState && (null === (
|
|
46117
|
+
if (!isRuntimeState && (null === (_d = this.graphicItem.glyphStates) || void 0 === _d ? void 0 : _d[stateName])) return this.graphicItem.glyphStates[stateName];
|
|
46070
46118
|
if (encoder) {
|
|
46071
46119
|
const item = this.items[0],
|
|
46072
46120
|
targetItems = [Object.assign({}, item, {
|
|
@@ -47140,9 +47188,18 @@
|
|
|
47140
47188
|
this.graphicIndex = markIndex;
|
|
47141
47189
|
}
|
|
47142
47190
|
update(spec) {
|
|
47143
|
-
this._context = this.spec.context, this.isUpdated = !0, this.renderContext.progressive || (spec.animation && this.animate.updateConfig(spec.animation), this.animate.updateState(spec.animationState)), this.markType !== GrammarMarkType.group
|
|
47144
|
-
|
|
47145
|
-
|
|
47191
|
+
if (this._context = this.spec.context, this.isUpdated = !0, this.renderContext.progressive || (spec.animation && this.animate.updateConfig(spec.animation), this.animate.updateState(spec.animationState)), this.markType !== GrammarMarkType.group) {
|
|
47192
|
+
if (isNil$1(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex), isNil$1(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), !isNil$1(spec.clipPath)) {
|
|
47193
|
+
const paths = isArray$1(spec.clipPath) ? spec.clipPath : spec.clipPath(this.elements);
|
|
47194
|
+
paths && paths.length ? this.graphicItem.setAttribute("path", paths) : this.graphicItem.setAttributes({
|
|
47195
|
+
path: paths,
|
|
47196
|
+
clip: !1
|
|
47197
|
+
});
|
|
47198
|
+
}
|
|
47199
|
+
this.elementMap.forEach(element => {
|
|
47200
|
+
element.updateGraphicItem();
|
|
47201
|
+
});
|
|
47202
|
+
} else this.elementMap.forEach(element => {
|
|
47146
47203
|
element.updateGraphicItem();
|
|
47147
47204
|
});
|
|
47148
47205
|
}
|
|
@@ -47446,7 +47503,11 @@
|
|
|
47446
47503
|
getChannelsFromConfig(element) {
|
|
47447
47504
|
const spec = this.spec,
|
|
47448
47505
|
initAttrs = {};
|
|
47449
|
-
|
|
47506
|
+
if (isNil$1(spec.clip) || (initAttrs.clip = spec.clip), isNil$1(spec.zIndex) || (initAttrs.zIndex = spec.zIndex), !isNil$1(spec.clipPath)) {
|
|
47507
|
+
const paths = isFunction$1(spec.clipPath) ? spec.clipPath([element]) : spec.clipPath;
|
|
47508
|
+
paths && paths.length ? initAttrs.path = paths : (initAttrs.path = null, initAttrs.clip = !1);
|
|
47509
|
+
}
|
|
47510
|
+
return isNil$1(spec.interactive) || (initAttrs.pickable = spec.interactive), initAttrs;
|
|
47450
47511
|
}
|
|
47451
47512
|
evaluateGroupEncode(elements, groupEncode, parameters) {
|
|
47452
47513
|
var _a;
|
|
@@ -50967,8 +51028,8 @@
|
|
|
50967
51028
|
};
|
|
50968
51029
|
|
|
50969
51030
|
const fadeIn = (element, options, animationParameters) => {
|
|
50970
|
-
var _a, _b, _c;
|
|
50971
|
-
const finalAttrs = element.getFinalGraphicAttributes();
|
|
51031
|
+
var _a, _b, _c, _d;
|
|
51032
|
+
const finalAttrs = null !== (_a = element.getFinalGraphicAttributes()) && void 0 !== _a ? _a : {};
|
|
50972
51033
|
return {
|
|
50973
51034
|
from: {
|
|
50974
51035
|
opacity: 0,
|
|
@@ -50976,9 +51037,9 @@
|
|
|
50976
51037
|
strokeOpacity: 0
|
|
50977
51038
|
},
|
|
50978
51039
|
to: {
|
|
50979
|
-
opacity: null !== (
|
|
50980
|
-
fillOpacity: null !== (
|
|
50981
|
-
strokeOpacity: null !== (
|
|
51040
|
+
opacity: null !== (_b = finalAttrs.opacity) && void 0 !== _b ? _b : 1,
|
|
51041
|
+
fillOpacity: null !== (_c = finalAttrs.fillOpacity) && void 0 !== _c ? _c : 1,
|
|
51042
|
+
strokeOpacity: null !== (_d = finalAttrs.strokeOpacity) && void 0 !== _d ? _d : 1
|
|
50982
51043
|
}
|
|
50983
51044
|
};
|
|
50984
51045
|
};
|
|
@@ -59984,11 +60045,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59984
60045
|
dependency: stateSignal
|
|
59985
60046
|
});
|
|
59986
60047
|
if (this._animationConfig.normal) {
|
|
59987
|
-
this.
|
|
59988
|
-
|
|
60048
|
+
if (!this._animationConfig.appear) {
|
|
60049
|
+
this._event.on(exports.VGRAMMAR_HOOK_EVENT.AFTER_DO_RENDER, () => {
|
|
59989
60050
|
this.runAnimationByState(AnimationStateEnum.normal);
|
|
59990
|
-
}
|
|
59991
|
-
}
|
|
60051
|
+
});
|
|
60052
|
+
}
|
|
60053
|
+
else {
|
|
60054
|
+
this._event.on(exports.VGRAMMAR_HOOK_EVENT.ANIMATION_END, ({ event }) => {
|
|
60055
|
+
if (event.mark === this.getProduct() && event.animationState === AnimationStateEnum.appear) {
|
|
60056
|
+
this.runAnimationByState(AnimationStateEnum.normal);
|
|
60057
|
+
}
|
|
60058
|
+
});
|
|
60059
|
+
}
|
|
59992
60060
|
}
|
|
59993
60061
|
}
|
|
59994
60062
|
}
|
|
@@ -66304,7 +66372,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66304
66372
|
registerComponentPlugin(CanvasTooltipHandler);
|
|
66305
66373
|
};
|
|
66306
66374
|
|
|
66307
|
-
const version = "1.11.
|
|
66375
|
+
const version = "1.11.4";
|
|
66308
66376
|
|
|
66309
66377
|
const addVChartProperty = (data, op) => {
|
|
66310
66378
|
const context = op.beforeCall();
|
|
@@ -70721,10 +70789,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
70721
70789
|
this.calcScales(this._defaultBandInnerPadding, this._defaultBandOuterPadding);
|
|
70722
70790
|
}
|
|
70723
70791
|
axisHelper() {
|
|
70724
|
-
const getScale = (depth) => {
|
|
70792
|
+
const getScale = (depth = 0) => {
|
|
70725
70793
|
return this._scales[depth];
|
|
70726
70794
|
};
|
|
70727
|
-
const getBandwidth = (depth) => {
|
|
70795
|
+
const getBandwidth = (depth = 0) => {
|
|
70728
70796
|
return getScale(depth).bandwidth();
|
|
70729
70797
|
};
|
|
70730
70798
|
return {
|
|
@@ -71903,8 +71971,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71903
71971
|
return this._chartData.getSeriesData(id, index);
|
|
71904
71972
|
}
|
|
71905
71973
|
_transformSpecScale() {
|
|
71906
|
-
var _a
|
|
71907
|
-
const scales =
|
|
71974
|
+
var _a;
|
|
71975
|
+
const scales = this._spec.scales ? [...this._spec.scales] : [];
|
|
71908
71976
|
let colorScaleSpec = scales.find(s => s.id === 'color');
|
|
71909
71977
|
const colorScheme = this.getColorScheme();
|
|
71910
71978
|
if (!colorScaleSpec) {
|
|
@@ -71930,7 +71998,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71930
71998
|
}
|
|
71931
71999
|
}
|
|
71932
72000
|
}
|
|
71933
|
-
if (!((
|
|
72001
|
+
if (!((_a = colorScaleSpec.range) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
71934
72002
|
colorScaleSpec.range = getDataScheme(colorScheme);
|
|
71935
72003
|
colorScaleSpec.rangeTheme = true;
|
|
71936
72004
|
}
|
|
@@ -78872,7 +78940,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78872
78940
|
initGroupScales() {
|
|
78873
78941
|
}
|
|
78874
78942
|
axisHelper() {
|
|
78875
|
-
const getScale = (depth) => {
|
|
78943
|
+
const getScale = (depth = 0) => {
|
|
78876
78944
|
return this._scales[depth];
|
|
78877
78945
|
};
|
|
78878
78946
|
const helper = {
|
|
@@ -80441,7 +80509,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80441
80509
|
let pos;
|
|
80442
80510
|
if (isValid$1(originValue)) {
|
|
80443
80511
|
const index = binaryFuzzySearch(subTickData, tick => tick.value - originValue);
|
|
80444
|
-
const targetIndex = originValue > subTickData[index].value - step / 2
|
|
80512
|
+
const targetIndex = index >= subTickData.length || originValue > subTickData[index].value - step / 2
|
|
80445
80513
|
? Math.min(index, subTickData.length - 1)
|
|
80446
80514
|
: index > 0
|
|
80447
80515
|
? index - 1
|
|
@@ -80469,7 +80537,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80469
80537
|
const step = subTickData[1].value - subTickData[0].value;
|
|
80470
80538
|
const offsetAngle = degreeToRadian(tickMask.offsetAngle);
|
|
80471
80539
|
const index = binaryFuzzySearch(subTickData, tick => tick.value - originValue);
|
|
80472
|
-
const targetIndex = originValue > subTickData[index].value - step / 2
|
|
80540
|
+
const targetIndex = index >= subTickData.length || originValue > subTickData[index].value - step / 2
|
|
80473
80541
|
? Math.min(index, subTickData.length - 1)
|
|
80474
80542
|
: index > 0
|
|
80475
80543
|
? index - 1
|
|
@@ -85948,7 +86016,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85948
86016
|
center: center,
|
|
85949
86017
|
start: left,
|
|
85950
86018
|
end: right
|
|
85951
|
-
}
|
|
86019
|
+
},
|
|
86020
|
+
linkClampe = clamper(0, 1);
|
|
85952
86021
|
class SankeyLayout {
|
|
85953
86022
|
constructor(options) {
|
|
85954
86023
|
this._ascendingSourceBreadth = (a, b) => ascendingNodeBreadth(this._nodeMap[a.source], this._nodeMap[b.source]) || a.index - b.index, this._ascendingTargetBreadth = (a, b) => ascendingNodeBreadth(this._nodeMap[a.target], this._nodeMap[b.target]) || a.index - b.index, this.options = Object.assign({}, SankeyLayout.defaultOptions, options);
|
|
@@ -86259,7 +86328,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86259
86328
|
const isStartGap = "start" === this.options.gapPosition,
|
|
86260
86329
|
isMiddleGap = !isStartGap && "end" !== this.options.gapPosition,
|
|
86261
86330
|
getNodeHeight = isNumber$1(this.options.nodeHeight) ? node => this.options.nodeHeight : isFunction$1(this.options.nodeHeight) ? this.options.nodeHeight : forceNodeHeight > 0 ? node => forceNodeHeight : node => Math.max(node.value * ky, minNodeHeight, 0),
|
|
86262
|
-
getLinkHeight = isNumber$1(this.options.linkHeight) ? () => this.options.linkHeight : isFunction$1(this.options.linkHeight) ? this.options.linkHeight : (link, sourceNode, sourceNodeHeight) => Math.max(sourceNode.value ? sourceNodeHeight * link.value / sourceNode.value : 0, minLinkHeight, 0);
|
|
86331
|
+
getLinkHeight = isNumber$1(this.options.linkHeight) ? () => this.options.linkHeight : isFunction$1(this.options.linkHeight) ? this.options.linkHeight : (link, sourceNode, sourceNodeHeight) => Math.max(sourceNode.value ? sourceNodeHeight * linkClampe(link.value / sourceNode.value) : 0, minLinkHeight, 0);
|
|
86263
86332
|
for (let i = 0, columnCount = columns.length; i < columnCount; i++) {
|
|
86264
86333
|
const nodes = columns[i];
|
|
86265
86334
|
if (!nodes || !nodes.length) continue;
|
|
@@ -86287,7 +86356,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86287
86356
|
}
|
|
86288
86357
|
}
|
|
86289
86358
|
} else if (deltaY < 0 && nodes.length > 1 && (deltaY /= nodes.length - 1, gapY + deltaY > 0)) {
|
|
86290
|
-
gapY += deltaY;
|
|
86359
|
+
gapY += deltaY, this._gapY = Math.min(gapY);
|
|
86291
86360
|
for (let j = 1, len = nodes.length; j < len; ++j) {
|
|
86292
86361
|
const node = nodes[j];
|
|
86293
86362
|
node.y0 += deltaY * j, node.y1 += deltaY * j;
|
|
@@ -86385,15 +86454,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86385
86454
|
computeLinkBreadthsNoOverlap(nodes) {
|
|
86386
86455
|
for (let i = 0, len = nodes.length; i < len; i++) {
|
|
86387
86456
|
const node = nodes[i];
|
|
86388
|
-
let y0 = node.y0
|
|
86457
|
+
let y0 = node.y0,
|
|
86458
|
+
reachBottom = !1;
|
|
86389
86459
|
for (let j = 0, linkLen = node.sourceLinks.length; j < linkLen; j++) {
|
|
86390
86460
|
const link = node.sourceLinks[j];
|
|
86391
|
-
link.y0 = y0 + link.thickness / 2, link.x0 = node.x1, y0 += link.thickness;
|
|
86461
|
+
reachBottom || (link.y0 = y0 + link.thickness / 2), link.x0 = node.x1, y0 + link.thickness > node.y1 || reachBottom ? (link.y0 = node.y1 - link.thickness / 2, reachBottom = !0) : y0 += link.thickness;
|
|
86392
86462
|
}
|
|
86393
86463
|
let y1 = node.y0;
|
|
86464
|
+
reachBottom = !1;
|
|
86394
86465
|
for (let j = 0, linkLen = node.targetLinks.length; j < linkLen; j++) {
|
|
86395
86466
|
const link = node.targetLinks[j];
|
|
86396
|
-
link.y1 = y1 + link.thickness / 2, link.x1 = node.x0, y1 += link.thickness;
|
|
86467
|
+
reachBottom || (link.y1 = y1 + link.thickness / 2), link.x1 = node.x0, y1 + link.thickness > node.y1 || reachBottom ? (link.y1 = node.y1 - link.thickness / 2, reachBottom = !0) : y1 += link.thickness;
|
|
86397
86468
|
}
|
|
86398
86469
|
}
|
|
86399
86470
|
}
|
|
@@ -88360,7 +88431,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88360
88431
|
return pointerSpec.height * this._computeLayoutRadius();
|
|
88361
88432
|
}
|
|
88362
88433
|
_getPointerAngle(datum) {
|
|
88363
|
-
|
|
88434
|
+
const scale = this.angleAxisHelper.getScale();
|
|
88435
|
+
const domain = scale.domain();
|
|
88436
|
+
const max = maxInArray(domain);
|
|
88437
|
+
const min = minInArray(domain);
|
|
88438
|
+
const angle = clamp$1(datum[this._angleField[0]], min, max);
|
|
88439
|
+
return this.angleAxisHelper.dataToPosition([angle]);
|
|
88364
88440
|
}
|
|
88365
88441
|
_getRotatedPointerCenterOffset(datum) {
|
|
88366
88442
|
var _a, _b, _c, _d;
|
|
@@ -92045,14 +92121,24 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92045
92121
|
r.getSeries().forEach(s => {
|
|
92046
92122
|
var _a, _b;
|
|
92047
92123
|
let activeNodeOrLink = null;
|
|
92048
|
-
s.
|
|
92124
|
+
s.getMarksWithoutRoot().forEach(m => {
|
|
92125
|
+
if (m.type === 'text') {
|
|
92126
|
+
return;
|
|
92127
|
+
}
|
|
92049
92128
|
let pickElement = null;
|
|
92050
92129
|
const mark = m.getProduct();
|
|
92051
92130
|
if (!mark) {
|
|
92052
92131
|
return;
|
|
92053
92132
|
}
|
|
92054
92133
|
if (!filter || (isFunction$1(filter) && filter(s, m))) {
|
|
92055
|
-
pickElement = mark.elements.find((e) => keys.every(k => {
|
|
92134
|
+
pickElement = mark.elements.find((e) => keys.every(k => {
|
|
92135
|
+
var _a;
|
|
92136
|
+
let datum = (_a = e.getDatum()) === null || _a === void 0 ? void 0 : _a.datum;
|
|
92137
|
+
if (isArray$1(datum)) {
|
|
92138
|
+
datum = datum[0];
|
|
92139
|
+
}
|
|
92140
|
+
return activeDatum[k] == (datum === null || datum === void 0 ? void 0 : datum[k]);
|
|
92141
|
+
}));
|
|
92056
92142
|
}
|
|
92057
92143
|
if (pickElement) {
|
|
92058
92144
|
hasPick = true;
|