@visactor/vchart 1.6.1 → 1.6.3
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 +353 -233
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/config.js +1 -0
- package/cjs/animation/config.js.map +1 -1
- package/cjs/animation/utils.js +13 -13
- package/cjs/animation/utils.js.map +1 -1
- package/cjs/compile/compiler.js +1 -1
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.d.ts +1 -2
- package/cjs/compile/mark/compilable-mark.js +4 -7
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js +10 -6
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/shape-model.d.ts +1 -0
- package/cjs/component/tooltip/handler/dom/model/shape-model.js +4 -4
- package/cjs/component/tooltip/handler/dom/model/shape-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/util.js +2 -2
- package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.js +1 -2
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.d.ts +1 -0
- package/cjs/core/vchart.js +9 -6
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/mark/arc.js +2 -2
- package/cjs/mark/arc.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +3 -3
- package/cjs/mark/base/base-mark.js +32 -72
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/series/cartesian/cartesian.js +6 -3
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +2 -1
- package/cjs/series/sankey/sankey.js +23 -28
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/theme/builtin/dark/color-scheme.js +1 -3
- package/cjs/theme/builtin/dark/color-scheme.js.map +1 -1
- package/cjs/theme/builtin/light/color-scheme.js +1 -3
- package/cjs/theme/builtin/light/color-scheme.js.map +1 -1
- package/cjs/theme/color-scheme/builtin/interface.d.ts +0 -2
- package/cjs/theme/color-scheme/builtin/interface.js.map +1 -1
- package/cjs/theme/color-scheme/legacy.d.ts +5 -0
- package/cjs/theme/color-scheme/legacy.js +21 -0
- package/cjs/theme/color-scheme/legacy.js.map +1 -0
- package/cjs/theme/color-scheme/util.js +5 -6
- package/cjs/theme/color-scheme/util.js.map +1 -1
- package/cjs/util/type.js +1 -1
- package/cjs/util/type.js.map +1 -1
- package/esm/animation/config.js +1 -0
- package/esm/animation/config.js.map +1 -1
- package/esm/animation/utils.js +13 -13
- package/esm/animation/utils.js.map +1 -1
- package/esm/compile/compiler.js +1 -1
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/mark/compilable-mark.d.ts +1 -2
- package/esm/compile/mark/compilable-mark.js +3 -7
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/content-column-model.js +11 -5
- package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/shape-model.d.ts +1 -0
- package/esm/component/tooltip/handler/dom/model/shape-model.js +4 -4
- package/esm/component/tooltip/handler/dom/model/shape-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/util.js +2 -2
- package/esm/component/tooltip/handler/dom/util.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.js +1 -2
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.d.ts +1 -0
- package/esm/core/vchart.js +9 -6
- package/esm/core/vchart.js.map +1 -1
- package/esm/mark/arc.js +2 -2
- package/esm/mark/arc.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +3 -3
- package/esm/mark/base/base-mark.js +30 -69
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/series/cartesian/cartesian.js +4 -1
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +2 -1
- package/esm/series/sankey/sankey.js +23 -27
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/theme/builtin/dark/color-scheme.js +1 -3
- package/esm/theme/builtin/dark/color-scheme.js.map +1 -1
- package/esm/theme/builtin/light/color-scheme.js +1 -3
- package/esm/theme/builtin/light/color-scheme.js.map +1 -1
- package/esm/theme/color-scheme/builtin/interface.d.ts +0 -2
- package/esm/theme/color-scheme/builtin/interface.js.map +1 -1
- package/esm/theme/color-scheme/legacy.d.ts +5 -0
- package/esm/theme/color-scheme/legacy.js +18 -0
- package/esm/theme/color-scheme/legacy.js.map +1 -0
- package/esm/theme/color-scheme/util.js +7 -5
- package/esm/theme/color-scheme/util.js.map +1 -1
- package/esm/util/type.js +1 -1
- package/esm/util/type.js.map +1 -1
- package/package.json +16 -16
package/build/index.js
CHANGED
|
@@ -6421,7 +6421,7 @@
|
|
|
6421
6421
|
}
|
|
6422
6422
|
|
|
6423
6423
|
function couldBeValidNumber(v) {
|
|
6424
|
-
if (
|
|
6424
|
+
if (v === null || v === undefined || v === '') {
|
|
6425
6425
|
return false;
|
|
6426
6426
|
}
|
|
6427
6427
|
if (isNumber$2(v)) {
|
|
@@ -6904,9 +6904,7 @@
|
|
|
6904
6904
|
dataZoomSelectedColor: '#0040ff',
|
|
6905
6905
|
scrollBarSliderColor: '#000000',
|
|
6906
6906
|
tooltipBackgroundColor: '#ffffff',
|
|
6907
|
-
markLabelBackgroundColor: '#ffc528'
|
|
6908
|
-
titleFontColor: '#21252c',
|
|
6909
|
-
labelFontColor: '#89909d'
|
|
6907
|
+
markLabelBackgroundColor: '#ffc528'
|
|
6910
6908
|
}
|
|
6911
6909
|
}
|
|
6912
6910
|
};
|
|
@@ -10938,7 +10936,10 @@
|
|
|
10938
10936
|
direction: "horizontal",
|
|
10939
10937
|
wordBreak: "break-all",
|
|
10940
10938
|
ignoreBuf: !1,
|
|
10941
|
-
verticalMode: 0
|
|
10939
|
+
verticalMode: 0,
|
|
10940
|
+
whiteSpace: "no-wrap",
|
|
10941
|
+
heightLimit: 1 / 0,
|
|
10942
|
+
lineClamp: 1 / 0
|
|
10942
10943
|
};
|
|
10943
10944
|
const DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
10944
10945
|
opacity: 1,
|
|
@@ -16969,7 +16970,7 @@
|
|
|
16969
16970
|
}
|
|
16970
16971
|
}
|
|
16971
16972
|
|
|
16972
|
-
const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16973
|
+
const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16973
16974
|
let Text$1 = class Text extends Graphic {
|
|
16974
16975
|
get font() {
|
|
16975
16976
|
const textTheme = getTheme$1(this).text;
|
|
@@ -17027,6 +17028,103 @@
|
|
|
17027
17028
|
paddingArray = parsePadding(boundsPadding);
|
|
17028
17029
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
17029
17030
|
}
|
|
17031
|
+
updateWrapAABBBounds(text) {
|
|
17032
|
+
var _a, _b, _c;
|
|
17033
|
+
const textTheme = getTheme$1(this).text,
|
|
17034
|
+
{
|
|
17035
|
+
fontFamily = textTheme.fontFamily,
|
|
17036
|
+
textAlign = textTheme.textAlign,
|
|
17037
|
+
textBaseline = textTheme.textBaseline,
|
|
17038
|
+
fontSize = textTheme.fontSize,
|
|
17039
|
+
lineHeight = this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize,
|
|
17040
|
+
ellipsis = textTheme.ellipsis,
|
|
17041
|
+
maxLineWidth: maxLineWidth,
|
|
17042
|
+
stroke = textTheme.stroke,
|
|
17043
|
+
lineWidth = textTheme.lineWidth,
|
|
17044
|
+
wordBreak = textTheme.wordBreak,
|
|
17045
|
+
fontWeight = textTheme.fontWeight,
|
|
17046
|
+
ignoreBuf = textTheme.ignoreBuf,
|
|
17047
|
+
heightLimit = 0,
|
|
17048
|
+
lineClamp: lineClamp
|
|
17049
|
+
} = this.attribute,
|
|
17050
|
+
buf = ignoreBuf ? 0 : 2;
|
|
17051
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
17052
|
+
const bbox = this.cache.layoutData.bbox;
|
|
17053
|
+
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17054
|
+
}
|
|
17055
|
+
const textMeasure = application.graphicUtil.textMeasure,
|
|
17056
|
+
layoutObj = new CanvasTextLayout(fontFamily, {
|
|
17057
|
+
fontSize: fontSize,
|
|
17058
|
+
fontWeight: fontWeight,
|
|
17059
|
+
fontFamily: fontFamily
|
|
17060
|
+
}, textMeasure),
|
|
17061
|
+
lines = isArray$1(text) ? text.map(l => l.toString()) : [text.toString()],
|
|
17062
|
+
linesLayout = [],
|
|
17063
|
+
bboxWH = [0, 0];
|
|
17064
|
+
let lineCountLimit = 1 / 0;
|
|
17065
|
+
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
17066
|
+
if (maxLineWidth > 0) for (let i = 0; i < lines.length; i++) {
|
|
17067
|
+
const str = lines[i];
|
|
17068
|
+
let needCut = !0;
|
|
17069
|
+
if (i === lineCountLimit - 1) {
|
|
17070
|
+
const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17071
|
+
linesLayout.push({
|
|
17072
|
+
str: clip.str,
|
|
17073
|
+
width: clip.width
|
|
17074
|
+
});
|
|
17075
|
+
break;
|
|
17076
|
+
}
|
|
17077
|
+
const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
|
|
17078
|
+
if ("" !== str && "" === clip.str) {
|
|
17079
|
+
if (ellipsis) {
|
|
17080
|
+
const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17081
|
+
clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
|
|
17082
|
+
} else clip.str = "", clip.width = 0;
|
|
17083
|
+
needCut = !1;
|
|
17084
|
+
}
|
|
17085
|
+
if (linesLayout.push({
|
|
17086
|
+
str: clip.str,
|
|
17087
|
+
width: clip.width
|
|
17088
|
+
}), clip.str.length === str.length) ;else if (needCut) {
|
|
17089
|
+
const newStr = str.substring(clip.str.length);
|
|
17090
|
+
lines.splice(i + 1, 0, newStr);
|
|
17091
|
+
}
|
|
17092
|
+
}
|
|
17093
|
+
let maxWidth = 0;
|
|
17094
|
+
linesLayout.forEach(layout => {
|
|
17095
|
+
maxWidth = Math.max(maxWidth, layout.width);
|
|
17096
|
+
}), bboxWH[0] = maxWidth;
|
|
17097
|
+
} else {
|
|
17098
|
+
let width,
|
|
17099
|
+
text,
|
|
17100
|
+
lineWidth = 0;
|
|
17101
|
+
for (let i = 0, len = lines.length; i < len; i++) {
|
|
17102
|
+
if (i === lineCountLimit - 1) {
|
|
17103
|
+
const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17104
|
+
linesLayout.push({
|
|
17105
|
+
str: clip.str,
|
|
17106
|
+
width: clip.width
|
|
17107
|
+
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
17108
|
+
break;
|
|
17109
|
+
}
|
|
17110
|
+
text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak), lineWidth = Math.max(lineWidth, width), linesLayout.push({
|
|
17111
|
+
str: text,
|
|
17112
|
+
width: width
|
|
17113
|
+
});
|
|
17114
|
+
}
|
|
17115
|
+
bboxWH[0] = lineWidth;
|
|
17116
|
+
}
|
|
17117
|
+
bboxWH[1] = linesLayout.length * (lineHeight + buf);
|
|
17118
|
+
const bbox = {
|
|
17119
|
+
xOffset: 0,
|
|
17120
|
+
yOffset: 0,
|
|
17121
|
+
width: bboxWH[0],
|
|
17122
|
+
height: bboxWH[1]
|
|
17123
|
+
};
|
|
17124
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
17125
|
+
const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
17126
|
+
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17127
|
+
}
|
|
17030
17128
|
updateSingallineAABBBounds(text) {
|
|
17031
17129
|
const textTheme = getTheme$1(this).text,
|
|
17032
17130
|
{
|
|
@@ -17058,9 +17156,11 @@
|
|
|
17058
17156
|
stroke = textTheme.stroke,
|
|
17059
17157
|
lineWidth = textTheme.lineWidth,
|
|
17060
17158
|
wordBreak = textTheme.wordBreak,
|
|
17061
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
17062
|
-
|
|
17063
|
-
|
|
17159
|
+
ignoreBuf = textTheme.ignoreBuf,
|
|
17160
|
+
whiteSpace = textTheme.whiteSpace
|
|
17161
|
+
} = attribute;
|
|
17162
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
17163
|
+
const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
17064
17164
|
{
|
|
17065
17165
|
lineHeight = null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf
|
|
17066
17166
|
} = attribute;
|
|
@@ -17188,8 +17288,9 @@
|
|
|
17188
17288
|
maxLineWidth: maxLineWidth,
|
|
17189
17289
|
stroke = textTheme.stroke,
|
|
17190
17290
|
lineWidth = textTheme.lineWidth,
|
|
17191
|
-
|
|
17291
|
+
whiteSpace = textTheme.whiteSpace
|
|
17192
17292
|
} = attribute;
|
|
17293
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
17193
17294
|
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
17194
17295
|
const bbox = this.cache.layoutData.bbox;
|
|
17195
17296
|
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
@@ -25139,13 +25240,16 @@
|
|
|
25139
25240
|
background: this._background
|
|
25140
25241
|
});
|
|
25141
25242
|
}
|
|
25243
|
+
preventRender(prevent) {
|
|
25244
|
+
prevent ? this._skipRender = -1 / 0 : this.params && this.params.optimize && !1 !== this.params.optimize.skipRenderWithOutRange ? this._skipRender = this.window.isVisible() ? 0 : 1 : this._skipRender = 0;
|
|
25245
|
+
}
|
|
25142
25246
|
optmize(params) {
|
|
25143
25247
|
this.optmizeRender(null == params ? void 0 : params.skipRenderWithOutRange);
|
|
25144
25248
|
}
|
|
25145
25249
|
optmizeRender() {
|
|
25146
25250
|
let skipRenderWithOutRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
25147
|
-
skipRenderWithOutRange && (this._skipRender = this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(visible => {
|
|
25148
|
-
visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()), this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1;
|
|
25251
|
+
skipRenderWithOutRange && (this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(visible => {
|
|
25252
|
+
this._skipRender < 0 || (visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()), this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1);
|
|
25149
25253
|
}));
|
|
25150
25254
|
}
|
|
25151
25255
|
getTimeline() {
|
|
@@ -37005,7 +37109,7 @@
|
|
|
37005
37109
|
function moveToHead(array, idx, start, cmp) {
|
|
37006
37110
|
let parent, pidx;
|
|
37007
37111
|
const item = array[idx];
|
|
37008
|
-
for (; idx > start && (pidx = Math.floor((idx - 1) / 2), parent = array[pidx], cmp(item, parent) < 0);) array[idx] = parent, idx = pidx;
|
|
37112
|
+
for (; idx > start && (pidx = Math.floor((idx - 1) / 2), parent = array[pidx], item && parent && cmp(item, parent) < 0);) array[idx] = parent, idx = pidx;
|
|
37009
37113
|
return array[idx] = item;
|
|
37010
37114
|
}
|
|
37011
37115
|
function moveToTail(array, idx, end, cmp) {
|
|
@@ -37172,6 +37276,7 @@
|
|
|
37172
37276
|
}
|
|
37173
37277
|
evaluate() {
|
|
37174
37278
|
return __awaiter$5(this, void 0, void 0, function* () {
|
|
37279
|
+
if (this._isReleased) return;
|
|
37175
37280
|
if (this._beforeRunner && (yield this.asyncCallback(this._beforeRunner)), !this._committed.length) return this.logger.info("Dataflow invoked, but nothing to do."), !1;
|
|
37176
37281
|
this._isRunning = !0, this._updateCounter += 1;
|
|
37177
37282
|
let grammar,
|
|
@@ -37181,14 +37286,14 @@
|
|
|
37181
37286
|
count = 0;
|
|
37182
37287
|
this.logger.canLogInfo() && (dt = Date.now(), this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)), this._beforeEvaluate();
|
|
37183
37288
|
try {
|
|
37184
|
-
for (; this._heap.size() > 0;) if (grammar = this._heap.pop(), grammar.rank === grammar.qrank) {
|
|
37289
|
+
for (; this._heap.size() > 0 && !this._isReleased;) if (grammar = this._heap.pop(), grammar.rank === grammar.qrank) {
|
|
37185
37290
|
if (next = grammar.run(), next && next.then && (next = yield next), !this._isRunning) return !1;
|
|
37186
37291
|
this._logGrammarRunInfo(grammar), this._enqueueTargets(grammar), count += 1;
|
|
37187
37292
|
} else this._enqueue(grammar);
|
|
37188
37293
|
} catch (err) {
|
|
37189
37294
|
this._heap.clear(), error = err;
|
|
37190
37295
|
}
|
|
37191
|
-
return this._isRunning = !1, this.logger.canLogInfo() && (dt = Date.now() - dt, this.logger.info(`> ${count} grammars; ${dt} ms`)), error ? this.logger.error(error) : this._afterRunner && (yield this.asyncCallback(this._afterRunner)), this._finishFirstRender = !0, !0;
|
|
37296
|
+
return !this._isReleased && (this._isRunning = !1, this.logger.canLogInfo() && (dt = Date.now() - dt, this.logger.info(`> ${count} grammars; ${dt} ms`)), error ? this.logger.error(error) : this._afterRunner && (yield this.asyncCallback(this._afterRunner)), this._finishFirstRender = !0, !0);
|
|
37192
37297
|
});
|
|
37193
37298
|
}
|
|
37194
37299
|
evaluateSync() {
|
|
@@ -37210,7 +37315,7 @@
|
|
|
37210
37315
|
this._afterRunner = callback;
|
|
37211
37316
|
}
|
|
37212
37317
|
release() {
|
|
37213
|
-
this.stop(), this._heap && (this._heap.clear(), this._heap = null), this.logger = null, this._committed = null;
|
|
37318
|
+
this.stop(), this._isReleased = !0, this._heap && (this._heap.clear(), this._heap = null), this.logger = null, this._committed = null;
|
|
37214
37319
|
}
|
|
37215
37320
|
}
|
|
37216
37321
|
|
|
@@ -40619,6 +40724,11 @@
|
|
|
40619
40724
|
_context.globalAlpha = strokeOpacity * opacity, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
40620
40725
|
}
|
|
40621
40726
|
}
|
|
40727
|
+
measureText(text) {
|
|
40728
|
+
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
40729
|
+
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
40730
|
+
return super.measureText(text, method);
|
|
40731
|
+
}
|
|
40622
40732
|
createPattern(image, repetition) {
|
|
40623
40733
|
return null;
|
|
40624
40734
|
}
|
|
@@ -41500,10 +41610,14 @@
|
|
|
41500
41610
|
toCanvas() {
|
|
41501
41611
|
return this._stage ? this._stage.toCanvas() : null;
|
|
41502
41612
|
}
|
|
41613
|
+
preventRender(tag) {
|
|
41614
|
+
this._stage && this._stage.preventRender(tag);
|
|
41615
|
+
}
|
|
41503
41616
|
release() {
|
|
41617
|
+
var _a;
|
|
41504
41618
|
this._view.traverseMarkTree(mark => {
|
|
41505
41619
|
mark.release();
|
|
41506
|
-
}), this._dragController && this._dragController.release(), this._gestureController && this._gestureController.release(), this._stage && this._stage.release(), this._stage = null, this._layer = null, this._dragController = null, this._gestureController = null;
|
|
41620
|
+
}), this._dragController && this._dragController.release(), this._gestureController && this._gestureController.release(), this._stage !== (null === (_a = this._viewOptions) || void 0 === _a ? void 0 : _a.stage) && this._stage.release(), this._stage = null, this._layer = null, this._dragController = null, this._gestureController = null;
|
|
41507
41621
|
}
|
|
41508
41622
|
createStage() {
|
|
41509
41623
|
var _a, _b, _c, _d, _e;
|
|
@@ -43442,8 +43556,8 @@
|
|
|
43442
43556
|
return null === (_c = null === (_b = null === (_a = this.elements) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b.getGraphicItem) || void 0 === _c ? void 0 : _c.call(_b);
|
|
43443
43557
|
}
|
|
43444
43558
|
getBounds() {
|
|
43445
|
-
var _a, _b, _c
|
|
43446
|
-
return this.graphicItem ? this.graphicItem.AABBBounds : null === (
|
|
43559
|
+
var _a, _b, _c;
|
|
43560
|
+
return this.graphicItem ? this.graphicItem.AABBBounds : null === (_c = null === (_b = null === (_a = this.elements) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b.getGraphicItem()) || void 0 === _c ? void 0 : _c.AABBBounds;
|
|
43447
43561
|
}
|
|
43448
43562
|
getMorphConfig() {
|
|
43449
43563
|
var _a;
|
|
@@ -45423,6 +45537,11 @@
|
|
|
45423
45537
|
"signal" === grammar.grammarType && BuiltInSignalID.includes(grammar.id()) || "mark" === grammar.grammarType && "root" === grammar.id() || this.removeGrammar(grammar);
|
|
45424
45538
|
}), this;
|
|
45425
45539
|
}
|
|
45540
|
+
removeAllGraphicItems() {
|
|
45541
|
+
return this.traverseMarkTree(mark => {
|
|
45542
|
+
mark.graphicItem && removeGraphicItem(mark.graphicItem), mark.graphicItem = null;
|
|
45543
|
+
}), this;
|
|
45544
|
+
}
|
|
45426
45545
|
parseSpec(spec) {
|
|
45427
45546
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45428
45547
|
if (this.emit(HOOK_EVENT.BEFORE_PARSE_VIEW), this._spec = spec, normalizeMarkTree(spec), spec.theme ? this.theme(spec.theme) : this.theme(ThemeManager$1.getDefaultTheme()), spec.width && this.width(spec.width), spec.height && this.height(spec.height), this.padding(null !== (_b = null !== (_a = spec.padding) && void 0 !== _a ? _a : this._options.padding) && void 0 !== _b ? _b : this._theme.padding), !this.width() || !this.height()) {
|
|
@@ -45504,9 +45623,15 @@
|
|
|
45504
45623
|
setCurrentTheme(theme) {
|
|
45505
45624
|
let render = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
45506
45625
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
45507
|
-
|
|
45508
|
-
|
|
45509
|
-
|
|
45626
|
+
if (!this._isReleased) {
|
|
45627
|
+
if (this.theme(theme), this.grammars.getAllMarks().forEach(mark => {
|
|
45628
|
+
mark.commit();
|
|
45629
|
+
}), render) {
|
|
45630
|
+
if (yield this.evaluate(), this._isReleased) return;
|
|
45631
|
+
this.renderer.render(!0);
|
|
45632
|
+
} else yield this._dataflow.evaluate();
|
|
45633
|
+
return this;
|
|
45634
|
+
}
|
|
45510
45635
|
});
|
|
45511
45636
|
}
|
|
45512
45637
|
background(value) {
|
|
@@ -45596,7 +45721,8 @@
|
|
|
45596
45721
|
}
|
|
45597
45722
|
runAsync(runningConfig) {
|
|
45598
45723
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
45599
|
-
|
|
45724
|
+
if (this._isReleased) return;
|
|
45725
|
+
for (; this._running && (yield this._running, !this._isReleased););
|
|
45600
45726
|
const clear = () => {
|
|
45601
45727
|
this._running = null;
|
|
45602
45728
|
};
|
|
@@ -45616,25 +45742,31 @@
|
|
|
45616
45742
|
this.emit(HOOK_EVENT.BEFORE_DO_RENDER), this.renderer && (this._progressiveMarks || this.animate.animate(), this.renderer.render(immediately), this.handleRenderEnd()), this.emit(HOOK_EVENT.AFTER_DO_RENDER);
|
|
45617
45743
|
}
|
|
45618
45744
|
evaluate(runningConfig) {
|
|
45619
|
-
var _a, _b;
|
|
45745
|
+
var _a, _b, _c, _d;
|
|
45620
45746
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
45621
|
-
|
|
45622
|
-
|
|
45623
|
-
|
|
45624
|
-
grammarWillDetach && this.detachCachedGrammar();
|
|
45747
|
+
if (this._isReleased) return;
|
|
45748
|
+
const normalizedRunningConfig = normalizeRunningConfig(runningConfig),
|
|
45749
|
+
grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
45750
|
+
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
45625
45751
|
const hasResize = this._resizeRenderer(),
|
|
45626
45752
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45627
|
-
|
|
45628
|
-
|
|
45629
|
-
|
|
45753
|
+
if (!(grammarWillDetach || hasUpdate || this._layoutState || hasResize)) return this;
|
|
45754
|
+
if (this.clearProgressive(), null === (_a = this.renderer) || void 0 === _a || _a.preventRender(!0), yield this._dataflow.evaluate(), !this._isReleased) {
|
|
45755
|
+
if (this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState) {
|
|
45756
|
+
if (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, yield this._dataflow.evaluate(), this._isReleased)) return;
|
|
45757
|
+
this._layoutState = LayoutState.after, (null === (_b = this._layoutMarks) || void 0 === _b ? void 0 : _b.length) && this.handleLayoutEnd();
|
|
45758
|
+
}
|
|
45759
|
+
return null === (_c = this.renderer) || void 0 === _c || _c.preventRender(!1), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!1), null === (_d = this._willMorphMarks) || void 0 === _d || _d.forEach(morphMarks => {
|
|
45760
|
+
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
45761
|
+
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doPreProgressive(), this;
|
|
45762
|
+
}
|
|
45630
45763
|
});
|
|
45631
45764
|
}
|
|
45632
45765
|
evaluateSync(runningConfig) {
|
|
45633
45766
|
var _a, _b;
|
|
45634
|
-
const normalizedRunningConfig = normalizeRunningConfig(runningConfig)
|
|
45635
|
-
|
|
45636
|
-
|
|
45637
|
-
grammarWillDetach && this.detachCachedGrammar();
|
|
45767
|
+
const normalizedRunningConfig = normalizeRunningConfig(runningConfig),
|
|
45768
|
+
grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
45769
|
+
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
45638
45770
|
const hasResize = this._resizeRenderer(),
|
|
45639
45771
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45640
45772
|
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), this._dataflow.evaluateSync(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, this._dataflow.evaluateSync()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!0), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
|
|
@@ -45910,7 +46042,7 @@
|
|
|
45910
46042
|
}
|
|
45911
46043
|
release() {
|
|
45912
46044
|
var _a, _b, _c;
|
|
45913
|
-
this._unBindResizeEvent(), this.clearProgressive(), Factory$1.unregisterRuntimeTransforms(), this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow = null, null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a), this.renderer = null, this._boundInteractions = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach(listener => {
|
|
46045
|
+
this._isReleased = !0, this._unBindResizeEvent(), this.clearProgressive(), Factory$1.unregisterRuntimeTransforms(), this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow.release(), this._dataflow = null, null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a), this.renderer = null, this._boundInteractions = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach(listener => {
|
|
45914
46046
|
listener.source.removeEventListener(listener.type, listener.handler);
|
|
45915
46047
|
}), this._eventListeners = null;
|
|
45916
46048
|
}
|
|
@@ -49815,6 +49947,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
49815
49947
|
return (_b = spec.direction) !== null && _b !== void 0 ? _b : 'vertical';
|
|
49816
49948
|
}
|
|
49817
49949
|
|
|
49950
|
+
const newTokenToLegacyToken = {
|
|
49951
|
+
primaryFontColor: 'titleFontColor',
|
|
49952
|
+
secondaryFontColor: 'labelFontColor'
|
|
49953
|
+
};
|
|
49954
|
+
const legacyTokenToNewToken = {
|
|
49955
|
+
titleFontColor: 'primaryFontColor',
|
|
49956
|
+
labelFontColor: 'secondaryFontColor'
|
|
49957
|
+
};
|
|
49958
|
+
function getUpgradedTokenValue(palette, key) {
|
|
49959
|
+
const legacyKey = newTokenToLegacyToken[key];
|
|
49960
|
+
if (legacyKey && palette[legacyKey]) {
|
|
49961
|
+
return palette[legacyKey];
|
|
49962
|
+
}
|
|
49963
|
+
if (palette[key]) {
|
|
49964
|
+
return palette[key];
|
|
49965
|
+
}
|
|
49966
|
+
const newKey = legacyTokenToNewToken[key];
|
|
49967
|
+
if (newKey) {
|
|
49968
|
+
return palette[newKey];
|
|
49969
|
+
}
|
|
49970
|
+
return undefined;
|
|
49971
|
+
}
|
|
49972
|
+
|
|
49818
49973
|
function getDataScheme(colorScheme, seriesSpec) {
|
|
49819
49974
|
var _a;
|
|
49820
49975
|
if (!colorScheme) {
|
|
@@ -49877,12 +50032,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
49877
50032
|
let color;
|
|
49878
50033
|
const { palette } = scheme;
|
|
49879
50034
|
if (isObject$2(palette)) {
|
|
49880
|
-
color = (_a = palette
|
|
50035
|
+
color = (_a = getUpgradedTokenValue(palette, colorKey.key)) !== null && _a !== void 0 ? _a : colorKey.default;
|
|
49881
50036
|
}
|
|
49882
50037
|
if (!color) {
|
|
49883
50038
|
return undefined;
|
|
49884
50039
|
}
|
|
49885
|
-
if ((
|
|
50040
|
+
if ((isNil$1(colorKey.a) && isNil$1(colorKey.l)) || !isString$1(color)) {
|
|
49886
50041
|
return color;
|
|
49887
50042
|
}
|
|
49888
50043
|
let c = new Color(color);
|
|
@@ -49933,7 +50088,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
49933
50088
|
var _a, _b;
|
|
49934
50089
|
const { type: seriesType } = seriesSpec !== null && seriesSpec !== void 0 ? seriesSpec : {};
|
|
49935
50090
|
let scheme;
|
|
49936
|
-
if (!seriesSpec ||
|
|
50091
|
+
if (!seriesSpec || isNil$1(seriesType)) {
|
|
49937
50092
|
scheme = colorScheme === null || colorScheme === void 0 ? void 0 : colorScheme.default;
|
|
49938
50093
|
}
|
|
49939
50094
|
else {
|
|
@@ -50009,9 +50164,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50009
50164
|
dataZoomSelectedColor: '#4284FF',
|
|
50010
50165
|
scrollBarSliderColor: '#ffffff',
|
|
50011
50166
|
tooltipBackgroundColor: '#404349',
|
|
50012
|
-
markLabelBackgroundColor: '#f0bd30'
|
|
50013
|
-
titleFontColor: '#fdfdfd',
|
|
50014
|
-
labelFontColor: '#bbbdc3'
|
|
50167
|
+
markLabelBackgroundColor: '#f0bd30'
|
|
50015
50168
|
}
|
|
50016
50169
|
}
|
|
50017
50170
|
};
|
|
@@ -52192,6 +52345,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
52192
52345
|
renderAsync(morphConfig) {
|
|
52193
52346
|
var _a;
|
|
52194
52347
|
return __awaiter$h(this, void 0, void 0, function* () {
|
|
52348
|
+
if (this.isReleased) {
|
|
52349
|
+
return;
|
|
52350
|
+
}
|
|
52195
52351
|
this.initView();
|
|
52196
52352
|
if (!this._view) {
|
|
52197
52353
|
return Promise.reject('srView init fail');
|
|
@@ -56015,28 +56171,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56015
56171
|
compileSignal() {
|
|
56016
56172
|
this.state.compile();
|
|
56017
56173
|
}
|
|
56018
|
-
_computeAttribute(key, state) {
|
|
56019
|
-
return (datum, opt) => {
|
|
56020
|
-
return undefined;
|
|
56021
|
-
};
|
|
56022
|
-
}
|
|
56023
56174
|
compileCommonAttributeCallback(key, state) {
|
|
56024
56175
|
const noAttrTransform = !needAttrTransform(this.type, key);
|
|
56025
56176
|
const opt = { mark: null, parent: null, element: null };
|
|
56026
|
-
|
|
56027
|
-
|
|
56028
|
-
|
|
56029
|
-
|
|
56030
|
-
|
|
56031
|
-
|
|
56032
|
-
|
|
56033
|
-
|
|
56034
|
-
|
|
56035
|
-
opt.mark = element.mark;
|
|
56036
|
-
opt.parent = element.mark.group;
|
|
56037
|
-
opt.element = element;
|
|
56038
|
-
return attrTransform(this.type, key, attrFunctor(datum, opt));
|
|
56039
|
-
};
|
|
56177
|
+
return (datum, element) => {
|
|
56178
|
+
opt.mark = element.mark;
|
|
56179
|
+
opt.parent = element.mark.group;
|
|
56180
|
+
opt.element = element;
|
|
56181
|
+
if (noAttrTransform) {
|
|
56182
|
+
return this.getAttribute(key, datum, state, opt);
|
|
56183
|
+
}
|
|
56184
|
+
return attrTransform(this.type, key, this.getAttribute(key, datum, state, opt));
|
|
56185
|
+
};
|
|
56040
56186
|
}
|
|
56041
56187
|
compileTransform() {
|
|
56042
56188
|
var _a;
|
|
@@ -56200,7 +56346,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56200
56346
|
}
|
|
56201
56347
|
}
|
|
56202
56348
|
getAttribute(key, datum, state = 'normal', opt) {
|
|
56203
|
-
return this._computeAttribute(key,
|
|
56349
|
+
return this._computeAttribute(key, datum, state, opt);
|
|
56204
56350
|
}
|
|
56205
56351
|
setAttribute(attr, style, state = 'normal', level = 0, stateStyle = this.stateStyle) {
|
|
56206
56352
|
var _a;
|
|
@@ -56254,60 +56400,42 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56254
56400
|
}
|
|
56255
56401
|
return style;
|
|
56256
56402
|
}
|
|
56257
|
-
_computeAttribute(key, state) {
|
|
56403
|
+
_computeAttribute(key, datum, state, opt) {
|
|
56258
56404
|
var _a;
|
|
56259
56405
|
let stateStyle = (_a = this.stateStyle[state]) === null || _a === void 0 ? void 0 : _a[key];
|
|
56260
56406
|
if (!stateStyle) {
|
|
56261
56407
|
stateStyle = this.stateStyle.normal[key];
|
|
56262
56408
|
}
|
|
56263
|
-
|
|
56264
|
-
|
|
56265
|
-
|
|
56266
|
-
if (hasPostProcess && hasExCompute) {
|
|
56267
|
-
const exCompute = this._computeExChannel[key];
|
|
56268
|
-
return (datum, opt) => {
|
|
56269
|
-
let baseValue = baseValueFunctor(datum, opt);
|
|
56270
|
-
baseValue = stateStyle.postProcess(baseValue, datum, this._attributeContext, opt, this.getDataView());
|
|
56271
|
-
return exCompute(key, datum, state, opt, baseValue);
|
|
56272
|
-
};
|
|
56273
|
-
}
|
|
56274
|
-
else if (hasPostProcess) {
|
|
56275
|
-
return (datum, opt) => {
|
|
56276
|
-
return stateStyle.postProcess(baseValueFunctor(datum, opt), datum, this._attributeContext, opt, this.getDataView());
|
|
56277
|
-
};
|
|
56409
|
+
let baseValue = this._computeStateAttribute(stateStyle, key, datum, state, opt);
|
|
56410
|
+
if (isFunction$1(stateStyle === null || stateStyle === void 0 ? void 0 : stateStyle.postProcess)) {
|
|
56411
|
+
baseValue = stateStyle.postProcess(baseValue, datum, this._attributeContext, opt, this.getDataView());
|
|
56278
56412
|
}
|
|
56279
|
-
|
|
56280
|
-
|
|
56281
|
-
return (datum, opt) => {
|
|
56282
|
-
return exCompute(key, datum, state, opt, baseValueFunctor(datum, opt));
|
|
56283
|
-
};
|
|
56413
|
+
if (key in this._computeExChannel) {
|
|
56414
|
+
return this._computeExChannel[key](key, datum, state, opt, baseValue);
|
|
56284
56415
|
}
|
|
56285
|
-
return
|
|
56416
|
+
return baseValue;
|
|
56286
56417
|
}
|
|
56287
|
-
_computeStateAttribute(stateStyle, key, state) {
|
|
56418
|
+
_computeStateAttribute(stateStyle, key, datum, state, opt) {
|
|
56288
56419
|
var _a;
|
|
56289
56420
|
if (!stateStyle) {
|
|
56290
|
-
return
|
|
56421
|
+
return undefined;
|
|
56291
56422
|
}
|
|
56292
56423
|
if (stateStyle.referer) {
|
|
56293
|
-
return stateStyle.referer.
|
|
56424
|
+
return stateStyle.referer.getAttribute(key, datum, state, opt);
|
|
56425
|
+
}
|
|
56426
|
+
if (typeof stateStyle.style === 'function') {
|
|
56427
|
+
return stateStyle.style(datum, this._attributeContext, opt, this.getDataView());
|
|
56294
56428
|
}
|
|
56295
56429
|
if (GradientType.includes(stateStyle.style.gradient)) {
|
|
56296
|
-
return this._computeGradientAttr(stateStyle.style);
|
|
56430
|
+
return this._computeGradientAttr(stateStyle.style, datum, opt);
|
|
56297
56431
|
}
|
|
56298
56432
|
if (['outerBorder', 'innerBorder'].includes(key)) {
|
|
56299
|
-
return this._computeBorderAttr(stateStyle.style);
|
|
56433
|
+
return this._computeBorderAttr(stateStyle.style, datum, opt);
|
|
56300
56434
|
}
|
|
56301
56435
|
if (isValidScaleType((_a = stateStyle.style.scale) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
56302
|
-
return
|
|
56436
|
+
return stateStyle.style.scale.scale(datum[stateStyle.style.field]);
|
|
56303
56437
|
}
|
|
56304
|
-
return
|
|
56305
|
-
var _a;
|
|
56306
|
-
if (typeof stateStyle.style === 'function') {
|
|
56307
|
-
return (_a = stateStyle.style) === null || _a === void 0 ? void 0 : _a.call(stateStyle, datum, this._attributeContext, opt, this.getDataView());
|
|
56308
|
-
}
|
|
56309
|
-
return stateStyle.style;
|
|
56310
|
-
};
|
|
56438
|
+
return stateStyle.style;
|
|
56311
56439
|
}
|
|
56312
56440
|
_initStyle() {
|
|
56313
56441
|
const defaultStyle = this._getDefaultStyle();
|
|
@@ -56344,7 +56472,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56344
56472
|
});
|
|
56345
56473
|
}
|
|
56346
56474
|
}
|
|
56347
|
-
_computeGradientAttr(gradientStyle) {
|
|
56475
|
+
_computeGradientAttr(gradientStyle, data, opt) {
|
|
56348
56476
|
var _a, _b;
|
|
56349
56477
|
const { gradient, scale, field } = gradientStyle, rest = __rest$8(gradientStyle, ["gradient", "scale", "field"]);
|
|
56350
56478
|
const markData = this.getDataView();
|
|
@@ -56360,42 +56488,49 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56360
56488
|
}
|
|
56361
56489
|
}
|
|
56362
56490
|
const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? (_b = (_a = this.model).getSpec) === null || _b === void 0 ? void 0 : _b.call(_a) : undefined), this.model.getDefaultColorDomain());
|
|
56491
|
+
const computeStyle = {};
|
|
56363
56492
|
const mergedStyle = Object.assign(Object.assign({}, DEFAULT_GRADIENT_CONFIG[gradient]), rest);
|
|
56364
|
-
|
|
56365
|
-
const
|
|
56366
|
-
|
|
56367
|
-
|
|
56368
|
-
|
|
56369
|
-
|
|
56370
|
-
|
|
56371
|
-
|
|
56372
|
-
|
|
56373
|
-
|
|
56374
|
-
|
|
56375
|
-
|
|
56376
|
-
|
|
56377
|
-
|
|
56378
|
-
|
|
56379
|
-
|
|
56380
|
-
|
|
56381
|
-
|
|
56382
|
-
|
|
56383
|
-
|
|
56384
|
-
|
|
56385
|
-
|
|
56386
|
-
|
|
56387
|
-
|
|
56388
|
-
|
|
56389
|
-
|
|
56390
|
-
|
|
56391
|
-
computeStyle.gradient = gradient;
|
|
56392
|
-
return computeStyle;
|
|
56393
|
-
};
|
|
56493
|
+
Object.keys(mergedStyle).forEach(key => {
|
|
56494
|
+
const value = mergedStyle[key];
|
|
56495
|
+
if (key === 'stops') {
|
|
56496
|
+
computeStyle.stops = value.map((stop) => {
|
|
56497
|
+
const { opacity, color, offset } = stop;
|
|
56498
|
+
let computeColor = color !== null && color !== void 0 ? color : colorScale === null || colorScale === void 0 ? void 0 : colorScale.scale(data[colorField]);
|
|
56499
|
+
if (isFunction$1(color)) {
|
|
56500
|
+
computeColor = color(data, this._attributeContext, opt, markData);
|
|
56501
|
+
}
|
|
56502
|
+
if (isValid$1(opacity)) {
|
|
56503
|
+
computeColor = Color.SetOpacity(computeColor, opacity);
|
|
56504
|
+
}
|
|
56505
|
+
return {
|
|
56506
|
+
offset: isFunction$1(offset) ? offset(data, this._attributeContext, opt, markData) : offset,
|
|
56507
|
+
color: computeColor || themeColor[0]
|
|
56508
|
+
};
|
|
56509
|
+
});
|
|
56510
|
+
}
|
|
56511
|
+
else if (isFunction$1(value)) {
|
|
56512
|
+
computeStyle[key] = value(data, this._attributeContext, opt, markData);
|
|
56513
|
+
}
|
|
56514
|
+
else {
|
|
56515
|
+
computeStyle[key] = value;
|
|
56516
|
+
}
|
|
56517
|
+
});
|
|
56518
|
+
computeStyle.gradient = gradient;
|
|
56519
|
+
return computeStyle;
|
|
56394
56520
|
}
|
|
56395
|
-
_computeBorderAttr(borderStyle) {
|
|
56521
|
+
_computeBorderAttr(borderStyle, data, opt) {
|
|
56396
56522
|
var _a, _b, _c;
|
|
56397
56523
|
const { scale, field } = borderStyle, mergedStyle = __rest$8(borderStyle, ["scale", "field"]);
|
|
56398
56524
|
const computeStyle = {};
|
|
56525
|
+
Object.keys(mergedStyle).forEach(key => {
|
|
56526
|
+
const value = mergedStyle[key];
|
|
56527
|
+
if (isFunction$1(value)) {
|
|
56528
|
+
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56529
|
+
}
|
|
56530
|
+
else {
|
|
56531
|
+
computeStyle[key] = value;
|
|
56532
|
+
}
|
|
56533
|
+
});
|
|
56399
56534
|
if (!('stroke' in computeStyle)) {
|
|
56400
56535
|
const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? (_b = (_a = this.model).getSpec) === null || _b === void 0 ? void 0 : _b.call(_a) : undefined), this.model.getDefaultColorDomain());
|
|
56401
56536
|
let colorScale = scale;
|
|
@@ -56408,52 +56543,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56408
56543
|
if (!colorField) {
|
|
56409
56544
|
colorField = globalField;
|
|
56410
56545
|
}
|
|
56411
|
-
|
|
56412
|
-
const computeStyle = {};
|
|
56413
|
-
Object.keys(mergedStyle).forEach(key => {
|
|
56414
|
-
const value = mergedStyle[key];
|
|
56415
|
-
if (isFunction$1(value)) {
|
|
56416
|
-
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56417
|
-
}
|
|
56418
|
-
else {
|
|
56419
|
-
computeStyle[key] = value;
|
|
56420
|
-
}
|
|
56421
|
-
});
|
|
56422
|
-
computeStyle.stroke = (colorScale === null || colorScale === void 0 ? void 0 : colorScale.scale(data[colorField])) || themeColor[0];
|
|
56423
|
-
return computeStyle;
|
|
56424
|
-
};
|
|
56546
|
+
computeStyle.stroke = (colorScale === null || colorScale === void 0 ? void 0 : colorScale.scale(data[colorField])) || themeColor[0];
|
|
56425
56547
|
}
|
|
56426
56548
|
}
|
|
56427
56549
|
else if (GradientType.includes((_c = mergedStyle.stroke) === null || _c === void 0 ? void 0 : _c.gradient)) {
|
|
56428
|
-
|
|
56429
|
-
return (data, opt) => {
|
|
56430
|
-
const computeStyle = {};
|
|
56431
|
-
Object.keys(mergedStyle).forEach(key => {
|
|
56432
|
-
const value = mergedStyle[key];
|
|
56433
|
-
if (isFunction$1(value)) {
|
|
56434
|
-
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56435
|
-
}
|
|
56436
|
-
else {
|
|
56437
|
-
computeStyle[key] = value;
|
|
56438
|
-
}
|
|
56439
|
-
});
|
|
56440
|
-
computeStyle.stroke = gradientFunctor(data, opt);
|
|
56441
|
-
return computeStyle;
|
|
56442
|
-
};
|
|
56550
|
+
computeStyle.stroke = this._computeGradientAttr(mergedStyle.stroke, data, opt);
|
|
56443
56551
|
}
|
|
56444
|
-
return
|
|
56445
|
-
const computeStyle = {};
|
|
56446
|
-
Object.keys(mergedStyle).forEach(key => {
|
|
56447
|
-
const value = mergedStyle[key];
|
|
56448
|
-
if (isFunction$1(value)) {
|
|
56449
|
-
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56450
|
-
}
|
|
56451
|
-
else {
|
|
56452
|
-
computeStyle[key] = value;
|
|
56453
|
-
}
|
|
56454
|
-
});
|
|
56455
|
-
return computeStyle;
|
|
56456
|
-
};
|
|
56552
|
+
return computeStyle;
|
|
56457
56553
|
}
|
|
56458
56554
|
}
|
|
56459
56555
|
|
|
@@ -56622,6 +56718,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56622
56718
|
exit: { type: 'fadeOut' },
|
|
56623
56719
|
update: [
|
|
56624
56720
|
{
|
|
56721
|
+
type: 'update',
|
|
56625
56722
|
options: { excludeChannels: 'points' }
|
|
56626
56723
|
},
|
|
56627
56724
|
{
|
|
@@ -56971,6 +57068,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56971
57068
|
}
|
|
56972
57069
|
updateCustomConfigAndRerender(modifyConfig, morphConfig) {
|
|
56973
57070
|
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57071
|
+
if (this._isReleased) {
|
|
57072
|
+
return this;
|
|
57073
|
+
}
|
|
56974
57074
|
const result = modifyConfig();
|
|
56975
57075
|
if (!isValid$1(result)) {
|
|
56976
57076
|
return this;
|
|
@@ -57044,6 +57144,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57044
57144
|
renderAsync(morphConfig) {
|
|
57045
57145
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
57046
57146
|
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57147
|
+
if (this._isReleased) {
|
|
57148
|
+
return this;
|
|
57149
|
+
}
|
|
57047
57150
|
if (!this._chart) {
|
|
57048
57151
|
(_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeInitializeChart) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
57049
57152
|
this._initChart(this._spec);
|
|
@@ -57056,6 +57159,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57056
57159
|
(_h = (_g = this._option.performanceHook) === null || _g === void 0 ? void 0 : _g.afterCompileToVGrammar) === null || _h === void 0 ? void 0 : _h.call(_g);
|
|
57057
57160
|
}
|
|
57058
57161
|
yield ((_j = this._compiler) === null || _j === void 0 ? void 0 : _j.renderAsync(morphConfig));
|
|
57162
|
+
if (this._isReleased) {
|
|
57163
|
+
return this;
|
|
57164
|
+
}
|
|
57059
57165
|
if (this._option.animation) {
|
|
57060
57166
|
(_k = this._chart) === null || _k === void 0 ? void 0 : _k.getAllRegions().forEach(region => {
|
|
57061
57167
|
var _a;
|
|
@@ -57086,6 +57192,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57086
57192
|
this._userEvents = null;
|
|
57087
57193
|
this._event = null;
|
|
57088
57194
|
this._eventDispatcher = null;
|
|
57195
|
+
this._isReleased = true;
|
|
57089
57196
|
InstanceManager.unregisterInstance(this);
|
|
57090
57197
|
}
|
|
57091
57198
|
updateData(id, data, options) {
|
|
@@ -57352,6 +57459,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57352
57459
|
this._chart.onResize(width, height);
|
|
57353
57460
|
(_d = (_c = this._option.performanceHook) === null || _c === void 0 ? void 0 : _c.afterResizeWithUpdate) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
57354
57461
|
yield ((_f = (_e = this._compiler).resize) === null || _f === void 0 ? void 0 : _f.call(_e, width, height));
|
|
57462
|
+
if (this._isReleased) {
|
|
57463
|
+
return this;
|
|
57464
|
+
}
|
|
57355
57465
|
this._event.emit(ChartEvent.afterResize, { chart: this._chart });
|
|
57356
57466
|
return this;
|
|
57357
57467
|
});
|
|
@@ -57782,7 +57892,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57782
57892
|
};
|
|
57783
57893
|
registerVChartCore();
|
|
57784
57894
|
|
|
57785
|
-
const version = "1.6.
|
|
57895
|
+
const version = "1.6.3";
|
|
57786
57896
|
|
|
57787
57897
|
class ChartData {
|
|
57788
57898
|
get dataList() {
|
|
@@ -59918,7 +60028,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59918
60028
|
|
|
59919
60029
|
const AnimationStates = ['appear', 'enter', 'update', 'exit', 'disappear', 'normal'];
|
|
59920
60030
|
function animationConfig(defaultConfig = {}, userConfig, params) {
|
|
59921
|
-
var _a;
|
|
59922
60031
|
const config = {};
|
|
59923
60032
|
for (let i = 0; i < AnimationStates.length; i++) {
|
|
59924
60033
|
const state = AnimationStates[i];
|
|
@@ -59935,9 +60044,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59935
60044
|
}
|
|
59936
60045
|
else {
|
|
59937
60046
|
defaultStateConfig = [Object.assign(Object.assign({}, DEFAULT_ANIMATION_CONFIG[state]), defaultConfig[state])];
|
|
59938
|
-
|
|
59939
|
-
|
|
59940
|
-
|
|
60047
|
+
}
|
|
60048
|
+
if (state === 'exit') {
|
|
60049
|
+
defaultStateConfig.forEach(exitConfig => {
|
|
60050
|
+
exitConfig.controlOptions = { stopWhenStateChange: true };
|
|
60051
|
+
});
|
|
59941
60052
|
}
|
|
59942
60053
|
if (!(userConfig === null || userConfig === void 0 ? void 0 : userConfig[state])) {
|
|
59943
60054
|
config[state] = defaultStateConfig;
|
|
@@ -59948,14 +60059,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59948
60059
|
stateConfig = userConfig[state];
|
|
59949
60060
|
}
|
|
59950
60061
|
else {
|
|
59951
|
-
|
|
59952
|
-
|
|
59953
|
-
|
|
59954
|
-
|
|
59955
|
-
|
|
59956
|
-
|
|
59957
|
-
|
|
59958
|
-
|
|
60062
|
+
stateConfig = defaultStateConfig.map((stateConfig, i) => {
|
|
60063
|
+
var _a;
|
|
60064
|
+
let singleConfig = mergeSpec({}, defaultStateConfig[i], userConfig[state]);
|
|
60065
|
+
if (isChannelAnimation(singleConfig)) {
|
|
60066
|
+
delete singleConfig.type;
|
|
60067
|
+
}
|
|
60068
|
+
if (singleConfig.oneByOne) {
|
|
60069
|
+
singleConfig = produceOneByOne(singleConfig, (_a = params === null || params === void 0 ? void 0 : params.dataIndex) !== null && _a !== void 0 ? _a : defaultDataIndex);
|
|
60070
|
+
}
|
|
60071
|
+
return singleConfig;
|
|
60072
|
+
});
|
|
59959
60073
|
}
|
|
59960
60074
|
config[state] = stateConfig;
|
|
59961
60075
|
}
|
|
@@ -60023,7 +60137,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60023
60137
|
}
|
|
60024
60138
|
config = cloneDeep(config);
|
|
60025
60139
|
traverseSpec(config, (node) => {
|
|
60026
|
-
|
|
60140
|
+
var _a;
|
|
60141
|
+
if (isFunction$1(node) && ((_a = node.prototype) === null || _a === void 0 ? void 0 : _a.constructor) !== node) {
|
|
60027
60142
|
const name = (...args) => {
|
|
60028
60143
|
return node(...args, ctx);
|
|
60029
60144
|
};
|
|
@@ -60938,12 +61053,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60938
61053
|
this._direction = Direction.vertical;
|
|
60939
61054
|
this._sortDataByAxis = false;
|
|
60940
61055
|
this._getInvalidDefined = (datum) => {
|
|
60941
|
-
|
|
61056
|
+
var _a, _b;
|
|
61057
|
+
if ((_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.isContinuous) {
|
|
60942
61058
|
if (!couldBeValidNumber(datum[this._specXField[0]])) {
|
|
60943
61059
|
return false;
|
|
60944
61060
|
}
|
|
60945
61061
|
}
|
|
60946
|
-
if (this._yAxisHelper.isContinuous) {
|
|
61062
|
+
if ((_b = this._yAxisHelper) === null || _b === void 0 ? void 0 : _b.isContinuous) {
|
|
60947
61063
|
if (!couldBeValidNumber(datum[this._specYField[0]])) {
|
|
60948
61064
|
return false;
|
|
60949
61065
|
}
|
|
@@ -65197,13 +65313,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65197
65313
|
this._unCompileChannel = { centerOffset: true, radiusOffset: true };
|
|
65198
65314
|
this.computeOuterRadius = (key, datum, states = 'normal', opt, superValue) => {
|
|
65199
65315
|
var _a;
|
|
65200
|
-
const offset = (_a = this.
|
|
65316
|
+
const offset = (_a = this._computeAttribute('radiusOffset', datum, states, opt)) !== null && _a !== void 0 ? _a : 0;
|
|
65201
65317
|
return superValue + offset;
|
|
65202
65318
|
};
|
|
65203
65319
|
this.computeCenter = (key, datum, states = 'normal', opt, center) => {
|
|
65204
65320
|
const offset = polarToCartesian({
|
|
65205
65321
|
angle: datum[ARC_MIDDLE_ANGLE],
|
|
65206
|
-
radius: this.
|
|
65322
|
+
radius: this._computeAttribute('centerOffset', datum, states, opt)
|
|
65207
65323
|
});
|
|
65208
65324
|
return center + offset[key];
|
|
65209
65325
|
};
|
|
@@ -77787,8 +77903,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77787
77903
|
y: (datum) => datum.y0,
|
|
77788
77904
|
y1: (datum) => datum.y1,
|
|
77789
77905
|
fill: (datum) => {
|
|
77790
|
-
var _a, _b, _c;
|
|
77791
|
-
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.
|
|
77906
|
+
var _a, _b, _c, _d;
|
|
77907
|
+
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : (_d = this._colorScale) === null || _d === void 0 ? void 0 : _d.scale(this._getNodeNameFromData(datum));
|
|
77792
77908
|
}
|
|
77793
77909
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Mark);
|
|
77794
77910
|
this._trigger.registerMark(nodeMark);
|
|
@@ -77806,11 +77922,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77806
77922
|
y1: (datum) => datum.y1,
|
|
77807
77923
|
thickness: (datum) => datum.thickness,
|
|
77808
77924
|
fill: (datum) => {
|
|
77809
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
77925
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
77810
77926
|
const sourceName = ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.nodeKey) || ((_d = (_c = (_b = this._rawData.latestData[0]) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.children)
|
|
77811
77927
|
? datum.source
|
|
77812
77928
|
: this.getNodeList()[datum.source];
|
|
77813
|
-
return (_g = (_f = (_e = this._spec.link) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.fill) !== null && _g !== void 0 ? _g : this.
|
|
77929
|
+
return (_g = (_f = (_e = this._spec.link) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.fill) !== null && _g !== void 0 ? _g : (_h = this._colorScale) === null || _h === void 0 ? void 0 : _h.scale(sourceName);
|
|
77814
77930
|
},
|
|
77815
77931
|
direction: (_a = this._spec.direction) !== null && _a !== void 0 ? _a : 'horizontal'
|
|
77816
77932
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
|
|
@@ -77864,8 +77980,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77864
77980
|
return datum.y1;
|
|
77865
77981
|
},
|
|
77866
77982
|
fill: (datum) => {
|
|
77867
|
-
var _a, _b, _c;
|
|
77868
|
-
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.
|
|
77983
|
+
var _a, _b, _c, _d;
|
|
77984
|
+
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : (_d = this._colorScale) === null || _d === void 0 ? void 0 : _d.scale(this._getNodeNameFromData(datum));
|
|
77869
77985
|
},
|
|
77870
77986
|
text: (datum) => this._createText(datum),
|
|
77871
77987
|
limit: this._labelLimit,
|
|
@@ -77918,8 +78034,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77918
78034
|
x: (datum) => datum.x0,
|
|
77919
78035
|
y: (datum) => (datum.y0 + datum.y1) / 2,
|
|
77920
78036
|
fill: (datum) => {
|
|
77921
|
-
var _a, _b, _c;
|
|
77922
|
-
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.
|
|
78037
|
+
var _a, _b, _c, _d;
|
|
78038
|
+
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : (_d = this._colorScale) === null || _d === void 0 ? void 0 : _d.scale(this._getNodeNameFromData(datum));
|
|
77923
78039
|
},
|
|
77924
78040
|
text: (datum) => this._createText(datum),
|
|
77925
78041
|
limit: this._labelLimit,
|
|
@@ -77932,8 +78048,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77932
78048
|
x: (datum) => datum.x1,
|
|
77933
78049
|
y: (datum) => (datum.y0 + datum.y1) / 2,
|
|
77934
78050
|
fill: (datum) => {
|
|
77935
|
-
var _a, _b, _c;
|
|
77936
|
-
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.
|
|
78051
|
+
var _a, _b, _c, _d;
|
|
78052
|
+
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : (_d = this._colorScale) === null || _d === void 0 ? void 0 : _d.scale(this._getNodeNameFromData(datum));
|
|
77937
78053
|
},
|
|
77938
78054
|
text: (datum) => this._createText(datum),
|
|
77939
78055
|
limit: this._labelLimit,
|
|
@@ -77951,8 +78067,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77951
78067
|
},
|
|
77952
78068
|
y: (datum) => (datum.y0 + datum.y1) / 2,
|
|
77953
78069
|
fill: (datum) => {
|
|
77954
|
-
var _a, _b, _c;
|
|
77955
|
-
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.
|
|
78070
|
+
var _a, _b, _c, _d;
|
|
78071
|
+
return (_c = (_b = (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : (_d = this._colorScale) === null || _d === void 0 ? void 0 : _d.scale(this._getNodeNameFromData(datum));
|
|
77956
78072
|
},
|
|
77957
78073
|
text: (datum) => this._createText(datum),
|
|
77958
78074
|
limit: this._labelLimit,
|
|
@@ -78027,6 +78143,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78027
78143
|
nodesSeriesDataUpdate() {
|
|
78028
78144
|
this.event.emit(ChartEvent.legendFilter, { model: this });
|
|
78029
78145
|
this._nodesSeriesData.updateData();
|
|
78146
|
+
this._setNodeOrdinalColorScale();
|
|
78030
78147
|
}
|
|
78031
78148
|
linksSeriesDataUpdate() {
|
|
78032
78149
|
this.event.emit(ChartEvent.legendFilter, { model: this });
|
|
@@ -78038,33 +78155,32 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78038
78155
|
this._linkMark && this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark);
|
|
78039
78156
|
this._labelMark && this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark);
|
|
78040
78157
|
}
|
|
78041
|
-
|
|
78042
|
-
var _a, _b, _c, _d, _e
|
|
78043
|
-
|
|
78044
|
-
|
|
78045
|
-
|
|
78046
|
-
|
|
78047
|
-
|
|
78048
|
-
|
|
78049
|
-
|
|
78050
|
-
|
|
78051
|
-
|
|
78052
|
-
|
|
78053
|
-
|
|
78054
|
-
|
|
78055
|
-
|
|
78056
|
-
|
|
78057
|
-
|
|
78058
|
-
|
|
78059
|
-
if (((_k = this._option.globalScale.getScale('color')) === null || _k === void 0 ? void 0 : _k.domain().length) === 0 ||
|
|
78060
|
-
isNil$1(this._option.globalScale.getScale('color').domain()[0])) {
|
|
78158
|
+
_setNodeOrdinalColorScale() {
|
|
78159
|
+
var _a, _b, _c, _d, _e;
|
|
78160
|
+
const colorScale = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalScale) === null || _b === void 0 ? void 0 : _b.getScale('color');
|
|
78161
|
+
if (colorScale === null || colorScale === void 0 ? void 0 : colorScale._specified) {
|
|
78162
|
+
this._colorScale = colorScale;
|
|
78163
|
+
return;
|
|
78164
|
+
}
|
|
78165
|
+
let colorDomain;
|
|
78166
|
+
let colorRange;
|
|
78167
|
+
if (colorScale) {
|
|
78168
|
+
colorDomain = colorScale.domain();
|
|
78169
|
+
colorRange = colorScale.range();
|
|
78170
|
+
}
|
|
78171
|
+
if (!colorRange) {
|
|
78172
|
+
colorRange = this._getDataScheme();
|
|
78173
|
+
}
|
|
78174
|
+
if (!colorDomain || isNil$1(colorDomain[0])) {
|
|
78175
|
+
colorDomain = this.getNodeList();
|
|
78061
78176
|
if (colorDomain.length > 10) {
|
|
78062
|
-
colorRange = (
|
|
78177
|
+
colorRange = (_c = this._getDataScheme()[1]) === null || _c === void 0 ? void 0 : _c.scheme;
|
|
78063
78178
|
}
|
|
78064
78179
|
}
|
|
78065
78180
|
const ordinalScale = new ColorOrdinalScale();
|
|
78066
|
-
(
|
|
78067
|
-
|
|
78181
|
+
(_e = (_d = ordinalScale.domain(colorDomain)).range) === null || _e === void 0 ? void 0 : _e.call(_d, colorRange);
|
|
78182
|
+
this._colorScale = ordinalScale;
|
|
78183
|
+
return;
|
|
78068
78184
|
}
|
|
78069
78185
|
getNodeList() {
|
|
78070
78186
|
var _a, _b, _c;
|
|
@@ -82854,7 +82970,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82854
82970
|
maxKeyWidth -
|
|
82855
82971
|
keyStyle.spacing -
|
|
82856
82972
|
valueStyle.spacing;
|
|
82857
|
-
value.multiLine = true;
|
|
82858
82973
|
if (!value.maxWidth) {
|
|
82859
82974
|
value.maxWidth = Math.ceil(value.width);
|
|
82860
82975
|
}
|
|
@@ -83425,7 +83540,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83425
83540
|
styleObj.lineHeight = getPixelPropertyStr(lineHeight);
|
|
83426
83541
|
styleObj.fontWeight = fontWeight;
|
|
83427
83542
|
styleObj.whiteSpace = multiLine ? 'initial' : 'nowrap';
|
|
83428
|
-
styleObj.wordBreak = wordBreak;
|
|
83543
|
+
styleObj.wordBreak = multiLine ? wordBreak !== null && wordBreak !== void 0 ? wordBreak : 'break-word' : 'normal';
|
|
83429
83544
|
styleObj.maxWidth = getPixelPropertyStr(maxWidth);
|
|
83430
83545
|
return styleObj;
|
|
83431
83546
|
}
|
|
@@ -83617,7 +83732,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83617
83732
|
}
|
|
83618
83733
|
}
|
|
83619
83734
|
function getSvgHtml(option, valueToHtml) {
|
|
83620
|
-
var _a, _b, _c, _d, _e, _f;
|
|
83735
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
83621
83736
|
if (!(option === null || option === void 0 ? void 0 : option.hasShape) || !option.symbolType) {
|
|
83622
83737
|
return '';
|
|
83623
83738
|
}
|
|
@@ -83648,9 +83763,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83648
83763
|
</svg>`;
|
|
83649
83764
|
}
|
|
83650
83765
|
if (isObject$2(fill)) {
|
|
83651
|
-
fillString = 'gradientColor';
|
|
83766
|
+
fillString = (_b = 'gradientColor' + option.index) !== null && _b !== void 0 ? _b : '';
|
|
83652
83767
|
let gradient = '';
|
|
83653
|
-
const stops = ((
|
|
83768
|
+
const stops = ((_c = fill.stops) !== null && _c !== void 0 ? _c : [])
|
|
83654
83769
|
.map(s => `<stop offset="${valueToHtml(s.offset.toString())}" stop-color="${valueToHtml(s.color)}"/>`)
|
|
83655
83770
|
.join('');
|
|
83656
83771
|
if (fill.gradient === 'radial') {
|
|
@@ -83659,7 +83774,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83659
83774
|
</radialGradient>`;
|
|
83660
83775
|
}
|
|
83661
83776
|
else if (fill.gradient === 'linear') {
|
|
83662
|
-
gradient = `<linearGradient id="${fillString}" x1="${((
|
|
83777
|
+
gradient = `<linearGradient id="${fillString}" x1="${((_d = fill.x0) !== null && _d !== void 0 ? _d : 0) * 100}%" y1="${((_e = fill.y0) !== null && _e !== void 0 ? _e : 0) * 100}%" x2="${((_f = fill.x1) !== null && _f !== void 0 ? _f : 0) * 100}%" y2="${((_g = fill.y1) !== null && _g !== void 0 ? _g : 0) * 100}%">
|
|
83663
83778
|
${stops}
|
|
83664
83779
|
</linearGradient>`;
|
|
83665
83780
|
}
|
|
@@ -83697,6 +83812,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83697
83812
|
}
|
|
83698
83813
|
}
|
|
83699
83814
|
|
|
83815
|
+
const defaultLabelStyle = {
|
|
83816
|
+
overflowWrap: 'normal',
|
|
83817
|
+
wordWrap: 'normal'
|
|
83818
|
+
};
|
|
83700
83819
|
class ContentColumnModel extends BaseTooltipModel {
|
|
83701
83820
|
constructor(parent, option, className, childIndex) {
|
|
83702
83821
|
super(parent, option, childIndex);
|
|
@@ -83750,7 +83869,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83750
83869
|
let childStyle = {};
|
|
83751
83870
|
if (this.className === 'key-box') {
|
|
83752
83871
|
const { key, isKeyAdaptive } = line;
|
|
83753
|
-
childStyle = mergeSpec({}, 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]));
|
|
83872
|
+
childStyle = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, defaultLabelStyle), tooltipStyle.keyColumn.common), (_a = tooltipStyle.keyColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
|
|
83754
83873
|
const hasContent = (isString$1(key) && ((_b = key === null || key === void 0 ? void 0 : key.trim) === null || _b === void 0 ? void 0 : _b.call(key)) !== '') || isNumber$2(key);
|
|
83755
83874
|
if (!hasContent && !childStyle.visibility) {
|
|
83756
83875
|
childStyle.visibility = 'hidden';
|
|
@@ -83761,7 +83880,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83761
83880
|
this.children[i].setStyle(childStyle);
|
|
83762
83881
|
}
|
|
83763
83882
|
else if (this.className === 'value-box') {
|
|
83764
|
-
childStyle = mergeSpec({}, 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]));
|
|
83883
|
+
childStyle = mergeSpec({}, defaultValueStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height) }, defaultLabelStyle), tooltipStyle.valueColumn.common), (_c = tooltipStyle.valueColumn.items) === null || _c === void 0 ? void 0 : _c[i]));
|
|
83765
83884
|
this.children[i].setStyle(childStyle);
|
|
83766
83885
|
}
|
|
83767
83886
|
else if (this.className === 'shape-box') {
|
|
@@ -83831,7 +83950,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83831
83950
|
stroke: line.shapeStroke,
|
|
83832
83951
|
lineWidth: line.shapeLineWidth,
|
|
83833
83952
|
hollow: line.shapeHollow,
|
|
83834
|
-
marginTop: `calc((${(_e = (_d = keyColumn.lineHeight) !== null && _d !== void 0 ? _d : keyColumn.fontSize) !== null && _e !== void 0 ? _e : '18px'} - ${(_f = shapeColumn.width) !== null && _f !== void 0 ? _f : '8px'}) / 2)
|
|
83953
|
+
marginTop: `calc((${(_e = (_d = keyColumn.lineHeight) !== null && _d !== void 0 ? _d : keyColumn.fontSize) !== null && _e !== void 0 ? _e : '18px'} - ${(_f = shapeColumn.width) !== null && _f !== void 0 ? _f : '8px'}) / 2)`,
|
|
83954
|
+
index
|
|
83835
83955
|
};
|
|
83836
83956
|
}
|
|
83837
83957
|
}
|