@visactor/vchart 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.js +1169 -821
- 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/compilable-base.js +2 -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/axis/cartesian/axis.d.ts +3 -0
- package/cjs/component/axis/cartesian/axis.js +12 -5
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +4 -3
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +9 -5
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js +12 -10
- 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.map +1 -1
- package/cjs/constant/polar.js +1 -2
- package/cjs/constant/scroll-bar.js +2 -1
- package/cjs/core/factory.js +1 -2
- 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/data/transforms/sankey.d.ts +3 -6
- package/cjs/data/transforms/sankey.js +40 -23
- package/cjs/data/transforms/sankey.js.map +1 -1
- package/cjs/event/event.js +2 -1
- package/cjs/interaction/interaction.js +1 -2
- 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 +8 -2
- package/cjs/series/sankey/sankey.js +67 -66
- package/cjs/series/sankey/sankey.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/compilable-base.js +2 -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/axis/cartesian/axis.d.ts +3 -0
- package/esm/component/axis/cartesian/axis.js +12 -5
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +4 -3
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +9 -5
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/content-column-model.js +13 -9
- 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.map +1 -1
- package/esm/constant/polar.js +1 -2
- package/esm/constant/scroll-bar.js +2 -1
- package/esm/core/factory.js +1 -2
- 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/data/transforms/sankey.d.ts +3 -6
- package/esm/data/transforms/sankey.js +36 -22
- package/esm/data/transforms/sankey.js.map +1 -1
- package/esm/event/event.js +2 -1
- package/esm/interaction/interaction.js +1 -2
- 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 +8 -2
- package/esm/series/sankey/sankey.js +68 -69
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/util/type.js +1 -1
- package/esm/util/type.js.map +1 -1
- package/package.json +18 -18
package/build/index.js
CHANGED
|
@@ -2063,9 +2063,15 @@
|
|
|
2063
2063
|
baseline: baseline,
|
|
2064
2064
|
textBaseline = null != baseline ? baseline : "middle",
|
|
2065
2065
|
ellipsis: ellipsis,
|
|
2066
|
-
limit: limit
|
|
2067
|
-
lineHeight = fontSize
|
|
2066
|
+
limit: limit
|
|
2068
2067
|
} = this._userSpec;
|
|
2068
|
+
let {
|
|
2069
|
+
lineHeight = fontSize
|
|
2070
|
+
} = this._userSpec;
|
|
2071
|
+
if (isString$1(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
2072
|
+
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
2073
|
+
lineHeight = fontSize * scale;
|
|
2074
|
+
}
|
|
2069
2075
|
return {
|
|
2070
2076
|
fontStyle: fontStyle,
|
|
2071
2077
|
fontVariant: fontVariant,
|
|
@@ -2134,6 +2140,7 @@
|
|
|
2134
2140
|
return this._measureReduce(text, this._measureWithNaiveCanvas.bind(this));
|
|
2135
2141
|
}
|
|
2136
2142
|
_measureWithNaiveCanvas(text) {
|
|
2143
|
+
var _a;
|
|
2137
2144
|
if (!this.initContext()) return this._quickMeasureWithoutCanvas(text);
|
|
2138
2145
|
const metrics = this._context.measureText(text),
|
|
2139
2146
|
{
|
|
@@ -2142,7 +2149,7 @@
|
|
|
2142
2149
|
} = this.textSpec;
|
|
2143
2150
|
return {
|
|
2144
2151
|
width: metrics.width,
|
|
2145
|
-
height: null
|
|
2152
|
+
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
|
|
2146
2153
|
};
|
|
2147
2154
|
}
|
|
2148
2155
|
quickMeasure(text) {
|
|
@@ -2164,6 +2171,7 @@
|
|
|
2164
2171
|
return this._measureReduce(text, this._quickMeasureWithoutCanvas.bind(this));
|
|
2165
2172
|
}
|
|
2166
2173
|
_quickMeasureWithoutCanvas(text) {
|
|
2174
|
+
var _a;
|
|
2167
2175
|
const totalSize = {
|
|
2168
2176
|
width: 0,
|
|
2169
2177
|
height: 0
|
|
@@ -2177,9 +2185,10 @@
|
|
|
2177
2185
|
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
2178
2186
|
totalSize.width += size * fontSize;
|
|
2179
2187
|
}
|
|
2180
|
-
return totalSize.height = null
|
|
2188
|
+
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
2181
2189
|
}
|
|
2182
2190
|
_measureReduce(text, processor) {
|
|
2191
|
+
var _a;
|
|
2183
2192
|
const {
|
|
2184
2193
|
fontSize: fontSize,
|
|
2185
2194
|
lineHeight: lineHeight
|
|
@@ -2193,7 +2202,7 @@
|
|
|
2193
2202
|
const textArr = text.filter(isValid$1).map(s => s.toString());
|
|
2194
2203
|
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
2195
2204
|
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
2196
|
-
height: textArr.length * ((null
|
|
2205
|
+
height: textArr.length * ((null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize) + 1) + 1
|
|
2197
2206
|
};
|
|
2198
2207
|
}
|
|
2199
2208
|
return processor(text.toString());
|
|
@@ -6421,7 +6430,7 @@
|
|
|
6421
6430
|
}
|
|
6422
6431
|
|
|
6423
6432
|
function couldBeValidNumber(v) {
|
|
6424
|
-
if (
|
|
6433
|
+
if (v === null || v === undefined || v === '') {
|
|
6425
6434
|
return false;
|
|
6426
6435
|
}
|
|
6427
6436
|
if (isNumber$2(v)) {
|
|
@@ -10936,7 +10945,10 @@
|
|
|
10936
10945
|
direction: "horizontal",
|
|
10937
10946
|
wordBreak: "break-all",
|
|
10938
10947
|
ignoreBuf: !1,
|
|
10939
|
-
verticalMode: 0
|
|
10948
|
+
verticalMode: 0,
|
|
10949
|
+
whiteSpace: "no-wrap",
|
|
10950
|
+
heightLimit: 1 / 0,
|
|
10951
|
+
lineClamp: 1 / 0
|
|
10940
10952
|
};
|
|
10941
10953
|
const DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
10942
10954
|
opacity: 1,
|
|
@@ -13729,6 +13741,12 @@
|
|
|
13729
13741
|
}
|
|
13730
13742
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
13731
13743
|
const rafBasedSto = new RafBasedSTO();
|
|
13744
|
+
const calculateLineHeight = (lineHeight, fontSize) => {
|
|
13745
|
+
if (isString$1(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
13746
|
+
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
13747
|
+
}
|
|
13748
|
+
return lineHeight;
|
|
13749
|
+
};
|
|
13732
13750
|
|
|
13733
13751
|
class IncreaseCount extends ACustomAnimate {
|
|
13734
13752
|
constructor(from, to, duration, easing, params) {
|
|
@@ -16967,7 +16985,7 @@
|
|
|
16967
16985
|
}
|
|
16968
16986
|
}
|
|
16969
16987
|
|
|
16970
|
-
const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16988
|
+
const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16971
16989
|
let Text$1 = class Text extends Graphic {
|
|
16972
16990
|
get font() {
|
|
16973
16991
|
const textTheme = getTheme$1(this).text;
|
|
@@ -17025,315 +17043,14 @@
|
|
|
17025
17043
|
paddingArray = parsePadding(boundsPadding);
|
|
17026
17044
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
17027
17045
|
}
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
{
|
|
17031
|
-
direction = textTheme.direction
|
|
17032
|
-
} = this.attribute;
|
|
17033
|
-
return "horizontal" === direction ? this.updateHorizontalSinglelineAABBBounds(text) : this.updateVerticalSinglelineAABBBounds(text);
|
|
17034
|
-
}
|
|
17035
|
-
updateMultilineAABBBounds(text) {
|
|
17036
|
-
const textTheme = getTheme$1(this).text,
|
|
17037
|
-
{
|
|
17038
|
-
direction = textTheme.direction
|
|
17039
|
-
} = this.attribute;
|
|
17040
|
-
return "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
|
|
17041
|
-
}
|
|
17042
|
-
updateHorizontalSinglelineAABBBounds(text) {
|
|
17043
|
-
var _a, _b;
|
|
17044
|
-
const textTheme = getTheme$1(this).text,
|
|
17045
|
-
textMeasure = application.graphicUtil.textMeasure;
|
|
17046
|
-
let width, str;
|
|
17047
|
-
const attribute = this.attribute,
|
|
17048
|
-
{
|
|
17049
|
-
maxLineWidth = textTheme.maxLineWidth,
|
|
17050
|
-
ellipsis = textTheme.ellipsis,
|
|
17051
|
-
textAlign = textTheme.textAlign,
|
|
17052
|
-
textBaseline = textTheme.textBaseline,
|
|
17053
|
-
fontFamily = textTheme.fontFamily,
|
|
17054
|
-
fontSize = textTheme.fontSize,
|
|
17055
|
-
fontWeight = textTheme.fontWeight,
|
|
17056
|
-
stroke = textTheme.stroke,
|
|
17057
|
-
lineWidth = textTheme.lineWidth,
|
|
17058
|
-
wordBreak = textTheme.wordBreak,
|
|
17059
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
17060
|
-
} = attribute,
|
|
17061
|
-
buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
17062
|
-
{
|
|
17063
|
-
lineHeight = null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf
|
|
17064
|
-
} = attribute;
|
|
17065
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
17066
|
-
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
17067
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
17068
|
-
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
17069
|
-
return this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17070
|
-
}
|
|
17071
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
17072
|
-
if (ellipsis) {
|
|
17073
|
-
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
17074
|
-
data = textMeasure.clipTextWithSuffix(text.toString(), {
|
|
17075
|
-
fontSize: fontSize,
|
|
17076
|
-
fontWeight: fontWeight,
|
|
17077
|
-
fontFamily: fontFamily
|
|
17078
|
-
}, maxLineWidth, strEllipsis, !1);
|
|
17079
|
-
str = data.str, width = data.width;
|
|
17080
|
-
} else {
|
|
17081
|
-
const data = textMeasure.clipText(text.toString(), {
|
|
17082
|
-
fontSize: fontSize,
|
|
17083
|
-
fontWeight: fontWeight,
|
|
17084
|
-
fontFamily: fontFamily
|
|
17085
|
-
}, maxLineWidth, !1);
|
|
17086
|
-
str = data.str, width = data.width;
|
|
17087
|
-
}
|
|
17088
|
-
this.cache.clipedText = str, this.cache.clipedWidth = width;
|
|
17089
|
-
} else width = textMeasure.measureTextWidth(text.toString(), {
|
|
17090
|
-
fontSize: fontSize,
|
|
17091
|
-
fontWeight: fontWeight,
|
|
17092
|
-
fontFamily: fontFamily
|
|
17093
|
-
}), this.cache.clipedText = text.toString(), this.cache.clipedWidth = width;
|
|
17094
|
-
this.clearUpdateShapeTag();
|
|
17095
|
-
const dx = textDrawOffsetX(textAlign, width);
|
|
17096
|
-
let lh = lineHeight;
|
|
17097
|
-
application.global && application.global.isSafari() && (lh += .2 * fontSize);
|
|
17098
|
-
const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);
|
|
17099
|
-
return this._AABBBounds.set(dx, dy, dx + width, dy + lh), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17100
|
-
}
|
|
17101
|
-
getBaselineMapAlign() {
|
|
17102
|
-
return Text.baselineMapAlign;
|
|
17103
|
-
}
|
|
17104
|
-
getAlignMapBaseline() {
|
|
17105
|
-
return Text.alignMapBaseline;
|
|
17106
|
-
}
|
|
17107
|
-
updateVerticalSinglelineAABBBounds(text) {
|
|
17108
|
-
var _a, _b, _c;
|
|
17109
|
-
const textTheme = getTheme$1(this).text,
|
|
17110
|
-
textMeasure = application.graphicUtil.textMeasure;
|
|
17111
|
-
let width;
|
|
17112
|
-
const attribute = this.attribute,
|
|
17113
|
-
{
|
|
17114
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
17115
|
-
} = attribute,
|
|
17116
|
-
buf = ignoreBuf ? 0 : 2,
|
|
17117
|
-
{
|
|
17118
|
-
maxLineWidth = textTheme.maxLineWidth,
|
|
17119
|
-
ellipsis = textTheme.ellipsis,
|
|
17120
|
-
fontSize = textTheme.fontSize,
|
|
17121
|
-
fontWeight = textTheme.fontWeight,
|
|
17122
|
-
fontFamily = textTheme.fontFamily,
|
|
17123
|
-
stroke = textTheme.stroke,
|
|
17124
|
-
lineHeight = null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf,
|
|
17125
|
-
lineWidth = textTheme.lineWidth,
|
|
17126
|
-
verticalMode = textTheme.verticalMode
|
|
17127
|
-
} = attribute;
|
|
17128
|
-
let {
|
|
17129
|
-
textAlign = textTheme.textAlign,
|
|
17130
|
-
textBaseline = textTheme.textBaseline
|
|
17131
|
-
} = attribute;
|
|
17132
|
-
if (!verticalMode) {
|
|
17133
|
-
const t = textAlign;
|
|
17134
|
-
textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
|
|
17135
|
-
}
|
|
17136
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
17137
|
-
width = this.cache.clipedWidth;
|
|
17138
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
17139
|
-
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
17140
|
-
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17141
|
-
}
|
|
17142
|
-
let verticalList = [verticalLayout(text.toString())];
|
|
17143
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
17144
|
-
if (ellipsis) {
|
|
17145
|
-
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
17146
|
-
data = textMeasure.clipTextWithSuffixVertical(verticalList[0], {
|
|
17147
|
-
fontSize: fontSize,
|
|
17148
|
-
fontWeight: fontWeight,
|
|
17149
|
-
fontFamily: fontFamily
|
|
17150
|
-
}, maxLineWidth, strEllipsis, !1);
|
|
17151
|
-
verticalList = [data.verticalList], width = data.width;
|
|
17152
|
-
} else {
|
|
17153
|
-
const data = textMeasure.clipTextVertical(verticalList[0], {
|
|
17154
|
-
fontSize: fontSize,
|
|
17155
|
-
fontWeight: fontWeight,
|
|
17156
|
-
fontFamily: fontFamily
|
|
17157
|
-
}, maxLineWidth, !1);
|
|
17158
|
-
verticalList = [data.verticalList], width = data.width;
|
|
17159
|
-
}
|
|
17160
|
-
this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
17161
|
-
} else width = 0, verticalList[0].forEach(t => {
|
|
17162
|
-
const w = t.direction === TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
|
|
17163
|
-
fontSize: fontSize,
|
|
17164
|
-
fontWeight: fontWeight,
|
|
17165
|
-
fontFamily: fontFamily
|
|
17166
|
-
});
|
|
17167
|
-
width += w, t.width = w;
|
|
17168
|
-
}), this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
17169
|
-
this.clearUpdateShapeTag();
|
|
17170
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
17171
|
-
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
17172
|
-
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17173
|
-
}
|
|
17174
|
-
updateHorizontalMultilineAABBBounds(text) {
|
|
17175
|
-
var _a;
|
|
17176
|
-
const textTheme = getTheme$1(this).text,
|
|
17177
|
-
attribute = this.attribute,
|
|
17178
|
-
{
|
|
17179
|
-
fontFamily = textTheme.fontFamily,
|
|
17180
|
-
textAlign = textTheme.textAlign,
|
|
17181
|
-
textBaseline = textTheme.textBaseline,
|
|
17182
|
-
fontSize = textTheme.fontSize,
|
|
17183
|
-
fontWeight = textTheme.fontWeight,
|
|
17184
|
-
lineHeight = attribute.lineHeight || attribute.fontSize || textTheme.fontSize,
|
|
17185
|
-
ellipsis = textTheme.ellipsis,
|
|
17186
|
-
maxLineWidth: maxLineWidth,
|
|
17187
|
-
stroke = textTheme.stroke,
|
|
17188
|
-
lineWidth = textTheme.lineWidth,
|
|
17189
|
-
wordBreak = textTheme.wordBreak
|
|
17190
|
-
} = attribute;
|
|
17191
|
-
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
17192
|
-
const bbox = this.cache.layoutData.bbox;
|
|
17193
|
-
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17194
|
-
}
|
|
17195
|
-
const textMeasure = application.graphicUtil.textMeasure,
|
|
17196
|
-
layoutData = new CanvasTextLayout(fontFamily, {
|
|
17197
|
-
fontSize: fontSize,
|
|
17198
|
-
fontWeight: fontWeight,
|
|
17199
|
-
fontFamily: fontFamily
|
|
17200
|
-
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth),
|
|
17201
|
-
{
|
|
17202
|
-
bbox: bbox
|
|
17203
|
-
} = layoutData;
|
|
17204
|
-
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;
|
|
17205
|
-
}
|
|
17206
|
-
updateVerticalMultilineAABBBounds(text) {
|
|
17207
|
-
var _a, _b, _c;
|
|
17208
|
-
const textTheme = getTheme$1(this).text,
|
|
17209
|
-
textMeasure = application.graphicUtil.textMeasure;
|
|
17210
|
-
let width;
|
|
17211
|
-
const attribute = this.attribute,
|
|
17212
|
-
{
|
|
17213
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
17214
|
-
} = attribute,
|
|
17215
|
-
buf = ignoreBuf ? 0 : 2,
|
|
17216
|
-
{
|
|
17217
|
-
maxLineWidth = textTheme.maxLineWidth,
|
|
17218
|
-
ellipsis = textTheme.ellipsis,
|
|
17219
|
-
fontFamily = textTheme.fontFamily,
|
|
17220
|
-
fontSize = textTheme.fontSize,
|
|
17221
|
-
fontWeight = textTheme.fontWeight,
|
|
17222
|
-
stroke = textTheme.stroke,
|
|
17223
|
-
lineHeight = null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf,
|
|
17224
|
-
lineWidth = textTheme.lineWidth,
|
|
17225
|
-
verticalMode = textTheme.verticalMode
|
|
17226
|
-
} = attribute;
|
|
17227
|
-
let {
|
|
17228
|
-
textAlign = textTheme.textAlign,
|
|
17229
|
-
textBaseline = textTheme.textBaseline
|
|
17230
|
-
} = attribute;
|
|
17231
|
-
if (!verticalMode) {
|
|
17232
|
-
const t = textAlign;
|
|
17233
|
-
textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
|
|
17234
|
-
}
|
|
17235
|
-
if (width = 0, !this.shouldUpdateShape() && this.cache) {
|
|
17236
|
-
this.cache.verticalList.forEach(item => {
|
|
17237
|
-
const w = item.reduce((a, b) => a + b.width, 0);
|
|
17238
|
-
width = max$2(w, width);
|
|
17239
|
-
});
|
|
17240
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
17241
|
-
height = this.cache.verticalList.length * lineHeight,
|
|
17242
|
-
dy = textLayoutOffsetY(textBaseline, height, fontSize);
|
|
17243
|
-
return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17244
|
-
}
|
|
17245
|
-
const verticalLists = text.map(str => verticalLayout(str.toString()));
|
|
17246
|
-
verticalLists.forEach((verticalData, i) => {
|
|
17247
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
17248
|
-
if (ellipsis) {
|
|
17249
|
-
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
17250
|
-
data = textMeasure.clipTextWithSuffixVertical(verticalData, {
|
|
17251
|
-
fontSize: fontSize,
|
|
17252
|
-
fontWeight: fontWeight,
|
|
17253
|
-
fontFamily: fontFamily
|
|
17254
|
-
}, maxLineWidth, strEllipsis, !1);
|
|
17255
|
-
verticalLists[i] = data.verticalList, width = data.width;
|
|
17256
|
-
} else {
|
|
17257
|
-
const data = textMeasure.clipTextVertical(verticalData, {
|
|
17258
|
-
fontSize: fontSize,
|
|
17259
|
-
fontWeight: fontWeight,
|
|
17260
|
-
fontFamily: fontFamily
|
|
17261
|
-
}, maxLineWidth, !1);
|
|
17262
|
-
verticalLists[i] = data.verticalList, width = data.width;
|
|
17263
|
-
}
|
|
17264
|
-
} else width = 0, verticalData.forEach(t => {
|
|
17265
|
-
const w = t.direction === TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
|
|
17266
|
-
fontSize: fontSize,
|
|
17267
|
-
fontWeight: fontWeight,
|
|
17268
|
-
fontFamily: fontFamily
|
|
17269
|
-
});
|
|
17270
|
-
width += w, t.width = w;
|
|
17271
|
-
});
|
|
17272
|
-
}), this.cache.verticalList = verticalLists, this.clearUpdateShapeTag(), this.cache.verticalList.forEach(item => {
|
|
17273
|
-
const w = item.reduce((a, b) => a + b.width, 0);
|
|
17274
|
-
width = max$2(w, width);
|
|
17275
|
-
});
|
|
17276
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
17277
|
-
height = this.cache.verticalList.length * lineHeight,
|
|
17278
|
-
dy = textLayoutOffsetY(textBaseline, height, fontSize);
|
|
17279
|
-
return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17280
|
-
}
|
|
17281
|
-
tryUpdateOBBBounds() {
|
|
17282
|
-
throw new Error("暂不支持");
|
|
17283
|
-
}
|
|
17284
|
-
getDefaultAttribute(name) {
|
|
17285
|
-
return getTheme$1(this).text[name];
|
|
17286
|
-
}
|
|
17287
|
-
needUpdateTags(keys) {
|
|
17288
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
17289
|
-
return super.needUpdateTags(keys, k);
|
|
17290
|
-
}
|
|
17291
|
-
needUpdateTag(key) {
|
|
17292
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
17293
|
-
return super.needUpdateTag(key, k);
|
|
17294
|
-
}
|
|
17295
|
-
clone() {
|
|
17296
|
-
return new Text(Object.assign({}, this.attribute));
|
|
17297
|
-
}
|
|
17298
|
-
getNoWorkAnimateAttr() {
|
|
17299
|
-
return Text.NOWORK_ANIMATE_ATTR;
|
|
17300
|
-
}
|
|
17301
|
-
};
|
|
17302
|
-
Text$1.NOWORK_ANIMATE_ATTR = Object.assign({
|
|
17303
|
-
ellipsis: 1,
|
|
17304
|
-
wordBreak: 1,
|
|
17305
|
-
direction: 1,
|
|
17306
|
-
textAlign: 1,
|
|
17307
|
-
textBaseline: 1,
|
|
17308
|
-
fontFamily: 1,
|
|
17309
|
-
fontWeight: 1
|
|
17310
|
-
}, NOWORK_ANIMATE_ATTR), Text$1.baselineMapAlign = {
|
|
17311
|
-
top: "left",
|
|
17312
|
-
bottom: "right",
|
|
17313
|
-
middle: "center"
|
|
17314
|
-
}, Text$1.alignMapBaseline = {
|
|
17315
|
-
left: "top",
|
|
17316
|
-
right: "bottom",
|
|
17317
|
-
center: "middle"
|
|
17318
|
-
};
|
|
17319
|
-
|
|
17320
|
-
const WRAP_TEXT_UPDATE_TAG_KEY = ["heightLimit", "lineClamp"];
|
|
17321
|
-
class WrapText extends Text$1 {
|
|
17322
|
-
_isValid() {
|
|
17323
|
-
const {
|
|
17324
|
-
text: text
|
|
17325
|
-
} = this.attribute;
|
|
17326
|
-
return isArray$1(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
|
|
17327
|
-
}
|
|
17328
|
-
updateMultilineAABBBounds(text) {
|
|
17329
|
-
var _a, _b, _c;
|
|
17046
|
+
updateWrapAABBBounds(text) {
|
|
17047
|
+
var _a, _b, _c, _d;
|
|
17330
17048
|
const textTheme = getTheme$1(this).text,
|
|
17331
17049
|
{
|
|
17332
17050
|
fontFamily = textTheme.fontFamily,
|
|
17333
17051
|
textAlign = textTheme.textAlign,
|
|
17334
17052
|
textBaseline = textTheme.textBaseline,
|
|
17335
17053
|
fontSize = textTheme.fontSize,
|
|
17336
|
-
lineHeight = this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize,
|
|
17337
17054
|
ellipsis = textTheme.ellipsis,
|
|
17338
17055
|
maxLineWidth: maxLineWidth,
|
|
17339
17056
|
stroke = textTheme.stroke,
|
|
@@ -17344,8 +17061,9 @@
|
|
|
17344
17061
|
heightLimit = 0,
|
|
17345
17062
|
lineClamp: lineClamp
|
|
17346
17063
|
} = this.attribute,
|
|
17064
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
17347
17065
|
buf = ignoreBuf ? 0 : 2;
|
|
17348
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
17066
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
17349
17067
|
const bbox = this.cache.layoutData.bbox;
|
|
17350
17068
|
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17351
17069
|
}
|
|
@@ -17355,7 +17073,7 @@
|
|
|
17355
17073
|
fontWeight: fontWeight,
|
|
17356
17074
|
fontFamily: fontFamily
|
|
17357
17075
|
}, textMeasure),
|
|
17358
|
-
lines = text.map(l => l.toString()),
|
|
17076
|
+
lines = isArray$1(text) ? text.map(l => l.toString()) : [text.toString()],
|
|
17359
17077
|
linesLayout = [],
|
|
17360
17078
|
bboxWH = [0, 0];
|
|
17361
17079
|
let lineCountLimit = 1 / 0;
|
|
@@ -17375,7 +17093,406 @@
|
|
|
17375
17093
|
if ("" !== str && "" === clip.str) {
|
|
17376
17094
|
if (ellipsis) {
|
|
17377
17095
|
const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17378
|
-
clip.str = null !== (
|
|
17096
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
17097
|
+
} else clip.str = "", clip.width = 0;
|
|
17098
|
+
needCut = !1;
|
|
17099
|
+
}
|
|
17100
|
+
if (linesLayout.push({
|
|
17101
|
+
str: clip.str,
|
|
17102
|
+
width: clip.width
|
|
17103
|
+
}), clip.str.length === str.length) ;else if (needCut) {
|
|
17104
|
+
const newStr = str.substring(clip.str.length);
|
|
17105
|
+
lines.splice(i + 1, 0, newStr);
|
|
17106
|
+
}
|
|
17107
|
+
}
|
|
17108
|
+
let maxWidth = 0;
|
|
17109
|
+
linesLayout.forEach(layout => {
|
|
17110
|
+
maxWidth = Math.max(maxWidth, layout.width);
|
|
17111
|
+
}), bboxWH[0] = maxWidth;
|
|
17112
|
+
} else {
|
|
17113
|
+
let width,
|
|
17114
|
+
text,
|
|
17115
|
+
lineWidth = 0;
|
|
17116
|
+
for (let i = 0, len = lines.length; i < len; i++) {
|
|
17117
|
+
if (i === lineCountLimit - 1) {
|
|
17118
|
+
const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17119
|
+
linesLayout.push({
|
|
17120
|
+
str: clip.str,
|
|
17121
|
+
width: clip.width
|
|
17122
|
+
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
17123
|
+
break;
|
|
17124
|
+
}
|
|
17125
|
+
text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak), lineWidth = Math.max(lineWidth, width), linesLayout.push({
|
|
17126
|
+
str: text,
|
|
17127
|
+
width: width
|
|
17128
|
+
});
|
|
17129
|
+
}
|
|
17130
|
+
bboxWH[0] = lineWidth;
|
|
17131
|
+
}
|
|
17132
|
+
bboxWH[1] = linesLayout.length * (lineHeight + buf);
|
|
17133
|
+
const bbox = {
|
|
17134
|
+
xOffset: 0,
|
|
17135
|
+
yOffset: 0,
|
|
17136
|
+
width: bboxWH[0],
|
|
17137
|
+
height: bboxWH[1]
|
|
17138
|
+
};
|
|
17139
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
17140
|
+
const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
17141
|
+
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;
|
|
17142
|
+
}
|
|
17143
|
+
updateSingallineAABBBounds(text) {
|
|
17144
|
+
const textTheme = getTheme$1(this).text,
|
|
17145
|
+
{
|
|
17146
|
+
direction = textTheme.direction
|
|
17147
|
+
} = this.attribute;
|
|
17148
|
+
return "horizontal" === direction ? this.updateHorizontalSinglelineAABBBounds(text) : this.updateVerticalSinglelineAABBBounds(text);
|
|
17149
|
+
}
|
|
17150
|
+
updateMultilineAABBBounds(text) {
|
|
17151
|
+
const textTheme = getTheme$1(this).text,
|
|
17152
|
+
{
|
|
17153
|
+
direction = textTheme.direction
|
|
17154
|
+
} = this.attribute;
|
|
17155
|
+
return "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
|
|
17156
|
+
}
|
|
17157
|
+
updateHorizontalSinglelineAABBBounds(text) {
|
|
17158
|
+
var _a, _b;
|
|
17159
|
+
const textTheme = getTheme$1(this).text,
|
|
17160
|
+
textMeasure = application.graphicUtil.textMeasure;
|
|
17161
|
+
let width, str;
|
|
17162
|
+
const attribute = this.attribute,
|
|
17163
|
+
{
|
|
17164
|
+
maxLineWidth = textTheme.maxLineWidth,
|
|
17165
|
+
ellipsis = textTheme.ellipsis,
|
|
17166
|
+
textAlign = textTheme.textAlign,
|
|
17167
|
+
textBaseline = textTheme.textBaseline,
|
|
17168
|
+
fontFamily = textTheme.fontFamily,
|
|
17169
|
+
fontSize = textTheme.fontSize,
|
|
17170
|
+
fontWeight = textTheme.fontWeight,
|
|
17171
|
+
stroke = textTheme.stroke,
|
|
17172
|
+
lineWidth = textTheme.lineWidth,
|
|
17173
|
+
wordBreak = textTheme.wordBreak,
|
|
17174
|
+
ignoreBuf = textTheme.ignoreBuf,
|
|
17175
|
+
whiteSpace = textTheme.whiteSpace
|
|
17176
|
+
} = attribute;
|
|
17177
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
17178
|
+
const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
17179
|
+
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
17180
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
17181
|
+
if (!this.shouldUpdateShape() && this.cache) {
|
|
17182
|
+
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
17183
|
+
const dx = textDrawOffsetX(textAlign, width),
|
|
17184
|
+
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
17185
|
+
return this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17186
|
+
}
|
|
17187
|
+
if (Number.isFinite(maxLineWidth)) {
|
|
17188
|
+
if (ellipsis) {
|
|
17189
|
+
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
17190
|
+
data = textMeasure.clipTextWithSuffix(text.toString(), {
|
|
17191
|
+
fontSize: fontSize,
|
|
17192
|
+
fontWeight: fontWeight,
|
|
17193
|
+
fontFamily: fontFamily
|
|
17194
|
+
}, maxLineWidth, strEllipsis, !1);
|
|
17195
|
+
str = data.str, width = data.width;
|
|
17196
|
+
} else {
|
|
17197
|
+
const data = textMeasure.clipText(text.toString(), {
|
|
17198
|
+
fontSize: fontSize,
|
|
17199
|
+
fontWeight: fontWeight,
|
|
17200
|
+
fontFamily: fontFamily
|
|
17201
|
+
}, maxLineWidth, !1);
|
|
17202
|
+
str = data.str, width = data.width;
|
|
17203
|
+
}
|
|
17204
|
+
this.cache.clipedText = str, this.cache.clipedWidth = width;
|
|
17205
|
+
} else width = textMeasure.measureTextWidth(text.toString(), {
|
|
17206
|
+
fontSize: fontSize,
|
|
17207
|
+
fontWeight: fontWeight,
|
|
17208
|
+
fontFamily: fontFamily
|
|
17209
|
+
}), this.cache.clipedText = text.toString(), this.cache.clipedWidth = width;
|
|
17210
|
+
this.clearUpdateShapeTag();
|
|
17211
|
+
const dx = textDrawOffsetX(textAlign, width);
|
|
17212
|
+
let lh = lineHeight;
|
|
17213
|
+
application.global && application.global.isSafari() && (lh += .2 * fontSize);
|
|
17214
|
+
const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);
|
|
17215
|
+
return this._AABBBounds.set(dx, dy, dx + width, dy + lh), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17216
|
+
}
|
|
17217
|
+
getBaselineMapAlign() {
|
|
17218
|
+
return Text.baselineMapAlign;
|
|
17219
|
+
}
|
|
17220
|
+
getAlignMapBaseline() {
|
|
17221
|
+
return Text.alignMapBaseline;
|
|
17222
|
+
}
|
|
17223
|
+
updateVerticalSinglelineAABBBounds(text) {
|
|
17224
|
+
var _a, _b, _c;
|
|
17225
|
+
const textTheme = getTheme$1(this).text,
|
|
17226
|
+
textMeasure = application.graphicUtil.textMeasure;
|
|
17227
|
+
let width;
|
|
17228
|
+
const attribute = this.attribute,
|
|
17229
|
+
{
|
|
17230
|
+
ignoreBuf = textTheme.ignoreBuf
|
|
17231
|
+
} = attribute,
|
|
17232
|
+
buf = ignoreBuf ? 0 : 2,
|
|
17233
|
+
{
|
|
17234
|
+
maxLineWidth = textTheme.maxLineWidth,
|
|
17235
|
+
ellipsis = textTheme.ellipsis,
|
|
17236
|
+
fontSize = textTheme.fontSize,
|
|
17237
|
+
fontWeight = textTheme.fontWeight,
|
|
17238
|
+
fontFamily = textTheme.fontFamily,
|
|
17239
|
+
stroke = textTheme.stroke,
|
|
17240
|
+
lineWidth = textTheme.lineWidth,
|
|
17241
|
+
verticalMode = textTheme.verticalMode
|
|
17242
|
+
} = attribute,
|
|
17243
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
17244
|
+
let {
|
|
17245
|
+
textAlign = textTheme.textAlign,
|
|
17246
|
+
textBaseline = textTheme.textBaseline
|
|
17247
|
+
} = attribute;
|
|
17248
|
+
if (!verticalMode) {
|
|
17249
|
+
const t = textAlign;
|
|
17250
|
+
textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
|
|
17251
|
+
}
|
|
17252
|
+
if (!this.shouldUpdateShape() && this.cache) {
|
|
17253
|
+
width = this.cache.clipedWidth;
|
|
17254
|
+
const dx = textDrawOffsetX(textAlign, width),
|
|
17255
|
+
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
17256
|
+
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17257
|
+
}
|
|
17258
|
+
let verticalList = [verticalLayout(text.toString())];
|
|
17259
|
+
if (Number.isFinite(maxLineWidth)) {
|
|
17260
|
+
if (ellipsis) {
|
|
17261
|
+
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
17262
|
+
data = textMeasure.clipTextWithSuffixVertical(verticalList[0], {
|
|
17263
|
+
fontSize: fontSize,
|
|
17264
|
+
fontWeight: fontWeight,
|
|
17265
|
+
fontFamily: fontFamily
|
|
17266
|
+
}, maxLineWidth, strEllipsis, !1);
|
|
17267
|
+
verticalList = [data.verticalList], width = data.width;
|
|
17268
|
+
} else {
|
|
17269
|
+
const data = textMeasure.clipTextVertical(verticalList[0], {
|
|
17270
|
+
fontSize: fontSize,
|
|
17271
|
+
fontWeight: fontWeight,
|
|
17272
|
+
fontFamily: fontFamily
|
|
17273
|
+
}, maxLineWidth, !1);
|
|
17274
|
+
verticalList = [data.verticalList], width = data.width;
|
|
17275
|
+
}
|
|
17276
|
+
this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
17277
|
+
} else width = 0, verticalList[0].forEach(t => {
|
|
17278
|
+
const w = t.direction === TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
|
|
17279
|
+
fontSize: fontSize,
|
|
17280
|
+
fontWeight: fontWeight,
|
|
17281
|
+
fontFamily: fontFamily
|
|
17282
|
+
});
|
|
17283
|
+
width += w, t.width = w;
|
|
17284
|
+
}), this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
17285
|
+
this.clearUpdateShapeTag();
|
|
17286
|
+
const dx = textDrawOffsetX(textAlign, width),
|
|
17287
|
+
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
17288
|
+
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17289
|
+
}
|
|
17290
|
+
updateHorizontalMultilineAABBBounds(text) {
|
|
17291
|
+
var _a, _b;
|
|
17292
|
+
const textTheme = getTheme$1(this).text,
|
|
17293
|
+
attribute = this.attribute,
|
|
17294
|
+
{
|
|
17295
|
+
fontFamily = textTheme.fontFamily,
|
|
17296
|
+
textAlign = textTheme.textAlign,
|
|
17297
|
+
textBaseline = textTheme.textBaseline,
|
|
17298
|
+
fontSize = textTheme.fontSize,
|
|
17299
|
+
fontWeight = textTheme.fontWeight,
|
|
17300
|
+
ellipsis = textTheme.ellipsis,
|
|
17301
|
+
maxLineWidth: maxLineWidth,
|
|
17302
|
+
stroke = textTheme.stroke,
|
|
17303
|
+
lineWidth = textTheme.lineWidth,
|
|
17304
|
+
whiteSpace = textTheme.whiteSpace
|
|
17305
|
+
} = attribute,
|
|
17306
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
17307
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
17308
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
17309
|
+
const bbox = this.cache.layoutData.bbox;
|
|
17310
|
+
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17311
|
+
}
|
|
17312
|
+
const textMeasure = application.graphicUtil.textMeasure,
|
|
17313
|
+
layoutData = new CanvasTextLayout(fontFamily, {
|
|
17314
|
+
fontSize: fontSize,
|
|
17315
|
+
fontWeight: fontWeight,
|
|
17316
|
+
fontFamily: fontFamily
|
|
17317
|
+
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth),
|
|
17318
|
+
{
|
|
17319
|
+
bbox: bbox
|
|
17320
|
+
} = layoutData;
|
|
17321
|
+
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;
|
|
17322
|
+
}
|
|
17323
|
+
updateVerticalMultilineAABBBounds(text) {
|
|
17324
|
+
var _a, _b, _c;
|
|
17325
|
+
const textTheme = getTheme$1(this).text,
|
|
17326
|
+
textMeasure = application.graphicUtil.textMeasure;
|
|
17327
|
+
let width;
|
|
17328
|
+
const attribute = this.attribute,
|
|
17329
|
+
{
|
|
17330
|
+
ignoreBuf = textTheme.ignoreBuf
|
|
17331
|
+
} = attribute,
|
|
17332
|
+
buf = ignoreBuf ? 0 : 2,
|
|
17333
|
+
{
|
|
17334
|
+
maxLineWidth = textTheme.maxLineWidth,
|
|
17335
|
+
ellipsis = textTheme.ellipsis,
|
|
17336
|
+
fontFamily = textTheme.fontFamily,
|
|
17337
|
+
fontSize = textTheme.fontSize,
|
|
17338
|
+
fontWeight = textTheme.fontWeight,
|
|
17339
|
+
stroke = textTheme.stroke,
|
|
17340
|
+
lineWidth = textTheme.lineWidth,
|
|
17341
|
+
verticalMode = textTheme.verticalMode
|
|
17342
|
+
} = attribute,
|
|
17343
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
17344
|
+
let {
|
|
17345
|
+
textAlign = textTheme.textAlign,
|
|
17346
|
+
textBaseline = textTheme.textBaseline
|
|
17347
|
+
} = attribute;
|
|
17348
|
+
if (!verticalMode) {
|
|
17349
|
+
const t = textAlign;
|
|
17350
|
+
textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
|
|
17351
|
+
}
|
|
17352
|
+
if (width = 0, !this.shouldUpdateShape() && this.cache) {
|
|
17353
|
+
this.cache.verticalList.forEach(item => {
|
|
17354
|
+
const w = item.reduce((a, b) => a + b.width, 0);
|
|
17355
|
+
width = max$2(w, width);
|
|
17356
|
+
});
|
|
17357
|
+
const dx = textDrawOffsetX(textAlign, width),
|
|
17358
|
+
height = this.cache.verticalList.length * lineHeight,
|
|
17359
|
+
dy = textLayoutOffsetY(textBaseline, height, fontSize);
|
|
17360
|
+
return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17361
|
+
}
|
|
17362
|
+
const verticalLists = text.map(str => verticalLayout(str.toString()));
|
|
17363
|
+
verticalLists.forEach((verticalData, i) => {
|
|
17364
|
+
if (Number.isFinite(maxLineWidth)) {
|
|
17365
|
+
if (ellipsis) {
|
|
17366
|
+
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
17367
|
+
data = textMeasure.clipTextWithSuffixVertical(verticalData, {
|
|
17368
|
+
fontSize: fontSize,
|
|
17369
|
+
fontWeight: fontWeight,
|
|
17370
|
+
fontFamily: fontFamily
|
|
17371
|
+
}, maxLineWidth, strEllipsis, !1);
|
|
17372
|
+
verticalLists[i] = data.verticalList, width = data.width;
|
|
17373
|
+
} else {
|
|
17374
|
+
const data = textMeasure.clipTextVertical(verticalData, {
|
|
17375
|
+
fontSize: fontSize,
|
|
17376
|
+
fontWeight: fontWeight,
|
|
17377
|
+
fontFamily: fontFamily
|
|
17378
|
+
}, maxLineWidth, !1);
|
|
17379
|
+
verticalLists[i] = data.verticalList, width = data.width;
|
|
17380
|
+
}
|
|
17381
|
+
} else width = 0, verticalData.forEach(t => {
|
|
17382
|
+
const w = t.direction === TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
|
|
17383
|
+
fontSize: fontSize,
|
|
17384
|
+
fontWeight: fontWeight,
|
|
17385
|
+
fontFamily: fontFamily
|
|
17386
|
+
});
|
|
17387
|
+
width += w, t.width = w;
|
|
17388
|
+
});
|
|
17389
|
+
}), this.cache.verticalList = verticalLists, this.clearUpdateShapeTag(), this.cache.verticalList.forEach(item => {
|
|
17390
|
+
const w = item.reduce((a, b) => a + b.width, 0);
|
|
17391
|
+
width = max$2(w, width);
|
|
17392
|
+
});
|
|
17393
|
+
const dx = textDrawOffsetX(textAlign, width),
|
|
17394
|
+
height = this.cache.verticalList.length * lineHeight,
|
|
17395
|
+
dy = textLayoutOffsetY(textBaseline, height, fontSize);
|
|
17396
|
+
return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17397
|
+
}
|
|
17398
|
+
tryUpdateOBBBounds() {
|
|
17399
|
+
throw new Error("暂不支持");
|
|
17400
|
+
}
|
|
17401
|
+
getDefaultAttribute(name) {
|
|
17402
|
+
return getTheme$1(this).text[name];
|
|
17403
|
+
}
|
|
17404
|
+
needUpdateTags(keys) {
|
|
17405
|
+
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
17406
|
+
return super.needUpdateTags(keys, k);
|
|
17407
|
+
}
|
|
17408
|
+
needUpdateTag(key) {
|
|
17409
|
+
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
17410
|
+
return super.needUpdateTag(key, k);
|
|
17411
|
+
}
|
|
17412
|
+
clone() {
|
|
17413
|
+
return new Text(Object.assign({}, this.attribute));
|
|
17414
|
+
}
|
|
17415
|
+
getNoWorkAnimateAttr() {
|
|
17416
|
+
return Text.NOWORK_ANIMATE_ATTR;
|
|
17417
|
+
}
|
|
17418
|
+
};
|
|
17419
|
+
Text$1.NOWORK_ANIMATE_ATTR = Object.assign({
|
|
17420
|
+
ellipsis: 1,
|
|
17421
|
+
wordBreak: 1,
|
|
17422
|
+
direction: 1,
|
|
17423
|
+
textAlign: 1,
|
|
17424
|
+
textBaseline: 1,
|
|
17425
|
+
fontFamily: 1,
|
|
17426
|
+
fontWeight: 1
|
|
17427
|
+
}, NOWORK_ANIMATE_ATTR), Text$1.baselineMapAlign = {
|
|
17428
|
+
top: "left",
|
|
17429
|
+
bottom: "right",
|
|
17430
|
+
middle: "center"
|
|
17431
|
+
}, Text$1.alignMapBaseline = {
|
|
17432
|
+
left: "top",
|
|
17433
|
+
right: "bottom",
|
|
17434
|
+
center: "middle"
|
|
17435
|
+
};
|
|
17436
|
+
|
|
17437
|
+
const WRAP_TEXT_UPDATE_TAG_KEY = ["heightLimit", "lineClamp"];
|
|
17438
|
+
class WrapText extends Text$1 {
|
|
17439
|
+
_isValid() {
|
|
17440
|
+
const {
|
|
17441
|
+
text: text
|
|
17442
|
+
} = this.attribute;
|
|
17443
|
+
return isArray$1(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
|
|
17444
|
+
}
|
|
17445
|
+
updateMultilineAABBBounds(text) {
|
|
17446
|
+
var _a, _b, _c, _d;
|
|
17447
|
+
const textTheme = getTheme$1(this).text,
|
|
17448
|
+
{
|
|
17449
|
+
fontFamily = textTheme.fontFamily,
|
|
17450
|
+
textAlign = textTheme.textAlign,
|
|
17451
|
+
textBaseline = textTheme.textBaseline,
|
|
17452
|
+
fontSize = textTheme.fontSize,
|
|
17453
|
+
ellipsis = textTheme.ellipsis,
|
|
17454
|
+
maxLineWidth: maxLineWidth,
|
|
17455
|
+
stroke = textTheme.stroke,
|
|
17456
|
+
lineWidth = textTheme.lineWidth,
|
|
17457
|
+
wordBreak = textTheme.wordBreak,
|
|
17458
|
+
fontWeight = textTheme.fontWeight,
|
|
17459
|
+
ignoreBuf = textTheme.ignoreBuf,
|
|
17460
|
+
heightLimit = 0,
|
|
17461
|
+
lineClamp: lineClamp
|
|
17462
|
+
} = this.attribute,
|
|
17463
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
17464
|
+
buf = ignoreBuf ? 0 : 2;
|
|
17465
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
17466
|
+
const bbox = this.cache.layoutData.bbox;
|
|
17467
|
+
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17468
|
+
}
|
|
17469
|
+
const textMeasure = application.graphicUtil.textMeasure,
|
|
17470
|
+
layoutObj = new CanvasTextLayout(fontFamily, {
|
|
17471
|
+
fontSize: fontSize,
|
|
17472
|
+
fontWeight: fontWeight,
|
|
17473
|
+
fontFamily: fontFamily
|
|
17474
|
+
}, textMeasure),
|
|
17475
|
+
lines = text.map(l => l.toString()),
|
|
17476
|
+
linesLayout = [],
|
|
17477
|
+
bboxWH = [0, 0];
|
|
17478
|
+
let lineCountLimit = 1 / 0;
|
|
17479
|
+
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
17480
|
+
if (maxLineWidth > 0) for (let i = 0; i < lines.length; i++) {
|
|
17481
|
+
const str = lines[i];
|
|
17482
|
+
let needCut = !0;
|
|
17483
|
+
if (i === lineCountLimit - 1) {
|
|
17484
|
+
const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17485
|
+
linesLayout.push({
|
|
17486
|
+
str: clip.str,
|
|
17487
|
+
width: clip.width
|
|
17488
|
+
});
|
|
17489
|
+
break;
|
|
17490
|
+
}
|
|
17491
|
+
const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
|
|
17492
|
+
if ("" !== str && "" === clip.str) {
|
|
17493
|
+
if (ellipsis) {
|
|
17494
|
+
const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17495
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
17379
17496
|
} else clip.str = "", clip.width = 0;
|
|
17380
17497
|
needCut = !1;
|
|
17381
17498
|
}
|
|
@@ -17911,6 +18028,13 @@
|
|
|
17911
18028
|
builtinSymbols.forEach(symbol => {
|
|
17912
18029
|
builtinSymbolsMap[symbol.type] = symbol;
|
|
17913
18030
|
});
|
|
18031
|
+
const builtInSymbolStrMap = {
|
|
18032
|
+
arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
|
|
18033
|
+
arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
|
|
18034
|
+
rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
|
|
18035
|
+
rectRound: "M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",
|
|
18036
|
+
roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
|
|
18037
|
+
};
|
|
17914
18038
|
|
|
17915
18039
|
const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
17916
18040
|
let Symbol$1 = class Symbol extends Graphic {
|
|
@@ -17933,13 +18057,14 @@
|
|
|
17933
18057
|
return isArray$1(size) ? 2 === size.length && size.every(this._validNumber) : this._validNumber(size);
|
|
17934
18058
|
}
|
|
17935
18059
|
doUpdateParsedPath() {
|
|
17936
|
-
const symbolTheme = getTheme$1(this).symbol
|
|
17937
|
-
|
|
18060
|
+
const symbolTheme = getTheme$1(this).symbol;
|
|
18061
|
+
let {
|
|
17938
18062
|
symbolType = symbolTheme.symbolType
|
|
17939
|
-
} = this.attribute
|
|
17940
|
-
|
|
18063
|
+
} = this.attribute,
|
|
18064
|
+
path = builtinSymbolsMap[symbolType];
|
|
17941
18065
|
if (path) return this._parsedPath = path, path;
|
|
17942
18066
|
if (path = Symbol.userSymbolMap[symbolType], path) return this._parsedPath = path, path;
|
|
18067
|
+
symbolType = builtInSymbolStrMap[symbolType] || symbolType;
|
|
17943
18068
|
if (!0 === isSvg(symbolType)) {
|
|
17944
18069
|
const parser = new XMLParser(),
|
|
17945
18070
|
{
|
|
@@ -18451,7 +18576,9 @@
|
|
|
18451
18576
|
|
|
18452
18577
|
class Paragraph {
|
|
18453
18578
|
constructor(text, newLine, character) {
|
|
18454
|
-
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic"
|
|
18579
|
+
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic";
|
|
18580
|
+
const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
18581
|
+
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
18455
18582
|
const {
|
|
18456
18583
|
ascent: ascent,
|
|
18457
18584
|
height: height,
|
|
@@ -21496,7 +21623,7 @@
|
|
|
21496
21623
|
const t = textAlign;
|
|
21497
21624
|
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
21498
21625
|
}
|
|
21499
|
-
const lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
|
|
21626
|
+
const lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
|
|
21500
21627
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
21501
21628
|
if (!data) return;
|
|
21502
21629
|
const {
|
|
@@ -25137,13 +25264,16 @@
|
|
|
25137
25264
|
background: this._background
|
|
25138
25265
|
});
|
|
25139
25266
|
}
|
|
25267
|
+
preventRender(prevent) {
|
|
25268
|
+
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;
|
|
25269
|
+
}
|
|
25140
25270
|
optmize(params) {
|
|
25141
25271
|
this.optmizeRender(null == params ? void 0 : params.skipRenderWithOutRange);
|
|
25142
25272
|
}
|
|
25143
25273
|
optmizeRender() {
|
|
25144
25274
|
let skipRenderWithOutRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
25145
|
-
skipRenderWithOutRange && (this._skipRender = this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(visible => {
|
|
25146
|
-
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;
|
|
25275
|
+
skipRenderWithOutRange && (this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(visible => {
|
|
25276
|
+
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);
|
|
25147
25277
|
}));
|
|
25148
25278
|
}
|
|
25149
25279
|
getTimeline() {
|
|
@@ -27939,6 +28069,48 @@
|
|
|
27939
28069
|
to: {}
|
|
27940
28070
|
};
|
|
27941
28071
|
}
|
|
28072
|
+
function updateAnimation(prev, next, animationConfig) {
|
|
28073
|
+
if (!isArray$1(animationConfig)) {
|
|
28074
|
+
const {
|
|
28075
|
+
duration: duration,
|
|
28076
|
+
easing: easing,
|
|
28077
|
+
increaseEffect = !0
|
|
28078
|
+
} = animationConfig;
|
|
28079
|
+
return prev.animate().to(next.attribute, duration, easing), void (increaseEffect && playIncreaseCount(prev, next, duration, easing));
|
|
28080
|
+
}
|
|
28081
|
+
animationConfig.forEach((cfg, i) => {
|
|
28082
|
+
const {
|
|
28083
|
+
duration: duration,
|
|
28084
|
+
easing: easing,
|
|
28085
|
+
increaseEffect = !0,
|
|
28086
|
+
channel: channel
|
|
28087
|
+
} = cfg,
|
|
28088
|
+
{
|
|
28089
|
+
from: from,
|
|
28090
|
+
to: to
|
|
28091
|
+
} = update$1(prev, next, channel, cfg.options);
|
|
28092
|
+
isEmpty(to) || prev.animate().to(to, duration, easing), "text" in from && "text" in to && increaseEffect && playIncreaseCount(prev, next, duration, easing);
|
|
28093
|
+
});
|
|
28094
|
+
}
|
|
28095
|
+
const update$1 = (prev, next, channel, options) => {
|
|
28096
|
+
const from = Object.assign({}, prev.attribute),
|
|
28097
|
+
to = Object.assign({}, next.attribute);
|
|
28098
|
+
return array(null == options ? void 0 : options.excludeChannels).forEach(key => {
|
|
28099
|
+
delete to[key];
|
|
28100
|
+
}), Object.keys(to).forEach(key => {
|
|
28101
|
+
channel && !channel.includes(key) && delete to[key];
|
|
28102
|
+
}), {
|
|
28103
|
+
from: from,
|
|
28104
|
+
to: to
|
|
28105
|
+
};
|
|
28106
|
+
};
|
|
28107
|
+
function playIncreaseCount(prev, next, duration, easing) {
|
|
28108
|
+
prev.attribute.text !== next.attribute.text && isValidNumber$1(Number(prev.attribute.text) * Number(next.attribute.text)) && prev.animate().play(new IncreaseCount({
|
|
28109
|
+
text: prev.attribute.text
|
|
28110
|
+
}, {
|
|
28111
|
+
text: next.attribute.text
|
|
28112
|
+
}, duration, easing));
|
|
28113
|
+
}
|
|
27942
28114
|
const DefaultLabelAnimation = {
|
|
27943
28115
|
mode: "same-time",
|
|
27944
28116
|
duration: 300,
|
|
@@ -28116,6 +28288,22 @@
|
|
|
28116
28288
|
}
|
|
28117
28289
|
return points;
|
|
28118
28290
|
};
|
|
28291
|
+
function labelingLineOrArea(textBounds, graphicBounds) {
|
|
28292
|
+
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
28293
|
+
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
28294
|
+
if (!textBounds || !graphicBounds) return;
|
|
28295
|
+
const {
|
|
28296
|
+
x1: x1,
|
|
28297
|
+
x2: x2
|
|
28298
|
+
} = textBounds,
|
|
28299
|
+
width = Math.abs(x2 - x1),
|
|
28300
|
+
anchorX = graphicBounds.x1;
|
|
28301
|
+
let x = anchorX;
|
|
28302
|
+
return "end" === position ? x = anchorX + width / 2 + offset : "start" === position && (x = anchorX - width / 2 - offset), {
|
|
28303
|
+
x: x,
|
|
28304
|
+
y: graphicBounds.y1
|
|
28305
|
+
};
|
|
28306
|
+
}
|
|
28119
28307
|
|
|
28120
28308
|
class LabelBase extends AbstractComponent {
|
|
28121
28309
|
setBitmap(bitmap) {
|
|
@@ -28191,30 +28379,37 @@
|
|
|
28191
28379
|
return this._bindEvent(text), this._setStatesOfText(text), text;
|
|
28192
28380
|
}
|
|
28193
28381
|
_prepare() {
|
|
28194
|
-
var _a, _b, _c, _d;
|
|
28382
|
+
var _a, _b, _c, _d, _e;
|
|
28195
28383
|
const currentBaseMarks = [];
|
|
28196
28384
|
let baseMarks;
|
|
28197
28385
|
if (baseMarks = isFunction$1(this.attribute.getBaseMarks) ? this.attribute.getBaseMarks() : getMarksByName(this.getRootNode(), this.attribute.baseMarkGroupName), baseMarks.forEach(mark => {
|
|
28198
28386
|
"willRelease" !== mark.releaseStatus && currentBaseMarks.push(mark);
|
|
28199
|
-
}), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), null === (_b = this._idToPoint) || void 0 === _b || _b.clear(), this._baseMarks = currentBaseMarks, this._isCollectionBase = "line" ===
|
|
28387
|
+
}), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), null === (_b = this._idToPoint) || void 0 === _b || _b.clear(), this._baseMarks = currentBaseMarks, this._isCollectionBase = "line-data" === this.attribute.type, !currentBaseMarks || 0 === currentBaseMarks.length) return;
|
|
28200
28388
|
const {
|
|
28201
28389
|
data: data
|
|
28202
28390
|
} = this.attribute;
|
|
28203
|
-
if (data && 0 !== data.length)
|
|
28204
|
-
this.
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28391
|
+
if (data && 0 !== data.length) {
|
|
28392
|
+
if (this._idToGraphic || (this._idToGraphic = new Map()), this._isCollectionBase) {
|
|
28393
|
+
this._idToPoint || (this._idToPoint = new Map());
|
|
28394
|
+
let cur = 0;
|
|
28395
|
+
for (let i = 0; i < currentBaseMarks.length; i++) {
|
|
28396
|
+
const baseMark = currentBaseMarks[i],
|
|
28397
|
+
points = getPointsOfLineArea(baseMark);
|
|
28398
|
+
if (null == points ? void 0 : points.length) for (let j = 0; j < points.length; j++) {
|
|
28399
|
+
const textData = data[cur];
|
|
28400
|
+
textData && points[j] && (isValid$1(textData.id) || (textData.id = `vrender-component-${this.name}-${cur}`), this._idToPoint.set(textData.id, points[j]), this._idToGraphic.set(textData.id, baseMark)), cur++;
|
|
28401
|
+
}
|
|
28212
28402
|
}
|
|
28403
|
+
} else for (let i = 0; i < currentBaseMarks.length; i++) {
|
|
28404
|
+
const textData = data[i],
|
|
28405
|
+
baseMark = currentBaseMarks[i];
|
|
28406
|
+
textData && baseMark && (isValid$1(textData.id) || (textData.id = `vrender-component-${this.name}-${i}`), this._idToGraphic.set(textData.id, baseMark));
|
|
28213
28407
|
}
|
|
28214
|
-
|
|
28215
|
-
|
|
28216
|
-
|
|
28217
|
-
|
|
28408
|
+
!1 !== this.attribute.animation && (this._animationConfig = {
|
|
28409
|
+
enter: merge$1({}, DefaultLabelAnimation, this.attribute.animation, null !== (_c = this.attribute.animationEnter) && void 0 !== _c ? _c : {}),
|
|
28410
|
+
exit: merge$1({}, DefaultLabelAnimation, this.attribute.animation, null !== (_d = this.attribute.animationExit) && void 0 !== _d ? _d : {}),
|
|
28411
|
+
update: isArray$1(this.attribute.animationUpdate) ? this.attribute.animationUpdate : merge$1({}, DefaultLabelAnimation, this.attribute.animation, null !== (_e = this.attribute.animationUpdate) && void 0 !== _e ? _e : {})
|
|
28412
|
+
});
|
|
28218
28413
|
}
|
|
28219
28414
|
}
|
|
28220
28415
|
getRelatedGrphic(item) {
|
|
@@ -28343,13 +28538,7 @@
|
|
|
28343
28538
|
!1 === this._enableAnimation || !1 === this.attribute.animation ? this._renderWithOutAnimation(labels) : this._renderWithAnimation(labels);
|
|
28344
28539
|
}
|
|
28345
28540
|
_renderWithAnimation(labels) {
|
|
28346
|
-
|
|
28347
|
-
const animationConfig = null !== (_a = this.attribute.animation) && void 0 !== _a ? _a : {},
|
|
28348
|
-
mode = null !== (_b = animationConfig.mode) && void 0 !== _b ? _b : DefaultLabelAnimation.mode,
|
|
28349
|
-
duration = null !== (_c = animationConfig.duration) && void 0 !== _c ? _c : DefaultLabelAnimation.duration,
|
|
28350
|
-
easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : DefaultLabelAnimation.easing,
|
|
28351
|
-
delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0,
|
|
28352
|
-
currentTextMap = new Map(),
|
|
28541
|
+
const currentTextMap = new Map(),
|
|
28353
28542
|
prevTextMap = this._graphicToText || new Map(),
|
|
28354
28543
|
texts = [];
|
|
28355
28544
|
labels.forEach((text, index) => {
|
|
@@ -28372,32 +28561,26 @@
|
|
|
28372
28561
|
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
28373
28562
|
this.add(text), labelLine && (this._setStatesOfLabelLine(labelLine), this.add(labelLine)), this._syncStateWithRelatedGraphic(relatedGraphic), relatedGraphic.once("animate-bind", a => {
|
|
28374
28563
|
text.setAttributes(from);
|
|
28375
|
-
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic,
|
|
28376
|
-
mode: mode,
|
|
28377
|
-
duration: duration,
|
|
28378
|
-
easing: easing,
|
|
28379
|
-
to: to,
|
|
28380
|
-
delay: delay
|
|
28381
|
-
});
|
|
28564
|
+
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, to, this._animationConfig.enter);
|
|
28382
28565
|
relatedGraphic.on("afterAttributeUpdate", listener);
|
|
28383
28566
|
});
|
|
28384
28567
|
}
|
|
28385
28568
|
} else if ("update" === state) {
|
|
28386
28569
|
const prevLabel = prevTextMap.get(textKey);
|
|
28387
28570
|
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel);
|
|
28388
|
-
const prevText = prevLabel.text
|
|
28389
|
-
|
|
28571
|
+
const prevText = prevLabel.text,
|
|
28572
|
+
{
|
|
28573
|
+
duration: duration,
|
|
28574
|
+
easing: easing
|
|
28575
|
+
} = this._animationConfig.update;
|
|
28576
|
+
updateAnimation(prevText, text, this._animationConfig.update), prevLabel.labelLine && prevLabel.labelLine.animate().to(merge$1({}, prevLabel.labelLine.attribute, {
|
|
28390
28577
|
visible: null === (_f = null !== (_d = (null === (_b = null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.line) || void 0 === _b ? void 0 : _b.visible) && (null === (_c = text.attribute) || void 0 === _c ? void 0 : _c.visible)) && void 0 !== _d ? _d : null === (_e = text.attribute) || void 0 === _e ? void 0 : _e.visible) || void 0 === _f || _f,
|
|
28391
28578
|
points: null === (_g = text.attribute) || void 0 === _g ? void 0 : _g.points
|
|
28392
|
-
}), duration, easing)
|
|
28393
|
-
text: prevText.attribute.text
|
|
28394
|
-
}, {
|
|
28395
|
-
text: text.attribute.text
|
|
28396
|
-
}, duration, easing));
|
|
28579
|
+
}), duration, easing);
|
|
28397
28580
|
}
|
|
28398
28581
|
}), prevTextMap.forEach(label => {
|
|
28399
28582
|
var _a;
|
|
28400
|
-
null === (_a = label.text) || void 0 === _a || _a.animate().to(getAnimationAttributes(label.text.attribute, "fadeOut").to, duration, easing).onEnd(() => {
|
|
28583
|
+
null === (_a = label.text) || void 0 === _a || _a.animate().to(getAnimationAttributes(label.text.attribute, "fadeOut").to, this._animationConfig.exit.duration, this._animationConfig.exit.easing).onEnd(() => {
|
|
28401
28584
|
this.removeChild(label.text), (null == label ? void 0 : label.labelLine) && this.removeChild(label.labelLine);
|
|
28402
28585
|
});
|
|
28403
28586
|
}), this._graphicToText = currentTextMap;
|
|
@@ -28429,12 +28612,11 @@
|
|
|
28429
28612
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
28430
28613
|
this.attribute.syncState && relatedGraphic.on("afterAttributeUpdate", this._handleRelatedGraphicSetState);
|
|
28431
28614
|
}
|
|
28432
|
-
_afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, _ref) {
|
|
28615
|
+
_afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, to, _ref) {
|
|
28433
28616
|
let {
|
|
28434
28617
|
mode: mode,
|
|
28435
28618
|
duration: duration,
|
|
28436
28619
|
easing: easing,
|
|
28437
|
-
to: to,
|
|
28438
28620
|
delay: delay
|
|
28439
28621
|
} = _ref;
|
|
28440
28622
|
const listener = event => {
|
|
@@ -28445,30 +28627,30 @@
|
|
|
28445
28627
|
if (!detail) return {};
|
|
28446
28628
|
if (!(detail && detail.type === AttributeUpdateType.ANIMATE_UPDATE && detail.animationState && "wait" !== (null === (_a = detail.animationState.step) || void 0 === _a ? void 0 : _a.type))) return {};
|
|
28447
28629
|
if (detail.type === AttributeUpdateType.ANIMATE_END) return void text.setAttributes(to);
|
|
28448
|
-
const
|
|
28630
|
+
const onStart = () => {
|
|
28449
28631
|
relatedGraphic && (relatedGraphic.onAnimateBind = void 0, relatedGraphic.removeEventListener("afterAttributeUpdate", listener));
|
|
28450
28632
|
};
|
|
28451
28633
|
switch (mode) {
|
|
28452
28634
|
case "after":
|
|
28453
28635
|
detail.animationState.end && text.animate({
|
|
28454
|
-
|
|
28636
|
+
onStart: onStart
|
|
28455
28637
|
}).wait(delay).to(to, duration, easing);
|
|
28456
28638
|
break;
|
|
28457
28639
|
case "after-all":
|
|
28458
28640
|
index === texts.length - 1 && detail.animationState.end && texts.forEach(t => {
|
|
28459
28641
|
t.animate({
|
|
28460
|
-
|
|
28642
|
+
onStart: onStart
|
|
28461
28643
|
}).wait(delay).to(to, duration, easing);
|
|
28462
28644
|
});
|
|
28463
28645
|
break;
|
|
28464
28646
|
default:
|
|
28465
28647
|
if (this._isCollectionBase) {
|
|
28466
28648
|
const point = this._idToPoint.get(text.attribute.id);
|
|
28467
|
-
!point || text.animates && text.animates.has("label-animate") || !
|
|
28468
|
-
|
|
28649
|
+
!point || text.animates && text.animates.has("label-animate") || !relatedGraphic.containsPoint(point.x, point.y, IContainPointMode.LOCAL, null === (_b = this.stage) || void 0 === _b ? void 0 : _b.pickerService) || text.animate({
|
|
28650
|
+
onStart: onStart
|
|
28469
28651
|
}).wait(delay).to(to, duration, easing);
|
|
28470
28652
|
} else detail.animationState.isFirstFrameOfStep && text.animate({
|
|
28471
|
-
|
|
28653
|
+
onStart: onStart
|
|
28472
28654
|
}).wait(delay).to(to, duration, easing);
|
|
28473
28655
|
}
|
|
28474
28656
|
};
|
|
@@ -28665,6 +28847,45 @@
|
|
|
28665
28847
|
pickable: !1
|
|
28666
28848
|
};
|
|
28667
28849
|
|
|
28850
|
+
class LineLabel extends LabelBase {
|
|
28851
|
+
constructor(attributes) {
|
|
28852
|
+
super(merge$1({}, LineLabel.defaultAttributes, attributes)), this.name = "line-label";
|
|
28853
|
+
}
|
|
28854
|
+
getGraphicBounds(graphic) {
|
|
28855
|
+
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28856
|
+
var _a;
|
|
28857
|
+
if ("line" !== graphic.type) return super.getGraphicBounds(graphic, point);
|
|
28858
|
+
const {
|
|
28859
|
+
position = "end"
|
|
28860
|
+
} = this.attribute,
|
|
28861
|
+
points = (null === (_a = null == graphic ? void 0 : graphic.attribute) || void 0 === _a ? void 0 : _a.points) || [point],
|
|
28862
|
+
index = "start" === position ? 0 : points.length - 1;
|
|
28863
|
+
return {
|
|
28864
|
+
x1: points[index].x,
|
|
28865
|
+
x2: points[index].x,
|
|
28866
|
+
y1: points[index].y,
|
|
28867
|
+
y2: points[index].y
|
|
28868
|
+
};
|
|
28869
|
+
}
|
|
28870
|
+
labeling(textBounds, graphicBounds) {
|
|
28871
|
+
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
28872
|
+
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
28873
|
+
return labelingLineOrArea(textBounds, graphicBounds, position, offset);
|
|
28874
|
+
}
|
|
28875
|
+
}
|
|
28876
|
+
LineLabel.defaultAttributes = {
|
|
28877
|
+
textStyle: {
|
|
28878
|
+
fontSize: 12,
|
|
28879
|
+
fill: "#000",
|
|
28880
|
+
textAlign: "center",
|
|
28881
|
+
textBaseline: "middle",
|
|
28882
|
+
boundsPadding: [-1, 0, -1, 0]
|
|
28883
|
+
},
|
|
28884
|
+
position: "end",
|
|
28885
|
+
offset: 6,
|
|
28886
|
+
pickable: !1
|
|
28887
|
+
};
|
|
28888
|
+
|
|
28668
28889
|
class ArcInfo {
|
|
28669
28890
|
constructor(refDatum, center, outerCenter, quadrant, radian, middleAngle, innerRadius, outerRadius, circleCenter) {
|
|
28670
28891
|
this.refDatum = refDatum, this.center = center, this.outerCenter = outerCenter, this.quadrant = quadrant, this.radian = radian, this.middleAngle = middleAngle, this.innerRadius = innerRadius, this.outerRadius = outerRadius, this.circleCenter = circleCenter, this.labelVisible = !0, this.labelLimit = 0;
|
|
@@ -29219,10 +29440,51 @@
|
|
|
29219
29440
|
pickable: !1
|
|
29220
29441
|
};
|
|
29221
29442
|
|
|
29443
|
+
class AreaLabel extends LabelBase {
|
|
29444
|
+
constructor(attributes) {
|
|
29445
|
+
super(merge$1({}, AreaLabel.defaultAttributes, attributes)), this.name = "line-label";
|
|
29446
|
+
}
|
|
29447
|
+
getGraphicBounds(graphic) {
|
|
29448
|
+
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29449
|
+
var _a;
|
|
29450
|
+
if ("area" !== graphic.type) return super.getGraphicBounds(graphic, point);
|
|
29451
|
+
const {
|
|
29452
|
+
position = "end"
|
|
29453
|
+
} = this.attribute,
|
|
29454
|
+
points = (null === (_a = null == graphic ? void 0 : graphic.attribute) || void 0 === _a ? void 0 : _a.points) || [point],
|
|
29455
|
+
index = "start" === position ? 0 : points.length - 1;
|
|
29456
|
+
return {
|
|
29457
|
+
x1: points[index].x,
|
|
29458
|
+
x2: points[index].x,
|
|
29459
|
+
y1: points[index].y,
|
|
29460
|
+
y2: points[index].y
|
|
29461
|
+
};
|
|
29462
|
+
}
|
|
29463
|
+
labeling(textBounds, graphicBounds) {
|
|
29464
|
+
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
29465
|
+
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
29466
|
+
return labelingLineOrArea(textBounds, graphicBounds, position, offset);
|
|
29467
|
+
}
|
|
29468
|
+
}
|
|
29469
|
+
AreaLabel.defaultAttributes = {
|
|
29470
|
+
textStyle: {
|
|
29471
|
+
fontSize: 12,
|
|
29472
|
+
fill: "#000",
|
|
29473
|
+
textAlign: "center",
|
|
29474
|
+
textBaseline: "middle",
|
|
29475
|
+
boundsPadding: [-1, 0, -1, 0]
|
|
29476
|
+
},
|
|
29477
|
+
position: "end",
|
|
29478
|
+
offset: 6,
|
|
29479
|
+
pickable: !1
|
|
29480
|
+
};
|
|
29481
|
+
|
|
29222
29482
|
const labelComponentMap = {
|
|
29223
29483
|
rect: RectLabel,
|
|
29224
29484
|
symbol: SymbolLabel,
|
|
29225
29485
|
arc: ArcLabel,
|
|
29486
|
+
line: LineLabel,
|
|
29487
|
+
area: AreaLabel,
|
|
29226
29488
|
"line-data": LineDataLabel
|
|
29227
29489
|
};
|
|
29228
29490
|
class DataLabel extends AbstractComponent {
|
|
@@ -29230,6 +29492,7 @@
|
|
|
29230
29492
|
super(merge$1({}, DataLabel.defaultAttributes, attributes)), this.name = "data-label";
|
|
29231
29493
|
}
|
|
29232
29494
|
render() {
|
|
29495
|
+
var _a;
|
|
29233
29496
|
const {
|
|
29234
29497
|
dataLabels: dataLabels,
|
|
29235
29498
|
size: size
|
|
@@ -29250,10 +29513,12 @@
|
|
|
29250
29513
|
labelComponent = labelComponentMap[dataLabel.type] || LabelBase;
|
|
29251
29514
|
if (labelComponent) {
|
|
29252
29515
|
const {
|
|
29253
|
-
|
|
29254
|
-
|
|
29255
|
-
|
|
29256
|
-
|
|
29516
|
+
baseMarkGroupName: baseMarkGroupName,
|
|
29517
|
+
type: type
|
|
29518
|
+
} = dataLabel,
|
|
29519
|
+
id = null !== (_a = dataLabel.id) && void 0 !== _a ? _a : `${baseMarkGroupName}-${type}-${i}`;
|
|
29520
|
+
let component = this._componentMap.get(id);
|
|
29521
|
+
component ? (component.setBitmapTool(tool), component.setBitmap(bitmap), component.setAttributes(dataLabel), currentComponentMap.set(id, component)) : (component = new labelComponent(dataLabel), component.setBitmap(bitmap), component.setBitmapTool(tool), this.add(component), currentComponentMap.set(id, component));
|
|
29257
29522
|
}
|
|
29258
29523
|
}
|
|
29259
29524
|
prevComponentMap.forEach((cp, key) => {
|
|
@@ -31095,10 +31360,6 @@
|
|
|
31095
31360
|
}
|
|
31096
31361
|
mixin(CircleAxisGrid, CircleAxisMixin);
|
|
31097
31362
|
|
|
31098
|
-
var DataZoomActiveTag;
|
|
31099
|
-
!function (DataZoomActiveTag) {
|
|
31100
|
-
DataZoomActiveTag.startHandler = "startHandler", DataZoomActiveTag.endHandler = "endHandler", DataZoomActiveTag.middleHandler = "middleHandler", DataZoomActiveTag.background = "background";
|
|
31101
|
-
}(DataZoomActiveTag || (DataZoomActiveTag = {}));
|
|
31102
31363
|
const DEFAULT_DATA_ZOOM_ATTRIBUTES = {
|
|
31103
31364
|
orient: "bottom",
|
|
31104
31365
|
showDetail: "auto",
|
|
@@ -31197,6 +31458,11 @@
|
|
|
31197
31458
|
}
|
|
31198
31459
|
};
|
|
31199
31460
|
|
|
31461
|
+
var DataZoomActiveTag;
|
|
31462
|
+
!function (DataZoomActiveTag) {
|
|
31463
|
+
DataZoomActiveTag.startHandler = "startHandler", DataZoomActiveTag.endHandler = "endHandler", DataZoomActiveTag.middleHandler = "middleHandler", DataZoomActiveTag.background = "background";
|
|
31464
|
+
}(DataZoomActiveTag || (DataZoomActiveTag = {}));
|
|
31465
|
+
|
|
31200
31466
|
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
31201
31467
|
var t = {};
|
|
31202
31468
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
@@ -31231,6 +31497,7 @@
|
|
|
31231
31497
|
}, this._statePointToData = state => state, this._onHandlerPointerDown = (e, tag) => {
|
|
31232
31498
|
e.stopPropagation(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandler) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandler) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e), this._activeCache.lastPos = this.eventPosToStagePos(e);
|
|
31233
31499
|
}, this._onHandlerPointerMove = e => {
|
|
31500
|
+
var _a;
|
|
31234
31501
|
e.stopPropagation();
|
|
31235
31502
|
const {
|
|
31236
31503
|
start: startAttr,
|
|
@@ -31248,7 +31515,7 @@
|
|
|
31248
31515
|
start: start,
|
|
31249
31516
|
end: end
|
|
31250
31517
|
} = this.state;
|
|
31251
|
-
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), realTime && this._updateStateCallback
|
|
31518
|
+
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), realTime && (null === (_a = this._updateStateCallback) || void 0 === _a || _a.call(this, start, end, this._activeTag)), this._dispatchChangeEvent(start, end));
|
|
31252
31519
|
};
|
|
31253
31520
|
const {
|
|
31254
31521
|
start: start,
|
|
@@ -31317,6 +31584,7 @@
|
|
|
31317
31584
|
};
|
|
31318
31585
|
}
|
|
31319
31586
|
_onHandlerPointerUp(e) {
|
|
31587
|
+
var _a;
|
|
31320
31588
|
e.preventDefault();
|
|
31321
31589
|
const {
|
|
31322
31590
|
start: start,
|
|
@@ -31328,7 +31596,7 @@
|
|
|
31328
31596
|
const pos = this.eventPosToStagePos(e);
|
|
31329
31597
|
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
31330
31598
|
}
|
|
31331
|
-
this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0), this._updateStateCallback
|
|
31599
|
+
this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0), null === (_a = this._updateStateCallback) || void 0 === _a || _a.call(this, this.state.start, this.state.end, this._activeTag), this._dispatchChangeEvent(this.state.start, this.state.end));
|
|
31332
31600
|
}
|
|
31333
31601
|
_onHandlerPointerEnter(e) {
|
|
31334
31602
|
e.stopPropagation(), this._showText = !0, this.renderText();
|
|
@@ -31720,11 +31988,12 @@
|
|
|
31720
31988
|
changeEvent.manager = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem.manager, this.dispatchEvent(changeEvent);
|
|
31721
31989
|
}
|
|
31722
31990
|
setStartAndEnd(start, end) {
|
|
31991
|
+
var _a;
|
|
31723
31992
|
const {
|
|
31724
31993
|
start: startAttr,
|
|
31725
31994
|
end: endAttr
|
|
31726
31995
|
} = this.attribute;
|
|
31727
|
-
isValid$1(start) && isValid$1(end) && (start !== this.state.start || end !== this.state.end) && (this.state.start = start, this.state.end = end, startAttr === this.state.start && endAttr === this.state.end || (this.setStateAttr(start, end, !0), this._updateStateCallback
|
|
31996
|
+
isValid$1(start) && isValid$1(end) && (start !== this.state.start || end !== this.state.end) && (this.state.start = start, this.state.end = end, startAttr === this.state.start && endAttr === this.state.end || (this.setStateAttr(start, end, !0), null === (_a = this._updateStateCallback) || void 0 === _a || _a.call(this, start, end, this._activeTag), this._dispatchChangeEvent(start, end)));
|
|
31728
31997
|
}
|
|
31729
31998
|
setPreviewData(data) {
|
|
31730
31999
|
this._previewData = data;
|
|
@@ -32689,22 +32958,14 @@
|
|
|
32689
32958
|
const target = e.target;
|
|
32690
32959
|
if (null === (_a = null == target ? void 0 : target.name) || void 0 === _a ? void 0 : _a.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
32691
32960
|
const legendItem = target.delegate;
|
|
32692
|
-
|
|
32693
|
-
|
|
32694
|
-
|
|
32695
|
-
|
|
32961
|
+
if (this._lastActiveItem) {
|
|
32962
|
+
if (this._lastActiveItem.id === legendItem.id) return;
|
|
32963
|
+
this._unHover(this._lastActiveItem, e);
|
|
32964
|
+
}
|
|
32965
|
+
this._hover(legendItem, e);
|
|
32966
|
+
} else this._lastActiveItem && (this._unHover(this._lastActiveItem, e), this._lastActiveItem = null);
|
|
32696
32967
|
}, this._onUnHover = e => {
|
|
32697
|
-
|
|
32698
|
-
const target = e.target;
|
|
32699
|
-
if (null === (_a = null == target ? void 0 : target.name) || void 0 === _a ? void 0 : _a.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
32700
|
-
const legendItem = target.delegate;
|
|
32701
|
-
let attributeUpdate = !1;
|
|
32702
|
-
(legendItem.hasState(LegendStateValue.unSelectedHover) || legendItem.hasState(LegendStateValue.selectedHover)) && (attributeUpdate = !0), legendItem.removeState(LegendStateValue.unSelectedHover), legendItem.removeState(LegendStateValue.selectedHover), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
32703
|
-
attributeUpdate || !child.hasState(LegendStateValue.unSelectedHover) && !child.hasState(LegendStateValue.selectedHover) || (attributeUpdate = !0), child.removeState(LegendStateValue.unSelectedHover), child.removeState(LegendStateValue.selectedHover);
|
|
32704
|
-
});
|
|
32705
|
-
const focusButton = legendItem.getChildren()[0].find(node => node.name === LEGEND_ELEMENT_NAME.focus, !1);
|
|
32706
|
-
focusButton && focusButton.setAttribute("visible", !1), attributeUpdate && this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e), this._dispatchEvent(LegendEvent.legendItemUnHover, legendItem, e);
|
|
32707
|
-
}
|
|
32968
|
+
this._lastActiveItem && (this._unHover(this._lastActiveItem, e), this._lastActiveItem = null);
|
|
32708
32969
|
}, this._onClick = e => {
|
|
32709
32970
|
var _a, _b, _c, _d, _e;
|
|
32710
32971
|
const target = e.target;
|
|
@@ -32806,7 +33067,7 @@
|
|
|
32806
33067
|
hover = !0,
|
|
32807
33068
|
select = !0
|
|
32808
33069
|
} = this.attribute;
|
|
32809
|
-
hover && (this._itemsContainer.addEventListener("pointermove", this._onHover), this._itemsContainer.addEventListener("
|
|
33070
|
+
hover && (this._itemsContainer.addEventListener("pointermove", this._onHover), this._itemsContainer.addEventListener("pointerleave", this._onUnHover)), select && this._itemsContainer.addEventListener("pointerdown", this._onClick);
|
|
32810
33071
|
}
|
|
32811
33072
|
_renderEachItem(item, isSelected, index, items) {
|
|
32812
33073
|
const {
|
|
@@ -32836,7 +33097,7 @@
|
|
|
32836
33097
|
}), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = createGroup(Object.assign({
|
|
32837
33098
|
x: 0,
|
|
32838
33099
|
y: 0
|
|
32839
|
-
}, null == background ? void 0 : background.style)), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, null == background ? void 0 : background.state)), itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);
|
|
33100
|
+
}, null == background ? void 0 : background.style)), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, null == background ? void 0 : background.state)), itemGroup.id = `${null != id ? id : label}-${index}`, itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);
|
|
32840
33101
|
const innerGroup = createGroup({
|
|
32841
33102
|
x: 0,
|
|
32842
33103
|
y: 0,
|
|
@@ -33010,6 +33271,20 @@
|
|
|
33010
33271
|
};
|
|
33011
33272
|
return this._pager.addEventListener("toPrev", onPaging), this._pager.addEventListener("toNext", onPaging), !0;
|
|
33012
33273
|
}
|
|
33274
|
+
_hover(legendItem, e) {
|
|
33275
|
+
this._lastActiveItem = legendItem;
|
|
33276
|
+
legendItem.hasState(LegendStateValue.selected) ? this._setLegendItemState(legendItem, LegendStateValue.selectedHover, e) : this._setLegendItemState(legendItem, LegendStateValue.unSelectedHover, e);
|
|
33277
|
+
const focusButton = legendItem.getChildren()[0].find(node => node.name === LEGEND_ELEMENT_NAME.focus, !1);
|
|
33278
|
+
focusButton && focusButton.setAttribute("visible", !0), this._dispatchEvent(LegendEvent.legendItemHover, legendItem, e);
|
|
33279
|
+
}
|
|
33280
|
+
_unHover(legendItem, e) {
|
|
33281
|
+
let attributeUpdate = !1;
|
|
33282
|
+
(legendItem.hasState(LegendStateValue.unSelectedHover) || legendItem.hasState(LegendStateValue.selectedHover)) && (attributeUpdate = !0), legendItem.removeState(LegendStateValue.unSelectedHover), legendItem.removeState(LegendStateValue.selectedHover), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
33283
|
+
attributeUpdate || !child.hasState(LegendStateValue.unSelectedHover) && !child.hasState(LegendStateValue.selectedHover) || (attributeUpdate = !0), child.removeState(LegendStateValue.unSelectedHover), child.removeState(LegendStateValue.selectedHover);
|
|
33284
|
+
});
|
|
33285
|
+
const focusButton = legendItem.getChildren()[0].find(node => node.name === LEGEND_ELEMENT_NAME.focus, !1);
|
|
33286
|
+
focusButton && focusButton.setAttribute("visible", !1), attributeUpdate && this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e), this._dispatchEvent(LegendEvent.legendItemUnHover, legendItem, e);
|
|
33287
|
+
}
|
|
33013
33288
|
_setLegendItemState(legendItem, stateName, e) {
|
|
33014
33289
|
let attributeUpdate = !1;
|
|
33015
33290
|
legendItem.hasState(stateName) || (attributeUpdate = !0), legendItem.addState(stateName, true), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
@@ -33209,20 +33484,97 @@
|
|
|
33209
33484
|
}
|
|
33210
33485
|
}
|
|
33211
33486
|
|
|
33487
|
+
function identity(x) {
|
|
33488
|
+
return x;
|
|
33489
|
+
}
|
|
33490
|
+
const generatePow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
|
|
33491
|
+
const sqrt$1 = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
|
|
33492
|
+
const square$1 = x => x < 0 ? -x * x : x * x;
|
|
33493
|
+
const logNegative = x => -Math.log(-x);
|
|
33494
|
+
const expNegative = x => -Math.exp(-x);
|
|
33495
|
+
const pow10 = x => isFinite(x) ? Math.pow(10, x) : x < 0 ? 0 : x;
|
|
33496
|
+
const powp = base => 10 === base ? pow10 : base === Math.E ? Math.exp : x => Math.pow(base, x);
|
|
33497
|
+
const logp = base => base === Math.E ? Math.log : 10 === base ? Math.log10 : 2 === base ? Math.log2 : (base = Math.log(base), x => Math.log(x) / base);
|
|
33498
|
+
const symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));
|
|
33499
|
+
const symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;
|
|
33500
|
+
function normalize(a, b) {
|
|
33501
|
+
if (a = Number(a), b = Number(b), b -= a) return x => (x - a) / b;
|
|
33502
|
+
const result = Number.isNaN(b) ? NaN : .5;
|
|
33503
|
+
return () => result;
|
|
33504
|
+
}
|
|
33505
|
+
function bimap(domain, range, interpolate) {
|
|
33506
|
+
const d0 = domain[0],
|
|
33507
|
+
d1 = domain[1],
|
|
33508
|
+
r0 = range[0],
|
|
33509
|
+
r1 = range[1];
|
|
33510
|
+
let d0Fuc, r0Fuc;
|
|
33511
|
+
return d1 < d0 ? (d0Fuc = normalize(d1, d0), r0Fuc = interpolate(r1, r0)) : (d0Fuc = normalize(d0, d1), r0Fuc = interpolate(r0, r1)), x => r0Fuc(d0Fuc(x));
|
|
33512
|
+
}
|
|
33513
|
+
function bandSpace$1(count, paddingInner, paddingOuter) {
|
|
33514
|
+
let space;
|
|
33515
|
+
return space = 1 === count ? count + 2 * paddingOuter : count - paddingInner + 2 * paddingOuter, count ? space > 0 ? space : 1 : 0;
|
|
33516
|
+
}
|
|
33517
|
+
function scaleWholeRangeSize$1(count, bandwidth, paddingInner, paddingOuter) {
|
|
33518
|
+
return bandSpace$1(count, paddingInner, paddingOuter) * (bandwidth / (1 - paddingInner));
|
|
33519
|
+
}
|
|
33520
|
+
function calculateBandwidthFromWholeRangeSize(count, wholeSize, paddingInner, paddingOuter, round) {
|
|
33521
|
+
const space = bandSpace$1(count, paddingInner, paddingOuter);
|
|
33522
|
+
let step = wholeSize / Math.max(1, space || 1);
|
|
33523
|
+
round && (step = Math.floor(step));
|
|
33524
|
+
let bandwidth = step * (1 - paddingInner);
|
|
33525
|
+
return round && (bandwidth = Math.round(bandwidth)), bandwidth;
|
|
33526
|
+
}
|
|
33527
|
+
function calculateWholeRangeFromRangeFactor(range, rangeFactor) {
|
|
33528
|
+
const k = (range[1] - range[0]) / (rangeFactor[1] - rangeFactor[0]),
|
|
33529
|
+
b = range[0] - k * rangeFactor[0];
|
|
33530
|
+
return [b, k + b];
|
|
33531
|
+
}
|
|
33532
|
+
function polymap(domain, range, interpolate) {
|
|
33533
|
+
const j = Math.min(domain.length, range.length) - 1,
|
|
33534
|
+
d = new Array(j),
|
|
33535
|
+
r = new Array(j);
|
|
33536
|
+
let i = -1;
|
|
33537
|
+
for (domain[j] < domain[0] && (domain = domain.slice().reverse(), range = range.slice().reverse()); ++i < j;) d[i] = normalize(domain[i], domain[i + 1]), r[i] = interpolate(range[i], range[i + 1]);
|
|
33538
|
+
return function (x) {
|
|
33539
|
+
const i = bisect(domain, x, 1, j) - 1;
|
|
33540
|
+
return r[i](d[i](x));
|
|
33541
|
+
};
|
|
33542
|
+
}
|
|
33543
|
+
const nice = (domain, options) => {
|
|
33544
|
+
const newDomain = domain.slice();
|
|
33545
|
+
let startIndex = 0,
|
|
33546
|
+
endIndex = newDomain.length - 1,
|
|
33547
|
+
x0 = newDomain[startIndex],
|
|
33548
|
+
x1 = newDomain[endIndex];
|
|
33549
|
+
return x1 < x0 && ([startIndex, endIndex] = [endIndex, startIndex], [x0, x1] = [x1, x0]), newDomain[startIndex] = options.floor(x0), newDomain[endIndex] = options.ceil(x1), newDomain;
|
|
33550
|
+
};
|
|
33551
|
+
const niceNumber = function (value) {
|
|
33552
|
+
let round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
33553
|
+
const exponent = Math.floor(Math.log10(value)),
|
|
33554
|
+
fraction = value / Math.pow(10, exponent);
|
|
33555
|
+
let niceFraction;
|
|
33556
|
+
return niceFraction = round ? fraction < 1.5 ? 1 : fraction < 3 ? 2 : fraction < 7 ? 5 : 10 : fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10, niceFraction * Math.pow(10, exponent);
|
|
33557
|
+
};
|
|
33558
|
+
const restrictNumber = (value, domain) => {
|
|
33559
|
+
let min, max;
|
|
33560
|
+
return domain[0] < domain[1] ? (min = domain[0], max = domain[1]) : (min = domain[1], max = domain[0]), Math.min(Math.max(value, min), max);
|
|
33561
|
+
};
|
|
33562
|
+
|
|
33212
33563
|
class BaseScale {
|
|
33564
|
+
constructor() {
|
|
33565
|
+
this._rangeFactorStart = null, this._rangeFactorEnd = null;
|
|
33566
|
+
}
|
|
33213
33567
|
_calculateWholeRange(range) {
|
|
33214
|
-
|
|
33215
|
-
if (this._rangeFactor && 2 === range.length) {
|
|
33216
|
-
const k = (range[1] - range[0]) / (this._rangeFactor[1] - this._rangeFactor[0]),
|
|
33217
|
-
b = range[0] - k * this._rangeFactor[0],
|
|
33218
|
-
r0 = b,
|
|
33219
|
-
r1 = k + b;
|
|
33220
|
-
return this._wholeRange = [r0, r1], this._wholeRange;
|
|
33221
|
-
}
|
|
33222
|
-
return range;
|
|
33568
|
+
return this._wholeRange ? this._wholeRange : isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && 2 === range.length ? (this._wholeRange = calculateWholeRangeFromRangeFactor(range, [this._rangeFactorStart, this._rangeFactorEnd]), this._wholeRange) : range;
|
|
33223
33569
|
}
|
|
33224
33570
|
rangeFactor(_, slience, clear) {
|
|
33225
|
-
return _ ? (2 === _.length && _.every(r => r >= 0 && r <= 1) && (this._wholeRange = null,
|
|
33571
|
+
return _ ? (2 === _.length && _.every(r => r >= 0 && r <= 1) && (this._wholeRange = null, 0 === _[0] && 1 === _[1] ? (this._rangeFactorStart = null, this._rangeFactorEnd = null) : (this._rangeFactorStart = _[0], this._rangeFactorEnd = _[1])), this) : clear ? (this._wholeRange = null, this._rangeFactorStart = null, this._rangeFactorEnd = null, this) : isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) ? [this._rangeFactorStart, this._rangeFactorEnd] : null;
|
|
33572
|
+
}
|
|
33573
|
+
rangeFactorStart(_, slience) {
|
|
33574
|
+
return _ ? (_ >= 0 && _ <= 1 && (this._wholeRange = null, 0 !== _ || !isNil$1(this._rangeFactorEnd) && 1 !== this._rangeFactorEnd ? this._rangeFactorStart = _ : (this._rangeFactorStart = null, this._rangeFactorEnd = null)), this) : this._rangeFactorStart;
|
|
33575
|
+
}
|
|
33576
|
+
rangeFactorEnd(_, slience) {
|
|
33577
|
+
return _ ? (_ >= 0 && _ <= 1 && (this._wholeRange = null, 0 !== _ || !isNil$1(this._rangeFactorStart) && 0 !== this._rangeFactorStart ? this._rangeFactorEnd = _ : (this._rangeFactorStart = null, this._rangeFactorEnd = null)), this) : this._rangeFactorEnd;
|
|
33226
33578
|
}
|
|
33227
33579
|
generateFishEyeTransform() {
|
|
33228
33580
|
var _a;
|
|
@@ -33271,7 +33623,7 @@
|
|
|
33271
33623
|
return new OrdinalScale().domain(this._domain).range(this._ordinalRange).unknown(this._unknown);
|
|
33272
33624
|
}
|
|
33273
33625
|
calculateVisibleDomain(range) {
|
|
33274
|
-
if (this.
|
|
33626
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && 2 === range.length) {
|
|
33275
33627
|
return [this.invert(range[0]), this.invert(range[1])];
|
|
33276
33628
|
}
|
|
33277
33629
|
return this._domain;
|
|
@@ -33309,77 +33661,6 @@
|
|
|
33309
33661
|
}
|
|
33310
33662
|
}
|
|
33311
33663
|
|
|
33312
|
-
function identity(x) {
|
|
33313
|
-
return x;
|
|
33314
|
-
}
|
|
33315
|
-
const generatePow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
|
|
33316
|
-
const sqrt$1 = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
|
|
33317
|
-
const square$1 = x => x < 0 ? -x * x : x * x;
|
|
33318
|
-
const logNegative = x => -Math.log(-x);
|
|
33319
|
-
const expNegative = x => -Math.exp(-x);
|
|
33320
|
-
const pow10 = x => isFinite(x) ? Math.pow(10, x) : x < 0 ? 0 : x;
|
|
33321
|
-
const powp = base => 10 === base ? pow10 : base === Math.E ? Math.exp : x => Math.pow(base, x);
|
|
33322
|
-
const logp = base => base === Math.E ? Math.log : 10 === base ? Math.log10 : 2 === base ? Math.log2 : (base = Math.log(base), x => Math.log(x) / base);
|
|
33323
|
-
const symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));
|
|
33324
|
-
const symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;
|
|
33325
|
-
function normalize(a, b) {
|
|
33326
|
-
if (a = Number(a), b = Number(b), b -= a) return x => (x - a) / b;
|
|
33327
|
-
const result = Number.isNaN(b) ? NaN : .5;
|
|
33328
|
-
return () => result;
|
|
33329
|
-
}
|
|
33330
|
-
function bimap(domain, range, interpolate) {
|
|
33331
|
-
const d0 = domain[0],
|
|
33332
|
-
d1 = domain[1],
|
|
33333
|
-
r0 = range[0],
|
|
33334
|
-
r1 = range[1];
|
|
33335
|
-
let d0Fuc, r0Fuc;
|
|
33336
|
-
return d1 < d0 ? (d0Fuc = normalize(d1, d0), r0Fuc = interpolate(r1, r0)) : (d0Fuc = normalize(d0, d1), r0Fuc = interpolate(r0, r1)), x => r0Fuc(d0Fuc(x));
|
|
33337
|
-
}
|
|
33338
|
-
function bandSpace$1(count, paddingInner, paddingOuter) {
|
|
33339
|
-
let space;
|
|
33340
|
-
return space = 1 === count ? count + 2 * paddingOuter : count - paddingInner + 2 * paddingOuter, count ? space > 0 ? space : 1 : 0;
|
|
33341
|
-
}
|
|
33342
|
-
function scaleWholeRangeSize$1(count, bandwidth, paddingInner, paddingOuter) {
|
|
33343
|
-
return bandSpace$1(count, paddingInner, paddingOuter) * (bandwidth / (1 - paddingInner));
|
|
33344
|
-
}
|
|
33345
|
-
function calculateBandwidthFromWholeRangeSize(count, wholeSize, paddingInner, paddingOuter, round) {
|
|
33346
|
-
const space = bandSpace$1(count, paddingInner, paddingOuter);
|
|
33347
|
-
let step = wholeSize / Math.max(1, space || 1);
|
|
33348
|
-
round && (step = Math.floor(step));
|
|
33349
|
-
let bandwidth = step * (1 - paddingInner);
|
|
33350
|
-
return round && (bandwidth = Math.round(bandwidth)), bandwidth;
|
|
33351
|
-
}
|
|
33352
|
-
function polymap(domain, range, interpolate) {
|
|
33353
|
-
const j = Math.min(domain.length, range.length) - 1,
|
|
33354
|
-
d = new Array(j),
|
|
33355
|
-
r = new Array(j);
|
|
33356
|
-
let i = -1;
|
|
33357
|
-
for (domain[j] < domain[0] && (domain = domain.slice().reverse(), range = range.slice().reverse()); ++i < j;) d[i] = normalize(domain[i], domain[i + 1]), r[i] = interpolate(range[i], range[i + 1]);
|
|
33358
|
-
return function (x) {
|
|
33359
|
-
const i = bisect(domain, x, 1, j) - 1;
|
|
33360
|
-
return r[i](d[i](x));
|
|
33361
|
-
};
|
|
33362
|
-
}
|
|
33363
|
-
const nice = (domain, options) => {
|
|
33364
|
-
const newDomain = domain.slice();
|
|
33365
|
-
let startIndex = 0,
|
|
33366
|
-
endIndex = newDomain.length - 1,
|
|
33367
|
-
x0 = newDomain[startIndex],
|
|
33368
|
-
x1 = newDomain[endIndex];
|
|
33369
|
-
return x1 < x0 && ([startIndex, endIndex] = [endIndex, startIndex], [x0, x1] = [x1, x0]), newDomain[startIndex] = options.floor(x0), newDomain[endIndex] = options.ceil(x1), newDomain;
|
|
33370
|
-
};
|
|
33371
|
-
const niceNumber = function (value) {
|
|
33372
|
-
let round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
33373
|
-
const exponent = Math.floor(Math.log10(value)),
|
|
33374
|
-
fraction = value / Math.pow(10, exponent);
|
|
33375
|
-
let niceFraction;
|
|
33376
|
-
return niceFraction = round ? fraction < 1.5 ? 1 : fraction < 3 ? 2 : fraction < 7 ? 5 : 10 : fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10, niceFraction * Math.pow(10, exponent);
|
|
33377
|
-
};
|
|
33378
|
-
const restrictNumber = (value, domain) => {
|
|
33379
|
-
let min, max;
|
|
33380
|
-
return domain[0] < domain[1] ? (min = domain[0], max = domain[1]) : (min = domain[1], max = domain[0]), Math.min(Math.max(value, min), max);
|
|
33381
|
-
};
|
|
33382
|
-
|
|
33383
33664
|
function ticks$2(start, stop, count, allowExcessive) {
|
|
33384
33665
|
let reverse;
|
|
33385
33666
|
const ticks = [];
|
|
@@ -33412,10 +33693,10 @@
|
|
|
33412
33693
|
constructor(slience) {
|
|
33413
33694
|
super(), this.type = ScaleEnum.Band, this._range = [0, 1], this._step = void 0, this._bandwidth = void 0, this._isFixed = !1, this._round = !1, this._paddingInner = 0, this._paddingOuter = 0, this._align = .5, this._unknown = void 0, delete this.unknown, this.rescale(slience);
|
|
33414
33695
|
}
|
|
33415
|
-
rescale(slience) {
|
|
33696
|
+
rescale(slience, changeProperty) {
|
|
33416
33697
|
if (slience) return this;
|
|
33417
33698
|
this._wholeRange = null;
|
|
33418
|
-
const wholeRange = this._calculateWholeRange(this._range),
|
|
33699
|
+
const wholeRange = this._calculateWholeRange(this._range, changeProperty),
|
|
33419
33700
|
n = super.domain().length,
|
|
33420
33701
|
reverse = wholeRange[1] < wholeRange[0];
|
|
33421
33702
|
let start = wholeRange[Number(reverse) - 0];
|
|
@@ -33425,22 +33706,25 @@
|
|
|
33425
33706
|
const values = range(n).map(i => start + this._step * i);
|
|
33426
33707
|
return super.range(reverse ? values.reverse() : values), this.generateFishEyeTransform(), this;
|
|
33427
33708
|
}
|
|
33428
|
-
_calculateWholeRange(range) {
|
|
33429
|
-
var _a;
|
|
33709
|
+
_calculateWholeRange(range, changeProperty) {
|
|
33430
33710
|
if (this._wholeRange) return this._wholeRange;
|
|
33431
33711
|
if ((this._minBandwidth || this._maxBandwidth) && !this._isBandwidthFixedByUser()) {
|
|
33432
|
-
|
|
33712
|
+
let wholeSize;
|
|
33713
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && 2 === range.length) {
|
|
33714
|
+
const wholeRange = calculateWholeRangeFromRangeFactor(range, [this._rangeFactorStart, this._rangeFactorEnd]);
|
|
33715
|
+
wholeSize = Math.abs(wholeRange[1] - wholeRange[0]);
|
|
33716
|
+
} else wholeSize = Math.abs(range[1] - range[0]);
|
|
33717
|
+
const autoBandwidth = calculateBandwidthFromWholeRangeSize(super.domain().length, wholeSize, this._paddingInner, this._paddingOuter, this._round);
|
|
33433
33718
|
autoBandwidth < this._minBandwidth ? (this._bandwidth = this._minBandwidth, this._isFixed = !0) : autoBandwidth > this._maxBandwidth ? (this._bandwidth = this._maxBandwidth, this._isFixed = !0) : (this._bandwidth = autoBandwidth, this._isFixed = !1);
|
|
33434
33719
|
}
|
|
33435
33720
|
if (this.isBandwidthFixed()) {
|
|
33436
33721
|
const wholeLength = scaleWholeRangeSize$1(super.domain().length, this._bandwidth, this._paddingInner, this._paddingOuter),
|
|
33437
33722
|
rangeFactorSize = Math.min((range[1] - range[0]) / wholeLength, 1);
|
|
33438
|
-
if (
|
|
33439
|
-
const [
|
|
33440
|
-
r0 = range[0] - wholeLength * rangeFactorStart,
|
|
33723
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd)) {
|
|
33724
|
+
const r0 = range[0] - wholeLength * this._rangeFactorStart,
|
|
33441
33725
|
r1 = r0 + wholeLength;
|
|
33442
|
-
this._wholeRange = [r0, r1], this.
|
|
33443
|
-
} else this.
|
|
33726
|
+
this._wholeRange = [r0, r1], "rangeFactorStart" === changeProperty && this._rangeFactorStart + rangeFactorSize <= 1 ? this._rangeFactorEnd = this._rangeFactorStart + rangeFactorSize : "rangeFactorEnd" === changeProperty && this._rangeFactorEnd - rangeFactorSize >= 0 ? this._rangeFactorStart = this._rangeFactorEnd - rangeFactorSize : this._rangeFactorStart + rangeFactorSize <= 1 ? this._rangeFactorEnd = this._rangeFactorStart + rangeFactorSize : this._rangeFactorEnd - rangeFactorSize >= 0 ? this._rangeFactorStart = this._rangeFactorEnd - rangeFactorSize : (this._rangeFactorStart = 0, this._rangeFactorEnd = rangeFactorSize);
|
|
33727
|
+
} else this._rangeFactorStart = 0, this._rangeFactorEnd = rangeFactorSize, this._wholeRange = [range[0], range[0] + wholeLength];
|
|
33444
33728
|
return this._wholeRange;
|
|
33445
33729
|
}
|
|
33446
33730
|
return super._calculateWholeRange(range);
|
|
@@ -33451,7 +33735,7 @@
|
|
|
33451
33735
|
}
|
|
33452
33736
|
calculateVisibleDomain(range) {
|
|
33453
33737
|
const domain = this._domain;
|
|
33454
|
-
if (this.
|
|
33738
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && domain.length) {
|
|
33455
33739
|
const d0 = this._getInvertIndex(range[0]),
|
|
33456
33740
|
d1 = this._getInvertIndex(range[1]);
|
|
33457
33741
|
return domain.slice(Math.min(d0, d1), Math.max(d0, d1) + 1);
|
|
@@ -33529,6 +33813,12 @@
|
|
|
33529
33813
|
rangeFactor(_, slience) {
|
|
33530
33814
|
return _ ? (super.rangeFactor(_), this.rescale(slience)) : super.rangeFactor();
|
|
33531
33815
|
}
|
|
33816
|
+
rangeFactorStart(_, slience) {
|
|
33817
|
+
return _ ? (super.rangeFactorStart(_), this.rescale(slience, "rangeFactorStart")) : super.rangeFactorStart();
|
|
33818
|
+
}
|
|
33819
|
+
rangeFactorEnd(_, slience) {
|
|
33820
|
+
return _ ? (super.rangeFactorEnd(_), this.rescale(slience, "rangeFactorEnd")) : super.rangeFactorEnd();
|
|
33821
|
+
}
|
|
33532
33822
|
bandwidth(_, slience) {
|
|
33533
33823
|
return _ ? ("auto" === _ ? (this._bandwidth = void 0, this._isFixed = !1) : (this._bandwidth = _, this._isFixed = !0), this._userBandwidth = _, this.rescale(slience)) : this._bandwidth;
|
|
33534
33824
|
}
|
|
@@ -33579,7 +33869,7 @@
|
|
|
33579
33869
|
}
|
|
33580
33870
|
calculateVisibleDomain(range) {
|
|
33581
33871
|
var _a;
|
|
33582
|
-
if (this.
|
|
33872
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && 2 === range.length) {
|
|
33583
33873
|
return [this.invert(range[0]), this.invert(range[1])];
|
|
33584
33874
|
}
|
|
33585
33875
|
return null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain;
|
|
@@ -33860,7 +34150,7 @@
|
|
|
33860
34150
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
33861
34151
|
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
33862
34152
|
var _a;
|
|
33863
|
-
if (this.
|
|
34153
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && (this._rangeFactorStart > 0 || this._rangeFactorEnd < 1) && 2 === this._range.length || !this._niceType) return this.d3Ticks(count, options);
|
|
33864
34154
|
const curNiceDomain = null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain,
|
|
33865
34155
|
originalDomain = this._domain,
|
|
33866
34156
|
start = curNiceDomain[0],
|
|
@@ -33966,7 +34256,7 @@
|
|
|
33966
34256
|
}
|
|
33967
34257
|
2 * z.length < count && (z = ticks$1(u, v, count));
|
|
33968
34258
|
} else z = ticks$1(i, j, Math.min(j - i, count)).map(this._pows);
|
|
33969
|
-
return r ? z.reverse() : z;
|
|
34259
|
+
return z = z.filter(t => 0 !== t), r ? z.reverse() : z;
|
|
33970
34260
|
}
|
|
33971
34261
|
ticks() {
|
|
33972
34262
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
@@ -33994,7 +34284,7 @@
|
|
|
33994
34284
|
} else niceType = "all";
|
|
33995
34285
|
if (niceType) {
|
|
33996
34286
|
const niceDomain = nice(originalDomain.slice(), {
|
|
33997
|
-
floor: x => Math.floor(x),
|
|
34287
|
+
floor: x => this._pows(Math.floor(this._logs(x))),
|
|
33998
34288
|
ceil: x => Math.ceil(x)
|
|
33999
34289
|
});
|
|
34000
34290
|
return "min" === niceType ? niceDomain[niceDomain.length - 1] = null !== (_a = niceMinMax[1]) && void 0 !== _a ? _a : niceDomain[niceDomain.length - 1] : "max" === niceType && (niceDomain[0] = null !== (_b = niceMinMax[0]) && void 0 !== _b ? _b : niceDomain[0]), this._niceDomain = niceDomain, this.rescale(), this;
|
|
@@ -36324,7 +36614,7 @@
|
|
|
36324
36614
|
if (isVisible(itemAttr.shape) && itemGroup.createOrUpdateChild(`${itemGroupName}-shape`, Object.assign({
|
|
36325
36615
|
visible: !0,
|
|
36326
36616
|
x: itemAttr.shape.size / 2,
|
|
36327
|
-
y: itemAttr.shape.size / 2 + ((null !== (_a = itemAttr.key.lineHeight) && void 0 !== _a ? _a : itemAttr.key.fontSize) - itemAttr.shape.size) / 2
|
|
36617
|
+
y: itemAttr.shape.size / 2 + ((null !== (_a = calculateLineHeight(itemAttr.key.lineHeight, itemAttr.key.fontSize)) && void 0 !== _a ? _a : itemAttr.key.fontSize) - itemAttr.shape.size) / 2
|
|
36328
36618
|
}, itemAttr.shape), "symbol"), hasContentShape && (x += itemAttr.shape.size + itemAttr.shape.spacing), isVisible(itemAttr.key)) {
|
|
36329
36619
|
let element;
|
|
36330
36620
|
element = itemAttr.key.multiLine ? itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
@@ -37003,7 +37293,7 @@
|
|
|
37003
37293
|
function moveToHead(array, idx, start, cmp) {
|
|
37004
37294
|
let parent, pidx;
|
|
37005
37295
|
const item = array[idx];
|
|
37006
|
-
for (; idx > start && (pidx = Math.floor((idx - 1) / 2), parent = array[pidx], cmp(item, parent) < 0);) array[idx] = parent, idx = pidx;
|
|
37296
|
+
for (; idx > start && (pidx = Math.floor((idx - 1) / 2), parent = array[pidx], item && parent && cmp(item, parent) < 0);) array[idx] = parent, idx = pidx;
|
|
37007
37297
|
return array[idx] = item;
|
|
37008
37298
|
}
|
|
37009
37299
|
function moveToTail(array, idx, end, cmp) {
|
|
@@ -37170,6 +37460,7 @@
|
|
|
37170
37460
|
}
|
|
37171
37461
|
evaluate() {
|
|
37172
37462
|
return __awaiter$5(this, void 0, void 0, function* () {
|
|
37463
|
+
if (this._isReleased) return;
|
|
37173
37464
|
if (this._beforeRunner && (yield this.asyncCallback(this._beforeRunner)), !this._committed.length) return this.logger.info("Dataflow invoked, but nothing to do."), !1;
|
|
37174
37465
|
this._isRunning = !0, this._updateCounter += 1;
|
|
37175
37466
|
let grammar,
|
|
@@ -37179,14 +37470,14 @@
|
|
|
37179
37470
|
count = 0;
|
|
37180
37471
|
this.logger.canLogInfo() && (dt = Date.now(), this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)), this._beforeEvaluate();
|
|
37181
37472
|
try {
|
|
37182
|
-
for (; this._heap.size() > 0;) if (grammar = this._heap.pop(), grammar.rank === grammar.qrank) {
|
|
37473
|
+
for (; this._heap.size() > 0 && !this._isReleased;) if (grammar = this._heap.pop(), grammar.rank === grammar.qrank) {
|
|
37183
37474
|
if (next = grammar.run(), next && next.then && (next = yield next), !this._isRunning) return !1;
|
|
37184
37475
|
this._logGrammarRunInfo(grammar), this._enqueueTargets(grammar), count += 1;
|
|
37185
37476
|
} else this._enqueue(grammar);
|
|
37186
37477
|
} catch (err) {
|
|
37187
37478
|
this._heap.clear(), error = err;
|
|
37188
37479
|
}
|
|
37189
|
-
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;
|
|
37480
|
+
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);
|
|
37190
37481
|
});
|
|
37191
37482
|
}
|
|
37192
37483
|
evaluateSync() {
|
|
@@ -37208,7 +37499,7 @@
|
|
|
37208
37499
|
this._afterRunner = callback;
|
|
37209
37500
|
}
|
|
37210
37501
|
release() {
|
|
37211
|
-
this.stop(), this._heap && (this._heap.clear(), this._heap = null), this.logger = null, this._committed = null;
|
|
37502
|
+
this.stop(), this._isReleased = !0, this._heap && (this._heap.clear(), this._heap = null), this.logger = null, this._committed = null;
|
|
37212
37503
|
}
|
|
37213
37504
|
}
|
|
37214
37505
|
|
|
@@ -37553,7 +37844,7 @@
|
|
|
37553
37844
|
let scaleX, scaleY;
|
|
37554
37845
|
return nativeCanvas && (scaleX = rect.width / nativeCanvas.offsetWidth, scaleY = rect.height / nativeCanvas.offsetHeight), {
|
|
37555
37846
|
x: (x - rect.left) / (isValidNumber$1(scaleX) ? scaleX : 1),
|
|
37556
|
-
y: (y - rect.top) / (isValidNumber$1(scaleY) ?
|
|
37847
|
+
y: (y - rect.top) / (isValidNumber$1(scaleY) ? scaleY : 1)
|
|
37557
37848
|
};
|
|
37558
37849
|
}
|
|
37559
37850
|
return {
|
|
@@ -39785,7 +40076,7 @@
|
|
|
39785
40076
|
width = data.width, height = data.height;
|
|
39786
40077
|
}
|
|
39787
40078
|
let dpr = params.dpr;
|
|
39788
|
-
if (
|
|
40079
|
+
if (null == dpr) {
|
|
39789
40080
|
dpr = null !== (_a = canvas.getContext("2d").pixelRatio) && void 0 !== _a ? _a : canvas.width / width;
|
|
39790
40081
|
}
|
|
39791
40082
|
this.canvas = new BrowserCanvas({
|
|
@@ -40617,6 +40908,11 @@
|
|
|
40617
40908
|
_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;
|
|
40618
40909
|
}
|
|
40619
40910
|
}
|
|
40911
|
+
measureText(text) {
|
|
40912
|
+
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
40913
|
+
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
40914
|
+
return super.measureText(text, method);
|
|
40915
|
+
}
|
|
40620
40916
|
createPattern(image, repetition) {
|
|
40621
40917
|
return null;
|
|
40622
40918
|
}
|
|
@@ -41498,10 +41794,14 @@
|
|
|
41498
41794
|
toCanvas() {
|
|
41499
41795
|
return this._stage ? this._stage.toCanvas() : null;
|
|
41500
41796
|
}
|
|
41797
|
+
preventRender(tag) {
|
|
41798
|
+
this._stage && this._stage.preventRender(tag);
|
|
41799
|
+
}
|
|
41501
41800
|
release() {
|
|
41801
|
+
var _a;
|
|
41502
41802
|
this._view.traverseMarkTree(mark => {
|
|
41503
41803
|
mark.release();
|
|
41504
|
-
}), 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;
|
|
41804
|
+
}), 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;
|
|
41505
41805
|
}
|
|
41506
41806
|
createStage() {
|
|
41507
41807
|
var _a, _b, _c, _d, _e;
|
|
@@ -43440,8 +43740,8 @@
|
|
|
43440
43740
|
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);
|
|
43441
43741
|
}
|
|
43442
43742
|
getBounds() {
|
|
43443
|
-
var _a, _b, _c
|
|
43444
|
-
return this.graphicItem ? this.graphicItem.AABBBounds : null === (
|
|
43743
|
+
var _a, _b, _c;
|
|
43744
|
+
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;
|
|
43445
43745
|
}
|
|
43446
43746
|
getMorphConfig() {
|
|
43447
43747
|
var _a;
|
|
@@ -45421,6 +45721,11 @@
|
|
|
45421
45721
|
"signal" === grammar.grammarType && BuiltInSignalID.includes(grammar.id()) || "mark" === grammar.grammarType && "root" === grammar.id() || this.removeGrammar(grammar);
|
|
45422
45722
|
}), this;
|
|
45423
45723
|
}
|
|
45724
|
+
removeAllGraphicItems() {
|
|
45725
|
+
return this.traverseMarkTree(mark => {
|
|
45726
|
+
mark.graphicItem && removeGraphicItem(mark.graphicItem), mark.graphicItem = null;
|
|
45727
|
+
}), this;
|
|
45728
|
+
}
|
|
45424
45729
|
parseSpec(spec) {
|
|
45425
45730
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45426
45731
|
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()) {
|
|
@@ -45502,9 +45807,15 @@
|
|
|
45502
45807
|
setCurrentTheme(theme) {
|
|
45503
45808
|
let render = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
45504
45809
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
45505
|
-
|
|
45506
|
-
|
|
45507
|
-
|
|
45810
|
+
if (!this._isReleased) {
|
|
45811
|
+
if (this.theme(theme), this.grammars.getAllMarks().forEach(mark => {
|
|
45812
|
+
mark.commit();
|
|
45813
|
+
}), render) {
|
|
45814
|
+
if (yield this.evaluate(), this._isReleased) return;
|
|
45815
|
+
this.renderer.render(!0);
|
|
45816
|
+
} else yield this._dataflow.evaluate();
|
|
45817
|
+
return this;
|
|
45818
|
+
}
|
|
45508
45819
|
});
|
|
45509
45820
|
}
|
|
45510
45821
|
background(value) {
|
|
@@ -45594,7 +45905,8 @@
|
|
|
45594
45905
|
}
|
|
45595
45906
|
runAsync(runningConfig) {
|
|
45596
45907
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
45597
|
-
|
|
45908
|
+
if (this._isReleased) return;
|
|
45909
|
+
for (; this._running && (yield this._running, !this._isReleased););
|
|
45598
45910
|
const clear = () => {
|
|
45599
45911
|
this._running = null;
|
|
45600
45912
|
};
|
|
@@ -45614,25 +45926,31 @@
|
|
|
45614
45926
|
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);
|
|
45615
45927
|
}
|
|
45616
45928
|
evaluate(runningConfig) {
|
|
45617
|
-
var _a, _b;
|
|
45929
|
+
var _a, _b, _c, _d;
|
|
45618
45930
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
45619
|
-
|
|
45620
|
-
|
|
45621
|
-
|
|
45622
|
-
grammarWillDetach && this.detachCachedGrammar();
|
|
45931
|
+
if (this._isReleased) return;
|
|
45932
|
+
const normalizedRunningConfig = normalizeRunningConfig(runningConfig),
|
|
45933
|
+
grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
45934
|
+
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
45623
45935
|
const hasResize = this._resizeRenderer(),
|
|
45624
45936
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45625
|
-
|
|
45626
|
-
|
|
45627
|
-
|
|
45937
|
+
if (!(grammarWillDetach || hasUpdate || this._layoutState || hasResize)) return this;
|
|
45938
|
+
if (this.clearProgressive(), null === (_a = this.renderer) || void 0 === _a || _a.preventRender(!0), yield this._dataflow.evaluate(), !this._isReleased) {
|
|
45939
|
+
if (this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState) {
|
|
45940
|
+
if (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, yield this._dataflow.evaluate(), this._isReleased)) return;
|
|
45941
|
+
this._layoutState = LayoutState.after, (null === (_b = this._layoutMarks) || void 0 === _b ? void 0 : _b.length) && this.handleLayoutEnd();
|
|
45942
|
+
}
|
|
45943
|
+
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 => {
|
|
45944
|
+
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
45945
|
+
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doPreProgressive(), this;
|
|
45946
|
+
}
|
|
45628
45947
|
});
|
|
45629
45948
|
}
|
|
45630
45949
|
evaluateSync(runningConfig) {
|
|
45631
45950
|
var _a, _b;
|
|
45632
|
-
const normalizedRunningConfig = normalizeRunningConfig(runningConfig)
|
|
45633
|
-
|
|
45634
|
-
|
|
45635
|
-
grammarWillDetach && this.detachCachedGrammar();
|
|
45951
|
+
const normalizedRunningConfig = normalizeRunningConfig(runningConfig),
|
|
45952
|
+
grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
45953
|
+
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
45636
45954
|
const hasResize = this._resizeRenderer(),
|
|
45637
45955
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45638
45956
|
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 => {
|
|
@@ -45908,7 +46226,7 @@
|
|
|
45908
46226
|
}
|
|
45909
46227
|
release() {
|
|
45910
46228
|
var _a, _b, _c;
|
|
45911
|
-
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 => {
|
|
46229
|
+
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 => {
|
|
45912
46230
|
listener.source.removeEventListener(listener.type, listener.handler);
|
|
45913
46231
|
}), this._eventListeners = null;
|
|
45914
46232
|
}
|
|
@@ -48454,7 +48772,7 @@
|
|
|
48454
48772
|
}
|
|
48455
48773
|
};
|
|
48456
48774
|
|
|
48457
|
-
const sankey
|
|
48775
|
+
const sankey = {
|
|
48458
48776
|
link: {
|
|
48459
48777
|
style: {
|
|
48460
48778
|
fillOpacity: 0.15,
|
|
@@ -48531,7 +48849,7 @@
|
|
|
48531
48849
|
rangeColumn,
|
|
48532
48850
|
circlePacking,
|
|
48533
48851
|
heatmap,
|
|
48534
|
-
sankey
|
|
48852
|
+
sankey,
|
|
48535
48853
|
rose,
|
|
48536
48854
|
boxPlot,
|
|
48537
48855
|
correlation: correlation$1
|
|
@@ -52211,6 +52529,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
52211
52529
|
renderAsync(morphConfig) {
|
|
52212
52530
|
var _a;
|
|
52213
52531
|
return __awaiter$h(this, void 0, void 0, function* () {
|
|
52532
|
+
if (this.isReleased) {
|
|
52533
|
+
return;
|
|
52534
|
+
}
|
|
52214
52535
|
this.initView();
|
|
52215
52536
|
if (!this._view) {
|
|
52216
52537
|
return Promise.reject('srView init fail');
|
|
@@ -56034,28 +56355,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56034
56355
|
compileSignal() {
|
|
56035
56356
|
this.state.compile();
|
|
56036
56357
|
}
|
|
56037
|
-
_computeAttribute(key, state) {
|
|
56038
|
-
return (datum, opt) => {
|
|
56039
|
-
return undefined;
|
|
56040
|
-
};
|
|
56041
|
-
}
|
|
56042
56358
|
compileCommonAttributeCallback(key, state) {
|
|
56043
56359
|
const noAttrTransform = !needAttrTransform(this.type, key);
|
|
56044
56360
|
const opt = { mark: null, parent: null, element: null };
|
|
56045
|
-
|
|
56046
|
-
|
|
56047
|
-
|
|
56048
|
-
|
|
56049
|
-
|
|
56050
|
-
|
|
56051
|
-
|
|
56052
|
-
|
|
56053
|
-
|
|
56054
|
-
opt.mark = element.mark;
|
|
56055
|
-
opt.parent = element.mark.group;
|
|
56056
|
-
opt.element = element;
|
|
56057
|
-
return attrTransform(this.type, key, attrFunctor(datum, opt));
|
|
56058
|
-
};
|
|
56361
|
+
return (datum, element) => {
|
|
56362
|
+
opt.mark = element.mark;
|
|
56363
|
+
opt.parent = element.mark.group;
|
|
56364
|
+
opt.element = element;
|
|
56365
|
+
if (noAttrTransform) {
|
|
56366
|
+
return this.getAttribute(key, datum, state, opt);
|
|
56367
|
+
}
|
|
56368
|
+
return attrTransform(this.type, key, this.getAttribute(key, datum, state, opt));
|
|
56369
|
+
};
|
|
56059
56370
|
}
|
|
56060
56371
|
compileTransform() {
|
|
56061
56372
|
var _a;
|
|
@@ -56219,7 +56530,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56219
56530
|
}
|
|
56220
56531
|
}
|
|
56221
56532
|
getAttribute(key, datum, state = 'normal', opt) {
|
|
56222
|
-
return this._computeAttribute(key,
|
|
56533
|
+
return this._computeAttribute(key, datum, state, opt);
|
|
56223
56534
|
}
|
|
56224
56535
|
setAttribute(attr, style, state = 'normal', level = 0, stateStyle = this.stateStyle) {
|
|
56225
56536
|
var _a;
|
|
@@ -56273,60 +56584,42 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56273
56584
|
}
|
|
56274
56585
|
return style;
|
|
56275
56586
|
}
|
|
56276
|
-
_computeAttribute(key, state) {
|
|
56587
|
+
_computeAttribute(key, datum, state, opt) {
|
|
56277
56588
|
var _a;
|
|
56278
56589
|
let stateStyle = (_a = this.stateStyle[state]) === null || _a === void 0 ? void 0 : _a[key];
|
|
56279
56590
|
if (!stateStyle) {
|
|
56280
56591
|
stateStyle = this.stateStyle.normal[key];
|
|
56281
56592
|
}
|
|
56282
|
-
|
|
56283
|
-
|
|
56284
|
-
|
|
56285
|
-
if (hasPostProcess && hasExCompute) {
|
|
56286
|
-
const exCompute = this._computeExChannel[key];
|
|
56287
|
-
return (datum, opt) => {
|
|
56288
|
-
let baseValue = baseValueFunctor(datum, opt);
|
|
56289
|
-
baseValue = stateStyle.postProcess(baseValue, datum, this._attributeContext, opt, this.getDataView());
|
|
56290
|
-
return exCompute(key, datum, state, opt, baseValue);
|
|
56291
|
-
};
|
|
56593
|
+
let baseValue = this._computeStateAttribute(stateStyle, key, datum, state, opt);
|
|
56594
|
+
if (isFunction$1(stateStyle === null || stateStyle === void 0 ? void 0 : stateStyle.postProcess)) {
|
|
56595
|
+
baseValue = stateStyle.postProcess(baseValue, datum, this._attributeContext, opt, this.getDataView());
|
|
56292
56596
|
}
|
|
56293
|
-
|
|
56294
|
-
return (datum, opt)
|
|
56295
|
-
return stateStyle.postProcess(baseValueFunctor(datum, opt), datum, this._attributeContext, opt, this.getDataView());
|
|
56296
|
-
};
|
|
56297
|
-
}
|
|
56298
|
-
else if (hasExCompute) {
|
|
56299
|
-
const exCompute = this._computeExChannel[key];
|
|
56300
|
-
return (datum, opt) => {
|
|
56301
|
-
return exCompute(key, datum, state, opt, baseValueFunctor(datum, opt));
|
|
56302
|
-
};
|
|
56597
|
+
if (key in this._computeExChannel) {
|
|
56598
|
+
return this._computeExChannel[key](key, datum, state, opt, baseValue);
|
|
56303
56599
|
}
|
|
56304
|
-
return
|
|
56600
|
+
return baseValue;
|
|
56305
56601
|
}
|
|
56306
|
-
_computeStateAttribute(stateStyle, key, state) {
|
|
56602
|
+
_computeStateAttribute(stateStyle, key, datum, state, opt) {
|
|
56307
56603
|
var _a;
|
|
56308
56604
|
if (!stateStyle) {
|
|
56309
|
-
return
|
|
56605
|
+
return undefined;
|
|
56310
56606
|
}
|
|
56311
56607
|
if (stateStyle.referer) {
|
|
56312
|
-
return stateStyle.referer.
|
|
56608
|
+
return stateStyle.referer.getAttribute(key, datum, state, opt);
|
|
56609
|
+
}
|
|
56610
|
+
if (typeof stateStyle.style === 'function') {
|
|
56611
|
+
return stateStyle.style(datum, this._attributeContext, opt, this.getDataView());
|
|
56313
56612
|
}
|
|
56314
56613
|
if (GradientType.includes(stateStyle.style.gradient)) {
|
|
56315
|
-
return this._computeGradientAttr(stateStyle.style);
|
|
56614
|
+
return this._computeGradientAttr(stateStyle.style, datum, opt);
|
|
56316
56615
|
}
|
|
56317
56616
|
if (['outerBorder', 'innerBorder'].includes(key)) {
|
|
56318
|
-
return this._computeBorderAttr(stateStyle.style);
|
|
56617
|
+
return this._computeBorderAttr(stateStyle.style, datum, opt);
|
|
56319
56618
|
}
|
|
56320
56619
|
if (isValidScaleType((_a = stateStyle.style.scale) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
56321
|
-
return
|
|
56620
|
+
return stateStyle.style.scale.scale(datum[stateStyle.style.field]);
|
|
56322
56621
|
}
|
|
56323
|
-
return
|
|
56324
|
-
var _a;
|
|
56325
|
-
if (typeof stateStyle.style === 'function') {
|
|
56326
|
-
return (_a = stateStyle.style) === null || _a === void 0 ? void 0 : _a.call(stateStyle, datum, this._attributeContext, opt, this.getDataView());
|
|
56327
|
-
}
|
|
56328
|
-
return stateStyle.style;
|
|
56329
|
-
};
|
|
56622
|
+
return stateStyle.style;
|
|
56330
56623
|
}
|
|
56331
56624
|
_initStyle() {
|
|
56332
56625
|
const defaultStyle = this._getDefaultStyle();
|
|
@@ -56363,7 +56656,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56363
56656
|
});
|
|
56364
56657
|
}
|
|
56365
56658
|
}
|
|
56366
|
-
_computeGradientAttr(gradientStyle) {
|
|
56659
|
+
_computeGradientAttr(gradientStyle, data, opt) {
|
|
56367
56660
|
var _a, _b;
|
|
56368
56661
|
const { gradient, scale, field } = gradientStyle, rest = __rest$8(gradientStyle, ["gradient", "scale", "field"]);
|
|
56369
56662
|
const markData = this.getDataView();
|
|
@@ -56379,42 +56672,49 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56379
56672
|
}
|
|
56380
56673
|
}
|
|
56381
56674
|
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());
|
|
56675
|
+
const computeStyle = {};
|
|
56382
56676
|
const mergedStyle = Object.assign(Object.assign({}, DEFAULT_GRADIENT_CONFIG[gradient]), rest);
|
|
56383
|
-
|
|
56384
|
-
const
|
|
56385
|
-
|
|
56386
|
-
|
|
56387
|
-
|
|
56388
|
-
|
|
56389
|
-
|
|
56390
|
-
|
|
56391
|
-
|
|
56392
|
-
|
|
56393
|
-
|
|
56394
|
-
|
|
56395
|
-
|
|
56396
|
-
|
|
56397
|
-
|
|
56398
|
-
|
|
56399
|
-
|
|
56400
|
-
|
|
56401
|
-
|
|
56402
|
-
|
|
56403
|
-
|
|
56404
|
-
|
|
56405
|
-
|
|
56406
|
-
|
|
56407
|
-
|
|
56408
|
-
|
|
56409
|
-
|
|
56410
|
-
computeStyle.gradient = gradient;
|
|
56411
|
-
return computeStyle;
|
|
56412
|
-
};
|
|
56677
|
+
Object.keys(mergedStyle).forEach(key => {
|
|
56678
|
+
const value = mergedStyle[key];
|
|
56679
|
+
if (key === 'stops') {
|
|
56680
|
+
computeStyle.stops = value.map((stop) => {
|
|
56681
|
+
const { opacity, color, offset } = stop;
|
|
56682
|
+
let computeColor = color !== null && color !== void 0 ? color : colorScale === null || colorScale === void 0 ? void 0 : colorScale.scale(data[colorField]);
|
|
56683
|
+
if (isFunction$1(color)) {
|
|
56684
|
+
computeColor = color(data, this._attributeContext, opt, markData);
|
|
56685
|
+
}
|
|
56686
|
+
if (isValid$1(opacity)) {
|
|
56687
|
+
computeColor = Color.SetOpacity(computeColor, opacity);
|
|
56688
|
+
}
|
|
56689
|
+
return {
|
|
56690
|
+
offset: isFunction$1(offset) ? offset(data, this._attributeContext, opt, markData) : offset,
|
|
56691
|
+
color: computeColor || themeColor[0]
|
|
56692
|
+
};
|
|
56693
|
+
});
|
|
56694
|
+
}
|
|
56695
|
+
else if (isFunction$1(value)) {
|
|
56696
|
+
computeStyle[key] = value(data, this._attributeContext, opt, markData);
|
|
56697
|
+
}
|
|
56698
|
+
else {
|
|
56699
|
+
computeStyle[key] = value;
|
|
56700
|
+
}
|
|
56701
|
+
});
|
|
56702
|
+
computeStyle.gradient = gradient;
|
|
56703
|
+
return computeStyle;
|
|
56413
56704
|
}
|
|
56414
|
-
_computeBorderAttr(borderStyle) {
|
|
56705
|
+
_computeBorderAttr(borderStyle, data, opt) {
|
|
56415
56706
|
var _a, _b, _c;
|
|
56416
56707
|
const { scale, field } = borderStyle, mergedStyle = __rest$8(borderStyle, ["scale", "field"]);
|
|
56417
56708
|
const computeStyle = {};
|
|
56709
|
+
Object.keys(mergedStyle).forEach(key => {
|
|
56710
|
+
const value = mergedStyle[key];
|
|
56711
|
+
if (isFunction$1(value)) {
|
|
56712
|
+
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56713
|
+
}
|
|
56714
|
+
else {
|
|
56715
|
+
computeStyle[key] = value;
|
|
56716
|
+
}
|
|
56717
|
+
});
|
|
56418
56718
|
if (!('stroke' in computeStyle)) {
|
|
56419
56719
|
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());
|
|
56420
56720
|
let colorScale = scale;
|
|
@@ -56427,52 +56727,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56427
56727
|
if (!colorField) {
|
|
56428
56728
|
colorField = globalField;
|
|
56429
56729
|
}
|
|
56430
|
-
|
|
56431
|
-
const computeStyle = {};
|
|
56432
|
-
Object.keys(mergedStyle).forEach(key => {
|
|
56433
|
-
const value = mergedStyle[key];
|
|
56434
|
-
if (isFunction$1(value)) {
|
|
56435
|
-
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56436
|
-
}
|
|
56437
|
-
else {
|
|
56438
|
-
computeStyle[key] = value;
|
|
56439
|
-
}
|
|
56440
|
-
});
|
|
56441
|
-
computeStyle.stroke = (colorScale === null || colorScale === void 0 ? void 0 : colorScale.scale(data[colorField])) || themeColor[0];
|
|
56442
|
-
return computeStyle;
|
|
56443
|
-
};
|
|
56730
|
+
computeStyle.stroke = (colorScale === null || colorScale === void 0 ? void 0 : colorScale.scale(data[colorField])) || themeColor[0];
|
|
56444
56731
|
}
|
|
56445
56732
|
}
|
|
56446
56733
|
else if (GradientType.includes((_c = mergedStyle.stroke) === null || _c === void 0 ? void 0 : _c.gradient)) {
|
|
56447
|
-
|
|
56448
|
-
return (data, opt) => {
|
|
56449
|
-
const computeStyle = {};
|
|
56450
|
-
Object.keys(mergedStyle).forEach(key => {
|
|
56451
|
-
const value = mergedStyle[key];
|
|
56452
|
-
if (isFunction$1(value)) {
|
|
56453
|
-
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56454
|
-
}
|
|
56455
|
-
else {
|
|
56456
|
-
computeStyle[key] = value;
|
|
56457
|
-
}
|
|
56458
|
-
});
|
|
56459
|
-
computeStyle.stroke = gradientFunctor(data, opt);
|
|
56460
|
-
return computeStyle;
|
|
56461
|
-
};
|
|
56734
|
+
computeStyle.stroke = this._computeGradientAttr(mergedStyle.stroke, data, opt);
|
|
56462
56735
|
}
|
|
56463
|
-
return
|
|
56464
|
-
const computeStyle = {};
|
|
56465
|
-
Object.keys(mergedStyle).forEach(key => {
|
|
56466
|
-
const value = mergedStyle[key];
|
|
56467
|
-
if (isFunction$1(value)) {
|
|
56468
|
-
computeStyle[key] = value(data, this._attributeContext, opt, this.getDataView());
|
|
56469
|
-
}
|
|
56470
|
-
else {
|
|
56471
|
-
computeStyle[key] = value;
|
|
56472
|
-
}
|
|
56473
|
-
});
|
|
56474
|
-
return computeStyle;
|
|
56475
|
-
};
|
|
56736
|
+
return computeStyle;
|
|
56476
56737
|
}
|
|
56477
56738
|
}
|
|
56478
56739
|
|
|
@@ -56641,6 +56902,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56641
56902
|
exit: { type: 'fadeOut' },
|
|
56642
56903
|
update: [
|
|
56643
56904
|
{
|
|
56905
|
+
type: 'update',
|
|
56644
56906
|
options: { excludeChannels: 'points' }
|
|
56645
56907
|
},
|
|
56646
56908
|
{
|
|
@@ -56990,6 +57252,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56990
57252
|
}
|
|
56991
57253
|
updateCustomConfigAndRerender(modifyConfig, morphConfig) {
|
|
56992
57254
|
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57255
|
+
if (this._isReleased) {
|
|
57256
|
+
return this;
|
|
57257
|
+
}
|
|
56993
57258
|
const result = modifyConfig();
|
|
56994
57259
|
if (!isValid$1(result)) {
|
|
56995
57260
|
return this;
|
|
@@ -57063,6 +57328,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57063
57328
|
renderAsync(morphConfig) {
|
|
57064
57329
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
57065
57330
|
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57331
|
+
if (this._isReleased) {
|
|
57332
|
+
return this;
|
|
57333
|
+
}
|
|
57066
57334
|
if (!this._chart) {
|
|
57067
57335
|
(_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeInitializeChart) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
57068
57336
|
this._initChart(this._spec);
|
|
@@ -57075,6 +57343,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57075
57343
|
(_h = (_g = this._option.performanceHook) === null || _g === void 0 ? void 0 : _g.afterCompileToVGrammar) === null || _h === void 0 ? void 0 : _h.call(_g);
|
|
57076
57344
|
}
|
|
57077
57345
|
yield ((_j = this._compiler) === null || _j === void 0 ? void 0 : _j.renderAsync(morphConfig));
|
|
57346
|
+
if (this._isReleased) {
|
|
57347
|
+
return this;
|
|
57348
|
+
}
|
|
57078
57349
|
if (this._option.animation) {
|
|
57079
57350
|
(_k = this._chart) === null || _k === void 0 ? void 0 : _k.getAllRegions().forEach(region => {
|
|
57080
57351
|
var _a;
|
|
@@ -57105,6 +57376,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57105
57376
|
this._userEvents = null;
|
|
57106
57377
|
this._event = null;
|
|
57107
57378
|
this._eventDispatcher = null;
|
|
57379
|
+
this._isReleased = true;
|
|
57108
57380
|
InstanceManager.unregisterInstance(this);
|
|
57109
57381
|
}
|
|
57110
57382
|
updateData(id, data, options) {
|
|
@@ -57371,6 +57643,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57371
57643
|
this._chart.onResize(width, height);
|
|
57372
57644
|
(_d = (_c = this._option.performanceHook) === null || _c === void 0 ? void 0 : _c.afterResizeWithUpdate) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
57373
57645
|
yield ((_f = (_e = this._compiler).resize) === null || _f === void 0 ? void 0 : _f.call(_e, width, height));
|
|
57646
|
+
if (this._isReleased) {
|
|
57647
|
+
return this;
|
|
57648
|
+
}
|
|
57374
57649
|
this._event.emit(ChartEvent.afterResize, { chart: this._chart });
|
|
57375
57650
|
return this;
|
|
57376
57651
|
});
|
|
@@ -57801,7 +58076,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57801
58076
|
};
|
|
57802
58077
|
registerVChartCore();
|
|
57803
58078
|
|
|
57804
|
-
const version = "1.6.
|
|
58079
|
+
const version = "1.6.4";
|
|
57805
58080
|
|
|
57806
58081
|
class ChartData {
|
|
57807
58082
|
get dataList() {
|
|
@@ -59937,7 +60212,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59937
60212
|
|
|
59938
60213
|
const AnimationStates = ['appear', 'enter', 'update', 'exit', 'disappear', 'normal'];
|
|
59939
60214
|
function animationConfig(defaultConfig = {}, userConfig, params) {
|
|
59940
|
-
var _a;
|
|
59941
60215
|
const config = {};
|
|
59942
60216
|
for (let i = 0; i < AnimationStates.length; i++) {
|
|
59943
60217
|
const state = AnimationStates[i];
|
|
@@ -59954,9 +60228,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59954
60228
|
}
|
|
59955
60229
|
else {
|
|
59956
60230
|
defaultStateConfig = [Object.assign(Object.assign({}, DEFAULT_ANIMATION_CONFIG[state]), defaultConfig[state])];
|
|
59957
|
-
|
|
59958
|
-
|
|
59959
|
-
|
|
60231
|
+
}
|
|
60232
|
+
if (state === 'exit') {
|
|
60233
|
+
defaultStateConfig.forEach(exitConfig => {
|
|
60234
|
+
exitConfig.controlOptions = { stopWhenStateChange: true };
|
|
60235
|
+
});
|
|
59960
60236
|
}
|
|
59961
60237
|
if (!(userConfig === null || userConfig === void 0 ? void 0 : userConfig[state])) {
|
|
59962
60238
|
config[state] = defaultStateConfig;
|
|
@@ -59967,14 +60243,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59967
60243
|
stateConfig = userConfig[state];
|
|
59968
60244
|
}
|
|
59969
60245
|
else {
|
|
59970
|
-
|
|
59971
|
-
|
|
59972
|
-
|
|
59973
|
-
|
|
59974
|
-
|
|
59975
|
-
|
|
59976
|
-
|
|
59977
|
-
|
|
60246
|
+
stateConfig = defaultStateConfig.map((stateConfig, i) => {
|
|
60247
|
+
var _a;
|
|
60248
|
+
let singleConfig = mergeSpec({}, defaultStateConfig[i], userConfig[state]);
|
|
60249
|
+
if (isChannelAnimation(singleConfig)) {
|
|
60250
|
+
delete singleConfig.type;
|
|
60251
|
+
}
|
|
60252
|
+
if (singleConfig.oneByOne) {
|
|
60253
|
+
singleConfig = produceOneByOne(singleConfig, (_a = params === null || params === void 0 ? void 0 : params.dataIndex) !== null && _a !== void 0 ? _a : defaultDataIndex);
|
|
60254
|
+
}
|
|
60255
|
+
return singleConfig;
|
|
60256
|
+
});
|
|
59978
60257
|
}
|
|
59979
60258
|
config[state] = stateConfig;
|
|
59980
60259
|
}
|
|
@@ -60042,7 +60321,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60042
60321
|
}
|
|
60043
60322
|
config = cloneDeep(config);
|
|
60044
60323
|
traverseSpec(config, (node) => {
|
|
60045
|
-
|
|
60324
|
+
var _a;
|
|
60325
|
+
if (isFunction$1(node) && ((_a = node.prototype) === null || _a === void 0 ? void 0 : _a.constructor) !== node) {
|
|
60046
60326
|
const name = (...args) => {
|
|
60047
60327
|
return node(...args, ctx);
|
|
60048
60328
|
};
|
|
@@ -60957,12 +61237,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60957
61237
|
this._direction = Direction.vertical;
|
|
60958
61238
|
this._sortDataByAxis = false;
|
|
60959
61239
|
this._getInvalidDefined = (datum) => {
|
|
60960
|
-
|
|
61240
|
+
var _a, _b;
|
|
61241
|
+
if ((_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.isContinuous) {
|
|
60961
61242
|
if (!couldBeValidNumber(datum[this._specXField[0]])) {
|
|
60962
61243
|
return false;
|
|
60963
61244
|
}
|
|
60964
61245
|
}
|
|
60965
|
-
if (this._yAxisHelper.isContinuous) {
|
|
61246
|
+
if ((_b = this._yAxisHelper) === null || _b === void 0 ? void 0 : _b.isContinuous) {
|
|
60966
61247
|
if (!couldBeValidNumber(datum[this._specYField[0]])) {
|
|
60967
61248
|
return false;
|
|
60968
61249
|
}
|
|
@@ -65216,13 +65497,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65216
65497
|
this._unCompileChannel = { centerOffset: true, radiusOffset: true };
|
|
65217
65498
|
this.computeOuterRadius = (key, datum, states = 'normal', opt, superValue) => {
|
|
65218
65499
|
var _a;
|
|
65219
|
-
const offset = (_a = this.
|
|
65500
|
+
const offset = (_a = this._computeAttribute('radiusOffset', datum, states, opt)) !== null && _a !== void 0 ? _a : 0;
|
|
65220
65501
|
return superValue + offset;
|
|
65221
65502
|
};
|
|
65222
65503
|
this.computeCenter = (key, datum, states = 'normal', opt, center) => {
|
|
65223
65504
|
const offset = polarToCartesian({
|
|
65224
65505
|
angle: datum[ARC_MIDDLE_ANGLE],
|
|
65225
|
-
radius: this.
|
|
65506
|
+
radius: this._computeAttribute('centerOffset', datum, states, opt)
|
|
65226
65507
|
});
|
|
65227
65508
|
return center + offset[key];
|
|
65228
65509
|
};
|
|
@@ -76853,19 +77134,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76853
77134
|
}, !0);
|
|
76854
77135
|
};
|
|
76855
77136
|
|
|
76856
|
-
const
|
|
76857
|
-
|
|
76858
|
-
|
|
76859
|
-
|
|
76860
|
-
|
|
76861
|
-
|
|
76862
|
-
|
|
76863
|
-
|
|
76864
|
-
|
|
76865
|
-
|
|
76866
|
-
|
|
76867
|
-
|
|
76868
|
-
|
|
77137
|
+
const collectHierarchyField = (set, data, field) => {
|
|
77138
|
+
data.forEach((obj) => {
|
|
77139
|
+
if (!isNil$1(obj[field])) {
|
|
77140
|
+
set.add(obj[field]);
|
|
77141
|
+
}
|
|
77142
|
+
if (obj.children && obj.children.length > 0) {
|
|
77143
|
+
collectHierarchyField(set, obj.children, field);
|
|
77144
|
+
}
|
|
77145
|
+
});
|
|
77146
|
+
};
|
|
77147
|
+
const convertValuesToNumbers = (data) => {
|
|
77148
|
+
data.forEach((obj) => {
|
|
77149
|
+
obj.value = isString$1(obj.value) ? +obj.value : obj.value;
|
|
77150
|
+
if (obj.children && obj.children.length > 0) {
|
|
77151
|
+
convertValuesToNumbers(obj.children);
|
|
77152
|
+
}
|
|
77153
|
+
});
|
|
77154
|
+
};
|
|
77155
|
+
const sankeyFormat = (data) => {
|
|
77156
|
+
var _a;
|
|
77157
|
+
if (!data || !isArray$1(data)) {
|
|
77158
|
+
return [];
|
|
76869
77159
|
}
|
|
76870
77160
|
if (data.length > 1) {
|
|
76871
77161
|
const updateData = {
|
|
@@ -76877,58 +77167,42 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76877
77167
|
updateData[datum.id] = datum.values;
|
|
76878
77168
|
}
|
|
76879
77169
|
});
|
|
76880
|
-
|
|
77170
|
+
return [updateData];
|
|
76881
77171
|
}
|
|
76882
|
-
|
|
76883
|
-
|
|
76884
|
-
data = data[0].latestData[0];
|
|
76885
|
-
}
|
|
76886
|
-
else {
|
|
76887
|
-
data = data[0];
|
|
76888
|
-
}
|
|
77172
|
+
if ((_a = data[0]) === null || _a === void 0 ? void 0 : _a.latestData) {
|
|
77173
|
+
return data[0].latestData;
|
|
76889
77174
|
}
|
|
76890
|
-
|
|
76891
|
-
|
|
76892
|
-
|
|
76893
|
-
|
|
76894
|
-
|
|
76895
|
-
|
|
76896
|
-
for (const key in datum) {
|
|
76897
|
-
if (key === op.sourceField) {
|
|
76898
|
-
updatedDatum.source = datum[op.sourceField];
|
|
76899
|
-
}
|
|
76900
|
-
else if (key === op.targetField) {
|
|
76901
|
-
updatedDatum.target = datum[op.targetField];
|
|
76902
|
-
}
|
|
76903
|
-
else if (key === op.valueField) {
|
|
76904
|
-
updatedDatum.value = datum[op.valueField];
|
|
76905
|
-
}
|
|
76906
|
-
else {
|
|
76907
|
-
updatedDatum[key] = datum[key];
|
|
76908
|
-
}
|
|
76909
|
-
}
|
|
76910
|
-
updatedData.push(updatedDatum);
|
|
76911
|
-
});
|
|
76912
|
-
data[key] = updatedData;
|
|
76913
|
-
}
|
|
76914
|
-
}
|
|
77175
|
+
return data;
|
|
77176
|
+
};
|
|
77177
|
+
const sankeyLayout = (data, op) => {
|
|
77178
|
+
var _a, _b;
|
|
77179
|
+
if (!data || !(op === null || op === void 0 ? void 0 : op.view) || !data.length) {
|
|
77180
|
+
return [];
|
|
76915
77181
|
}
|
|
76916
|
-
const
|
|
76917
|
-
|
|
76918
|
-
|
|
76919
|
-
|
|
76920
|
-
|
|
76921
|
-
|
|
76922
|
-
|
|
76923
|
-
|
|
76924
|
-
|
|
76925
|
-
|
|
77182
|
+
const view = op.view();
|
|
77183
|
+
if (view.x1 - view.x0 === 0 ||
|
|
77184
|
+
view.y1 - view.y0 === 0 ||
|
|
77185
|
+
view.x1 - view.x0 === -Infinity ||
|
|
77186
|
+
view.x1 - view.x0 === Infinity ||
|
|
77187
|
+
view.y1 - view.y0 === -Infinity ||
|
|
77188
|
+
view.y1 - view.y0 === Infinity) {
|
|
77189
|
+
return [];
|
|
77190
|
+
}
|
|
77191
|
+
const originalData = data[0];
|
|
77192
|
+
if (op.sourceField !== 'source' || op.targetField !== 'target' || op.valueField !== 'value') {
|
|
77193
|
+
if (originalData.links) {
|
|
76926
77194
|
const updatedData = [];
|
|
76927
|
-
|
|
77195
|
+
originalData.links.forEach((datum) => {
|
|
76928
77196
|
const updatedDatum = {};
|
|
76929
77197
|
for (const key in datum) {
|
|
76930
|
-
if (key ===
|
|
76931
|
-
updatedDatum.
|
|
77198
|
+
if (key === op.sourceField) {
|
|
77199
|
+
updatedDatum.source = datum[op.sourceField];
|
|
77200
|
+
}
|
|
77201
|
+
else if (key === op.targetField) {
|
|
77202
|
+
updatedDatum.target = datum[op.targetField];
|
|
77203
|
+
}
|
|
77204
|
+
else if (key === op.valueField) {
|
|
77205
|
+
updatedDatum.value = datum[op.valueField];
|
|
76932
77206
|
}
|
|
76933
77207
|
else {
|
|
76934
77208
|
updatedDatum[key] = datum[key];
|
|
@@ -76936,17 +77210,31 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76936
77210
|
}
|
|
76937
77211
|
updatedData.push(updatedDatum);
|
|
76938
77212
|
});
|
|
76939
|
-
|
|
77213
|
+
originalData.links = updatedData;
|
|
76940
77214
|
}
|
|
76941
|
-
|
|
76942
|
-
|
|
76943
|
-
|
|
77215
|
+
}
|
|
77216
|
+
if (originalData.links) {
|
|
77217
|
+
const updatedData = [];
|
|
77218
|
+
originalData.links.forEach((datum) => {
|
|
77219
|
+
const updatedDatum = {};
|
|
77220
|
+
for (const key in datum) {
|
|
77221
|
+
if (key === 'value') {
|
|
77222
|
+
updatedDatum.value = isString$1(datum.value) ? +datum.value : datum.value;
|
|
77223
|
+
}
|
|
77224
|
+
else {
|
|
77225
|
+
updatedDatum[key] = datum[key];
|
|
77226
|
+
}
|
|
76944
77227
|
}
|
|
76945
|
-
|
|
77228
|
+
updatedData.push(updatedDatum);
|
|
77229
|
+
});
|
|
77230
|
+
originalData.links = updatedData;
|
|
77231
|
+
}
|
|
77232
|
+
else if ((_b = (_a = originalData.nodes) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.children) {
|
|
77233
|
+
convertValuesToNumbers(originalData.nodes);
|
|
76946
77234
|
}
|
|
76947
77235
|
const layout = new SankeyLayout(op);
|
|
76948
77236
|
const result = [];
|
|
76949
|
-
result.push(layout.layout(
|
|
77237
|
+
result.push(layout.layout(originalData, view));
|
|
76950
77238
|
return result;
|
|
76951
77239
|
};
|
|
76952
77240
|
|
|
@@ -77668,12 +77956,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77668
77956
|
this._labelLimit = (_c = (_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.limit) !== null && _c !== void 0 ? _c : 100;
|
|
77669
77957
|
}
|
|
77670
77958
|
initData() {
|
|
77671
|
-
var _a, _b, _c, _d
|
|
77959
|
+
var _a, _b, _c, _d;
|
|
77672
77960
|
super.initData();
|
|
77673
|
-
|
|
77674
|
-
|
|
77675
|
-
|
|
77676
|
-
|
|
77961
|
+
const viewData = this.getViewData();
|
|
77962
|
+
const rawData = this.getRawData();
|
|
77963
|
+
if (rawData && viewData) {
|
|
77964
|
+
registerDataSetInstanceTransform(this._dataSet, 'sankeyLayout', sankeyLayout);
|
|
77965
|
+
registerDataSetInstanceTransform(this._dataSet, 'sankeyFormat', sankeyFormat);
|
|
77966
|
+
rawData.transform({
|
|
77967
|
+
type: 'sankeyFormat'
|
|
77968
|
+
}, false);
|
|
77969
|
+
viewData.transform({
|
|
77970
|
+
type: 'sankeyLayout',
|
|
77677
77971
|
options: {
|
|
77678
77972
|
view: () => {
|
|
77679
77973
|
return {
|
|
@@ -77702,12 +77996,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77702
77996
|
},
|
|
77703
77997
|
level: TransformLevel.sankeyLayout
|
|
77704
77998
|
});
|
|
77705
|
-
const
|
|
77706
|
-
|
|
77707
|
-
registerDataSetInstanceTransform(
|
|
77708
|
-
|
|
77709
|
-
registerDataSetInstanceTransform(nodesDataSet, 'flatten', flatten);
|
|
77710
|
-
const nodesDataView = new DataView(nodesDataSet, { name: `sankey-node-${this.id}-data` });
|
|
77999
|
+
const { dataSet } = this._option;
|
|
78000
|
+
registerDataSetInstanceTransform(dataSet, 'sankeyNodes', sankeyNodes);
|
|
78001
|
+
registerDataSetInstanceTransform(dataSet, 'flatten', flatten);
|
|
78002
|
+
const nodesDataView = new DataView(dataSet, { name: `sankey-node-${this.id}-data` });
|
|
77711
78003
|
nodesDataView.parse([this.getViewData()], {
|
|
77712
78004
|
type: 'dataview'
|
|
77713
78005
|
});
|
|
@@ -77725,7 +78017,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77725
78017
|
return node;
|
|
77726
78018
|
}
|
|
77727
78019
|
}
|
|
77728
|
-
});
|
|
78020
|
+
}, false);
|
|
77729
78021
|
nodesDataView.transform({
|
|
77730
78022
|
type: 'addVChartProperty',
|
|
77731
78023
|
options: {
|
|
@@ -77733,13 +78025,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77733
78025
|
call: addDataKey
|
|
77734
78026
|
}
|
|
77735
78027
|
}, false);
|
|
77736
|
-
(_e = this._data) === null || _e === void 0 ? void 0 : _e.getDataView().target.addListener('change', nodesDataView.reRunAllTransform);
|
|
77737
78028
|
this._nodesSeriesData = new SeriesData(this._option, nodesDataView);
|
|
77738
|
-
|
|
77739
|
-
|
|
77740
|
-
registerDataSetInstanceTransform(linksDataSet, 'sankeyLinks', sankeyLinks);
|
|
77741
|
-
registerDataSetInstanceTransform(linksDataSet, 'addVChartProperty', addVChartProperty);
|
|
77742
|
-
const linksDataView = new DataView(linksDataSet, { name: `sankey-link-${this.id}-data` });
|
|
78029
|
+
registerDataSetInstanceTransform(dataSet, 'sankeyLinks', sankeyLinks);
|
|
78030
|
+
const linksDataView = new DataView(dataSet, { name: `sankey-link-${this.id}-data` });
|
|
77743
78031
|
linksDataView.parse([this.getViewData()], {
|
|
77744
78032
|
type: 'dataview'
|
|
77745
78033
|
});
|
|
@@ -77753,7 +78041,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77753
78041
|
call: addDataKey
|
|
77754
78042
|
}
|
|
77755
78043
|
}, false);
|
|
77756
|
-
(_f = this._data) === null || _f === void 0 ? void 0 : _f.getDataView().target.addListener('change', linksDataView.reRunAllTransform);
|
|
77757
78044
|
this._linksSeriesData = new SeriesData(this._option, linksDataView);
|
|
77758
78045
|
}
|
|
77759
78046
|
}
|
|
@@ -77806,8 +78093,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77806
78093
|
y: (datum) => datum.y0,
|
|
77807
78094
|
y1: (datum) => datum.y1,
|
|
77808
78095
|
fill: (datum) => {
|
|
77809
|
-
var _a, _b, _c;
|
|
77810
|
-
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.
|
|
78096
|
+
var _a, _b, _c, _d;
|
|
78097
|
+
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));
|
|
77811
78098
|
}
|
|
77812
78099
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Mark);
|
|
77813
78100
|
this._trigger.registerMark(nodeMark);
|
|
@@ -77826,10 +78113,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77826
78113
|
thickness: (datum) => datum.thickness,
|
|
77827
78114
|
fill: (datum) => {
|
|
77828
78115
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
77829
|
-
const
|
|
78116
|
+
const fill = (_b = (_a = this._spec.link) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill;
|
|
78117
|
+
if (fill) {
|
|
78118
|
+
return fill;
|
|
78119
|
+
}
|
|
78120
|
+
const sourceName = ((_c = this._spec) === null || _c === void 0 ? void 0 : _c.nodeKey) || ((_f = (_e = (_d = this._rawData.latestData[0]) === null || _d === void 0 ? void 0 : _d.nodes) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.children)
|
|
77830
78121
|
? datum.source
|
|
77831
78122
|
: this.getNodeList()[datum.source];
|
|
77832
|
-
return (_g =
|
|
78123
|
+
return (_g = this._colorScale) === null || _g === void 0 ? void 0 : _g.scale(sourceName);
|
|
77833
78124
|
},
|
|
77834
78125
|
direction: (_a = this._spec.direction) !== null && _a !== void 0 ? _a : 'horizontal'
|
|
77835
78126
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
|
|
@@ -77883,8 +78174,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77883
78174
|
return datum.y1;
|
|
77884
78175
|
},
|
|
77885
78176
|
fill: (datum) => {
|
|
77886
|
-
var _a, _b, _c;
|
|
77887
|
-
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.
|
|
78177
|
+
var _a, _b, _c, _d;
|
|
78178
|
+
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));
|
|
77888
78179
|
},
|
|
77889
78180
|
text: (datum) => this._createText(datum),
|
|
77890
78181
|
limit: this._labelLimit,
|
|
@@ -77937,8 +78228,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77937
78228
|
x: (datum) => datum.x0,
|
|
77938
78229
|
y: (datum) => (datum.y0 + datum.y1) / 2,
|
|
77939
78230
|
fill: (datum) => {
|
|
77940
|
-
var _a, _b, _c;
|
|
77941
|
-
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.
|
|
78231
|
+
var _a, _b, _c, _d;
|
|
78232
|
+
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));
|
|
77942
78233
|
},
|
|
77943
78234
|
text: (datum) => this._createText(datum),
|
|
77944
78235
|
limit: this._labelLimit,
|
|
@@ -77951,8 +78242,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77951
78242
|
x: (datum) => datum.x1,
|
|
77952
78243
|
y: (datum) => (datum.y0 + datum.y1) / 2,
|
|
77953
78244
|
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.
|
|
78245
|
+
var _a, _b, _c, _d;
|
|
78246
|
+
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
78247
|
},
|
|
77957
78248
|
text: (datum) => this._createText(datum),
|
|
77958
78249
|
limit: this._labelLimit,
|
|
@@ -77970,8 +78261,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77970
78261
|
},
|
|
77971
78262
|
y: (datum) => (datum.y0 + datum.y1) / 2,
|
|
77972
78263
|
fill: (datum) => {
|
|
77973
|
-
var _a, _b, _c;
|
|
77974
|
-
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.
|
|
78264
|
+
var _a, _b, _c, _d;
|
|
78265
|
+
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));
|
|
77975
78266
|
},
|
|
77976
78267
|
text: (datum) => this._createText(datum),
|
|
77977
78268
|
limit: this._labelLimit,
|
|
@@ -78044,11 +78335,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78044
78335
|
}
|
|
78045
78336
|
}
|
|
78046
78337
|
nodesSeriesDataUpdate() {
|
|
78047
|
-
this.event.emit(ChartEvent.legendFilter, { model: this });
|
|
78048
78338
|
this._nodesSeriesData.updateData();
|
|
78339
|
+
this._setNodeOrdinalColorScale();
|
|
78049
78340
|
}
|
|
78050
78341
|
linksSeriesDataUpdate() {
|
|
78051
|
-
this.event.emit(ChartEvent.legendFilter, { model: this });
|
|
78052
78342
|
this._linksSeriesData.updateData();
|
|
78053
78343
|
}
|
|
78054
78344
|
initTooltip() {
|
|
@@ -78057,33 +78347,32 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78057
78347
|
this._linkMark && this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark);
|
|
78058
78348
|
this._labelMark && this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark);
|
|
78059
78349
|
}
|
|
78060
|
-
|
|
78061
|
-
var _a, _b, _c, _d, _e
|
|
78062
|
-
|
|
78063
|
-
|
|
78064
|
-
|
|
78065
|
-
|
|
78066
|
-
|
|
78067
|
-
|
|
78068
|
-
|
|
78069
|
-
|
|
78070
|
-
|
|
78071
|
-
|
|
78072
|
-
|
|
78073
|
-
|
|
78074
|
-
|
|
78075
|
-
|
|
78076
|
-
|
|
78077
|
-
|
|
78078
|
-
if (((_k = this._option.globalScale.getScale('color')) === null || _k === void 0 ? void 0 : _k.domain().length) === 0 ||
|
|
78079
|
-
isNil$1(this._option.globalScale.getScale('color').domain()[0])) {
|
|
78350
|
+
_setNodeOrdinalColorScale() {
|
|
78351
|
+
var _a, _b, _c, _d, _e;
|
|
78352
|
+
const colorScale = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalScale) === null || _b === void 0 ? void 0 : _b.getScale('color');
|
|
78353
|
+
if (colorScale === null || colorScale === void 0 ? void 0 : colorScale._specified) {
|
|
78354
|
+
this._colorScale = colorScale;
|
|
78355
|
+
return;
|
|
78356
|
+
}
|
|
78357
|
+
let colorDomain;
|
|
78358
|
+
let colorRange;
|
|
78359
|
+
if (colorScale) {
|
|
78360
|
+
colorDomain = colorScale.domain();
|
|
78361
|
+
colorRange = colorScale.range();
|
|
78362
|
+
}
|
|
78363
|
+
if (!colorRange) {
|
|
78364
|
+
colorRange = this._getDataScheme();
|
|
78365
|
+
}
|
|
78366
|
+
if (!colorDomain || isNil$1(colorDomain[0])) {
|
|
78367
|
+
colorDomain = this.getNodeList();
|
|
78080
78368
|
if (colorDomain.length > 10) {
|
|
78081
|
-
colorRange = (
|
|
78369
|
+
colorRange = (_c = this._getDataScheme()[1]) === null || _c === void 0 ? void 0 : _c.scheme;
|
|
78082
78370
|
}
|
|
78083
78371
|
}
|
|
78084
78372
|
const ordinalScale = new ColorOrdinalScale();
|
|
78085
|
-
(
|
|
78086
|
-
|
|
78373
|
+
(_e = (_d = ordinalScale.domain(colorDomain)).range) === null || _e === void 0 ? void 0 : _e.call(_d, colorRange);
|
|
78374
|
+
this._colorScale = ordinalScale;
|
|
78375
|
+
return;
|
|
78087
78376
|
}
|
|
78088
78377
|
getNodeList() {
|
|
78089
78378
|
var _a, _b, _c;
|
|
@@ -78118,22 +78407,50 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78118
78407
|
getMeasureField() {
|
|
78119
78408
|
return [this._valueField];
|
|
78120
78409
|
}
|
|
78121
|
-
|
|
78122
|
-
var _a
|
|
78123
|
-
if (this.
|
|
78124
|
-
|
|
78125
|
-
(_b = (_a = this._nodesSeriesData) === null || _a === void 0 ? void 0 : _a.getDataView()) === null || _b === void 0 ? void 0 : _b.latestData.forEach((datum) => {
|
|
78126
|
-
var _a;
|
|
78127
|
-
keyArray.push((_a = datum[this._seriesField]) !== null && _a !== void 0 ? _a : datum.datum[this._seriesField]);
|
|
78128
|
-
});
|
|
78129
|
-
return keyArray;
|
|
78410
|
+
getRawDataStatisticsByField(field, isNumeric) {
|
|
78411
|
+
var _a;
|
|
78412
|
+
if (!this._rawStatisticsCache) {
|
|
78413
|
+
this._rawStatisticsCache = {};
|
|
78130
78414
|
}
|
|
78131
|
-
|
|
78415
|
+
if (!this._rawStatisticsCache[field]) {
|
|
78416
|
+
const canUseViewStatistics = this._viewDataStatistics && this.getViewData().transformsArr.length <= 1;
|
|
78417
|
+
if (canUseViewStatistics && ((_a = this._viewDataStatistics.latestData) === null || _a === void 0 ? void 0 : _a[field])) {
|
|
78418
|
+
this._rawStatisticsCache[field] = this._viewDataStatistics.latestData[field];
|
|
78419
|
+
}
|
|
78420
|
+
else if (this._rawData) {
|
|
78421
|
+
this._rawStatisticsCache[field] = {
|
|
78422
|
+
values: this._collectByField(field)
|
|
78423
|
+
};
|
|
78424
|
+
}
|
|
78425
|
+
}
|
|
78426
|
+
return this._rawStatisticsCache[field];
|
|
78427
|
+
}
|
|
78428
|
+
_collectByField(field) {
|
|
78429
|
+
var _a, _b, _c;
|
|
78430
|
+
const keyArray = [];
|
|
78431
|
+
const rawData = (_b = (_a = this.getRawData()) === null || _a === void 0 ? void 0 : _a.latestData) === null || _b === void 0 ? void 0 : _b[0];
|
|
78432
|
+
if (!rawData) {
|
|
78433
|
+
return [];
|
|
78434
|
+
}
|
|
78435
|
+
if (rawData.links) {
|
|
78436
|
+
if ((_c = rawData.nodes) === null || _c === void 0 ? void 0 : _c.length) {
|
|
78437
|
+
rawData.nodes.forEach((node) => {
|
|
78438
|
+
if (node[this._seriesField]) {
|
|
78439
|
+
keyArray.push(node[this._seriesField]);
|
|
78440
|
+
}
|
|
78441
|
+
});
|
|
78442
|
+
}
|
|
78443
|
+
}
|
|
78444
|
+
else if (rawData.nodes) {
|
|
78445
|
+
const set = new Set();
|
|
78446
|
+
collectHierarchyField(set, rawData.nodes, this._seriesField);
|
|
78447
|
+
return Array.from(set);
|
|
78448
|
+
}
|
|
78449
|
+
return keyArray;
|
|
78132
78450
|
}
|
|
78133
78451
|
onLayoutEnd(ctx) {
|
|
78134
78452
|
super.onLayoutEnd(ctx);
|
|
78135
78453
|
this._viewBox.set(0, 0, this._region.getLayoutRect().width, this._region.getLayoutRect().height);
|
|
78136
|
-
this._rawData.reRunAllTransform();
|
|
78137
78454
|
this.getViewData().reRunAllTransform();
|
|
78138
78455
|
this._nodesSeriesData.updateData();
|
|
78139
78456
|
this._linksSeriesData.updateData();
|
|
@@ -79701,6 +80018,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79701
80018
|
this._orient = v;
|
|
79702
80019
|
this._layoutOrient = v;
|
|
79703
80020
|
}
|
|
80021
|
+
set autoIndentOnce(v) {
|
|
80022
|
+
this._autoIndentOnce = v;
|
|
80023
|
+
}
|
|
79704
80024
|
getScales() {
|
|
79705
80025
|
return this._scales;
|
|
79706
80026
|
}
|
|
@@ -79718,6 +80038,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79718
80038
|
this.layoutZIndex = LayoutZIndex.Axis;
|
|
79719
80039
|
this.layoutLevel = LayoutLevel.Axis;
|
|
79720
80040
|
this._orient = 'left';
|
|
80041
|
+
this._autoIndentOnce = false;
|
|
80042
|
+
this._hasAutoIndent = false;
|
|
79721
80043
|
this._scales = [];
|
|
79722
80044
|
this._statisticsDomain = { domain: [], index: {} };
|
|
79723
80045
|
this._tick = undefined;
|
|
@@ -80332,17 +80654,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80332
80654
|
this._layoutCache[key] = rect[key];
|
|
80333
80655
|
}
|
|
80334
80656
|
});
|
|
80335
|
-
|
|
80336
|
-
|
|
80337
|
-
this.
|
|
80338
|
-
}
|
|
80339
|
-
|
|
80340
|
-
|
|
80341
|
-
|
|
80342
|
-
|
|
80657
|
+
if (this._autoIndentOnce && this._hasAutoIndent) {
|
|
80658
|
+
['x1', 'x2', 'y1', 'y2'].forEach(key => {
|
|
80659
|
+
this.getLastComputeOutBounds()[key] = this._layoutCache._lastComputeOutBounds[key];
|
|
80660
|
+
});
|
|
80661
|
+
}
|
|
80662
|
+
else {
|
|
80663
|
+
this._hasAutoIndent = true;
|
|
80664
|
+
['x1', 'x2', 'y1', 'y2'].forEach(key => {
|
|
80665
|
+
if (this.getLastComputeOutBounds()[key] < this._layoutCache._lastComputeOutBounds[key]) {
|
|
80666
|
+
this.getLastComputeOutBounds()[key] = this._layoutCache._lastComputeOutBounds[key];
|
|
80667
|
+
}
|
|
80668
|
+
else {
|
|
80669
|
+
this._layoutCache._lastComputeOutBounds[key] = this.getLastComputeOutBounds()[key];
|
|
80670
|
+
}
|
|
80671
|
+
});
|
|
80672
|
+
}
|
|
80343
80673
|
return rect;
|
|
80344
80674
|
}
|
|
80345
80675
|
_clearLayoutCache() {
|
|
80676
|
+
this._hasAutoIndent = false;
|
|
80346
80677
|
this._layoutCache.width = 0;
|
|
80347
80678
|
this._layoutCache.height = 0;
|
|
80348
80679
|
this._layoutCache._lastComputeOutBounds = { x1: 0, x2: 0, y1: 0, y2: 0 };
|
|
@@ -83635,7 +83966,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83635
83966
|
}
|
|
83636
83967
|
}
|
|
83637
83968
|
function getSvgHtml(option, valueToHtml) {
|
|
83638
|
-
var _a, _b, _c, _d, _e, _f;
|
|
83969
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
83639
83970
|
if (!(option === null || option === void 0 ? void 0 : option.hasShape) || !option.symbolType) {
|
|
83640
83971
|
return '';
|
|
83641
83972
|
}
|
|
@@ -83666,9 +83997,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83666
83997
|
</svg>`;
|
|
83667
83998
|
}
|
|
83668
83999
|
if (isObject$2(fill)) {
|
|
83669
|
-
fillString = 'gradientColor';
|
|
84000
|
+
fillString = (_b = 'gradientColor' + option.index) !== null && _b !== void 0 ? _b : '';
|
|
83670
84001
|
let gradient = '';
|
|
83671
|
-
const stops = ((
|
|
84002
|
+
const stops = ((_c = fill.stops) !== null && _c !== void 0 ? _c : [])
|
|
83672
84003
|
.map(s => `<stop offset="${valueToHtml(s.offset.toString())}" stop-color="${valueToHtml(s.color)}"/>`)
|
|
83673
84004
|
.join('');
|
|
83674
84005
|
if (fill.gradient === 'radial') {
|
|
@@ -83677,7 +84008,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83677
84008
|
</radialGradient>`;
|
|
83678
84009
|
}
|
|
83679
84010
|
else if (fill.gradient === 'linear') {
|
|
83680
|
-
gradient = `<linearGradient id="${fillString}" x1="${((
|
|
84011
|
+
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}%">
|
|
83681
84012
|
${stops}
|
|
83682
84013
|
</linearGradient>`;
|
|
83683
84014
|
}
|
|
@@ -83715,6 +84046,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83715
84046
|
}
|
|
83716
84047
|
}
|
|
83717
84048
|
|
|
84049
|
+
const defaultLabelStyle = {
|
|
84050
|
+
overflowWrap: 'normal',
|
|
84051
|
+
wordWrap: 'normal'
|
|
84052
|
+
};
|
|
83718
84053
|
class ContentColumnModel extends BaseTooltipModel {
|
|
83719
84054
|
constructor(parent, option, className, childIndex) {
|
|
83720
84055
|
super(parent, option, childIndex);
|
|
@@ -83768,7 +84103,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83768
84103
|
let childStyle = {};
|
|
83769
84104
|
if (this.className === 'key-box') {
|
|
83770
84105
|
const { key, isKeyAdaptive } = line;
|
|
83771
|
-
childStyle = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height)
|
|
84106
|
+
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]));
|
|
83772
84107
|
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);
|
|
83773
84108
|
if (!hasContent && !childStyle.visibility) {
|
|
83774
84109
|
childStyle.visibility = 'hidden';
|
|
@@ -83779,7 +84114,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83779
84114
|
this.children[i].setStyle(childStyle);
|
|
83780
84115
|
}
|
|
83781
84116
|
else if (this.className === 'value-box') {
|
|
83782
|
-
childStyle = mergeSpec({}, defaultValueStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(contentAttributes[i].height)
|
|
84117
|
+
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]));
|
|
83783
84118
|
this.children[i].setStyle(childStyle);
|
|
83784
84119
|
}
|
|
83785
84120
|
else if (this.className === 'shape-box') {
|
|
@@ -83849,7 +84184,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83849
84184
|
stroke: line.shapeStroke,
|
|
83850
84185
|
lineWidth: line.shapeLineWidth,
|
|
83851
84186
|
hollow: line.shapeHollow,
|
|
83852
|
-
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)
|
|
84187
|
+
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)`,
|
|
84188
|
+
index
|
|
83853
84189
|
};
|
|
83854
84190
|
}
|
|
83855
84191
|
}
|
|
@@ -86372,8 +86708,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86372
86708
|
});
|
|
86373
86709
|
}
|
|
86374
86710
|
_handleChange(start, end, updateComponent) {
|
|
86375
|
-
var _a;
|
|
86376
|
-
const zoomLock = (_a = this._spec.zoomLock) !== null &&
|
|
86711
|
+
var _a, _b;
|
|
86712
|
+
const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
|
|
86377
86713
|
if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
|
|
86378
86714
|
return;
|
|
86379
86715
|
}
|
|
@@ -86542,6 +86878,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86542
86878
|
this._relatedAxisComponent = bandAxis;
|
|
86543
86879
|
}
|
|
86544
86880
|
}
|
|
86881
|
+
if (this._relatedAxisComponent && this._filterMode === IFilterMode.axis) {
|
|
86882
|
+
this._relatedAxisComponent.autoIndentOnce = true;
|
|
86883
|
+
}
|
|
86545
86884
|
}
|
|
86546
86885
|
_setRegionsFromSpec() {
|
|
86547
86886
|
var _a, _b;
|
|
@@ -86862,7 +87201,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86862
87201
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
86863
87202
|
const delayType = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType) !== null && _b !== void 0 ? _b : 'throttle';
|
|
86864
87203
|
const delayTime = isValid$1((_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayType) ? (_e = (_d = this._spec) === null || _d === void 0 ? void 0 : _d.delayTime) !== null && _e !== void 0 ? _e : 30 : 0;
|
|
86865
|
-
const realTime = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.realTime) !== null && _g !== void 0 ? _g :
|
|
87204
|
+
const realTime = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.realTime) !== null && _g !== void 0 ? _g : true;
|
|
86866
87205
|
const option = { delayType, delayTime, realTime };
|
|
86867
87206
|
if (this._zoomAttr.enable) {
|
|
86868
87207
|
this.initZoomEventOfRegions(this._regions, null, this._handleChartZoom, option);
|
|
@@ -87094,20 +87433,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87094
87433
|
}
|
|
87095
87434
|
}
|
|
87096
87435
|
_updateScaleRange() {
|
|
87436
|
+
var _a, _b;
|
|
87097
87437
|
const handlerSize = (this._startHandlerSize + this._endHandlerSize) / 2;
|
|
87098
87438
|
if (!this._stateScale || !this._valueScale) {
|
|
87099
87439
|
return;
|
|
87100
87440
|
}
|
|
87441
|
+
let stateScaleRange;
|
|
87442
|
+
const defaultSize = this._isHorizontal
|
|
87443
|
+
? this.getLayoutRect().width - handlerSize
|
|
87444
|
+
: this.getLayoutRect().height - handlerSize;
|
|
87445
|
+
const defaultRange = (_b = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getScale().range()) !== null && _b !== void 0 ? _b : [0, defaultSize];
|
|
87101
87446
|
if (this._isHorizontal) {
|
|
87102
|
-
this.
|
|
87447
|
+
stateScaleRange = this._visible ? [0, this._computeWidth() - handlerSize] : defaultRange;
|
|
87448
|
+
this._stateScale.range(stateScaleRange);
|
|
87103
87449
|
this._valueScale.range([this._computeHeight() - this._middleHandlerSize, 0]);
|
|
87104
87450
|
}
|
|
87105
87451
|
else if (this.layoutOrient === 'left') {
|
|
87106
|
-
this.
|
|
87452
|
+
stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
|
|
87453
|
+
this._stateScale.range(stateScaleRange);
|
|
87107
87454
|
this._valueScale.range([this._computeWidth() - this._middleHandlerSize, 0]);
|
|
87108
87455
|
}
|
|
87109
87456
|
else {
|
|
87110
|
-
this.
|
|
87457
|
+
stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
|
|
87458
|
+
this._stateScale.range(stateScaleRange);
|
|
87111
87459
|
this._valueScale.range([0, this._computeWidth() - this._middleHandlerSize]);
|
|
87112
87460
|
}
|
|
87113
87461
|
if (this._component) {
|