@visactor/vchart 1.11.7 → 1.11.9
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 +126 -66
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.js +1 -0
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/util.js +2 -1
- package/cjs/chart/util.js.map +1 -1
- package/cjs/compile/grammar-item.js +1 -2
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/tooltip/interface/spec.d.ts +1 -1
- package/cjs/component/tooltip/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +1 -0
- package/cjs/component/tooltip/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/tooltip-transformer.js +3 -0
- package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
- package/cjs/component/tooltip/tooltip.js +2 -3
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/util.js +2 -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/core/vchart.d.ts +1 -0
- package/cjs/core/vchart.js +34 -28
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/model/interface.d.ts +1 -0
- package/cjs/model/interface.js.map +1 -1
- package/cjs/series/base/base-series.js +13 -12
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/polar/animation.js +6 -6
- package/cjs/series/polar/animation.js.map +1 -1
- package/cjs/series/waterfall/waterfall-transformer.js +1 -1
- package/cjs/series/waterfall/waterfall-transformer.js.map +1 -1
- package/cjs/series/waterfall/waterfall.d.ts +1 -0
- package/cjs/series/waterfall/waterfall.js +13 -13
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/esm/chart/base/base-chart.js +1 -0
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/util.js +2 -1
- package/esm/chart/util.js.map +1 -1
- package/esm/compile/grammar-item.js +1 -2
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/tooltip/interface/spec.d.ts +1 -1
- package/esm/component/tooltip/interface/spec.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +1 -0
- package/esm/component/tooltip/interface/theme.js.map +1 -1
- package/esm/component/tooltip/tooltip-transformer.js +4 -1
- package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
- package/esm/component/tooltip/tooltip.js +2 -3
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/util.js +2 -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/core/vchart.d.ts +1 -0
- package/esm/core/vchart.js +34 -28
- package/esm/core/vchart.js.map +1 -1
- package/esm/model/interface.d.ts +1 -0
- package/esm/model/interface.js.map +1 -1
- package/esm/series/base/base-series.js +12 -11
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/polar/animation.js +5 -6
- package/esm/series/polar/animation.js.map +1 -1
- package/esm/series/waterfall/waterfall-transformer.js +1 -1
- package/esm/series/waterfall/waterfall-transformer.js.map +1 -1
- package/esm/series/waterfall/waterfall.d.ts +1 -0
- package/esm/series/waterfall/waterfall.js +12 -12
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/package.json +14 -14
package/build/index.js
CHANGED
|
@@ -11886,7 +11886,7 @@
|
|
|
11886
11886
|
const stage = this.target.stage;
|
|
11887
11887
|
stage && stage.renderNextFrame();
|
|
11888
11888
|
}
|
|
11889
|
-
return 1 === this.subAnimates.length && this.tailAnimate.
|
|
11889
|
+
return 1 === this.subAnimates.length && this.tailAnimate.totalDuration === customAnimate.duration && this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode), this;
|
|
11890
11890
|
}
|
|
11891
11891
|
trySetAttribute(attr) {
|
|
11892
11892
|
let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Animate.mode;
|
|
@@ -23573,13 +23573,14 @@
|
|
|
23573
23573
|
if (!this.htmlMap || !this.htmlMap[id]) return;
|
|
23574
23574
|
const {
|
|
23575
23575
|
root: root,
|
|
23576
|
-
wrapContainer: wrapContainer
|
|
23576
|
+
wrapContainer: wrapContainer,
|
|
23577
|
+
unmount: unmount
|
|
23577
23578
|
} = this.htmlMap[id];
|
|
23578
23579
|
if (root) {
|
|
23579
23580
|
application.global.getRequestAnimationFrame()(() => {
|
|
23580
23581
|
root.unmount();
|
|
23581
23582
|
});
|
|
23582
|
-
}
|
|
23583
|
+
} else unmount && unmount();
|
|
23583
23584
|
wrapContainer && application.global.removeDom(wrapContainer), this.htmlMap[id] = null;
|
|
23584
23585
|
}
|
|
23585
23586
|
renderGraphicHTML(graphic) {
|
|
@@ -23595,23 +23596,31 @@
|
|
|
23595
23596
|
element: element,
|
|
23596
23597
|
container: container
|
|
23597
23598
|
} = react;
|
|
23598
|
-
if (!
|
|
23599
|
+
if (!element || !ReactDOM || !ReactDOM.createRoot && !ReactDOM.render) return;
|
|
23599
23600
|
const id = isNil$1(react.id) ? `${null !== (_a = graphic.id) && void 0 !== _a ? _a : graphic._uid}_react` : react.id;
|
|
23600
|
-
if (this.htmlMap && this.htmlMap[id] && container && container !== this.htmlMap[id].container && this.removeElement(id), this.htmlMap && this.htmlMap[id]) this.htmlMap[id].root.render(element);else {
|
|
23601
|
+
if (this.htmlMap && this.htmlMap[id] && container && container !== this.htmlMap[id].container && this.removeElement(id), this.htmlMap && this.htmlMap[id]) ReactDOM.createRoot ? this.htmlMap[id].root.render(element) : ReactDOM.render(element, this.htmlMap[id].wrapContainer);else {
|
|
23601
23602
|
const {
|
|
23602
23603
|
wrapContainer: wrapContainer,
|
|
23603
23604
|
nativeContainer: nativeContainer
|
|
23604
23605
|
} = this.getWrapContainer(stage, container);
|
|
23605
|
-
if (wrapContainer) {
|
|
23606
|
+
if (wrapContainer) if (this.htmlMap || (this.htmlMap = {}), ReactDOM.createRoot) {
|
|
23606
23607
|
const root = ReactDOM.createRoot(wrapContainer);
|
|
23607
|
-
root.render(element), this.htmlMap
|
|
23608
|
+
root.render(element), this.htmlMap[id] = {
|
|
23608
23609
|
root: root,
|
|
23609
23610
|
wrapContainer: wrapContainer,
|
|
23610
23611
|
nativeContainer: nativeContainer,
|
|
23611
23612
|
container: container,
|
|
23612
23613
|
renderId: this.renderId
|
|
23613
23614
|
};
|
|
23614
|
-
}
|
|
23615
|
+
} else ReactDOM.render(element, wrapContainer), this.htmlMap[id] = {
|
|
23616
|
+
wrapContainer: wrapContainer,
|
|
23617
|
+
nativeContainer: nativeContainer,
|
|
23618
|
+
container: container,
|
|
23619
|
+
renderId: this.renderId,
|
|
23620
|
+
unmount: () => {
|
|
23621
|
+
ReactDOM.unmountComponentAtNode(wrapContainer);
|
|
23622
|
+
}
|
|
23623
|
+
};
|
|
23615
23624
|
}
|
|
23616
23625
|
if (!this.htmlMap || !this.htmlMap[id]) return;
|
|
23617
23626
|
const {
|
|
@@ -32666,10 +32675,9 @@
|
|
|
32666
32675
|
}, this._handleRelatedGraphicSetState = e => {
|
|
32667
32676
|
var _a, _b, _c, _d, _e;
|
|
32668
32677
|
if ((null === (_a = e.detail) || void 0 === _a ? void 0 : _a.type) === AttributeUpdateType.STATE || (null === (_b = e.detail) || void 0 === _b ? void 0 : _b.type) === AttributeUpdateType.ANIMATE_UPDATE && (null === (_c = e.detail.animationState) || void 0 === _c ? void 0 : _c.isFirstFrameOfStep)) {
|
|
32669
|
-
const currentStates = null !== (_e = null === (_d = e.target) || void 0 === _d ? void 0 : _d.currentStates) && void 0 !== _e ? _e : []
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
});
|
|
32678
|
+
const currentStates = null !== (_e = null === (_d = e.target) || void 0 === _d ? void 0 : _d.currentStates) && void 0 !== _e ? _e : [],
|
|
32679
|
+
labels = this._isCollectionBase ? [...this._graphicToText.values()] : [this._graphicToText.get(e.target)];
|
|
32680
|
+
this.updateStatesOfLabels(labels, currentStates);
|
|
32673
32681
|
}
|
|
32674
32682
|
};
|
|
32675
32683
|
}
|
|
@@ -32695,7 +32703,7 @@
|
|
|
32695
32703
|
let data = this.attribute.data;
|
|
32696
32704
|
isFunction$1(dataFilter) && (data = dataFilter(data));
|
|
32697
32705
|
let labels = this._initText(data);
|
|
32698
|
-
labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : this._layout(labels), isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : !1 !== overlap && (labels = this._overlapping(labels)), labels && labels.length && labels.forEach(label => {
|
|
32706
|
+
labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : this._layout(labels), isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : !1 !== overlap && (labels = this._overlapping(labels)), isFunction$1(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null), labels && labels.length && labels.forEach(label => {
|
|
32699
32707
|
this._bindEvent(label), this._setStatesOfText(label);
|
|
32700
32708
|
}), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels);
|
|
32701
32709
|
}
|
|
@@ -32887,7 +32895,7 @@
|
|
|
32887
32895
|
}
|
|
32888
32896
|
!hasPlace && !hideOnHit && result.push(text);
|
|
32889
32897
|
}
|
|
32890
|
-
return
|
|
32898
|
+
return result;
|
|
32891
32899
|
}
|
|
32892
32900
|
getBaseMarkGroup() {
|
|
32893
32901
|
const {
|
|
@@ -32926,7 +32934,10 @@
|
|
|
32926
32934
|
}
|
|
32927
32935
|
_renderWithAnimation(labels) {
|
|
32928
32936
|
var _a;
|
|
32929
|
-
const
|
|
32937
|
+
const {
|
|
32938
|
+
syncState: syncState
|
|
32939
|
+
} = this.attribute,
|
|
32940
|
+
currentTextMap = new Map(),
|
|
32930
32941
|
prevTextMap = this._graphicToText || new Map(),
|
|
32931
32942
|
texts = [],
|
|
32932
32943
|
labelLines = [],
|
|
@@ -32934,12 +32945,18 @@
|
|
|
32934
32945
|
visible: showLabelLine
|
|
32935
32946
|
} = null !== (_a = this.attribute.line) && void 0 !== _a ? _a : {};
|
|
32936
32947
|
labels && labels.forEach((text, index) => {
|
|
32948
|
+
var _a;
|
|
32937
32949
|
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
32938
32950
|
textId = text.attribute.id,
|
|
32939
32951
|
textKey = this._isCollectionBase ? textId : relatedGraphic,
|
|
32940
32952
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(textKey)) ? "update" : "enter";
|
|
32941
32953
|
let labelLine;
|
|
32942
|
-
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)),
|
|
32954
|
+
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), syncState && this.updateStatesOfLabels([labelLine ? {
|
|
32955
|
+
text: text,
|
|
32956
|
+
labelLine: labelLine
|
|
32957
|
+
} : {
|
|
32958
|
+
text: text
|
|
32959
|
+
}], null !== (_a = relatedGraphic.currentStates) && void 0 !== _a ? _a : []), "enter" === state) {
|
|
32943
32960
|
if (texts.push(text), currentTextMap.set(textKey, labelLine ? {
|
|
32944
32961
|
text: text,
|
|
32945
32962
|
labelLine: labelLine
|
|
@@ -32975,17 +32992,26 @@
|
|
|
32975
32992
|
}
|
|
32976
32993
|
_renderWithOutAnimation(labels) {
|
|
32977
32994
|
var _a;
|
|
32978
|
-
const
|
|
32995
|
+
const {
|
|
32996
|
+
syncState: syncState
|
|
32997
|
+
} = this.attribute,
|
|
32998
|
+
currentTextMap = new Map(),
|
|
32979
32999
|
prevTextMap = this._graphicToText || new Map(),
|
|
32980
33000
|
{
|
|
32981
33001
|
visible: showLabelLine
|
|
32982
33002
|
} = null !== (_a = this.attribute.line) && void 0 !== _a ? _a : {};
|
|
32983
33003
|
labels && labels.forEach(text => {
|
|
33004
|
+
var _a;
|
|
32984
33005
|
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
32985
33006
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter",
|
|
32986
33007
|
textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
32987
33008
|
let labelLine;
|
|
32988
|
-
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)),
|
|
33009
|
+
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), syncState && this.updateStatesOfLabels([labelLine ? {
|
|
33010
|
+
text: text,
|
|
33011
|
+
labelLine: labelLine
|
|
33012
|
+
} : {
|
|
33013
|
+
text: text
|
|
33014
|
+
}], null !== (_a = relatedGraphic.currentStates) && void 0 !== _a ? _a : []), "enter" === state) currentTextMap.set(textKey, labelLine ? {
|
|
32989
33015
|
text: text,
|
|
32990
33016
|
labelLine: labelLine
|
|
32991
33017
|
} : {
|
|
@@ -32998,6 +33024,11 @@
|
|
|
32998
33024
|
this.removeChild(label.text), label.labelLine && this.removeChild(label.labelLine);
|
|
32999
33025
|
}), this._graphicToText = currentTextMap;
|
|
33000
33026
|
}
|
|
33027
|
+
updateStatesOfLabels(labels, currentStates) {
|
|
33028
|
+
labels.forEach(label => {
|
|
33029
|
+
label && (label.text && label.text.useStates(currentStates), label.labelLine && label.labelLine.useStates(currentStates));
|
|
33030
|
+
});
|
|
33031
|
+
}
|
|
33001
33032
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
33002
33033
|
this.attribute.syncState && relatedGraphic.on("afterAttributeUpdate", this._handleRelatedGraphicSetState);
|
|
33003
33034
|
}
|
|
@@ -33266,11 +33297,14 @@
|
|
|
33266
33297
|
textBoundsArray = labels.map(label => this.getGraphicBounds(label)),
|
|
33267
33298
|
ellipsisLabelAttribute = Object.assign(Object.assign({}, this.attribute.textStyle), {
|
|
33268
33299
|
text: "…"
|
|
33269
|
-
})
|
|
33270
|
-
|
|
33271
|
-
|
|
33272
|
-
|
|
33273
|
-
|
|
33300
|
+
});
|
|
33301
|
+
let ellipsisWidth = 1 / 0;
|
|
33302
|
+
if (!1 !== ellipsisLabelAttribute.ellipsis) {
|
|
33303
|
+
const ellipsisText = this._createLabelText(ellipsisLabelAttribute),
|
|
33304
|
+
ellipsisTextBounds = this.getGraphicBounds(ellipsisText);
|
|
33305
|
+
ellipsisWidth = ellipsisTextBounds.x2 - ellipsisTextBounds.x1;
|
|
33306
|
+
}
|
|
33307
|
+
const data = labels.map(label => label.attribute),
|
|
33274
33308
|
arcs = this.layoutArcLabels(this.attribute.position, this.attribute, Array.from(this._idToGraphic.values()), data, textBoundsArray, ellipsisWidth);
|
|
33275
33309
|
for (let i = 0; i < data.length; i++) {
|
|
33276
33310
|
const textData = data[i],
|
|
@@ -57255,7 +57289,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57255
57289
|
reMake: merge('reMake'),
|
|
57256
57290
|
reRender: merge('reRender'),
|
|
57257
57291
|
reSize: merge('reSize'),
|
|
57258
|
-
reTransformSpec: merge('reTransformSpec')
|
|
57292
|
+
reTransformSpec: merge('reTransformSpec'),
|
|
57293
|
+
changeTheme: merge('changeTheme')
|
|
57259
57294
|
});
|
|
57260
57295
|
return target;
|
|
57261
57296
|
}
|
|
@@ -61061,7 +61096,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61061
61096
|
return this._dataSet;
|
|
61062
61097
|
}
|
|
61063
61098
|
constructor(spec, options) {
|
|
61064
|
-
var _a, _b, _c, _d, _e, _f
|
|
61099
|
+
var _a, _b, _c, _d, _e, _f;
|
|
61065
61100
|
this.id = createID();
|
|
61066
61101
|
this._userEvents = [];
|
|
61067
61102
|
this._autoSize = true;
|
|
@@ -61081,7 +61116,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61081
61116
|
}, 100);
|
|
61082
61117
|
this._option = merge$2(this._option, { animation: spec.animation !== false }, options);
|
|
61083
61118
|
this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
|
|
61084
|
-
const
|
|
61119
|
+
const _g = this._option, { dom, renderCanvas, mode, stage, poptip } = _g, restOptions = __rest$7(_g, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
|
|
61085
61120
|
const isTrueBrowseEnv = isTrueBrowser(mode);
|
|
61086
61121
|
if (isTrueBrowseEnv && dom) {
|
|
61087
61122
|
this._container = isString$1(dom) ? document === null || document === void 0 ? void 0 : document.getElementById(dom) : dom;
|
|
@@ -61115,11 +61150,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61115
61150
|
this._eventDispatcher = new EventDispatcher(this, this._compiler);
|
|
61116
61151
|
this._event = new Event$1(this._eventDispatcher, mode);
|
|
61117
61152
|
this._compiler.initView();
|
|
61118
|
-
(_d = this.
|
|
61119
|
-
text: { fontFamily: (_e = this._currentTheme) === null || _e === void 0 ? void 0 : _e.fontFamily }
|
|
61120
|
-
});
|
|
61153
|
+
this._setFontFamilyTheme((_d = this._currentTheme) === null || _d === void 0 ? void 0 : _d.fontFamily);
|
|
61121
61154
|
this._initDataSet(this._option.dataSet);
|
|
61122
|
-
this._autoSize = isTrueBrowseEnv ? (
|
|
61155
|
+
this._autoSize = isTrueBrowseEnv ? (_f = (_e = spec.autoFit) !== null && _e !== void 0 ? _e : this._option.autoFit) !== null && _f !== void 0 ? _f : true : false;
|
|
61123
61156
|
this._bindResizeEvent();
|
|
61124
61157
|
this._bindVGrammarViewEvent();
|
|
61125
61158
|
this._initChartPlugin();
|
|
@@ -61304,6 +61337,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61304
61337
|
this._chartSpecTransformer = null;
|
|
61305
61338
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.release();
|
|
61306
61339
|
this._chart = null;
|
|
61340
|
+
if (updateResult.changeTheme) {
|
|
61341
|
+
this._setCurrentTheme();
|
|
61342
|
+
}
|
|
61307
61343
|
(_b = this._compiler) === null || _b === void 0 ? void 0 : _b.releaseGrammar(((_c = this._option) === null || _c === void 0 ? void 0 : _c.animation) === false || ((_d = this._spec) === null || _d === void 0 ? void 0 : _d.animation) === false);
|
|
61308
61344
|
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
61309
61345
|
if (updateResult.reSize) {
|
|
@@ -61311,6 +61347,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61311
61347
|
}
|
|
61312
61348
|
}
|
|
61313
61349
|
else {
|
|
61350
|
+
if (updateResult.changeTheme) {
|
|
61351
|
+
this._setCurrentTheme();
|
|
61352
|
+
}
|
|
61314
61353
|
if (updateResult.reCompile) {
|
|
61315
61354
|
(_e = this._compiler) === null || _e === void 0 ? void 0 : _e.clear({ chart: this._chart, vChart: this }, !this._option.animation || !this._spec.animation);
|
|
61316
61355
|
(_f = this._compiler) === null || _f === void 0 ? void 0 : _f.compile({ chart: this._chart, vChart: this }, {});
|
|
@@ -61570,31 +61609,31 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61570
61609
|
_updateSpec(spec, forceMerge = false, userUpdateOptions) {
|
|
61571
61610
|
var _a, _b;
|
|
61572
61611
|
const lastSpec = this._spec;
|
|
61612
|
+
const result = {
|
|
61613
|
+
reTransformSpec: false,
|
|
61614
|
+
change: false,
|
|
61615
|
+
reMake: false,
|
|
61616
|
+
reCompile: false,
|
|
61617
|
+
reSize: false,
|
|
61618
|
+
changeTheme: false
|
|
61619
|
+
};
|
|
61573
61620
|
if (!this._setNewSpec(spec, forceMerge)) {
|
|
61574
61621
|
return undefined;
|
|
61575
61622
|
}
|
|
61576
61623
|
if (!isEqual$1(lastSpec.theme, this._spec.theme)) {
|
|
61577
|
-
|
|
61624
|
+
result.changeTheme = true;
|
|
61578
61625
|
}
|
|
61579
61626
|
const reSize = this._shouldChartResize(lastSpec);
|
|
61627
|
+
result.reSize = reSize;
|
|
61580
61628
|
(_b = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.getVGrammarView()) === null || _b === void 0 ? void 0 : _b.updateLayoutTag();
|
|
61581
61629
|
if (this._spec.type !== lastSpec.type) {
|
|
61582
|
-
|
|
61583
|
-
|
|
61584
|
-
|
|
61585
|
-
|
|
61586
|
-
reCompile: false,
|
|
61587
|
-
reSize: reSize
|
|
61588
|
-
};
|
|
61630
|
+
result.reMake = true;
|
|
61631
|
+
result.reTransformSpec = true;
|
|
61632
|
+
result.change = true;
|
|
61633
|
+
return result;
|
|
61589
61634
|
}
|
|
61590
61635
|
this._initChartSpec(this._spec, 'render');
|
|
61591
|
-
const res = mergeUpdateResult(this._chart.updateSpec(this._spec),
|
|
61592
|
-
reTransformSpec: false,
|
|
61593
|
-
change: reSize,
|
|
61594
|
-
reMake: false,
|
|
61595
|
-
reCompile: false,
|
|
61596
|
-
reSize
|
|
61597
|
-
});
|
|
61636
|
+
const res = mergeUpdateResult(this._chart.updateSpec(this._spec), result);
|
|
61598
61637
|
return userUpdateOptions
|
|
61599
61638
|
? Object.assign(Object.assign({}, res), userUpdateOptions) : res;
|
|
61600
61639
|
}
|
|
@@ -61827,11 +61866,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61827
61866
|
return this._currentThemeName;
|
|
61828
61867
|
}
|
|
61829
61868
|
setCurrentTheme(name) {
|
|
61869
|
+
var _a;
|
|
61830
61870
|
return __awaiter$7(this, void 0, void 0, function* () {
|
|
61831
61871
|
if (!ThemeManager.themeExist(name)) {
|
|
61832
61872
|
return this;
|
|
61833
61873
|
}
|
|
61834
61874
|
const result = this._setCurrentTheme(name);
|
|
61875
|
+
this._setFontFamilyTheme((_a = this._currentTheme) === null || _a === void 0 ? void 0 : _a.fontFamily);
|
|
61835
61876
|
yield this.updateCustomConfigAndRerender(result, false, {
|
|
61836
61877
|
transformSpec: false,
|
|
61837
61878
|
actionSource: 'setCurrentTheme'
|
|
@@ -61840,10 +61881,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61840
61881
|
});
|
|
61841
61882
|
}
|
|
61842
61883
|
setCurrentThemeSync(name) {
|
|
61884
|
+
var _a;
|
|
61843
61885
|
if (!ThemeManager.themeExist(name)) {
|
|
61844
61886
|
return this;
|
|
61845
61887
|
}
|
|
61846
61888
|
const result = this._setCurrentTheme(name);
|
|
61889
|
+
this._setFontFamilyTheme((_a = this._currentTheme) === null || _a === void 0 ? void 0 : _a.fontFamily);
|
|
61847
61890
|
this.updateCustomConfigAndRerender(result, true, {
|
|
61848
61891
|
transformSpec: false,
|
|
61849
61892
|
actionSource: 'setCurrentTheme'
|
|
@@ -61857,6 +61900,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61857
61900
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme();
|
|
61858
61901
|
return { change: true, reMake: false };
|
|
61859
61902
|
}
|
|
61903
|
+
_setFontFamilyTheme(fontFamily) {
|
|
61904
|
+
var _a;
|
|
61905
|
+
if (!fontFamily) {
|
|
61906
|
+
return;
|
|
61907
|
+
}
|
|
61908
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.setTheme({ text: { fontFamily } });
|
|
61909
|
+
}
|
|
61860
61910
|
_getTooltipComponent() {
|
|
61861
61911
|
var _a;
|
|
61862
61912
|
const tooltip = (_a = this._chart) === null || _a === void 0 ? void 0 : _a.getComponentsByType(ComponentTypeEnum.tooltip)[0];
|
|
@@ -66479,7 +66529,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66479
66529
|
registerComponentPlugin(CanvasTooltipHandler);
|
|
66480
66530
|
};
|
|
66481
66531
|
|
|
66482
|
-
const version = "1.11.
|
|
66532
|
+
const version = "1.11.9";
|
|
66483
66533
|
|
|
66484
66534
|
const addVChartProperty = (data, op) => {
|
|
66485
66535
|
const context = op.beforeCall();
|
|
@@ -67262,11 +67312,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67262
67312
|
}
|
|
67263
67313
|
}
|
|
67264
67314
|
getRawDataStatisticsByField(field, isNumeric) {
|
|
67265
|
-
var _a, _b;
|
|
67315
|
+
var _a, _b, _c;
|
|
67266
67316
|
if (!this._rawStatisticsCache) {
|
|
67267
67317
|
this._rawStatisticsCache = {};
|
|
67268
67318
|
}
|
|
67269
|
-
if (!this._rawStatisticsCache[field]
|
|
67319
|
+
if (!this._rawStatisticsCache[field] ||
|
|
67320
|
+
(isNumeric && (isNil$1(this._rawStatisticsCache[field].min) || isNil$1(this._rawStatisticsCache[field].max))) ||
|
|
67321
|
+
(!isNumeric && isNil$1(this._rawStatisticsCache[field].values))) {
|
|
67270
67322
|
const canUseViewStatistics = this._viewDataStatistics &&
|
|
67271
67323
|
(!this._viewDataFilter || this._viewDataFilter.transformsArr.length <= 1) &&
|
|
67272
67324
|
this.getViewData().transformsArr.length <= 1;
|
|
@@ -67286,16 +67338,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67286
67338
|
}
|
|
67287
67339
|
}
|
|
67288
67340
|
else {
|
|
67289
|
-
|
|
67341
|
+
const result = dimensionStatisticsOfSimpleData(this._rawData.latestData, [
|
|
67290
67342
|
{ key: field, operations: isNumeric ? ['min', 'max'] : ['values'] }
|
|
67291
67343
|
])[field];
|
|
67344
|
+
this._rawStatisticsCache[field] = merge$2((_c = this._rawStatisticsCache[field]) !== null && _c !== void 0 ? _c : {}, result);
|
|
67292
67345
|
}
|
|
67293
67346
|
}
|
|
67294
67347
|
}
|
|
67295
|
-
if (isNumeric && (isNil$1(this._rawStatisticsCache[field].min) || isNil$1(this._rawStatisticsCache[field].max))) {
|
|
67296
|
-
this._rawStatisticsCache[field].min = minInArray(this._rawStatisticsCache[field].values);
|
|
67297
|
-
this._rawStatisticsCache[field].max = maxInArray(this._rawStatisticsCache[field].values);
|
|
67298
|
-
}
|
|
67299
67348
|
return this._rawStatisticsCache[field];
|
|
67300
67349
|
}
|
|
67301
67350
|
_statisticViewData() {
|
|
@@ -72225,6 +72274,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72225
72274
|
const componentCache = {};
|
|
72226
72275
|
this._components.forEach(c => {
|
|
72227
72276
|
var _a, _b;
|
|
72277
|
+
if (c.type === ComponentTypeEnum.label || c.type === ComponentTypeEnum.totalLabel) {
|
|
72278
|
+
return;
|
|
72279
|
+
}
|
|
72228
72280
|
const compSpecKey = c.specKey || c.type;
|
|
72229
72281
|
const cmpSpec = (_a = this._spec[compSpecKey]) !== null && _a !== void 0 ? _a : {};
|
|
72230
72282
|
if (isArray$1(cmpSpec)) {
|
|
@@ -76250,7 +76302,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76250
76302
|
}
|
|
76251
76303
|
_transformLabelSpec(spec) {
|
|
76252
76304
|
this._addMarkLabelSpec(spec, "bar");
|
|
76253
|
-
this._addMarkLabelSpec(spec, "bar", 'stackLabel');
|
|
76305
|
+
this._addMarkLabelSpec(spec, "bar", 'stackLabel', 'initStackLabelMarkStyle');
|
|
76254
76306
|
}
|
|
76255
76307
|
}
|
|
76256
76308
|
|
|
@@ -76653,6 +76705,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76653
76705
|
this._labelMark = labelMark;
|
|
76654
76706
|
return;
|
|
76655
76707
|
}
|
|
76708
|
+
}
|
|
76709
|
+
initStackLabelMarkStyle(labelMark) {
|
|
76710
|
+
if (!labelMark) {
|
|
76711
|
+
return;
|
|
76712
|
+
}
|
|
76656
76713
|
this._stackLabelMark = labelMark;
|
|
76657
76714
|
labelMark.skipEncode = true;
|
|
76658
76715
|
labelMark.setRule('stackLabel');
|
|
@@ -79506,15 +79563,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79506
79563
|
}
|
|
79507
79564
|
onBind() {
|
|
79508
79565
|
const { angle: fromAngle, radius: fromRadius } = this._pointToCoord(this.from);
|
|
79509
|
-
if (!isValidNumber$1(fromAngle * fromRadius)) {
|
|
79510
|
-
this.valid = false;
|
|
79511
|
-
}
|
|
79512
|
-
this._fromAngle = fromAngle;
|
|
79513
|
-
this._fromRadius = fromRadius;
|
|
79514
79566
|
const { angle: toAngle, radius: toRadius } = this._pointToCoord(this.to);
|
|
79515
79567
|
if (!isValidNumber$1(toAngle * toRadius)) {
|
|
79516
79568
|
this.valid = false;
|
|
79517
79569
|
}
|
|
79570
|
+
this._fromAngle = isValidNumber$1(fromAngle) ? fromAngle : toAngle;
|
|
79571
|
+
this._fromRadius = isValidNumber$1(fromRadius) ? fromRadius : toRadius;
|
|
79518
79572
|
this._toAngle = toAngle;
|
|
79519
79573
|
this._toRadius = toRadius;
|
|
79520
79574
|
if (isClose(this._fromAngle, this._toAngle) && isClose(this._fromRadius, this._toRadius)) {
|
|
@@ -79523,6 +79577,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79523
79577
|
}
|
|
79524
79578
|
onUpdate(end, ratio, out) {
|
|
79525
79579
|
if (this.valid === false) {
|
|
79580
|
+
out.x = this.to.x;
|
|
79581
|
+
out.y = this.to.y;
|
|
79526
79582
|
return;
|
|
79527
79583
|
}
|
|
79528
79584
|
if (end) {
|
|
@@ -86483,20 +86539,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86483
86539
|
}
|
|
86484
86540
|
const isStartGap = "start" === this.options.gapPosition,
|
|
86485
86541
|
isMiddleGap = !isStartGap && "end" !== this.options.gapPosition,
|
|
86486
|
-
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,
|
|
86542
|
+
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, 0),
|
|
86487
86543
|
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);
|
|
86488
86544
|
for (let i = 0, columnCount = columns.length; i < columnCount; i++) {
|
|
86489
86545
|
const nodes = columns[i];
|
|
86490
86546
|
if (!nodes || !nodes.length) continue;
|
|
86491
86547
|
let y = this._viewBox.y0,
|
|
86492
86548
|
gapY = 0,
|
|
86493
|
-
nodeHeight = 0
|
|
86549
|
+
nodeHeight = 0,
|
|
86550
|
+
calculatedNodeHeight = 0;
|
|
86494
86551
|
for (let j = 0, len = nodes.length; j < len; j++) {
|
|
86495
86552
|
const node = nodes[j];
|
|
86496
|
-
gapY = getGapY(node), isStartGap && (y += gapY),
|
|
86553
|
+
gapY = getGapY(node), isStartGap && (y += gapY), calculatedNodeHeight = getNodeHeight(node), nodeHeight = Math.max(calculatedNodeHeight, minNodeHeight), node.y0 = y, node.y1 = y + nodeHeight, y = isStartGap ? node.y1 : node.y1 + gapY;
|
|
86497
86554
|
for (let k = 0, linkLen = node.sourceLinks.length; k < linkLen; k++) {
|
|
86498
86555
|
const link = node.sourceLinks[k];
|
|
86499
|
-
link.thickness = getLinkHeight(link, node,
|
|
86556
|
+
link.thickness = getLinkHeight(link, node, calculatedNodeHeight);
|
|
86500
86557
|
}
|
|
86501
86558
|
}
|
|
86502
86559
|
let deltaY = this._viewBox.y1 - y + (isMiddleGap ? gapY : 0);
|
|
@@ -93556,8 +93613,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93556
93613
|
return false;
|
|
93557
93614
|
}
|
|
93558
93615
|
_initTheme(spec, chartSpec) {
|
|
93616
|
+
var _a;
|
|
93559
93617
|
const { spec: newSpec, theme } = super._initTheme(spec, chartSpec);
|
|
93560
93618
|
newSpec.style = mergeSpec({}, this._theme, newSpec.style);
|
|
93619
|
+
newSpec.offset = mergeSpec({}, theme.offset, spec.offset);
|
|
93620
|
+
newSpec.transitionDuration = (_a = spec.transitionDuration) !== null && _a !== void 0 ? _a : theme.transitionDuration;
|
|
93561
93621
|
return { spec: newSpec, theme };
|
|
93562
93622
|
}
|
|
93563
93623
|
_transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
|
|
@@ -93696,6 +93756,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93696
93756
|
})) {
|
|
93697
93757
|
return false;
|
|
93698
93758
|
}
|
|
93759
|
+
if (this._timer) {
|
|
93760
|
+
clearTimeout(this._timer);
|
|
93761
|
+
}
|
|
93699
93762
|
let success;
|
|
93700
93763
|
if (useCache) {
|
|
93701
93764
|
success = !processor.showTooltip(this._cacheInfo, params, true);
|
|
@@ -93716,9 +93779,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93716
93779
|
this._clickLock = true;
|
|
93717
93780
|
}
|
|
93718
93781
|
else if (Number.isFinite(this._spec.hideTimer)) {
|
|
93719
|
-
if (this._timer) {
|
|
93720
|
-
clearTimeout(this._timer);
|
|
93721
|
-
}
|
|
93722
93782
|
this._timer = setTimeout(() => {
|
|
93723
93783
|
this._handleChartMouseOut();
|
|
93724
93784
|
}, this._spec.hideTimer);
|