@visactor/vchart 1.3.0-beta.4 → 1.3.0-beta.6
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 -208
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/area/area.js +2 -1
- package/cjs/chart/area/area.js.map +1 -1
- package/cjs/chart/base-chart.d.ts +2 -1
- package/cjs/chart/base-chart.js +12 -0
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +2 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/line/line.js +2 -1
- package/cjs/chart/line/line.js.map +1 -1
- package/cjs/chart/radar/radar.js +2 -1
- package/cjs/chart/radar/radar.js.map +1 -1
- package/cjs/chart/util.js +1 -2
- package/cjs/compile/compiler.d.ts +2 -1
- package/cjs/compile/compiler.js +4 -0
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/mark/interface.d.ts +2 -0
- package/cjs/compile/mark/interface.js.map +1 -1
- package/cjs/component/index.js +2 -1
- package/cjs/component/title/title.js +1 -1
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/interface.d.ts +9 -12
- package/cjs/component/tooltip/handler/dom/interface.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/content-column-model.d.ts +4 -6
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js +17 -15
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/title-model.js +3 -3
- package/cjs/component/tooltip/handler/dom/model/title-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/util.js +18 -11
- package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.js +23 -23
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/compose.d.ts +2 -2
- package/cjs/component/tooltip/handler/utils/compose.js +13 -10
- package/cjs/component/tooltip/handler/utils/compose.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/get-spec.js +72 -54
- package/cjs/component/tooltip/handler/utils/get-spec.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/style.d.ts +1 -1
- package/cjs/component/tooltip/handler/utils/style.js +15 -10
- package/cjs/component/tooltip/handler/utils/style.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.d.ts +1 -1
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/marker.js +1 -2
- package/cjs/core/factory.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 +4 -1
- package/cjs/core/vchart.js +41 -11
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js +9 -7
- package/cjs/data/initialize.js.map +1 -1
- package/cjs/series/area/interface.d.ts +1 -0
- package/cjs/series/area/interface.js.map +1 -1
- package/cjs/series/base/base-series.js +2 -1
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/base/tooltip-helper.js +1 -0
- package/cjs/series/base/tooltip-helper.js.map +1 -1
- package/cjs/series/line/interface.d.ts +1 -0
- package/cjs/series/line/interface.js.map +1 -1
- package/cjs/series/mixin/line-mixin.d.ts +10 -2
- package/cjs/series/mixin/line-mixin.js +53 -6
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/polar/polar.js +2 -1
- package/cjs/series/polar/polar.js.map +1 -1
- package/cjs/series/radar/interface.d.ts +1 -0
- package/cjs/series/radar/interface.js.map +1 -1
- package/cjs/typings/tooltip/label.d.ts +10 -0
- package/cjs/typings/tooltip/label.js +6 -0
- package/cjs/typings/tooltip/label.js.map +1 -0
- package/cjs/typings/tooltip/line.d.ts +3 -3
- package/cjs/typings/tooltip/line.js.map +1 -1
- package/cjs/typings/tooltip/shape.d.ts +3 -0
- package/cjs/typings/tooltip/shape.js.map +1 -1
- package/esm/chart/area/area.js +2 -1
- package/esm/chart/area/area.js.map +1 -1
- package/esm/chart/base-chart.d.ts +2 -1
- package/esm/chart/base-chart.js +12 -0
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +2 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/line/line.js +2 -1
- package/esm/chart/line/line.js.map +1 -1
- package/esm/chart/radar/radar.js +2 -1
- package/esm/chart/radar/radar.js.map +1 -1
- package/esm/chart/util.js +1 -2
- package/esm/compile/compiler.d.ts +2 -1
- package/esm/compile/compiler.js +4 -0
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/mark/interface.d.ts +2 -0
- package/esm/compile/mark/interface.js.map +1 -1
- package/esm/component/index.js +2 -1
- package/esm/component/title/title.js +1 -1
- package/esm/component/title/title.js.map +1 -1
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/interface.d.ts +9 -12
- package/esm/component/tooltip/handler/dom/interface.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/content-column-model.d.ts +4 -6
- package/esm/component/tooltip/handler/dom/model/content-column-model.js +16 -14
- package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/title-model.js +3 -3
- package/esm/component/tooltip/handler/dom/model/title-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/util.js +18 -11
- package/esm/component/tooltip/handler/dom/util.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.js +22 -23
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/tooltip/handler/utils/compose.d.ts +2 -2
- package/esm/component/tooltip/handler/utils/compose.js +11 -10
- package/esm/component/tooltip/handler/utils/compose.js.map +1 -1
- package/esm/component/tooltip/handler/utils/get-spec.js +70 -50
- package/esm/component/tooltip/handler/utils/get-spec.js.map +1 -1
- package/esm/component/tooltip/handler/utils/style.d.ts +1 -1
- package/esm/component/tooltip/handler/utils/style.js +16 -9
- package/esm/component/tooltip/handler/utils/style.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.d.ts +1 -1
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/marker.js +1 -2
- package/esm/core/factory.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 +4 -1
- package/esm/core/vchart.js +41 -11
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js +10 -7
- package/esm/data/initialize.js.map +1 -1
- package/esm/series/area/interface.d.ts +1 -0
- package/esm/series/area/interface.js.map +1 -1
- package/esm/series/base/base-series.js +2 -1
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/base/tooltip-helper.js +1 -0
- package/esm/series/base/tooltip-helper.js.map +1 -1
- package/esm/series/line/interface.d.ts +1 -0
- package/esm/series/line/interface.js.map +1 -1
- package/esm/series/mixin/line-mixin.d.ts +10 -2
- package/esm/series/mixin/line-mixin.js +60 -5
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/polar/polar.js +2 -1
- package/esm/series/polar/polar.js.map +1 -1
- package/esm/series/radar/interface.d.ts +1 -0
- package/esm/series/radar/interface.js.map +1 -1
- package/esm/typings/tooltip/label.d.ts +10 -0
- package/esm/typings/tooltip/label.js +2 -0
- package/esm/typings/tooltip/label.js.map +1 -0
- package/esm/typings/tooltip/line.d.ts +3 -3
- package/esm/typings/tooltip/line.js.map +1 -1
- package/esm/typings/tooltip/shape.d.ts +3 -0
- package/esm/typings/tooltip/shape.js.map +1 -1
- package/package.json +4 -4
package/build/index.js
CHANGED
|
@@ -7514,11 +7514,12 @@
|
|
|
7514
7514
|
}
|
|
7515
7515
|
parse(data, options) {
|
|
7516
7516
|
let emit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
7517
|
+
var _a;
|
|
7517
7518
|
this.isRunning = !0, emit && this.target.emit("beforeParse", []);
|
|
7518
7519
|
const cloneData = this.cloneParseData(data, options);
|
|
7519
|
-
if (options) {
|
|
7520
|
+
if (null == options ? void 0 : options.type) {
|
|
7520
7521
|
this.parseOption = options, options = cloneDeep(options);
|
|
7521
|
-
const parserData = this.dataSet.getParser(options.type
|
|
7522
|
+
const parserData = (null !== (_a = this.dataSet.getParser(options.type)) && void 0 !== _a ? _a : this.dataSet.getParser("bytejson"))(cloneData, options.options, this);
|
|
7522
7523
|
this.rawData = cloneData, this.parserData = parserData, this.history && this.historyData.push(cloneData, parserData), this.latestData = parserData;
|
|
7523
7524
|
} else this.parserData = cloneData, this.rawData = cloneData, this.history && this.historyData.push(cloneData), this.latestData = cloneData;
|
|
7524
7525
|
return this.isRunning = !1, emit && this.target.emit("afterParse", []), this;
|
|
@@ -7599,8 +7600,8 @@
|
|
|
7599
7600
|
this._diffRank = next;
|
|
7600
7601
|
}
|
|
7601
7602
|
cloneParseData(data, options) {
|
|
7602
|
-
let clone = !
|
|
7603
|
-
return
|
|
7603
|
+
let clone = !1;
|
|
7604
|
+
return data instanceof DataView || !0 !== (null == options ? void 0 : options.clone) || (clone = !0), clone ? cloneDeep(data) : data;
|
|
7604
7605
|
}
|
|
7605
7606
|
parseNewData(data, options) {
|
|
7606
7607
|
this.parse(data, options || this.parseOption), this.reRunAllTransform();
|
|
@@ -26502,6 +26503,7 @@
|
|
|
26502
26503
|
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
26503
26504
|
if (maxLineWidth > 0) for (let i = 0; i < lines.length; i++) {
|
|
26504
26505
|
const str = lines[i];
|
|
26506
|
+
let needCut = !0;
|
|
26505
26507
|
if (i === lineCountLimit - 1) {
|
|
26506
26508
|
const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
|
|
26507
26509
|
linesLayout.push({
|
|
@@ -26511,14 +26513,17 @@
|
|
|
26511
26513
|
break;
|
|
26512
26514
|
}
|
|
26513
26515
|
const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth);
|
|
26514
|
-
if ("" !== str && "" === clip.str)
|
|
26515
|
-
|
|
26516
|
-
|
|
26517
|
-
|
|
26516
|
+
if ("" !== str && "" === clip.str) {
|
|
26517
|
+
if (ellipsis) {
|
|
26518
|
+
const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
|
|
26519
|
+
clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
|
|
26520
|
+
} else clip.str = "", clip.width = 0;
|
|
26521
|
+
needCut = !1;
|
|
26522
|
+
}
|
|
26518
26523
|
if (linesLayout.push({
|
|
26519
26524
|
str: clip.str,
|
|
26520
26525
|
width: clip.width
|
|
26521
|
-
}), clip.str.length === str.length) ;else {
|
|
26526
|
+
}), clip.str.length === str.length) ;else if (needCut) {
|
|
26522
26527
|
const newStr = str.substring(clip.str.length);
|
|
26523
26528
|
lines.splice(i + 1, 0, newStr);
|
|
26524
26529
|
}
|
|
@@ -46208,13 +46213,31 @@
|
|
|
46208
46213
|
}(IMarkPointItemPosition || (IMarkPointItemPosition = {}));
|
|
46209
46214
|
|
|
46210
46215
|
class Marker extends AbstractComponent {
|
|
46216
|
+
_initContainer() {
|
|
46217
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
46218
|
+
const groupClip = createGroup(Object.assign(Object.assign({}, null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.clipRange), {
|
|
46219
|
+
clip: null !== (_c = isValid(null === (_b = this.attribute) || void 0 === _b ? void 0 : _b.clipRange)) && void 0 !== _c && _c
|
|
46220
|
+
}));
|
|
46221
|
+
groupClip.name = "marker-container";
|
|
46222
|
+
const group = createGroup({
|
|
46223
|
+
x: -(null !== (_f = null === (_e = null === (_d = this.attribute) || void 0 === _d ? void 0 : _d.clipRange) || void 0 === _e ? void 0 : _e.x) && void 0 !== _f ? _f : 0),
|
|
46224
|
+
y: -(null !== (_j = null === (_h = null === (_g = this.attribute) || void 0 === _g ? void 0 : _g.clipRange) || void 0 === _h ? void 0 : _h.y) && void 0 !== _j ? _j : 0)
|
|
46225
|
+
});
|
|
46226
|
+
groupClip.add(group), this._containerClip = groupClip, this.add(groupClip), this._container = group;
|
|
46227
|
+
}
|
|
46228
|
+
_updateContainer() {
|
|
46229
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
46230
|
+
this._containerClip.setAttributes(Object.assign(Object.assign({}, null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.clipRange), {
|
|
46231
|
+
clip: null !== (_c = isValid(null === (_b = this.attribute) || void 0 === _b ? void 0 : _b.clipRange)) && void 0 !== _c && _c
|
|
46232
|
+
})), this._container.setAttributes({
|
|
46233
|
+
x: -(null !== (_f = null === (_e = null === (_d = this.attribute) || void 0 === _d ? void 0 : _d.clipRange) || void 0 === _e ? void 0 : _e.x) && void 0 !== _f ? _f : 0),
|
|
46234
|
+
y: -(null !== (_j = null === (_h = null === (_g = this.attribute) || void 0 === _g ? void 0 : _g.clipRange) || void 0 === _h ? void 0 : _h.y) && void 0 !== _j ? _j : 0)
|
|
46235
|
+
});
|
|
46236
|
+
}
|
|
46211
46237
|
render() {
|
|
46212
46238
|
var _a, _b;
|
|
46213
46239
|
const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
|
|
46214
|
-
|
|
46215
|
-
const group = createGroup({});
|
|
46216
|
-
group.name = "marker-container", this.add(group), this._container = group, this.initMarker(group);
|
|
46217
|
-
}
|
|
46240
|
+
null !== (_b = this.attribute.interactive) && void 0 !== _b && _b || (this.setAttribute("pickable", !1), this.setAttribute("childrenPickable", !1)), markerVisible && (this._containerClip ? (this._updateContainer(), this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)));
|
|
46218
46241
|
}
|
|
46219
46242
|
}
|
|
46220
46243
|
|
|
@@ -46891,7 +46914,7 @@
|
|
|
46891
46914
|
}(LegendStateValue || (LegendStateValue = {}));
|
|
46892
46915
|
var LegendEvent;
|
|
46893
46916
|
!function (LegendEvent) {
|
|
46894
|
-
LegendEvent.legendItemHover = "legendItemHover", LegendEvent.legendItemUnHover = "legendItemUnHover", LegendEvent.legendItemClick = "legendItemClick";
|
|
46917
|
+
LegendEvent.legendItemHover = "legendItemHover", LegendEvent.legendItemUnHover = "legendItemUnHover", LegendEvent.legendItemClick = "legendItemClick", LegendEvent.legendItemAttributeUpdate = "legendItemAttributeUpdate";
|
|
46895
46918
|
}(LegendEvent || (LegendEvent = {}));
|
|
46896
46919
|
var LEGEND_ELEMENT_NAME;
|
|
46897
46920
|
!function (LEGEND_ELEMENT_NAME) {
|
|
@@ -46990,11 +47013,12 @@
|
|
|
46990
47013
|
const target = e.target;
|
|
46991
47014
|
if (null === (_a = null == target ? void 0 : target.name) || void 0 === _a ? void 0 : _a.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
46992
47015
|
const legendItem = target.delegate;
|
|
46993
|
-
|
|
46994
|
-
|
|
47016
|
+
let attributeUpdate = !1;
|
|
47017
|
+
(legendItem.hasState(LegendStateValue.unSelectedHover) || legendItem.hasState(LegendStateValue.selectedHover)) && (attributeUpdate = !0), legendItem.removeState(LegendStateValue.unSelectedHover), legendItem.removeState(LegendStateValue.selectedHover), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
47018
|
+
attributeUpdate || !child.hasState(LegendStateValue.unSelectedHover) && !child.hasState(LegendStateValue.selectedHover) || (attributeUpdate = !0), child.removeState(LegendStateValue.unSelectedHover), child.removeState(LegendStateValue.selectedHover);
|
|
46995
47019
|
});
|
|
46996
47020
|
const focusButton = legendItem.getChildren()[0].find(node => node.name === LEGEND_ELEMENT_NAME.focus, !1);
|
|
46997
|
-
focusButton && focusButton.setAttribute("visible", !1), this._dispatchEvent(LegendEvent.legendItemUnHover, legendItem);
|
|
47021
|
+
focusButton && focusButton.setAttribute("visible", !1), attributeUpdate && this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem), this._dispatchEvent(LegendEvent.legendItemUnHover, legendItem);
|
|
46998
47022
|
}
|
|
46999
47023
|
}, this._onClick = e => {
|
|
47000
47024
|
var _a, _b, _c, _d, _e;
|
|
@@ -47290,18 +47314,20 @@
|
|
|
47290
47314
|
}
|
|
47291
47315
|
_setLegendItemState(legendItem, stateName) {
|
|
47292
47316
|
let keepCurrentStates = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
47293
|
-
|
|
47294
|
-
|
|
47295
|
-
|
|
47317
|
+
let attributeUpdate = !1;
|
|
47318
|
+
legendItem.hasState(stateName) || (attributeUpdate = !0), legendItem.addState(stateName, keepCurrentStates), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
47319
|
+
child.name !== LEGEND_ELEMENT_NAME.focus && (attributeUpdate || child.hasState(stateName) || (attributeUpdate = !0), child.addState(stateName, keepCurrentStates));
|
|
47320
|
+
}), attributeUpdate && this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem);
|
|
47296
47321
|
}
|
|
47297
47322
|
_removeLegendItemState(legendItem, stateNames) {
|
|
47323
|
+
let attributeUpdate = !1;
|
|
47298
47324
|
stateNames.forEach(name => {
|
|
47299
|
-
legendItem.removeState(name);
|
|
47325
|
+
!attributeUpdate && legendItem.hasState(name) && (attributeUpdate = !0), legendItem.removeState(name);
|
|
47300
47326
|
}), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
47301
47327
|
child.name !== LEGEND_ELEMENT_NAME.focus && stateNames.forEach(name => {
|
|
47302
|
-
child.removeState(name);
|
|
47328
|
+
!attributeUpdate && child.hasState(name) && (attributeUpdate = !0), child.removeState(name);
|
|
47303
47329
|
});
|
|
47304
|
-
});
|
|
47330
|
+
}), attributeUpdate && this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem);
|
|
47305
47331
|
}
|
|
47306
47332
|
_getSelectedLegends() {
|
|
47307
47333
|
var _a;
|
|
@@ -56689,11 +56715,13 @@
|
|
|
56689
56715
|
return viewData;
|
|
56690
56716
|
}
|
|
56691
56717
|
function dataToDataView(data, dataSet, sourceDataViews = [], ctx = {}) {
|
|
56692
|
-
var _a, _b, _c;
|
|
56718
|
+
var _a, _b, _c, _d;
|
|
56693
56719
|
if (data instanceof DataView) {
|
|
56694
56720
|
return data;
|
|
56695
56721
|
}
|
|
56696
|
-
const { id, values = [], fromDataIndex, fromDataId, transforms = [], fields
|
|
56722
|
+
const { id, values = [], fromDataIndex, fromDataId, transforms = [], fields } = data;
|
|
56723
|
+
const parser = ((_a = data.parser) !== null && _a !== void 0 ? _a : { clone: true });
|
|
56724
|
+
parser.clone = !(parser.clone === false);
|
|
56697
56725
|
let dataView;
|
|
56698
56726
|
const existDataView = sourceDataViews.find(dv => dv.name === id);
|
|
56699
56727
|
if (existDataView) {
|
|
@@ -56708,7 +56736,7 @@
|
|
|
56708
56736
|
if (typeof fromDataId === 'string') {
|
|
56709
56737
|
const fromDataView = sourceDataViews.find(dv => dv.name === fromDataId);
|
|
56710
56738
|
if (!fromDataView) {
|
|
56711
|
-
((
|
|
56739
|
+
((_b = ctx.onError) !== null && _b !== void 0 ? _b : error$1)(`no data matches fromDataId ${fromDataId}`);
|
|
56712
56740
|
return null;
|
|
56713
56741
|
}
|
|
56714
56742
|
dataView.parse([fromDataView], {
|
|
@@ -56721,7 +56749,7 @@
|
|
|
56721
56749
|
else if (typeof fromDataIndex === 'number') {
|
|
56722
56750
|
const fromDataView = sourceDataViews[fromDataIndex];
|
|
56723
56751
|
if (!fromDataView) {
|
|
56724
|
-
((
|
|
56752
|
+
((_c = ctx.onError) !== null && _c !== void 0 ? _c : error$1)(`no data matches fromDataIndex ${fromDataIndex}`);
|
|
56725
56753
|
return null;
|
|
56726
56754
|
}
|
|
56727
56755
|
dataView.parse([fromDataView], {
|
|
@@ -56732,10 +56760,10 @@
|
|
|
56732
56760
|
});
|
|
56733
56761
|
}
|
|
56734
56762
|
else if (Array.isArray(values)) {
|
|
56735
|
-
dataView.parse(
|
|
56763
|
+
dataView.parse(values, parser);
|
|
56736
56764
|
}
|
|
56737
56765
|
else if (isString(values) && (!parser || ['csv', 'dsv', 'tsv'].includes(parser.type))) {
|
|
56738
|
-
dataView.parse(values, (
|
|
56766
|
+
dataView.parse(values, (_d = parser) !== null && _d !== void 0 ? _d : { type: 'csv' });
|
|
56739
56767
|
}
|
|
56740
56768
|
else {
|
|
56741
56769
|
dataView.parse([]);
|
|
@@ -56952,6 +56980,10 @@
|
|
|
56952
56980
|
this._view.resize(width, height);
|
|
56953
56981
|
return this.reRenderAsync({ morph: false });
|
|
56954
56982
|
}
|
|
56983
|
+
setBackground(color) {
|
|
56984
|
+
var _a;
|
|
56985
|
+
(_a = this._view) === null || _a === void 0 ? void 0 : _a.background(color);
|
|
56986
|
+
}
|
|
56955
56987
|
reRenderAsync(morphConfig) {
|
|
56956
56988
|
if (this.isInited) {
|
|
56957
56989
|
if (this._rafId) {
|
|
@@ -57250,11 +57282,10 @@
|
|
|
57250
57282
|
this._currentThemeName = ThemeManager.getCurrentThemeName();
|
|
57251
57283
|
this._setSpec(spec);
|
|
57252
57284
|
this._updateCurrentTheme();
|
|
57253
|
-
const specBackground = typeof spec.background === 'string' ? spec.background : null;
|
|
57254
57285
|
this._compiler = new Compiler({
|
|
57255
57286
|
dom: (_a = this._container) !== null && _a !== void 0 ? _a : 'none',
|
|
57256
57287
|
canvas: renderCanvas
|
|
57257
|
-
}, Object.assign(Object.assign({ mode: this._option.mode, stage, pluginList: poptip !== false ? ['poptipForText'] : [] }, restOptions), { background:
|
|
57288
|
+
}, Object.assign(Object.assign({ mode: this._option.mode, stage, pluginList: poptip !== false ? ['poptipForText'] : [] }, restOptions), { background: this._getBackground(), onError: this._onError }));
|
|
57258
57289
|
this._eventDispatcher = new EventDispatcher(this, this._compiler);
|
|
57259
57290
|
this._event = new Event$1(this._eventDispatcher, mode);
|
|
57260
57291
|
this._compiler.initView();
|
|
@@ -57409,10 +57440,8 @@
|
|
|
57409
57440
|
(_a = this._compiler) === null || _a === void 0 ? void 0 : _a.releaseGrammar();
|
|
57410
57441
|
}
|
|
57411
57442
|
else {
|
|
57412
|
-
|
|
57413
|
-
|
|
57414
|
-
(_b = this._compiler) === null || _b === void 0 ? void 0 : _b.compile({ chart: this._chart, vChart: this }, {});
|
|
57415
|
-
}
|
|
57443
|
+
this.getComponents().forEach(c => c.clear());
|
|
57444
|
+
(_b = this._compiler) === null || _b === void 0 ? void 0 : _b.compile({ chart: this._chart, vChart: this }, {});
|
|
57416
57445
|
}
|
|
57417
57446
|
}
|
|
57418
57447
|
renderSync(morphConfig) {
|
|
@@ -57566,6 +57595,58 @@
|
|
|
57566
57595
|
}
|
|
57567
57596
|
return this;
|
|
57568
57597
|
}
|
|
57598
|
+
updateFullDataSync(data, reRender = true) {
|
|
57599
|
+
if (this._chart) {
|
|
57600
|
+
this._chart.updateFullData(data);
|
|
57601
|
+
if (reRender) {
|
|
57602
|
+
this._compiler.renderSync();
|
|
57603
|
+
}
|
|
57604
|
+
return this;
|
|
57605
|
+
}
|
|
57606
|
+
const list = array(data);
|
|
57607
|
+
list.forEach(d => {
|
|
57608
|
+
const { id, values, parser, fields } = d;
|
|
57609
|
+
const preDV = this._spec.data.find(dv => dv.name === id);
|
|
57610
|
+
if (preDV) {
|
|
57611
|
+
preDV.setFields(fields);
|
|
57612
|
+
preDV.parse(values, parser);
|
|
57613
|
+
}
|
|
57614
|
+
else {
|
|
57615
|
+
const dataView = dataToDataView(d, this._dataSet, this._spec.data, {
|
|
57616
|
+
onError: this._option.onError
|
|
57617
|
+
});
|
|
57618
|
+
this._spec.data.push(dataView);
|
|
57619
|
+
}
|
|
57620
|
+
});
|
|
57621
|
+
return this;
|
|
57622
|
+
}
|
|
57623
|
+
updateFullData(data, reRender = true) {
|
|
57624
|
+
return __awaiter$i(this, void 0, void 0, function* () {
|
|
57625
|
+
if (this._chart) {
|
|
57626
|
+
this._chart.updateFullData(data);
|
|
57627
|
+
if (reRender) {
|
|
57628
|
+
yield this._compiler.renderAsync();
|
|
57629
|
+
}
|
|
57630
|
+
return this;
|
|
57631
|
+
}
|
|
57632
|
+
const list = array(data);
|
|
57633
|
+
list.forEach(d => {
|
|
57634
|
+
const { id, values, parser, fields } = d;
|
|
57635
|
+
const preDV = this._spec.data.find(dv => dv.name === id);
|
|
57636
|
+
if (preDV) {
|
|
57637
|
+
preDV.setFields(fields);
|
|
57638
|
+
preDV.parse(values, parser);
|
|
57639
|
+
}
|
|
57640
|
+
else {
|
|
57641
|
+
const dataView = dataToDataView(d, this._dataSet, this._spec.data, {
|
|
57642
|
+
onError: this._option.onError
|
|
57643
|
+
});
|
|
57644
|
+
this._spec.data.push(dataView);
|
|
57645
|
+
}
|
|
57646
|
+
});
|
|
57647
|
+
return this;
|
|
57648
|
+
});
|
|
57649
|
+
}
|
|
57569
57650
|
updateSpec(spec, forceMerge = false, morphConfig) {
|
|
57570
57651
|
return __awaiter$i(this, void 0, void 0, function* () {
|
|
57571
57652
|
if (!spec) {
|
|
@@ -57666,7 +57747,7 @@
|
|
|
57666
57747
|
this._chart.setHovered(datum, filter, region);
|
|
57667
57748
|
}
|
|
57668
57749
|
_updateCurrentTheme() {
|
|
57669
|
-
var _a, _b, _c, _d;
|
|
57750
|
+
var _a, _b, _c, _d, _e;
|
|
57670
57751
|
if (isString((_a = this._spec) === null || _a === void 0 ? void 0 : _a.theme)) {
|
|
57671
57752
|
this._currentTheme = merge$2({}, ThemeManager.getTheme(this._spec.theme));
|
|
57672
57753
|
this._currentThemeName = this._spec.theme;
|
|
@@ -57675,6 +57756,11 @@
|
|
|
57675
57756
|
this._currentTheme = merge$2({}, ThemeManager.getTheme(this._currentThemeName), (_c = (_b = this._spec) === null || _b === void 0 ? void 0 : _b.theme) !== null && _c !== void 0 ? _c : {});
|
|
57676
57757
|
}
|
|
57677
57758
|
setPoptipTheme(merge$2({}, (_d = this._currentTheme.component) === null || _d === void 0 ? void 0 : _d.poptip));
|
|
57759
|
+
(_e = this._compiler) === null || _e === void 0 ? void 0 : _e.setBackground(this._getBackground());
|
|
57760
|
+
}
|
|
57761
|
+
_getBackground() {
|
|
57762
|
+
const specBackground = typeof this._spec.background === 'string' ? this._spec.background : null;
|
|
57763
|
+
return specBackground || this._currentTheme.background || this._option.background;
|
|
57678
57764
|
}
|
|
57679
57765
|
getCurrentTheme() {
|
|
57680
57766
|
return this._currentTheme;
|
|
@@ -60720,7 +60806,7 @@
|
|
|
60720
60806
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
60721
60807
|
Factory.registerRegion('region', Region);
|
|
60722
60808
|
Factory.registerLayout('base', Layout);
|
|
60723
|
-
const version = "1.3.0-beta.
|
|
60809
|
+
const version = "1.3.0-beta.6";
|
|
60724
60810
|
Logger.getInstance(LoggerLevel.Error);
|
|
60725
60811
|
|
|
60726
60812
|
var SeriesMarkNameEnum;
|
|
@@ -61624,6 +61710,24 @@
|
|
|
61624
61710
|
}
|
|
61625
61711
|
this.getAllModels().forEach(model => model.onDataUpdate());
|
|
61626
61712
|
}
|
|
61713
|
+
updateFullData(data, updateGlobalScale = true) {
|
|
61714
|
+
const dvs = [];
|
|
61715
|
+
array(data).forEach(d => {
|
|
61716
|
+
const dv = this._dataSet.getDataView(d.id);
|
|
61717
|
+
if (dv) {
|
|
61718
|
+
dvs.push({ d, dv });
|
|
61719
|
+
dv.markRunning();
|
|
61720
|
+
}
|
|
61721
|
+
});
|
|
61722
|
+
dvs.forEach(({ d, dv }) => {
|
|
61723
|
+
dv.setFields(d.fields);
|
|
61724
|
+
dv.parseNewData(d.values, d.parser);
|
|
61725
|
+
});
|
|
61726
|
+
if (updateGlobalScale) {
|
|
61727
|
+
this.updateGlobalScaleDomain();
|
|
61728
|
+
}
|
|
61729
|
+
this.getAllModels().forEach(model => model.onDataUpdate());
|
|
61730
|
+
}
|
|
61627
61731
|
onRender(option) {
|
|
61628
61732
|
}
|
|
61629
61733
|
getCanvasRect() {
|
|
@@ -63253,6 +63357,7 @@
|
|
|
63253
63357
|
},
|
|
63254
63358
|
content: [
|
|
63255
63359
|
{
|
|
63360
|
+
seriesId: this.series.id,
|
|
63256
63361
|
key: this.contentKeyCallback,
|
|
63257
63362
|
value: this.contentValueCallback,
|
|
63258
63363
|
hasShape: true,
|
|
@@ -63592,7 +63697,8 @@
|
|
|
63592
63697
|
seriesValue = this.getSeriesKeys()[0];
|
|
63593
63698
|
}
|
|
63594
63699
|
return (_a = this._option.globalScale.getScale('color')) === null || _a === void 0 ? void 0 : _a.scale(seriesValue);
|
|
63595
|
-
}
|
|
63700
|
+
},
|
|
63701
|
+
getRegion: () => this._region
|
|
63596
63702
|
};
|
|
63597
63703
|
}
|
|
63598
63704
|
setAttrFromSpec() {
|
|
@@ -66649,6 +66755,32 @@
|
|
|
66649
66755
|
}
|
|
66650
66756
|
return lineMark;
|
|
66651
66757
|
}
|
|
66758
|
+
_getEventElement(params, reverse = false) {
|
|
66759
|
+
let data = [];
|
|
66760
|
+
params.dimensionInfo.some(df => {
|
|
66761
|
+
df.data.some(dd => {
|
|
66762
|
+
if (dd.series === this) {
|
|
66763
|
+
data = dd.datum;
|
|
66764
|
+
return true;
|
|
66765
|
+
}
|
|
66766
|
+
return false;
|
|
66767
|
+
});
|
|
66768
|
+
return !data.length;
|
|
66769
|
+
});
|
|
66770
|
+
return data;
|
|
66771
|
+
}
|
|
66772
|
+
_dimensionTrigger(params) {
|
|
66773
|
+
const elements = this._getEventElement(params);
|
|
66774
|
+
switch (params.action) {
|
|
66775
|
+
case 'enter':
|
|
66776
|
+
this._symbolActiveMark.getDataView().parse(elements);
|
|
66777
|
+
this._symbolActiveMark.getData().updateData(false);
|
|
66778
|
+
break;
|
|
66779
|
+
case 'leave':
|
|
66780
|
+
this._symbolActiveMark.getDataView().parse([]);
|
|
66781
|
+
this._symbolActiveMark.getData().updateData(false);
|
|
66782
|
+
}
|
|
66783
|
+
}
|
|
66652
66784
|
initSymbolMark(progressive, isSeriesMark) {
|
|
66653
66785
|
this._symbolMark = this._createMark(lineLikeSeriesMarkMap.point, {
|
|
66654
66786
|
morph: shouldDoMorph(this._spec.animation, this._spec.morph, userAnimationConfig('point', this._spec)),
|
|
@@ -66658,35 +66790,66 @@
|
|
|
66658
66790
|
progressive,
|
|
66659
66791
|
isSeriesMark: !!isSeriesMark
|
|
66660
66792
|
});
|
|
66793
|
+
if (this._spec.activePoint === true) {
|
|
66794
|
+
const activeData = new DataView(this._option.dataSet, { name: `${PREFIX}_series_${this.id}_active_point` });
|
|
66795
|
+
activeData.parse([]);
|
|
66796
|
+
this._symbolActiveMark = this._createMark({ name: `active_point`, type: MarkTypeEnum.symbol }, {
|
|
66797
|
+
morph: false,
|
|
66798
|
+
groupKey: this._seriesField,
|
|
66799
|
+
label: null,
|
|
66800
|
+
isSeriesMark: false,
|
|
66801
|
+
dataView: activeData
|
|
66802
|
+
});
|
|
66803
|
+
this._symbolActiveMark.setVisible(false);
|
|
66804
|
+
}
|
|
66661
66805
|
return this._symbolMark;
|
|
66662
66806
|
}
|
|
66663
66807
|
initSymbolMarkStyle() {
|
|
66664
66808
|
var _a;
|
|
66665
66809
|
const symbolMark = this._symbolMark;
|
|
66666
|
-
if (symbolMark) {
|
|
66810
|
+
if (!symbolMark) {
|
|
66811
|
+
return symbolMark;
|
|
66812
|
+
}
|
|
66813
|
+
this.setMarkStyle(symbolMark, {
|
|
66814
|
+
fill: this.getColorAttribute()
|
|
66815
|
+
}, 'normal', AttributeLevel.Series);
|
|
66816
|
+
if (this._invalidType) {
|
|
66667
66817
|
this.setMarkStyle(symbolMark, {
|
|
66668
|
-
|
|
66669
|
-
|
|
66670
|
-
|
|
66671
|
-
this.setMarkStyle(symbolMark, {
|
|
66672
|
-
visible: (datum) => {
|
|
66673
|
-
if (this._invalidType === 'break') {
|
|
66674
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66675
|
-
}
|
|
66676
|
-
else if (this._invalidType === 'link') {
|
|
66677
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66678
|
-
}
|
|
66679
|
-
return true;
|
|
66818
|
+
visible: (datum) => {
|
|
66819
|
+
if (this._invalidType === 'break') {
|
|
66820
|
+
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66680
66821
|
}
|
|
66681
|
-
|
|
66682
|
-
|
|
66683
|
-
|
|
66684
|
-
|
|
66685
|
-
|
|
66686
|
-
z: this.dataToPositionZ.bind(this)
|
|
66822
|
+
else if (this._invalidType === 'link') {
|
|
66823
|
+
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66824
|
+
}
|
|
66825
|
+
return true;
|
|
66826
|
+
}
|
|
66687
66827
|
}, 'normal', AttributeLevel.Series);
|
|
66688
|
-
|
|
66689
|
-
|
|
66828
|
+
}
|
|
66829
|
+
this.setMarkStyle(symbolMark, {
|
|
66830
|
+
x: this.dataToPositionX.bind(this),
|
|
66831
|
+
y: this.dataToPositionY.bind(this),
|
|
66832
|
+
z: this.dataToPositionZ.bind(this)
|
|
66833
|
+
}, 'normal', AttributeLevel.Series);
|
|
66834
|
+
this._trigger.registerMark(symbolMark);
|
|
66835
|
+
(_a = this._tooltipHelper) === null || _a === void 0 ? void 0 : _a.activeTriggerSet.mark.add(symbolMark);
|
|
66836
|
+
if (this._symbolActiveMark && this._symbolMark.stateStyle.dimension_hover) {
|
|
66837
|
+
this._symbolActiveMark.setVisible(true);
|
|
66838
|
+
this.event.on(DimensionEventEnum.dimensionHover, this._dimensionTrigger.bind(this));
|
|
66839
|
+
for (const state in this._symbolMark.stateStyle) {
|
|
66840
|
+
this._symbolActiveMark.stateStyle[state] = {};
|
|
66841
|
+
for (const key in this._symbolMark.stateStyle[state]) {
|
|
66842
|
+
this._symbolActiveMark.stateStyle[state][key] = {
|
|
66843
|
+
style: null,
|
|
66844
|
+
level: AttributeLevel.Series,
|
|
66845
|
+
referer: symbolMark
|
|
66846
|
+
};
|
|
66847
|
+
}
|
|
66848
|
+
}
|
|
66849
|
+
this._symbolActiveMark.state.changeStateInfo({
|
|
66850
|
+
stateValue: STATE_VALUE_ENUM.STATE_DIMENSION_HOVER,
|
|
66851
|
+
filter: () => true
|
|
66852
|
+
});
|
|
66690
66853
|
}
|
|
66691
66854
|
return symbolMark;
|
|
66692
66855
|
}
|
|
@@ -68169,6 +68332,9 @@
|
|
|
68169
68332
|
_buildMarkAttributeContext() {
|
|
68170
68333
|
super._buildMarkAttributeContext();
|
|
68171
68334
|
this._markAttributeContext.valueToPosition = this.valueToPosition.bind(this);
|
|
68335
|
+
this._markAttributeContext.getCenter = () => {
|
|
68336
|
+
return this.angleAxisHelper.center();
|
|
68337
|
+
};
|
|
68172
68338
|
}
|
|
68173
68339
|
valueToPosition(angleValue, radiusValue) {
|
|
68174
68340
|
if (isNil(angleValue) || isNil(radiusValue) || !this.angleAxisHelper || !this.radiusAxisHelper) {
|
|
@@ -78468,7 +78634,7 @@
|
|
|
78468
78634
|
}
|
|
78469
78635
|
_getDefaultSeriesSpec(spec) {
|
|
78470
78636
|
var _a;
|
|
78471
|
-
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { invalidType: spec.invalidType || 'break', point: spec.point, line: spec.line, area: spec.area, seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area' });
|
|
78637
|
+
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { invalidType: spec.invalidType || 'break', point: spec.point, line: spec.line, area: spec.area, seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area', activePoint: spec.activePoint });
|
|
78472
78638
|
}
|
|
78473
78639
|
transformSpec(spec) {
|
|
78474
78640
|
super.transformSpec(spec);
|
|
@@ -78967,7 +79133,7 @@
|
|
|
78967
79133
|
}
|
|
78968
79134
|
_getDefaultSeriesSpec(spec) {
|
|
78969
79135
|
var _a;
|
|
78970
|
-
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { invalidType: spec.invalidType || 'break', point: spec.point, line: spec.line, seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'line' });
|
|
79136
|
+
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { invalidType: spec.invalidType || 'break', point: spec.point, line: spec.line, seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'line', activePoint: spec.activePoint });
|
|
78971
79137
|
}
|
|
78972
79138
|
transformSpec(spec) {
|
|
78973
79139
|
super.transformSpec(spec);
|
|
@@ -79239,7 +79405,7 @@
|
|
|
79239
79405
|
var _a;
|
|
79240
79406
|
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { seriesField: spec.seriesField, invalidType: spec.invalidType || 'break', line: spec.line, point: spec.point, stack: spec.stack, percent: spec.percent, area: merge$2({
|
|
79241
79407
|
visible: false
|
|
79242
|
-
}, spec.area), seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area' });
|
|
79408
|
+
}, spec.area), seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area', activePoint: spec.activePoint });
|
|
79243
79409
|
}
|
|
79244
79410
|
transformSpec(spec) {
|
|
79245
79411
|
var _a;
|
|
@@ -85633,7 +85799,7 @@
|
|
|
85633
85799
|
}
|
|
85634
85800
|
_getTitleAttrs() {
|
|
85635
85801
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
85636
|
-
const realWidth = (_a = this._spec.width) !== null && _a !== void 0 ? _a : this.getLayoutRect().width;
|
|
85802
|
+
const realWidth = Math.max(0, (_a = this._spec.width) !== null && _a !== void 0 ? _a : this.getLayoutRect().width);
|
|
85637
85803
|
return {
|
|
85638
85804
|
text: (_b = this._spec.text) !== null && _b !== void 0 ? _b : '',
|
|
85639
85805
|
subtext: (_c = this._spec.subtext) !== null && _c !== void 0 ? _c : '',
|
|
@@ -88254,15 +88420,13 @@
|
|
|
88254
88420
|
};
|
|
88255
88421
|
}
|
|
88256
88422
|
else {
|
|
88257
|
-
|
|
88258
|
-
|
|
88259
|
-
|
|
88260
|
-
|
|
88261
|
-
|
|
88262
|
-
|
|
88263
|
-
|
|
88264
|
-
tooltipContent.title.value = getTooltipContentValue(patternTitle === null || patternTitle === void 0 ? void 0 : patternTitle.value, datum, params);
|
|
88265
|
-
}
|
|
88423
|
+
const datum = getFirstDatumFromTooltipData(data);
|
|
88424
|
+
tooltipContent.title = {
|
|
88425
|
+
value: getTooltipContentValue(patternTitle === null || patternTitle === void 0 ? void 0 : patternTitle.value, datum, params),
|
|
88426
|
+
valueStyle: getTooltipContentValue(patternTitle === null || patternTitle === void 0 ? void 0 : patternTitle.valueStyle, datum, params),
|
|
88427
|
+
hasShape: patternTitle.hasShape,
|
|
88428
|
+
shapeHollow: patternTitle.shapeHollow
|
|
88429
|
+
};
|
|
88266
88430
|
}
|
|
88267
88431
|
if (pattern.activeType === 'mark') {
|
|
88268
88432
|
for (const content of patternContent !== null && patternContent !== void 0 ? patternContent : []) {
|
|
@@ -88340,6 +88504,8 @@
|
|
|
88340
88504
|
const isKeyAdaptive = getTooltipContentValue(config.isKeyAdaptive, datum, params);
|
|
88341
88505
|
const shapeType = getTooltipContentValue(config.shapeType, datum, params);
|
|
88342
88506
|
const shapeColor = getTooltipContentValue(config.shapeColor, datum, params);
|
|
88507
|
+
const keyStyle = getTooltipContentValue(config.keyStyle, datum, params);
|
|
88508
|
+
const valueStyle = getTooltipContentValue(config.valueStyle, datum, params);
|
|
88343
88509
|
return {
|
|
88344
88510
|
key,
|
|
88345
88511
|
value,
|
|
@@ -88348,7 +88514,9 @@
|
|
|
88348
88514
|
hasShape: config.hasShape,
|
|
88349
88515
|
shapeType: shapeType,
|
|
88350
88516
|
shapeHollow: config.shapeHollow,
|
|
88351
|
-
shapeColor
|
|
88517
|
+
shapeColor,
|
|
88518
|
+
keyStyle,
|
|
88519
|
+
valueStyle
|
|
88352
88520
|
};
|
|
88353
88521
|
};
|
|
88354
88522
|
|
|
@@ -88358,10 +88526,8 @@
|
|
|
88358
88526
|
};
|
|
88359
88527
|
|
|
88360
88528
|
const getTooltipSpecForShow = (activeType, globalSpec, series, dimensionInfo) => {
|
|
88361
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
88529
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
88362
88530
|
const finalSpec = Object.assign(Object.assign({}, globalSpec), { activeType });
|
|
88363
|
-
let defaultPattern = {};
|
|
88364
|
-
let userPattern = {};
|
|
88365
88531
|
if (activeType === 'mark' && series) {
|
|
88366
88532
|
const seriesSpec = ((_b = (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec) !== null && _b !== void 0 ? _b : {});
|
|
88367
88533
|
if (isValid(seriesSpec.visible) || isValid(seriesSpec.activeType)) {
|
|
@@ -88377,11 +88543,9 @@
|
|
|
88377
88543
|
if ((_e = finalSpec.handler) === null || _e === void 0 ? void 0 : _e.showTooltip) {
|
|
88378
88544
|
return finalSpec;
|
|
88379
88545
|
}
|
|
88380
|
-
defaultPattern = (_f = makeDefaultPattern(series, 'mark')) !== null && _f !== void 0 ? _f : {};
|
|
88381
|
-
userPattern = merge$2({}, cloneDeep(globalSpec.mark), cloneDeep(seriesSpec.mark));
|
|
88382
88546
|
}
|
|
88383
88547
|
else if (activeType === 'dimension' && (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length)) {
|
|
88384
|
-
const seriesList = dimensionInfo
|
|
88548
|
+
const seriesList = getSeriesListFromDimensionInfo(dimensionInfo);
|
|
88385
88549
|
if (seriesList.every(series => { var _a; return !getTooltipActualActiveType((_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec).includes('dimension'); })) {
|
|
88386
88550
|
finalSpec.visible = false;
|
|
88387
88551
|
}
|
|
@@ -88391,10 +88555,67 @@
|
|
|
88391
88555
|
else {
|
|
88392
88556
|
finalSpec.visible = true;
|
|
88393
88557
|
}
|
|
88394
|
-
finalSpec.handler = (
|
|
88395
|
-
if ((
|
|
88558
|
+
finalSpec.handler = (_f = globalSpec.handler) !== null && _f !== void 0 ? _f : undefined;
|
|
88559
|
+
if ((_g = finalSpec.handler) === null || _g === void 0 ? void 0 : _g.showTooltip) {
|
|
88396
88560
|
return finalSpec;
|
|
88397
88561
|
}
|
|
88562
|
+
}
|
|
88563
|
+
const defaultPattern = getDefaultTooltipPattern(activeType, series, dimensionInfo);
|
|
88564
|
+
const seriesPattern = getSeriesTooltipPattern(activeType, series, dimensionInfo);
|
|
88565
|
+
const userPattern = merge$2({}, cloneDeep(globalSpec[activeType]), seriesPattern);
|
|
88566
|
+
const defaultPatternTitle = defaultPattern.title;
|
|
88567
|
+
const titleShape = getShapePattern(undefined, userPattern, undefined, defaultPatternTitle);
|
|
88568
|
+
if (isValid(userPattern.title)) {
|
|
88569
|
+
if (!isFunction(userPattern.title)) {
|
|
88570
|
+
userPattern.title = Object.assign(Object.assign(Object.assign({}, defaultPattern.title), titleShape), userPattern.title);
|
|
88571
|
+
}
|
|
88572
|
+
else {
|
|
88573
|
+
const userPatternTitle = userPattern.title;
|
|
88574
|
+
userPattern.title = (data, params) => {
|
|
88575
|
+
var _a;
|
|
88576
|
+
const userResult = (_a = userPatternTitle(data, params)) !== null && _a !== void 0 ? _a : {};
|
|
88577
|
+
return Object.assign(Object.assign({}, titleShape), userResult);
|
|
88578
|
+
};
|
|
88579
|
+
}
|
|
88580
|
+
}
|
|
88581
|
+
else {
|
|
88582
|
+
userPattern.title = Object.assign(Object.assign({}, defaultPattern.title), titleShape);
|
|
88583
|
+
}
|
|
88584
|
+
const defaultPatternContent = array(defaultPattern.content);
|
|
88585
|
+
if (isValid(userPattern.content)) {
|
|
88586
|
+
const shapePatternMap = getShapePatternMapOfEachSeries(defaultPatternContent);
|
|
88587
|
+
if (!isFunction(userPattern.content)) {
|
|
88588
|
+
const newPatternContent = [];
|
|
88589
|
+
array(userPattern.content).forEach(userLine => {
|
|
88590
|
+
newPatternContent.push(Object.assign(Object.assign({}, getShapePattern(userLine, userPattern, shapePatternMap)), userLine));
|
|
88591
|
+
});
|
|
88592
|
+
userPattern.content = newPatternContent;
|
|
88593
|
+
}
|
|
88594
|
+
else {
|
|
88595
|
+
const userPatternContent = userPattern.content;
|
|
88596
|
+
userPattern.content = (data, params) => {
|
|
88597
|
+
var _a;
|
|
88598
|
+
const newPatternContent = [];
|
|
88599
|
+
array((_a = userPatternContent(data, params)) !== null && _a !== void 0 ? _a : []).forEach(userLine => {
|
|
88600
|
+
newPatternContent.push(Object.assign(Object.assign({}, getShapePattern(userLine, userPattern, shapePatternMap)), userLine));
|
|
88601
|
+
});
|
|
88602
|
+
return newPatternContent;
|
|
88603
|
+
};
|
|
88604
|
+
}
|
|
88605
|
+
}
|
|
88606
|
+
else {
|
|
88607
|
+
userPattern.content = defaultPatternContent.map(line => (Object.assign(Object.assign({}, line), getShapePattern(undefined, userPattern, undefined, line))));
|
|
88608
|
+
}
|
|
88609
|
+
finalSpec[activeType] = Object.assign(Object.assign(Object.assign({}, defaultPattern), userPattern), { activeType });
|
|
88610
|
+
return finalSpec;
|
|
88611
|
+
};
|
|
88612
|
+
const getDefaultTooltipPattern = (activeType, series, dimensionInfo) => {
|
|
88613
|
+
var _a;
|
|
88614
|
+
let defaultPattern = {};
|
|
88615
|
+
if (activeType === 'mark' && series) {
|
|
88616
|
+
defaultPattern = (_a = makeDefaultPattern(series, 'mark')) !== null && _a !== void 0 ? _a : {};
|
|
88617
|
+
}
|
|
88618
|
+
else if (activeType === 'dimension' && (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length)) {
|
|
88398
88619
|
const patternList = [];
|
|
88399
88620
|
dimensionInfo[0].data.forEach(data => {
|
|
88400
88621
|
const { series } = data;
|
|
@@ -88416,17 +88637,25 @@
|
|
|
88416
88637
|
}
|
|
88417
88638
|
});
|
|
88418
88639
|
defaultPattern = Object.assign(Object.assign({}, patternList[0]), { content: defaultPatternContent });
|
|
88419
|
-
|
|
88640
|
+
}
|
|
88641
|
+
return defaultPattern;
|
|
88642
|
+
};
|
|
88643
|
+
const getSeriesTooltipPattern = (activeType, series, dimensionInfo) => {
|
|
88644
|
+
var _a, _b;
|
|
88645
|
+
let seriesPattern = {};
|
|
88646
|
+
if (activeType === 'mark' && series) {
|
|
88647
|
+
const seriesSpec = ((_b = (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec) !== null && _b !== void 0 ? _b : {});
|
|
88648
|
+
seriesPattern = seriesSpec.mark ? cloneDeep(seriesSpec.mark) : {};
|
|
88649
|
+
}
|
|
88650
|
+
else if (activeType === 'dimension' && (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length)) {
|
|
88651
|
+
const seriesList = getSeriesListFromDimensionInfo(dimensionInfo);
|
|
88420
88652
|
const seriesPatternList = seriesList
|
|
88421
88653
|
.filter(series => {
|
|
88422
88654
|
var _a;
|
|
88423
88655
|
const spec = (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec;
|
|
88424
88656
|
return isValid(spec === null || spec === void 0 ? void 0 : spec.dimension) && getTooltipActualActiveType(spec).includes('dimension');
|
|
88425
88657
|
})
|
|
88426
|
-
.map(series =>
|
|
88427
|
-
const pattern = series.tooltipHelper.spec.dimension;
|
|
88428
|
-
return pattern;
|
|
88429
|
-
});
|
|
88658
|
+
.map(series => series.tooltipHelper.spec.dimension);
|
|
88430
88659
|
if (seriesPatternList.length) {
|
|
88431
88660
|
let seriesPatternContent = [];
|
|
88432
88661
|
if (seriesPatternList.every(({ content }) => isNil(content))) {
|
|
@@ -88445,65 +88674,38 @@
|
|
|
88445
88674
|
}
|
|
88446
88675
|
});
|
|
88447
88676
|
}
|
|
88448
|
-
|
|
88677
|
+
seriesPattern = Object.assign(Object.assign({}, seriesPatternList[0]), { content: seriesPatternContent });
|
|
88449
88678
|
}
|
|
88450
|
-
userPattern = merge$2({}, cloneDeep(globalSpec.dimension), seriesDimensionPattern);
|
|
88451
88679
|
}
|
|
88452
|
-
|
|
88453
|
-
|
|
88454
|
-
|
|
88455
|
-
|
|
88456
|
-
|
|
88457
|
-
|
|
88458
|
-
|
|
88459
|
-
|
|
88460
|
-
|
|
88461
|
-
|
|
88462
|
-
|
|
88463
|
-
|
|
88464
|
-
userPattern.title = (data, params) => {
|
|
88465
|
-
var _a;
|
|
88466
|
-
const userResult = (_a = userPatternTitle(data, params)) !== null && _a !== void 0 ? _a : {};
|
|
88467
|
-
return Object.assign(Object.assign({}, titleShape), userResult);
|
|
88468
|
-
};
|
|
88680
|
+
return seriesPattern;
|
|
88681
|
+
};
|
|
88682
|
+
const getSeriesListFromDimensionInfo = memoize((dimensionInfo) => {
|
|
88683
|
+
return dimensionInfo.reduce((list, cur) => list.concat(cur.data.map(data => data.series).filter(isValid)), []);
|
|
88684
|
+
});
|
|
88685
|
+
const getShapePatternMapOfEachSeries = (content) => {
|
|
88686
|
+
const shapePatternMap = {};
|
|
88687
|
+
content.forEach(line => {
|
|
88688
|
+
var _a;
|
|
88689
|
+
const key = (_a = line.seriesId) !== null && _a !== void 0 ? _a : 0;
|
|
88690
|
+
if (!shapePatternMap[key]) {
|
|
88691
|
+
shapePatternMap[key] = line;
|
|
88469
88692
|
}
|
|
88470
|
-
}
|
|
88471
|
-
|
|
88472
|
-
|
|
88473
|
-
|
|
88474
|
-
|
|
88693
|
+
});
|
|
88694
|
+
return shapePatternMap;
|
|
88695
|
+
};
|
|
88696
|
+
const getShapePattern = (userLinePattern, userPattern, shapePatternMap, defaultShapePattern) => {
|
|
88697
|
+
var _a, _b;
|
|
88698
|
+
const shapePatternFromMap = (_b = shapePatternMap === null || shapePatternMap === void 0 ? void 0 : shapePatternMap[(_a = userLinePattern === null || userLinePattern === void 0 ? void 0 : userLinePattern.seriesId) !== null && _a !== void 0 ? _a : 0]) !== null && _b !== void 0 ? _b : shapePatternMap === null || shapePatternMap === void 0 ? void 0 : shapePatternMap[0];
|
|
88699
|
+
const shapeKeys = ['hasShape', 'shapeType', 'shapeColor'];
|
|
88700
|
+
const shapePattern = {};
|
|
88701
|
+
shapeKeys.forEach(key => {
|
|
88475
88702
|
var _a, _b, _c;
|
|
88476
|
-
|
|
88477
|
-
|
|
88478
|
-
|
|
88479
|
-
shapeColor: (_c = userPattern.shapeColor) !== null && _c !== void 0 ? _c : defaultContentLine === null || defaultContentLine === void 0 ? void 0 : defaultContentLine.shapeColor
|
|
88480
|
-
});
|
|
88481
|
-
};
|
|
88482
|
-
const defaultPatternContent = array(defaultPattern.content);
|
|
88483
|
-
if (isValid(userPattern.content)) {
|
|
88484
|
-
if (!isFunction(userPattern.content)) {
|
|
88485
|
-
const userPatternContent = array(userPattern.content);
|
|
88486
|
-
userPatternContent.forEach((line, i) => {
|
|
88487
|
-
userPatternContent[i] = Object.assign(Object.assign({}, getContentShape(defaultPatternContent[0])), line);
|
|
88488
|
-
});
|
|
88703
|
+
const value = (_c = (_b = (_a = userLinePattern === null || userLinePattern === void 0 ? void 0 : userLinePattern[key]) !== null && _a !== void 0 ? _a : userPattern === null || userPattern === void 0 ? void 0 : userPattern[key]) !== null && _b !== void 0 ? _b : shapePatternFromMap === null || shapePatternFromMap === void 0 ? void 0 : shapePatternFromMap[key]) !== null && _c !== void 0 ? _c : defaultShapePattern === null || defaultShapePattern === void 0 ? void 0 : defaultShapePattern[key];
|
|
88704
|
+
if (value !== undefined) {
|
|
88705
|
+
shapePattern[key] = value;
|
|
88489
88706
|
}
|
|
88490
|
-
|
|
88491
|
-
|
|
88492
|
-
userPattern.content = (data, params) => {
|
|
88493
|
-
var _a;
|
|
88494
|
-
const userResult = array((_a = userPatternContent(data, params)) !== null && _a !== void 0 ? _a : []);
|
|
88495
|
-
userResult.forEach((line, i) => {
|
|
88496
|
-
userResult[i] = Object.assign(Object.assign({}, getContentShape(defaultPatternContent[0])), line);
|
|
88497
|
-
});
|
|
88498
|
-
return userResult;
|
|
88499
|
-
};
|
|
88500
|
-
}
|
|
88501
|
-
}
|
|
88502
|
-
else {
|
|
88503
|
-
userPattern.content = defaultPatternContent.map(line => (Object.assign(Object.assign({}, line), getContentShape(line))));
|
|
88504
|
-
}
|
|
88505
|
-
finalSpec[activeType] = Object.assign(Object.assign(Object.assign({}, defaultPattern), userPattern), { activeType });
|
|
88506
|
-
return finalSpec;
|
|
88707
|
+
});
|
|
88708
|
+
return shapePattern;
|
|
88507
88709
|
};
|
|
88508
88710
|
|
|
88509
88711
|
const getActualTooltipPositionValue = (position, event) => {
|
|
@@ -88522,6 +88724,18 @@
|
|
|
88522
88724
|
return result;
|
|
88523
88725
|
};
|
|
88524
88726
|
|
|
88727
|
+
const defaultTextAttributes = {
|
|
88728
|
+
fontFamily: DEFAULT_TEXT_FONT_FAMILY$1,
|
|
88729
|
+
spacing: 10,
|
|
88730
|
+
multiLine: false,
|
|
88731
|
+
wordBreak: 'break-word'
|
|
88732
|
+
};
|
|
88733
|
+
function getTextAttributes(style = {}, globalTheme, defaultAttributes) {
|
|
88734
|
+
var _a, _b;
|
|
88735
|
+
const attrs = Object.assign(Object.assign({}, (defaultAttributes !== null && defaultAttributes !== void 0 ? defaultAttributes : defaultTextAttributes)), { fill: (_a = style.fill) !== null && _a !== void 0 ? _a : style.fontColor, textAlign: style.textAlign, textBaseline: style.textBaseline, fontFamily: (_b = style.fontFamily) !== null && _b !== void 0 ? _b : globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.fontFamily, fontSize: style.fontSize, fontWeight: style.fontWeight, lineHeight: style.lineHeight, spacing: style.spacing, multiLine: style.multiLine, maxWidth: style.maxWidth, wordBreak: style.wordBreak });
|
|
88736
|
+
return attrs;
|
|
88737
|
+
}
|
|
88738
|
+
|
|
88525
88739
|
const getTooltipAttributes = (actualTooltip, style) => {
|
|
88526
88740
|
const { spaceRow, padding, title: titleStyle, shape: shapeStyle, key: keyStyle, value: valueStyle } = style;
|
|
88527
88741
|
const attribute = Object.assign(Object.assign({}, style), { title: {}, content: [], titleStyle: {
|
|
@@ -88540,17 +88754,13 @@
|
|
|
88540
88754
|
let maxWidth = 0;
|
|
88541
88755
|
let containerHeight = padding.top + padding.bottom;
|
|
88542
88756
|
let titleMaxHeight = 0;
|
|
88543
|
-
const { visible: titleVisible = true, value: titleValue = '', hasShape: titleHasShape, shapeType: titleShapeType = '', shapeHollow: titleShapeHollow, shapeColor: titleShapeColor } = title;
|
|
88757
|
+
const { visible: titleVisible = true, value: titleValue = '', valueStyle: titleValueStyle, hasShape: titleHasShape, shapeType: titleShapeType = '', shapeHollow: titleShapeHollow, shapeColor: titleShapeColor } = title;
|
|
88544
88758
|
attribute.title.visible = titleVisible;
|
|
88545
88759
|
if (titleVisible) {
|
|
88546
|
-
const {
|
|
88547
|
-
|
|
88548
|
-
|
|
88549
|
-
height,
|
|
88550
|
-
text,
|
|
88551
|
-
multiLine: titleStyle.multiLine,
|
|
88552
|
-
wordBreak: titleStyle.wordBreak
|
|
88553
|
-
};
|
|
88760
|
+
const lineTitleStyle = merge$2({}, titleStyle, getTextAttributes(titleValueStyle, undefined, {}));
|
|
88761
|
+
const { text, width, height } = measureTooltipText(titleValue, lineTitleStyle);
|
|
88762
|
+
attribute.title.value = Object.assign(Object.assign({ width,
|
|
88763
|
+
height }, lineTitleStyle), { text });
|
|
88554
88764
|
maxWidth = width;
|
|
88555
88765
|
titleMaxHeight = height;
|
|
88556
88766
|
if (titleHasShape && builtinSymbolsMap[titleShapeType]) {
|
|
@@ -88588,14 +88798,10 @@
|
|
|
88588
88798
|
let itemHeight = 0;
|
|
88589
88799
|
const { hasShape, key, shapeColor, shapeHollow, shapeType = '', value, isKeyAdaptive } = item;
|
|
88590
88800
|
if (isValid(key)) {
|
|
88591
|
-
const {
|
|
88592
|
-
|
|
88593
|
-
|
|
88594
|
-
height,
|
|
88595
|
-
text,
|
|
88596
|
-
multiLine: keyStyle.multiLine,
|
|
88597
|
-
wordBreak: titleStyle.wordBreak
|
|
88598
|
-
};
|
|
88801
|
+
const lineKeyStyle = merge$2({}, keyStyle, getTextAttributes(item.keyStyle, undefined, {}));
|
|
88802
|
+
const { width, height, text } = measureTooltipText(key, lineKeyStyle);
|
|
88803
|
+
itemAttrs.key = Object.assign(Object.assign({ width,
|
|
88804
|
+
height }, lineKeyStyle), { text });
|
|
88599
88805
|
if (!isKeyAdaptive) {
|
|
88600
88806
|
keyWidths.push(width);
|
|
88601
88807
|
}
|
|
@@ -88605,14 +88811,10 @@
|
|
|
88605
88811
|
itemHeight = Math.max(itemHeight, height);
|
|
88606
88812
|
}
|
|
88607
88813
|
if (isValid(value)) {
|
|
88608
|
-
const {
|
|
88609
|
-
|
|
88610
|
-
|
|
88611
|
-
height,
|
|
88612
|
-
text,
|
|
88613
|
-
multiLine: valueStyle.multiLine,
|
|
88614
|
-
wordBreak: titleStyle.wordBreak
|
|
88615
|
-
};
|
|
88814
|
+
const lineValueStyle = merge$2({}, valueStyle, getTextAttributes(item.valueStyle, undefined, {}));
|
|
88815
|
+
const { width, height, text } = measureTooltipText(value, lineValueStyle);
|
|
88816
|
+
itemAttrs.value = Object.assign(Object.assign({ width,
|
|
88817
|
+
height }, lineValueStyle), { text });
|
|
88616
88818
|
valueWidths.push(width);
|
|
88617
88819
|
itemHeight = Math.max(itemHeight, height);
|
|
88618
88820
|
}
|
|
@@ -88693,24 +88895,6 @@
|
|
|
88693
88895
|
};
|
|
88694
88896
|
};
|
|
88695
88897
|
|
|
88696
|
-
function getTextAttributes(style = {}, globalTheme) {
|
|
88697
|
-
var _a, _b, _c, _d, _e;
|
|
88698
|
-
const attrs = {
|
|
88699
|
-
fill: style.fontColor,
|
|
88700
|
-
textAlign: style.textAlign,
|
|
88701
|
-
textBaseline: style.textBaseline,
|
|
88702
|
-
fontFamily: (_b = (_a = style.fontFamily) !== null && _a !== void 0 ? _a : globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.fontFamily) !== null && _b !== void 0 ? _b : DEFAULT_TEXT_FONT_FAMILY$1,
|
|
88703
|
-
fontSize: style.fontSize,
|
|
88704
|
-
fontWeight: style.fontWeight,
|
|
88705
|
-
lineHeight: style.lineHeight,
|
|
88706
|
-
spacing: (_c = style.spacing) !== null && _c !== void 0 ? _c : 10,
|
|
88707
|
-
multiLine: (_d = style.multiLine) !== null && _d !== void 0 ? _d : false,
|
|
88708
|
-
maxWidth: style.maxWidth,
|
|
88709
|
-
wordBreak: (_e = style.wordBreak) !== null && _e !== void 0 ? _e : 'break-word'
|
|
88710
|
-
};
|
|
88711
|
-
return attrs;
|
|
88712
|
-
}
|
|
88713
|
-
|
|
88714
88898
|
var TooltipResult;
|
|
88715
88899
|
(function (TooltipResult) {
|
|
88716
88900
|
TooltipResult[TooltipResult["success"] = 0] = "success";
|
|
@@ -89091,9 +89275,12 @@
|
|
|
89091
89275
|
return defaultStr !== null && defaultStr !== void 0 ? defaultStr : 'initial';
|
|
89092
89276
|
};
|
|
89093
89277
|
function getDomStyles(style, attributeCache) {
|
|
89094
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
89278
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
89095
89279
|
const { panel: { fill: fillColor, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, shadowSpread, cornerRadius, stroke: strokeColor, lineWidth = 0 }, padding, key, value, title, shape, enterable, spaceRow, transitionDuration } = style;
|
|
89096
89280
|
const backgroundColor = fillColor;
|
|
89281
|
+
const shapeStyle = getShapeStyle(shape);
|
|
89282
|
+
const keyStyle = getLabelStyle(key);
|
|
89283
|
+
const valueStyle = getLabelStyle(value);
|
|
89097
89284
|
const styles = {
|
|
89098
89285
|
panel: {
|
|
89099
89286
|
width: getPixelPropertyStr(((_b = (_a = attributeCache === null || attributeCache === void 0 ? void 0 : attributeCache.panel) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0) + lineWidth * 2),
|
|
@@ -89114,28 +89301,31 @@
|
|
|
89114
89301
|
transitionProperty: transitionDuration ? 'transform' : 'initial',
|
|
89115
89302
|
transitionTimingFunction: transitionDuration ? 'ease-out' : 'initial'
|
|
89116
89303
|
},
|
|
89117
|
-
title: getLabelStyle(title),
|
|
89304
|
+
title: getLabelStyle(merge$2({}, title, (_e = attributeCache === null || attributeCache === void 0 ? void 0 : attributeCache.title) === null || _e === void 0 ? void 0 : _e.value)),
|
|
89118
89305
|
content: {},
|
|
89119
89306
|
shapeColumn: {
|
|
89120
|
-
|
|
89307
|
+
common: shapeStyle,
|
|
89308
|
+
items: [],
|
|
89121
89309
|
width: getPixelPropertyStr(shape.size),
|
|
89122
|
-
marginRight: getPixelPropertyStr((
|
|
89310
|
+
marginRight: getPixelPropertyStr((_f = shape.spacing) !== null && _f !== void 0 ? _f : DEFAULT_SHAPE_SPACING)
|
|
89123
89311
|
},
|
|
89124
89312
|
keyColumn: {
|
|
89125
|
-
|
|
89313
|
+
common: keyStyle,
|
|
89314
|
+
items: (_g = attributeCache === null || attributeCache === void 0 ? void 0 : attributeCache.content) === null || _g === void 0 ? void 0 : _g.map(({ key }) => (Object.assign(Object.assign(Object.assign({}, keyStyle), getLabelStyle(key)), ((key === null || key === void 0 ? void 0 : key.multiLine) ? { width: getPixelPropertyStr(Math.ceil(key.width)) } : undefined)))),
|
|
89126
89315
|
width: getPixelPropertyStr(attributeCache === null || attributeCache === void 0 ? void 0 : attributeCache.keyWidth),
|
|
89127
|
-
marginRight: getPixelPropertyStr((
|
|
89316
|
+
marginRight: getPixelPropertyStr((_h = key.spacing) !== null && _h !== void 0 ? _h : DEFAULT_KEY_SPACING)
|
|
89128
89317
|
},
|
|
89129
89318
|
valueColumn: {
|
|
89130
|
-
|
|
89319
|
+
common: valueStyle,
|
|
89320
|
+
items: (_j = attributeCache === null || attributeCache === void 0 ? void 0 : attributeCache.content) === null || _j === void 0 ? void 0 : _j.map(({ value }) => (Object.assign(Object.assign(Object.assign({}, valueStyle), getLabelStyle(value)), ((value === null || value === void 0 ? void 0 : value.multiLine) ? { width: getPixelPropertyStr(Math.ceil(value.width)) } : undefined)))),
|
|
89131
89321
|
width: getPixelPropertyStr(attributeCache === null || attributeCache === void 0 ? void 0 : attributeCache.valueWidth),
|
|
89132
|
-
marginRight: getPixelPropertyStr((
|
|
89322
|
+
marginRight: getPixelPropertyStr((_k = value.spacing) !== null && _k !== void 0 ? _k : DEFAULT_VALUE_SPACING)
|
|
89133
89323
|
},
|
|
89134
89324
|
spaceRow: getPixelPropertyStr(spaceRow)
|
|
89135
89325
|
};
|
|
89136
89326
|
if (isValid(spaceRow)) {
|
|
89137
89327
|
const gapUnit = spaceRow / 2;
|
|
89138
|
-
[styles.shapeColumn.
|
|
89328
|
+
[styles.shapeColumn.common, styles.keyColumn.common, styles.valueColumn.common].forEach(obj => {
|
|
89139
89329
|
obj.marginTop = getPixelPropertyStr(gapUnit);
|
|
89140
89330
|
obj.marginBottom = obj.marginTop;
|
|
89141
89331
|
});
|
|
@@ -89143,7 +89333,7 @@
|
|
|
89143
89333
|
styles.content.marginBottom = styles.content.marginTop;
|
|
89144
89334
|
}
|
|
89145
89335
|
else {
|
|
89146
|
-
[styles.content, styles.shapeColumn.
|
|
89336
|
+
[styles.content, styles.shapeColumn.common, styles.keyColumn.common, styles.valueColumn.common].forEach(obj => {
|
|
89147
89337
|
obj.marginTop = 'initial';
|
|
89148
89338
|
obj.marginBottom = 'initial';
|
|
89149
89339
|
});
|
|
@@ -89468,12 +89658,12 @@
|
|
|
89468
89658
|
const renderContent = (_b = (_a = this._option.getTooltipActual()) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : [];
|
|
89469
89659
|
const contentAttributes = (_d = (_c = this._option.getTooltipAttributes()) === null || _c === void 0 ? void 0 : _c.content) !== null && _d !== void 0 ? _d : [];
|
|
89470
89660
|
renderContent.forEach((line, i) => {
|
|
89471
|
-
var _a, _b;
|
|
89661
|
+
var _a, _b, _c, _d, _e;
|
|
89472
89662
|
let childStyle = {};
|
|
89473
89663
|
if (this.className === 'key-box') {
|
|
89474
89664
|
const { key, isKeyAdaptive } = line;
|
|
89475
|
-
childStyle = merge$2({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, tooltipStyle.keyColumn.
|
|
89476
|
-
const hasContent = (isString(key) && ((
|
|
89665
|
+
childStyle = merge$2({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, tooltipStyle.keyColumn.common), (_a = tooltipStyle.keyColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
|
|
89666
|
+
const hasContent = (isString(key) && ((_b = key === null || key === void 0 ? void 0 : key.trim) === null || _b === void 0 ? void 0 : _b.call(key)) !== '') || isNumber(key);
|
|
89477
89667
|
if (!hasContent && !childStyle.visibility) {
|
|
89478
89668
|
childStyle.visibility = 'hidden';
|
|
89479
89669
|
}
|
|
@@ -89483,12 +89673,12 @@
|
|
|
89483
89673
|
this.children[i].setStyle(childStyle);
|
|
89484
89674
|
}
|
|
89485
89675
|
else if (this.className === 'value-box') {
|
|
89486
|
-
childStyle = merge$2({}, defaultValueStyle, Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, tooltipStyle.valueColumn.
|
|
89676
|
+
childStyle = merge$2({}, defaultValueStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, tooltipStyle.valueColumn.common), (_c = tooltipStyle.valueColumn.items) === null || _c === void 0 ? void 0 : _c[i]));
|
|
89487
89677
|
this.children[i].setStyle(childStyle);
|
|
89488
89678
|
}
|
|
89489
89679
|
else if (this.className === 'shape-box') {
|
|
89490
|
-
childStyle = merge$2({}, defaultShapeStyle, Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, tooltipStyle.shapeColumn.
|
|
89491
|
-
(
|
|
89680
|
+
childStyle = merge$2({}, defaultShapeStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, tooltipStyle.shapeColumn.common), (_d = tooltipStyle.shapeColumn.items) === null || _d === void 0 ? void 0 : _d[i]));
|
|
89681
|
+
(_e = this.children[i]) === null || _e === void 0 ? void 0 : _e.setStyle(childStyle, this._getShapeSvgOption(line, i));
|
|
89492
89682
|
}
|
|
89493
89683
|
});
|
|
89494
89684
|
}
|
|
@@ -89507,7 +89697,7 @@
|
|
|
89507
89697
|
else {
|
|
89508
89698
|
childContent = TOOLTIP_EMPTY_STRING;
|
|
89509
89699
|
}
|
|
89510
|
-
(_b = this.children[i]) === null || _b === void 0 ? void 0 : _b.setContent(childContent, (_c = contentAttributes[i].
|
|
89700
|
+
(_b = this.children[i]) === null || _b === void 0 ? void 0 : _b.setContent(childContent, (_c = contentAttributes[i].key) === null || _c === void 0 ? void 0 : _c.multiLine);
|
|
89511
89701
|
}
|
|
89512
89702
|
else if (this.className === 'value-box') {
|
|
89513
89703
|
const valueContent = line.value;
|
|
@@ -89520,7 +89710,7 @@
|
|
|
89520
89710
|
(_e = this.children[i]) === null || _e === void 0 ? void 0 : _e.setContent(childContent, (_f = contentAttributes[i].value) === null || _f === void 0 ? void 0 : _f.multiLine);
|
|
89521
89711
|
}
|
|
89522
89712
|
else if (this.className === 'shape-box') {
|
|
89523
|
-
childContent = this._getShapeSvgOption(line);
|
|
89713
|
+
childContent = this._getShapeSvgOption(line, i);
|
|
89524
89714
|
(_g = this.children[i]) === null || _g === void 0 ? void 0 : _g.setContent(childContent);
|
|
89525
89715
|
}
|
|
89526
89716
|
});
|
|
@@ -89540,16 +89730,18 @@
|
|
|
89540
89730
|
return tooltipStyle.valueColumn;
|
|
89541
89731
|
}
|
|
89542
89732
|
}
|
|
89543
|
-
_getShapeSvgOption(line) {
|
|
89544
|
-
var _a, _b, _c, _d, _e
|
|
89733
|
+
_getShapeSvgOption(line, index) {
|
|
89734
|
+
var _a, _b, _c, _d, _e;
|
|
89545
89735
|
const tooltipStyle = this._option.getTooltipStyle();
|
|
89736
|
+
const shapeColumn = Object.assign(Object.assign({}, tooltipStyle.shapeColumn), (_a = tooltipStyle.shapeColumn.items) === null || _a === void 0 ? void 0 : _a[index]);
|
|
89737
|
+
const keyColumn = Object.assign(Object.assign({}, tooltipStyle.keyColumn), (_b = tooltipStyle.keyColumn.items) === null || _b === void 0 ? void 0 : _b[index]);
|
|
89546
89738
|
return {
|
|
89547
89739
|
hasShape: line.hasShape,
|
|
89548
89740
|
shapeType: line.shapeType,
|
|
89549
|
-
size:
|
|
89741
|
+
size: shapeColumn.width,
|
|
89550
89742
|
color: line.shapeColor,
|
|
89551
89743
|
hollow: line.shapeHollow,
|
|
89552
|
-
marginTop: `calc((${(
|
|
89744
|
+
marginTop: `calc((${(_d = (_c = keyColumn.lineHeight) !== null && _c !== void 0 ? _c : keyColumn.fontSize) !== null && _d !== void 0 ? _d : '18px'} - ${(_e = shapeColumn.width) !== null && _e !== void 0 ? _e : '8px'}) / 2)`
|
|
89553
89745
|
};
|
|
89554
89746
|
}
|
|
89555
89747
|
}
|
|
@@ -89652,11 +89844,11 @@
|
|
|
89652
89844
|
const { title } = tooltipActual;
|
|
89653
89845
|
super.setStyle(merge$2({}, defaultH2Style, tooltipStyle.title, style));
|
|
89654
89846
|
(_a = this.shape) === null || _a === void 0 ? void 0 : _a.setStyle({
|
|
89655
|
-
paddingRight: (_b = tooltipStyle.shapeColumn.
|
|
89847
|
+
paddingRight: (_b = tooltipStyle.shapeColumn.common) === null || _b === void 0 ? void 0 : _b.marginRight
|
|
89656
89848
|
}, {
|
|
89657
89849
|
hasShape: title === null || title === void 0 ? void 0 : title.hasShape,
|
|
89658
89850
|
shapeType: title === null || title === void 0 ? void 0 : title.shapeType,
|
|
89659
|
-
size: (_c = tooltipStyle.shapeColumn.
|
|
89851
|
+
size: (_c = tooltipStyle.shapeColumn.common) === null || _c === void 0 ? void 0 : _c.width,
|
|
89660
89852
|
color: title === null || title === void 0 ? void 0 : title.shapeColor,
|
|
89661
89853
|
hollow: title === null || title === void 0 ? void 0 : title.shapeHollow
|
|
89662
89854
|
});
|
|
@@ -89671,7 +89863,7 @@
|
|
|
89671
89863
|
(_a = this.shape) === null || _a === void 0 ? void 0 : _a.setStyle(undefined, {
|
|
89672
89864
|
hasShape: title === null || title === void 0 ? void 0 : title.hasShape,
|
|
89673
89865
|
shapeType: title === null || title === void 0 ? void 0 : title.shapeType,
|
|
89674
|
-
size: (_b = tooltipStyle.shapeColumn.
|
|
89866
|
+
size: (_b = tooltipStyle.shapeColumn.common) === null || _b === void 0 ? void 0 : _b.width,
|
|
89675
89867
|
color: title === null || title === void 0 ? void 0 : title.shapeColor,
|
|
89676
89868
|
hollow: title === null || title === void 0 ? void 0 : title.shapeHollow
|
|
89677
89869
|
});
|