@visactor/vchart 1.6.3 → 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 +566 -320
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/compile/grammar-item.js +2 -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/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/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/series/sankey/sankey.d.ts +6 -1
- package/cjs/series/sankey/sankey.js +48 -42
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/esm/compile/grammar-item.js +2 -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/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/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/series/sankey/sankey.d.ts +6 -1
- package/esm/series/sankey/sankey.js +49 -46
- package/esm/series/sankey/sankey.js.map +1 -1
- package/package.json +10 -10
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());
|
|
@@ -13732,6 +13741,12 @@
|
|
|
13732
13741
|
}
|
|
13733
13742
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
13734
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
|
+
};
|
|
13735
13750
|
|
|
13736
13751
|
class IncreaseCount extends ACustomAnimate {
|
|
13737
13752
|
constructor(from, to, duration, easing, params) {
|
|
@@ -17029,14 +17044,13 @@
|
|
|
17029
17044
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
17030
17045
|
}
|
|
17031
17046
|
updateWrapAABBBounds(text) {
|
|
17032
|
-
var _a, _b, _c;
|
|
17047
|
+
var _a, _b, _c, _d;
|
|
17033
17048
|
const textTheme = getTheme$1(this).text,
|
|
17034
17049
|
{
|
|
17035
17050
|
fontFamily = textTheme.fontFamily,
|
|
17036
17051
|
textAlign = textTheme.textAlign,
|
|
17037
17052
|
textBaseline = textTheme.textBaseline,
|
|
17038
17053
|
fontSize = textTheme.fontSize,
|
|
17039
|
-
lineHeight = this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize,
|
|
17040
17054
|
ellipsis = textTheme.ellipsis,
|
|
17041
17055
|
maxLineWidth: maxLineWidth,
|
|
17042
17056
|
stroke = textTheme.stroke,
|
|
@@ -17047,8 +17061,9 @@
|
|
|
17047
17061
|
heightLimit = 0,
|
|
17048
17062
|
lineClamp: lineClamp
|
|
17049
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,
|
|
17050
17065
|
buf = ignoreBuf ? 0 : 2;
|
|
17051
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
17066
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
17052
17067
|
const bbox = this.cache.layoutData.bbox;
|
|
17053
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;
|
|
17054
17069
|
}
|
|
@@ -17078,7 +17093,7 @@
|
|
|
17078
17093
|
if ("" !== str && "" === clip.str) {
|
|
17079
17094
|
if (ellipsis) {
|
|
17080
17095
|
const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17081
|
-
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;
|
|
17082
17097
|
} else clip.str = "", clip.width = 0;
|
|
17083
17098
|
needCut = !1;
|
|
17084
17099
|
}
|
|
@@ -17161,9 +17176,8 @@
|
|
|
17161
17176
|
} = attribute;
|
|
17162
17177
|
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
17163
17178
|
const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
17164
|
-
|
|
17165
|
-
|
|
17166
|
-
} = attribute;
|
|
17179
|
+
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
17180
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
17167
17181
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
17168
17182
|
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
17169
17183
|
const dx = textDrawOffsetX(textAlign, width),
|
|
@@ -17223,10 +17237,10 @@
|
|
|
17223
17237
|
fontWeight = textTheme.fontWeight,
|
|
17224
17238
|
fontFamily = textTheme.fontFamily,
|
|
17225
17239
|
stroke = textTheme.stroke,
|
|
17226
|
-
lineHeight = null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf,
|
|
17227
17240
|
lineWidth = textTheme.lineWidth,
|
|
17228
17241
|
verticalMode = textTheme.verticalMode
|
|
17229
|
-
} = attribute
|
|
17242
|
+
} = attribute,
|
|
17243
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
17230
17244
|
let {
|
|
17231
17245
|
textAlign = textTheme.textAlign,
|
|
17232
17246
|
textBaseline = textTheme.textBaseline
|
|
@@ -17274,7 +17288,7 @@
|
|
|
17274
17288
|
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
17275
17289
|
}
|
|
17276
17290
|
updateHorizontalMultilineAABBBounds(text) {
|
|
17277
|
-
var _a;
|
|
17291
|
+
var _a, _b;
|
|
17278
17292
|
const textTheme = getTheme$1(this).text,
|
|
17279
17293
|
attribute = this.attribute,
|
|
17280
17294
|
{
|
|
@@ -17283,15 +17297,15 @@
|
|
|
17283
17297
|
textBaseline = textTheme.textBaseline,
|
|
17284
17298
|
fontSize = textTheme.fontSize,
|
|
17285
17299
|
fontWeight = textTheme.fontWeight,
|
|
17286
|
-
lineHeight = attribute.lineHeight || attribute.fontSize || textTheme.fontSize,
|
|
17287
17300
|
ellipsis = textTheme.ellipsis,
|
|
17288
17301
|
maxLineWidth: maxLineWidth,
|
|
17289
17302
|
stroke = textTheme.stroke,
|
|
17290
17303
|
lineWidth = textTheme.lineWidth,
|
|
17291
17304
|
whiteSpace = textTheme.whiteSpace
|
|
17292
|
-
} = attribute
|
|
17305
|
+
} = attribute,
|
|
17306
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
17293
17307
|
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
17294
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
17308
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
17295
17309
|
const bbox = this.cache.layoutData.bbox;
|
|
17296
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;
|
|
17297
17311
|
}
|
|
@@ -17323,10 +17337,10 @@
|
|
|
17323
17337
|
fontSize = textTheme.fontSize,
|
|
17324
17338
|
fontWeight = textTheme.fontWeight,
|
|
17325
17339
|
stroke = textTheme.stroke,
|
|
17326
|
-
lineHeight = null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf,
|
|
17327
17340
|
lineWidth = textTheme.lineWidth,
|
|
17328
17341
|
verticalMode = textTheme.verticalMode
|
|
17329
|
-
} = attribute
|
|
17342
|
+
} = attribute,
|
|
17343
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
17330
17344
|
let {
|
|
17331
17345
|
textAlign = textTheme.textAlign,
|
|
17332
17346
|
textBaseline = textTheme.textBaseline
|
|
@@ -17429,14 +17443,13 @@
|
|
|
17429
17443
|
return isArray$1(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
|
|
17430
17444
|
}
|
|
17431
17445
|
updateMultilineAABBBounds(text) {
|
|
17432
|
-
var _a, _b, _c;
|
|
17446
|
+
var _a, _b, _c, _d;
|
|
17433
17447
|
const textTheme = getTheme$1(this).text,
|
|
17434
17448
|
{
|
|
17435
17449
|
fontFamily = textTheme.fontFamily,
|
|
17436
17450
|
textAlign = textTheme.textAlign,
|
|
17437
17451
|
textBaseline = textTheme.textBaseline,
|
|
17438
17452
|
fontSize = textTheme.fontSize,
|
|
17439
|
-
lineHeight = this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize,
|
|
17440
17453
|
ellipsis = textTheme.ellipsis,
|
|
17441
17454
|
maxLineWidth: maxLineWidth,
|
|
17442
17455
|
stroke = textTheme.stroke,
|
|
@@ -17447,8 +17460,9 @@
|
|
|
17447
17460
|
heightLimit = 0,
|
|
17448
17461
|
lineClamp: lineClamp
|
|
17449
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,
|
|
17450
17464
|
buf = ignoreBuf ? 0 : 2;
|
|
17451
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
17465
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
17452
17466
|
const bbox = this.cache.layoutData.bbox;
|
|
17453
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;
|
|
17454
17468
|
}
|
|
@@ -17478,7 +17492,7 @@
|
|
|
17478
17492
|
if ("" !== str && "" === clip.str) {
|
|
17479
17493
|
if (ellipsis) {
|
|
17480
17494
|
const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
17481
|
-
clip.str = null !== (
|
|
17495
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
17482
17496
|
} else clip.str = "", clip.width = 0;
|
|
17483
17497
|
needCut = !1;
|
|
17484
17498
|
}
|
|
@@ -18014,6 +18028,13 @@
|
|
|
18014
18028
|
builtinSymbols.forEach(symbol => {
|
|
18015
18029
|
builtinSymbolsMap[symbol.type] = symbol;
|
|
18016
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
|
+
};
|
|
18017
18038
|
|
|
18018
18039
|
const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
18019
18040
|
let Symbol$1 = class Symbol extends Graphic {
|
|
@@ -18036,13 +18057,14 @@
|
|
|
18036
18057
|
return isArray$1(size) ? 2 === size.length && size.every(this._validNumber) : this._validNumber(size);
|
|
18037
18058
|
}
|
|
18038
18059
|
doUpdateParsedPath() {
|
|
18039
|
-
const symbolTheme = getTheme$1(this).symbol
|
|
18040
|
-
|
|
18060
|
+
const symbolTheme = getTheme$1(this).symbol;
|
|
18061
|
+
let {
|
|
18041
18062
|
symbolType = symbolTheme.symbolType
|
|
18042
|
-
} = this.attribute
|
|
18043
|
-
|
|
18063
|
+
} = this.attribute,
|
|
18064
|
+
path = builtinSymbolsMap[symbolType];
|
|
18044
18065
|
if (path) return this._parsedPath = path, path;
|
|
18045
18066
|
if (path = Symbol.userSymbolMap[symbolType], path) return this._parsedPath = path, path;
|
|
18067
|
+
symbolType = builtInSymbolStrMap[symbolType] || symbolType;
|
|
18046
18068
|
if (!0 === isSvg(symbolType)) {
|
|
18047
18069
|
const parser = new XMLParser(),
|
|
18048
18070
|
{
|
|
@@ -18554,7 +18576,9 @@
|
|
|
18554
18576
|
|
|
18555
18577
|
class Paragraph {
|
|
18556
18578
|
constructor(text, newLine, character) {
|
|
18557
|
-
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;
|
|
18558
18582
|
const {
|
|
18559
18583
|
ascent: ascent,
|
|
18560
18584
|
height: height,
|
|
@@ -21599,7 +21623,7 @@
|
|
|
21599
21623
|
const t = textAlign;
|
|
21600
21624
|
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
21601
21625
|
}
|
|
21602
|
-
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,
|
|
21603
21627
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
21604
21628
|
if (!data) return;
|
|
21605
21629
|
const {
|
|
@@ -28045,6 +28069,48 @@
|
|
|
28045
28069
|
to: {}
|
|
28046
28070
|
};
|
|
28047
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
|
+
}
|
|
28048
28114
|
const DefaultLabelAnimation = {
|
|
28049
28115
|
mode: "same-time",
|
|
28050
28116
|
duration: 300,
|
|
@@ -28222,6 +28288,22 @@
|
|
|
28222
28288
|
}
|
|
28223
28289
|
return points;
|
|
28224
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
|
+
}
|
|
28225
28307
|
|
|
28226
28308
|
class LabelBase extends AbstractComponent {
|
|
28227
28309
|
setBitmap(bitmap) {
|
|
@@ -28297,30 +28379,37 @@
|
|
|
28297
28379
|
return this._bindEvent(text), this._setStatesOfText(text), text;
|
|
28298
28380
|
}
|
|
28299
28381
|
_prepare() {
|
|
28300
|
-
var _a, _b, _c, _d;
|
|
28382
|
+
var _a, _b, _c, _d, _e;
|
|
28301
28383
|
const currentBaseMarks = [];
|
|
28302
28384
|
let baseMarks;
|
|
28303
28385
|
if (baseMarks = isFunction$1(this.attribute.getBaseMarks) ? this.attribute.getBaseMarks() : getMarksByName(this.getRootNode(), this.attribute.baseMarkGroupName), baseMarks.forEach(mark => {
|
|
28304
28386
|
"willRelease" !== mark.releaseStatus && currentBaseMarks.push(mark);
|
|
28305
|
-
}), 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;
|
|
28306
28388
|
const {
|
|
28307
28389
|
data: data
|
|
28308
28390
|
} = this.attribute;
|
|
28309
|
-
if (data && 0 !== data.length)
|
|
28310
|
-
this.
|
|
28311
|
-
|
|
28312
|
-
|
|
28313
|
-
|
|
28314
|
-
|
|
28315
|
-
|
|
28316
|
-
|
|
28317
|
-
|
|
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
|
+
}
|
|
28318
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));
|
|
28319
28407
|
}
|
|
28320
|
-
|
|
28321
|
-
|
|
28322
|
-
|
|
28323
|
-
|
|
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
|
+
});
|
|
28324
28413
|
}
|
|
28325
28414
|
}
|
|
28326
28415
|
getRelatedGrphic(item) {
|
|
@@ -28449,13 +28538,7 @@
|
|
|
28449
28538
|
!1 === this._enableAnimation || !1 === this.attribute.animation ? this._renderWithOutAnimation(labels) : this._renderWithAnimation(labels);
|
|
28450
28539
|
}
|
|
28451
28540
|
_renderWithAnimation(labels) {
|
|
28452
|
-
|
|
28453
|
-
const animationConfig = null !== (_a = this.attribute.animation) && void 0 !== _a ? _a : {},
|
|
28454
|
-
mode = null !== (_b = animationConfig.mode) && void 0 !== _b ? _b : DefaultLabelAnimation.mode,
|
|
28455
|
-
duration = null !== (_c = animationConfig.duration) && void 0 !== _c ? _c : DefaultLabelAnimation.duration,
|
|
28456
|
-
easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : DefaultLabelAnimation.easing,
|
|
28457
|
-
delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0,
|
|
28458
|
-
currentTextMap = new Map(),
|
|
28541
|
+
const currentTextMap = new Map(),
|
|
28459
28542
|
prevTextMap = this._graphicToText || new Map(),
|
|
28460
28543
|
texts = [];
|
|
28461
28544
|
labels.forEach((text, index) => {
|
|
@@ -28478,32 +28561,26 @@
|
|
|
28478
28561
|
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
28479
28562
|
this.add(text), labelLine && (this._setStatesOfLabelLine(labelLine), this.add(labelLine)), this._syncStateWithRelatedGraphic(relatedGraphic), relatedGraphic.once("animate-bind", a => {
|
|
28480
28563
|
text.setAttributes(from);
|
|
28481
|
-
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic,
|
|
28482
|
-
mode: mode,
|
|
28483
|
-
duration: duration,
|
|
28484
|
-
easing: easing,
|
|
28485
|
-
to: to,
|
|
28486
|
-
delay: delay
|
|
28487
|
-
});
|
|
28564
|
+
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, to, this._animationConfig.enter);
|
|
28488
28565
|
relatedGraphic.on("afterAttributeUpdate", listener);
|
|
28489
28566
|
});
|
|
28490
28567
|
}
|
|
28491
28568
|
} else if ("update" === state) {
|
|
28492
28569
|
const prevLabel = prevTextMap.get(textKey);
|
|
28493
28570
|
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel);
|
|
28494
|
-
const prevText = prevLabel.text
|
|
28495
|
-
|
|
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, {
|
|
28496
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,
|
|
28497
28578
|
points: null === (_g = text.attribute) || void 0 === _g ? void 0 : _g.points
|
|
28498
|
-
}), duration, easing)
|
|
28499
|
-
text: prevText.attribute.text
|
|
28500
|
-
}, {
|
|
28501
|
-
text: text.attribute.text
|
|
28502
|
-
}, duration, easing));
|
|
28579
|
+
}), duration, easing);
|
|
28503
28580
|
}
|
|
28504
28581
|
}), prevTextMap.forEach(label => {
|
|
28505
28582
|
var _a;
|
|
28506
|
-
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(() => {
|
|
28507
28584
|
this.removeChild(label.text), (null == label ? void 0 : label.labelLine) && this.removeChild(label.labelLine);
|
|
28508
28585
|
});
|
|
28509
28586
|
}), this._graphicToText = currentTextMap;
|
|
@@ -28535,12 +28612,11 @@
|
|
|
28535
28612
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
28536
28613
|
this.attribute.syncState && relatedGraphic.on("afterAttributeUpdate", this._handleRelatedGraphicSetState);
|
|
28537
28614
|
}
|
|
28538
|
-
_afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, _ref) {
|
|
28615
|
+
_afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, to, _ref) {
|
|
28539
28616
|
let {
|
|
28540
28617
|
mode: mode,
|
|
28541
28618
|
duration: duration,
|
|
28542
28619
|
easing: easing,
|
|
28543
|
-
to: to,
|
|
28544
28620
|
delay: delay
|
|
28545
28621
|
} = _ref;
|
|
28546
28622
|
const listener = event => {
|
|
@@ -28551,30 +28627,30 @@
|
|
|
28551
28627
|
if (!detail) return {};
|
|
28552
28628
|
if (!(detail && detail.type === AttributeUpdateType.ANIMATE_UPDATE && detail.animationState && "wait" !== (null === (_a = detail.animationState.step) || void 0 === _a ? void 0 : _a.type))) return {};
|
|
28553
28629
|
if (detail.type === AttributeUpdateType.ANIMATE_END) return void text.setAttributes(to);
|
|
28554
|
-
const
|
|
28630
|
+
const onStart = () => {
|
|
28555
28631
|
relatedGraphic && (relatedGraphic.onAnimateBind = void 0, relatedGraphic.removeEventListener("afterAttributeUpdate", listener));
|
|
28556
28632
|
};
|
|
28557
28633
|
switch (mode) {
|
|
28558
28634
|
case "after":
|
|
28559
28635
|
detail.animationState.end && text.animate({
|
|
28560
|
-
|
|
28636
|
+
onStart: onStart
|
|
28561
28637
|
}).wait(delay).to(to, duration, easing);
|
|
28562
28638
|
break;
|
|
28563
28639
|
case "after-all":
|
|
28564
28640
|
index === texts.length - 1 && detail.animationState.end && texts.forEach(t => {
|
|
28565
28641
|
t.animate({
|
|
28566
|
-
|
|
28642
|
+
onStart: onStart
|
|
28567
28643
|
}).wait(delay).to(to, duration, easing);
|
|
28568
28644
|
});
|
|
28569
28645
|
break;
|
|
28570
28646
|
default:
|
|
28571
28647
|
if (this._isCollectionBase) {
|
|
28572
28648
|
const point = this._idToPoint.get(text.attribute.id);
|
|
28573
|
-
!point || text.animates && text.animates.has("label-animate") || !
|
|
28574
|
-
|
|
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
|
|
28575
28651
|
}).wait(delay).to(to, duration, easing);
|
|
28576
28652
|
} else detail.animationState.isFirstFrameOfStep && text.animate({
|
|
28577
|
-
|
|
28653
|
+
onStart: onStart
|
|
28578
28654
|
}).wait(delay).to(to, duration, easing);
|
|
28579
28655
|
}
|
|
28580
28656
|
};
|
|
@@ -28771,6 +28847,45 @@
|
|
|
28771
28847
|
pickable: !1
|
|
28772
28848
|
};
|
|
28773
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
|
+
|
|
28774
28889
|
class ArcInfo {
|
|
28775
28890
|
constructor(refDatum, center, outerCenter, quadrant, radian, middleAngle, innerRadius, outerRadius, circleCenter) {
|
|
28776
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;
|
|
@@ -29325,10 +29440,51 @@
|
|
|
29325
29440
|
pickable: !1
|
|
29326
29441
|
};
|
|
29327
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
|
+
|
|
29328
29482
|
const labelComponentMap = {
|
|
29329
29483
|
rect: RectLabel,
|
|
29330
29484
|
symbol: SymbolLabel,
|
|
29331
29485
|
arc: ArcLabel,
|
|
29486
|
+
line: LineLabel,
|
|
29487
|
+
area: AreaLabel,
|
|
29332
29488
|
"line-data": LineDataLabel
|
|
29333
29489
|
};
|
|
29334
29490
|
class DataLabel extends AbstractComponent {
|
|
@@ -29336,6 +29492,7 @@
|
|
|
29336
29492
|
super(merge$1({}, DataLabel.defaultAttributes, attributes)), this.name = "data-label";
|
|
29337
29493
|
}
|
|
29338
29494
|
render() {
|
|
29495
|
+
var _a;
|
|
29339
29496
|
const {
|
|
29340
29497
|
dataLabels: dataLabels,
|
|
29341
29498
|
size: size
|
|
@@ -29356,10 +29513,12 @@
|
|
|
29356
29513
|
labelComponent = labelComponentMap[dataLabel.type] || LabelBase;
|
|
29357
29514
|
if (labelComponent) {
|
|
29358
29515
|
const {
|
|
29359
|
-
|
|
29360
|
-
|
|
29361
|
-
|
|
29362
|
-
|
|
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));
|
|
29363
29522
|
}
|
|
29364
29523
|
}
|
|
29365
29524
|
prevComponentMap.forEach((cp, key) => {
|
|
@@ -31201,10 +31360,6 @@
|
|
|
31201
31360
|
}
|
|
31202
31361
|
mixin(CircleAxisGrid, CircleAxisMixin);
|
|
31203
31362
|
|
|
31204
|
-
var DataZoomActiveTag;
|
|
31205
|
-
!function (DataZoomActiveTag) {
|
|
31206
|
-
DataZoomActiveTag.startHandler = "startHandler", DataZoomActiveTag.endHandler = "endHandler", DataZoomActiveTag.middleHandler = "middleHandler", DataZoomActiveTag.background = "background";
|
|
31207
|
-
}(DataZoomActiveTag || (DataZoomActiveTag = {}));
|
|
31208
31363
|
const DEFAULT_DATA_ZOOM_ATTRIBUTES = {
|
|
31209
31364
|
orient: "bottom",
|
|
31210
31365
|
showDetail: "auto",
|
|
@@ -31303,6 +31458,11 @@
|
|
|
31303
31458
|
}
|
|
31304
31459
|
};
|
|
31305
31460
|
|
|
31461
|
+
var DataZoomActiveTag;
|
|
31462
|
+
!function (DataZoomActiveTag) {
|
|
31463
|
+
DataZoomActiveTag.startHandler = "startHandler", DataZoomActiveTag.endHandler = "endHandler", DataZoomActiveTag.middleHandler = "middleHandler", DataZoomActiveTag.background = "background";
|
|
31464
|
+
}(DataZoomActiveTag || (DataZoomActiveTag = {}));
|
|
31465
|
+
|
|
31306
31466
|
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
31307
31467
|
var t = {};
|
|
31308
31468
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
@@ -31337,6 +31497,7 @@
|
|
|
31337
31497
|
}, this._statePointToData = state => state, this._onHandlerPointerDown = (e, tag) => {
|
|
31338
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);
|
|
31339
31499
|
}, this._onHandlerPointerMove = e => {
|
|
31500
|
+
var _a;
|
|
31340
31501
|
e.stopPropagation();
|
|
31341
31502
|
const {
|
|
31342
31503
|
start: startAttr,
|
|
@@ -31354,7 +31515,7 @@
|
|
|
31354
31515
|
start: start,
|
|
31355
31516
|
end: end
|
|
31356
31517
|
} = this.state;
|
|
31357
|
-
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));
|
|
31358
31519
|
};
|
|
31359
31520
|
const {
|
|
31360
31521
|
start: start,
|
|
@@ -31423,6 +31584,7 @@
|
|
|
31423
31584
|
};
|
|
31424
31585
|
}
|
|
31425
31586
|
_onHandlerPointerUp(e) {
|
|
31587
|
+
var _a;
|
|
31426
31588
|
e.preventDefault();
|
|
31427
31589
|
const {
|
|
31428
31590
|
start: start,
|
|
@@ -31434,7 +31596,7 @@
|
|
|
31434
31596
|
const pos = this.eventPosToStagePos(e);
|
|
31435
31597
|
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
31436
31598
|
}
|
|
31437
|
-
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));
|
|
31438
31600
|
}
|
|
31439
31601
|
_onHandlerPointerEnter(e) {
|
|
31440
31602
|
e.stopPropagation(), this._showText = !0, this.renderText();
|
|
@@ -31826,11 +31988,12 @@
|
|
|
31826
31988
|
changeEvent.manager = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem.manager, this.dispatchEvent(changeEvent);
|
|
31827
31989
|
}
|
|
31828
31990
|
setStartAndEnd(start, end) {
|
|
31991
|
+
var _a;
|
|
31829
31992
|
const {
|
|
31830
31993
|
start: startAttr,
|
|
31831
31994
|
end: endAttr
|
|
31832
31995
|
} = this.attribute;
|
|
31833
|
-
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)));
|
|
31834
31997
|
}
|
|
31835
31998
|
setPreviewData(data) {
|
|
31836
31999
|
this._previewData = data;
|
|
@@ -32795,22 +32958,14 @@
|
|
|
32795
32958
|
const target = e.target;
|
|
32796
32959
|
if (null === (_a = null == target ? void 0 : target.name) || void 0 === _a ? void 0 : _a.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
32797
32960
|
const legendItem = target.delegate;
|
|
32798
|
-
|
|
32799
|
-
|
|
32800
|
-
|
|
32801
|
-
|
|
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);
|
|
32802
32967
|
}, this._onUnHover = e => {
|
|
32803
|
-
|
|
32804
|
-
const target = e.target;
|
|
32805
|
-
if (null === (_a = null == target ? void 0 : target.name) || void 0 === _a ? void 0 : _a.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
32806
|
-
const legendItem = target.delegate;
|
|
32807
|
-
let attributeUpdate = !1;
|
|
32808
|
-
(legendItem.hasState(LegendStateValue.unSelectedHover) || legendItem.hasState(LegendStateValue.selectedHover)) && (attributeUpdate = !0), legendItem.removeState(LegendStateValue.unSelectedHover), legendItem.removeState(LegendStateValue.selectedHover), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
32809
|
-
attributeUpdate || !child.hasState(LegendStateValue.unSelectedHover) && !child.hasState(LegendStateValue.selectedHover) || (attributeUpdate = !0), child.removeState(LegendStateValue.unSelectedHover), child.removeState(LegendStateValue.selectedHover);
|
|
32810
|
-
});
|
|
32811
|
-
const focusButton = legendItem.getChildren()[0].find(node => node.name === LEGEND_ELEMENT_NAME.focus, !1);
|
|
32812
|
-
focusButton && focusButton.setAttribute("visible", !1), attributeUpdate && this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e), this._dispatchEvent(LegendEvent.legendItemUnHover, legendItem, e);
|
|
32813
|
-
}
|
|
32968
|
+
this._lastActiveItem && (this._unHover(this._lastActiveItem, e), this._lastActiveItem = null);
|
|
32814
32969
|
}, this._onClick = e => {
|
|
32815
32970
|
var _a, _b, _c, _d, _e;
|
|
32816
32971
|
const target = e.target;
|
|
@@ -32912,7 +33067,7 @@
|
|
|
32912
33067
|
hover = !0,
|
|
32913
33068
|
select = !0
|
|
32914
33069
|
} = this.attribute;
|
|
32915
|
-
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);
|
|
32916
33071
|
}
|
|
32917
33072
|
_renderEachItem(item, isSelected, index, items) {
|
|
32918
33073
|
const {
|
|
@@ -32942,7 +33097,7 @@
|
|
|
32942
33097
|
}), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = createGroup(Object.assign({
|
|
32943
33098
|
x: 0,
|
|
32944
33099
|
y: 0
|
|
32945
|
-
}, 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);
|
|
32946
33101
|
const innerGroup = createGroup({
|
|
32947
33102
|
x: 0,
|
|
32948
33103
|
y: 0,
|
|
@@ -33116,6 +33271,20 @@
|
|
|
33116
33271
|
};
|
|
33117
33272
|
return this._pager.addEventListener("toPrev", onPaging), this._pager.addEventListener("toNext", onPaging), !0;
|
|
33118
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
|
+
}
|
|
33119
33288
|
_setLegendItemState(legendItem, stateName, e) {
|
|
33120
33289
|
let attributeUpdate = !1;
|
|
33121
33290
|
legendItem.hasState(stateName) || (attributeUpdate = !0), legendItem.addState(stateName, true), legendItem.getChildren()[0].getChildren().forEach(child => {
|
|
@@ -33315,20 +33484,97 @@
|
|
|
33315
33484
|
}
|
|
33316
33485
|
}
|
|
33317
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
|
+
|
|
33318
33563
|
class BaseScale {
|
|
33564
|
+
constructor() {
|
|
33565
|
+
this._rangeFactorStart = null, this._rangeFactorEnd = null;
|
|
33566
|
+
}
|
|
33319
33567
|
_calculateWholeRange(range) {
|
|
33320
|
-
|
|
33321
|
-
if (this._rangeFactor && 2 === range.length) {
|
|
33322
|
-
const k = (range[1] - range[0]) / (this._rangeFactor[1] - this._rangeFactor[0]),
|
|
33323
|
-
b = range[0] - k * this._rangeFactor[0],
|
|
33324
|
-
r0 = b,
|
|
33325
|
-
r1 = k + b;
|
|
33326
|
-
return this._wholeRange = [r0, r1], this._wholeRange;
|
|
33327
|
-
}
|
|
33328
|
-
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;
|
|
33329
33569
|
}
|
|
33330
33570
|
rangeFactor(_, slience, clear) {
|
|
33331
|
-
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;
|
|
33332
33578
|
}
|
|
33333
33579
|
generateFishEyeTransform() {
|
|
33334
33580
|
var _a;
|
|
@@ -33377,7 +33623,7 @@
|
|
|
33377
33623
|
return new OrdinalScale().domain(this._domain).range(this._ordinalRange).unknown(this._unknown);
|
|
33378
33624
|
}
|
|
33379
33625
|
calculateVisibleDomain(range) {
|
|
33380
|
-
if (this.
|
|
33626
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && 2 === range.length) {
|
|
33381
33627
|
return [this.invert(range[0]), this.invert(range[1])];
|
|
33382
33628
|
}
|
|
33383
33629
|
return this._domain;
|
|
@@ -33415,77 +33661,6 @@
|
|
|
33415
33661
|
}
|
|
33416
33662
|
}
|
|
33417
33663
|
|
|
33418
|
-
function identity(x) {
|
|
33419
|
-
return x;
|
|
33420
|
-
}
|
|
33421
|
-
const generatePow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
|
|
33422
|
-
const sqrt$1 = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
|
|
33423
|
-
const square$1 = x => x < 0 ? -x * x : x * x;
|
|
33424
|
-
const logNegative = x => -Math.log(-x);
|
|
33425
|
-
const expNegative = x => -Math.exp(-x);
|
|
33426
|
-
const pow10 = x => isFinite(x) ? Math.pow(10, x) : x < 0 ? 0 : x;
|
|
33427
|
-
const powp = base => 10 === base ? pow10 : base === Math.E ? Math.exp : x => Math.pow(base, x);
|
|
33428
|
-
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);
|
|
33429
|
-
const symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));
|
|
33430
|
-
const symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;
|
|
33431
|
-
function normalize(a, b) {
|
|
33432
|
-
if (a = Number(a), b = Number(b), b -= a) return x => (x - a) / b;
|
|
33433
|
-
const result = Number.isNaN(b) ? NaN : .5;
|
|
33434
|
-
return () => result;
|
|
33435
|
-
}
|
|
33436
|
-
function bimap(domain, range, interpolate) {
|
|
33437
|
-
const d0 = domain[0],
|
|
33438
|
-
d1 = domain[1],
|
|
33439
|
-
r0 = range[0],
|
|
33440
|
-
r1 = range[1];
|
|
33441
|
-
let d0Fuc, r0Fuc;
|
|
33442
|
-
return d1 < d0 ? (d0Fuc = normalize(d1, d0), r0Fuc = interpolate(r1, r0)) : (d0Fuc = normalize(d0, d1), r0Fuc = interpolate(r0, r1)), x => r0Fuc(d0Fuc(x));
|
|
33443
|
-
}
|
|
33444
|
-
function bandSpace$1(count, paddingInner, paddingOuter) {
|
|
33445
|
-
let space;
|
|
33446
|
-
return space = 1 === count ? count + 2 * paddingOuter : count - paddingInner + 2 * paddingOuter, count ? space > 0 ? space : 1 : 0;
|
|
33447
|
-
}
|
|
33448
|
-
function scaleWholeRangeSize$1(count, bandwidth, paddingInner, paddingOuter) {
|
|
33449
|
-
return bandSpace$1(count, paddingInner, paddingOuter) * (bandwidth / (1 - paddingInner));
|
|
33450
|
-
}
|
|
33451
|
-
function calculateBandwidthFromWholeRangeSize(count, wholeSize, paddingInner, paddingOuter, round) {
|
|
33452
|
-
const space = bandSpace$1(count, paddingInner, paddingOuter);
|
|
33453
|
-
let step = wholeSize / Math.max(1, space || 1);
|
|
33454
|
-
round && (step = Math.floor(step));
|
|
33455
|
-
let bandwidth = step * (1 - paddingInner);
|
|
33456
|
-
return round && (bandwidth = Math.round(bandwidth)), bandwidth;
|
|
33457
|
-
}
|
|
33458
|
-
function polymap(domain, range, interpolate) {
|
|
33459
|
-
const j = Math.min(domain.length, range.length) - 1,
|
|
33460
|
-
d = new Array(j),
|
|
33461
|
-
r = new Array(j);
|
|
33462
|
-
let i = -1;
|
|
33463
|
-
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]);
|
|
33464
|
-
return function (x) {
|
|
33465
|
-
const i = bisect(domain, x, 1, j) - 1;
|
|
33466
|
-
return r[i](d[i](x));
|
|
33467
|
-
};
|
|
33468
|
-
}
|
|
33469
|
-
const nice = (domain, options) => {
|
|
33470
|
-
const newDomain = domain.slice();
|
|
33471
|
-
let startIndex = 0,
|
|
33472
|
-
endIndex = newDomain.length - 1,
|
|
33473
|
-
x0 = newDomain[startIndex],
|
|
33474
|
-
x1 = newDomain[endIndex];
|
|
33475
|
-
return x1 < x0 && ([startIndex, endIndex] = [endIndex, startIndex], [x0, x1] = [x1, x0]), newDomain[startIndex] = options.floor(x0), newDomain[endIndex] = options.ceil(x1), newDomain;
|
|
33476
|
-
};
|
|
33477
|
-
const niceNumber = function (value) {
|
|
33478
|
-
let round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
33479
|
-
const exponent = Math.floor(Math.log10(value)),
|
|
33480
|
-
fraction = value / Math.pow(10, exponent);
|
|
33481
|
-
let niceFraction;
|
|
33482
|
-
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);
|
|
33483
|
-
};
|
|
33484
|
-
const restrictNumber = (value, domain) => {
|
|
33485
|
-
let min, max;
|
|
33486
|
-
return domain[0] < domain[1] ? (min = domain[0], max = domain[1]) : (min = domain[1], max = domain[0]), Math.min(Math.max(value, min), max);
|
|
33487
|
-
};
|
|
33488
|
-
|
|
33489
33664
|
function ticks$2(start, stop, count, allowExcessive) {
|
|
33490
33665
|
let reverse;
|
|
33491
33666
|
const ticks = [];
|
|
@@ -33518,10 +33693,10 @@
|
|
|
33518
33693
|
constructor(slience) {
|
|
33519
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);
|
|
33520
33695
|
}
|
|
33521
|
-
rescale(slience) {
|
|
33696
|
+
rescale(slience, changeProperty) {
|
|
33522
33697
|
if (slience) return this;
|
|
33523
33698
|
this._wholeRange = null;
|
|
33524
|
-
const wholeRange = this._calculateWholeRange(this._range),
|
|
33699
|
+
const wholeRange = this._calculateWholeRange(this._range, changeProperty),
|
|
33525
33700
|
n = super.domain().length,
|
|
33526
33701
|
reverse = wholeRange[1] < wholeRange[0];
|
|
33527
33702
|
let start = wholeRange[Number(reverse) - 0];
|
|
@@ -33531,22 +33706,25 @@
|
|
|
33531
33706
|
const values = range(n).map(i => start + this._step * i);
|
|
33532
33707
|
return super.range(reverse ? values.reverse() : values), this.generateFishEyeTransform(), this;
|
|
33533
33708
|
}
|
|
33534
|
-
_calculateWholeRange(range) {
|
|
33535
|
-
var _a;
|
|
33709
|
+
_calculateWholeRange(range, changeProperty) {
|
|
33536
33710
|
if (this._wholeRange) return this._wholeRange;
|
|
33537
33711
|
if ((this._minBandwidth || this._maxBandwidth) && !this._isBandwidthFixedByUser()) {
|
|
33538
|
-
|
|
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);
|
|
33539
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);
|
|
33540
33719
|
}
|
|
33541
33720
|
if (this.isBandwidthFixed()) {
|
|
33542
33721
|
const wholeLength = scaleWholeRangeSize$1(super.domain().length, this._bandwidth, this._paddingInner, this._paddingOuter),
|
|
33543
33722
|
rangeFactorSize = Math.min((range[1] - range[0]) / wholeLength, 1);
|
|
33544
|
-
if (
|
|
33545
|
-
const [
|
|
33546
|
-
r0 = range[0] - wholeLength * rangeFactorStart,
|
|
33723
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd)) {
|
|
33724
|
+
const r0 = range[0] - wholeLength * this._rangeFactorStart,
|
|
33547
33725
|
r1 = r0 + wholeLength;
|
|
33548
|
-
this._wholeRange = [r0, r1], this.
|
|
33549
|
-
} 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];
|
|
33550
33728
|
return this._wholeRange;
|
|
33551
33729
|
}
|
|
33552
33730
|
return super._calculateWholeRange(range);
|
|
@@ -33557,7 +33735,7 @@
|
|
|
33557
33735
|
}
|
|
33558
33736
|
calculateVisibleDomain(range) {
|
|
33559
33737
|
const domain = this._domain;
|
|
33560
|
-
if (this.
|
|
33738
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && domain.length) {
|
|
33561
33739
|
const d0 = this._getInvertIndex(range[0]),
|
|
33562
33740
|
d1 = this._getInvertIndex(range[1]);
|
|
33563
33741
|
return domain.slice(Math.min(d0, d1), Math.max(d0, d1) + 1);
|
|
@@ -33635,6 +33813,12 @@
|
|
|
33635
33813
|
rangeFactor(_, slience) {
|
|
33636
33814
|
return _ ? (super.rangeFactor(_), this.rescale(slience)) : super.rangeFactor();
|
|
33637
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
|
+
}
|
|
33638
33822
|
bandwidth(_, slience) {
|
|
33639
33823
|
return _ ? ("auto" === _ ? (this._bandwidth = void 0, this._isFixed = !1) : (this._bandwidth = _, this._isFixed = !0), this._userBandwidth = _, this.rescale(slience)) : this._bandwidth;
|
|
33640
33824
|
}
|
|
@@ -33685,7 +33869,7 @@
|
|
|
33685
33869
|
}
|
|
33686
33870
|
calculateVisibleDomain(range) {
|
|
33687
33871
|
var _a;
|
|
33688
|
-
if (this.
|
|
33872
|
+
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && 2 === range.length) {
|
|
33689
33873
|
return [this.invert(range[0]), this.invert(range[1])];
|
|
33690
33874
|
}
|
|
33691
33875
|
return null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain;
|
|
@@ -33966,7 +34150,7 @@
|
|
|
33966
34150
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
33967
34151
|
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
33968
34152
|
var _a;
|
|
33969
|
-
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);
|
|
33970
34154
|
const curNiceDomain = null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain,
|
|
33971
34155
|
originalDomain = this._domain,
|
|
33972
34156
|
start = curNiceDomain[0],
|
|
@@ -34072,7 +34256,7 @@
|
|
|
34072
34256
|
}
|
|
34073
34257
|
2 * z.length < count && (z = ticks$1(u, v, count));
|
|
34074
34258
|
} else z = ticks$1(i, j, Math.min(j - i, count)).map(this._pows);
|
|
34075
|
-
return r ? z.reverse() : z;
|
|
34259
|
+
return z = z.filter(t => 0 !== t), r ? z.reverse() : z;
|
|
34076
34260
|
}
|
|
34077
34261
|
ticks() {
|
|
34078
34262
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
@@ -34100,7 +34284,7 @@
|
|
|
34100
34284
|
} else niceType = "all";
|
|
34101
34285
|
if (niceType) {
|
|
34102
34286
|
const niceDomain = nice(originalDomain.slice(), {
|
|
34103
|
-
floor: x => Math.floor(x),
|
|
34287
|
+
floor: x => this._pows(Math.floor(this._logs(x))),
|
|
34104
34288
|
ceil: x => Math.ceil(x)
|
|
34105
34289
|
});
|
|
34106
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;
|
|
@@ -36430,7 +36614,7 @@
|
|
|
36430
36614
|
if (isVisible(itemAttr.shape) && itemGroup.createOrUpdateChild(`${itemGroupName}-shape`, Object.assign({
|
|
36431
36615
|
visible: !0,
|
|
36432
36616
|
x: itemAttr.shape.size / 2,
|
|
36433
|
-
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
|
|
36434
36618
|
}, itemAttr.shape), "symbol"), hasContentShape && (x += itemAttr.shape.size + itemAttr.shape.spacing), isVisible(itemAttr.key)) {
|
|
36435
36619
|
let element;
|
|
36436
36620
|
element = itemAttr.key.multiLine ? itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
@@ -37660,7 +37844,7 @@
|
|
|
37660
37844
|
let scaleX, scaleY;
|
|
37661
37845
|
return nativeCanvas && (scaleX = rect.width / nativeCanvas.offsetWidth, scaleY = rect.height / nativeCanvas.offsetHeight), {
|
|
37662
37846
|
x: (x - rect.left) / (isValidNumber$1(scaleX) ? scaleX : 1),
|
|
37663
|
-
y: (y - rect.top) / (isValidNumber$1(scaleY) ?
|
|
37847
|
+
y: (y - rect.top) / (isValidNumber$1(scaleY) ? scaleY : 1)
|
|
37664
37848
|
};
|
|
37665
37849
|
}
|
|
37666
37850
|
return {
|
|
@@ -39892,7 +40076,7 @@
|
|
|
39892
40076
|
width = data.width, height = data.height;
|
|
39893
40077
|
}
|
|
39894
40078
|
let dpr = params.dpr;
|
|
39895
|
-
if (
|
|
40079
|
+
if (null == dpr) {
|
|
39896
40080
|
dpr = null !== (_a = canvas.getContext("2d").pixelRatio) && void 0 !== _a ? _a : canvas.width / width;
|
|
39897
40081
|
}
|
|
39898
40082
|
this.canvas = new BrowserCanvas({
|
|
@@ -48588,7 +48772,7 @@
|
|
|
48588
48772
|
}
|
|
48589
48773
|
};
|
|
48590
48774
|
|
|
48591
|
-
const sankey
|
|
48775
|
+
const sankey = {
|
|
48592
48776
|
link: {
|
|
48593
48777
|
style: {
|
|
48594
48778
|
fillOpacity: 0.15,
|
|
@@ -48665,7 +48849,7 @@
|
|
|
48665
48849
|
rangeColumn,
|
|
48666
48850
|
circlePacking,
|
|
48667
48851
|
heatmap,
|
|
48668
|
-
sankey
|
|
48852
|
+
sankey,
|
|
48669
48853
|
rose,
|
|
48670
48854
|
boxPlot,
|
|
48671
48855
|
correlation: correlation$1
|
|
@@ -57892,7 +58076,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57892
58076
|
};
|
|
57893
58077
|
registerVChartCore();
|
|
57894
58078
|
|
|
57895
|
-
const version = "1.6.
|
|
58079
|
+
const version = "1.6.4";
|
|
57896
58080
|
|
|
57897
58081
|
class ChartData {
|
|
57898
58082
|
get dataList() {
|
|
@@ -76950,19 +77134,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76950
77134
|
}, !0);
|
|
76951
77135
|
};
|
|
76952
77136
|
|
|
76953
|
-
const
|
|
76954
|
-
|
|
76955
|
-
|
|
76956
|
-
|
|
76957
|
-
|
|
76958
|
-
|
|
76959
|
-
|
|
76960
|
-
|
|
76961
|
-
|
|
76962
|
-
|
|
76963
|
-
|
|
76964
|
-
|
|
76965
|
-
|
|
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 [];
|
|
76966
77159
|
}
|
|
76967
77160
|
if (data.length > 1) {
|
|
76968
77161
|
const updateData = {
|
|
@@ -76974,58 +77167,42 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76974
77167
|
updateData[datum.id] = datum.values;
|
|
76975
77168
|
}
|
|
76976
77169
|
});
|
|
76977
|
-
|
|
77170
|
+
return [updateData];
|
|
76978
77171
|
}
|
|
76979
|
-
|
|
76980
|
-
|
|
76981
|
-
data = data[0].latestData[0];
|
|
76982
|
-
}
|
|
76983
|
-
else {
|
|
76984
|
-
data = data[0];
|
|
76985
|
-
}
|
|
77172
|
+
if ((_a = data[0]) === null || _a === void 0 ? void 0 : _a.latestData) {
|
|
77173
|
+
return data[0].latestData;
|
|
76986
77174
|
}
|
|
76987
|
-
|
|
76988
|
-
|
|
76989
|
-
|
|
76990
|
-
|
|
76991
|
-
|
|
76992
|
-
|
|
76993
|
-
for (const key in datum) {
|
|
76994
|
-
if (key === op.sourceField) {
|
|
76995
|
-
updatedDatum.source = datum[op.sourceField];
|
|
76996
|
-
}
|
|
76997
|
-
else if (key === op.targetField) {
|
|
76998
|
-
updatedDatum.target = datum[op.targetField];
|
|
76999
|
-
}
|
|
77000
|
-
else if (key === op.valueField) {
|
|
77001
|
-
updatedDatum.value = datum[op.valueField];
|
|
77002
|
-
}
|
|
77003
|
-
else {
|
|
77004
|
-
updatedDatum[key] = datum[key];
|
|
77005
|
-
}
|
|
77006
|
-
}
|
|
77007
|
-
updatedData.push(updatedDatum);
|
|
77008
|
-
});
|
|
77009
|
-
data[key] = updatedData;
|
|
77010
|
-
}
|
|
77011
|
-
}
|
|
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 [];
|
|
77012
77181
|
}
|
|
77013
|
-
const
|
|
77014
|
-
|
|
77015
|
-
|
|
77016
|
-
|
|
77017
|
-
|
|
77018
|
-
|
|
77019
|
-
|
|
77020
|
-
|
|
77021
|
-
|
|
77022
|
-
|
|
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) {
|
|
77023
77194
|
const updatedData = [];
|
|
77024
|
-
|
|
77195
|
+
originalData.links.forEach((datum) => {
|
|
77025
77196
|
const updatedDatum = {};
|
|
77026
77197
|
for (const key in datum) {
|
|
77027
|
-
if (key ===
|
|
77028
|
-
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];
|
|
77029
77206
|
}
|
|
77030
77207
|
else {
|
|
77031
77208
|
updatedDatum[key] = datum[key];
|
|
@@ -77033,17 +77210,31 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77033
77210
|
}
|
|
77034
77211
|
updatedData.push(updatedDatum);
|
|
77035
77212
|
});
|
|
77036
|
-
|
|
77213
|
+
originalData.links = updatedData;
|
|
77037
77214
|
}
|
|
77038
|
-
|
|
77039
|
-
|
|
77040
|
-
|
|
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
|
+
}
|
|
77041
77227
|
}
|
|
77042
|
-
|
|
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);
|
|
77043
77234
|
}
|
|
77044
77235
|
const layout = new SankeyLayout(op);
|
|
77045
77236
|
const result = [];
|
|
77046
|
-
result.push(layout.layout(
|
|
77237
|
+
result.push(layout.layout(originalData, view));
|
|
77047
77238
|
return result;
|
|
77048
77239
|
};
|
|
77049
77240
|
|
|
@@ -77765,12 +77956,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77765
77956
|
this._labelLimit = (_c = (_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.limit) !== null && _c !== void 0 ? _c : 100;
|
|
77766
77957
|
}
|
|
77767
77958
|
initData() {
|
|
77768
|
-
var _a, _b, _c, _d
|
|
77959
|
+
var _a, _b, _c, _d;
|
|
77769
77960
|
super.initData();
|
|
77770
|
-
|
|
77771
|
-
|
|
77772
|
-
|
|
77773
|
-
|
|
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',
|
|
77774
77971
|
options: {
|
|
77775
77972
|
view: () => {
|
|
77776
77973
|
return {
|
|
@@ -77799,12 +77996,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77799
77996
|
},
|
|
77800
77997
|
level: TransformLevel.sankeyLayout
|
|
77801
77998
|
});
|
|
77802
|
-
const
|
|
77803
|
-
|
|
77804
|
-
registerDataSetInstanceTransform(
|
|
77805
|
-
|
|
77806
|
-
registerDataSetInstanceTransform(nodesDataSet, 'flatten', flatten);
|
|
77807
|
-
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` });
|
|
77808
78003
|
nodesDataView.parse([this.getViewData()], {
|
|
77809
78004
|
type: 'dataview'
|
|
77810
78005
|
});
|
|
@@ -77822,7 +78017,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77822
78017
|
return node;
|
|
77823
78018
|
}
|
|
77824
78019
|
}
|
|
77825
|
-
});
|
|
78020
|
+
}, false);
|
|
77826
78021
|
nodesDataView.transform({
|
|
77827
78022
|
type: 'addVChartProperty',
|
|
77828
78023
|
options: {
|
|
@@ -77830,13 +78025,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77830
78025
|
call: addDataKey
|
|
77831
78026
|
}
|
|
77832
78027
|
}, false);
|
|
77833
|
-
(_e = this._data) === null || _e === void 0 ? void 0 : _e.getDataView().target.addListener('change', nodesDataView.reRunAllTransform);
|
|
77834
78028
|
this._nodesSeriesData = new SeriesData(this._option, nodesDataView);
|
|
77835
|
-
|
|
77836
|
-
|
|
77837
|
-
registerDataSetInstanceTransform(linksDataSet, 'sankeyLinks', sankeyLinks);
|
|
77838
|
-
registerDataSetInstanceTransform(linksDataSet, 'addVChartProperty', addVChartProperty);
|
|
77839
|
-
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` });
|
|
77840
78031
|
linksDataView.parse([this.getViewData()], {
|
|
77841
78032
|
type: 'dataview'
|
|
77842
78033
|
});
|
|
@@ -77850,7 +78041,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77850
78041
|
call: addDataKey
|
|
77851
78042
|
}
|
|
77852
78043
|
}, false);
|
|
77853
|
-
(_f = this._data) === null || _f === void 0 ? void 0 : _f.getDataView().target.addListener('change', linksDataView.reRunAllTransform);
|
|
77854
78044
|
this._linksSeriesData = new SeriesData(this._option, linksDataView);
|
|
77855
78045
|
}
|
|
77856
78046
|
}
|
|
@@ -77922,11 +78112,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77922
78112
|
y1: (datum) => datum.y1,
|
|
77923
78113
|
thickness: (datum) => datum.thickness,
|
|
77924
78114
|
fill: (datum) => {
|
|
77925
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
77926
|
-
const
|
|
78115
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
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)
|
|
77927
78121
|
? datum.source
|
|
77928
78122
|
: this.getNodeList()[datum.source];
|
|
77929
|
-
return (_g =
|
|
78123
|
+
return (_g = this._colorScale) === null || _g === void 0 ? void 0 : _g.scale(sourceName);
|
|
77930
78124
|
},
|
|
77931
78125
|
direction: (_a = this._spec.direction) !== null && _a !== void 0 ? _a : 'horizontal'
|
|
77932
78126
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
|
|
@@ -78141,12 +78335,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78141
78335
|
}
|
|
78142
78336
|
}
|
|
78143
78337
|
nodesSeriesDataUpdate() {
|
|
78144
|
-
this.event.emit(ChartEvent.legendFilter, { model: this });
|
|
78145
78338
|
this._nodesSeriesData.updateData();
|
|
78146
78339
|
this._setNodeOrdinalColorScale();
|
|
78147
78340
|
}
|
|
78148
78341
|
linksSeriesDataUpdate() {
|
|
78149
|
-
this.event.emit(ChartEvent.legendFilter, { model: this });
|
|
78150
78342
|
this._linksSeriesData.updateData();
|
|
78151
78343
|
}
|
|
78152
78344
|
initTooltip() {
|
|
@@ -78215,22 +78407,50 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78215
78407
|
getMeasureField() {
|
|
78216
78408
|
return [this._valueField];
|
|
78217
78409
|
}
|
|
78218
|
-
|
|
78219
|
-
var _a
|
|
78220
|
-
if (this.
|
|
78221
|
-
|
|
78222
|
-
(_b = (_a = this._nodesSeriesData) === null || _a === void 0 ? void 0 : _a.getDataView()) === null || _b === void 0 ? void 0 : _b.latestData.forEach((datum) => {
|
|
78223
|
-
var _a;
|
|
78224
|
-
keyArray.push((_a = datum[this._seriesField]) !== null && _a !== void 0 ? _a : datum.datum[this._seriesField]);
|
|
78225
|
-
});
|
|
78226
|
-
return keyArray;
|
|
78410
|
+
getRawDataStatisticsByField(field, isNumeric) {
|
|
78411
|
+
var _a;
|
|
78412
|
+
if (!this._rawStatisticsCache) {
|
|
78413
|
+
this._rawStatisticsCache = {};
|
|
78227
78414
|
}
|
|
78228
|
-
|
|
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;
|
|
78229
78450
|
}
|
|
78230
78451
|
onLayoutEnd(ctx) {
|
|
78231
78452
|
super.onLayoutEnd(ctx);
|
|
78232
78453
|
this._viewBox.set(0, 0, this._region.getLayoutRect().width, this._region.getLayoutRect().height);
|
|
78233
|
-
this._rawData.reRunAllTransform();
|
|
78234
78454
|
this.getViewData().reRunAllTransform();
|
|
78235
78455
|
this._nodesSeriesData.updateData();
|
|
78236
78456
|
this._linksSeriesData.updateData();
|
|
@@ -79798,6 +80018,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79798
80018
|
this._orient = v;
|
|
79799
80019
|
this._layoutOrient = v;
|
|
79800
80020
|
}
|
|
80021
|
+
set autoIndentOnce(v) {
|
|
80022
|
+
this._autoIndentOnce = v;
|
|
80023
|
+
}
|
|
79801
80024
|
getScales() {
|
|
79802
80025
|
return this._scales;
|
|
79803
80026
|
}
|
|
@@ -79815,6 +80038,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79815
80038
|
this.layoutZIndex = LayoutZIndex.Axis;
|
|
79816
80039
|
this.layoutLevel = LayoutLevel.Axis;
|
|
79817
80040
|
this._orient = 'left';
|
|
80041
|
+
this._autoIndentOnce = false;
|
|
80042
|
+
this._hasAutoIndent = false;
|
|
79818
80043
|
this._scales = [];
|
|
79819
80044
|
this._statisticsDomain = { domain: [], index: {} };
|
|
79820
80045
|
this._tick = undefined;
|
|
@@ -80429,17 +80654,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80429
80654
|
this._layoutCache[key] = rect[key];
|
|
80430
80655
|
}
|
|
80431
80656
|
});
|
|
80432
|
-
|
|
80433
|
-
|
|
80434
|
-
this.
|
|
80435
|
-
}
|
|
80436
|
-
|
|
80437
|
-
|
|
80438
|
-
|
|
80439
|
-
|
|
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
|
+
}
|
|
80440
80673
|
return rect;
|
|
80441
80674
|
}
|
|
80442
80675
|
_clearLayoutCache() {
|
|
80676
|
+
this._hasAutoIndent = false;
|
|
80443
80677
|
this._layoutCache.width = 0;
|
|
80444
80678
|
this._layoutCache.height = 0;
|
|
80445
80679
|
this._layoutCache._lastComputeOutBounds = { x1: 0, x2: 0, y1: 0, y2: 0 };
|
|
@@ -86474,8 +86708,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86474
86708
|
});
|
|
86475
86709
|
}
|
|
86476
86710
|
_handleChange(start, end, updateComponent) {
|
|
86477
|
-
var _a;
|
|
86478
|
-
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;
|
|
86479
86713
|
if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
|
|
86480
86714
|
return;
|
|
86481
86715
|
}
|
|
@@ -86644,6 +86878,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86644
86878
|
this._relatedAxisComponent = bandAxis;
|
|
86645
86879
|
}
|
|
86646
86880
|
}
|
|
86881
|
+
if (this._relatedAxisComponent && this._filterMode === IFilterMode.axis) {
|
|
86882
|
+
this._relatedAxisComponent.autoIndentOnce = true;
|
|
86883
|
+
}
|
|
86647
86884
|
}
|
|
86648
86885
|
_setRegionsFromSpec() {
|
|
86649
86886
|
var _a, _b;
|
|
@@ -86964,7 +87201,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86964
87201
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
86965
87202
|
const delayType = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType) !== null && _b !== void 0 ? _b : 'throttle';
|
|
86966
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;
|
|
86967
|
-
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;
|
|
86968
87205
|
const option = { delayType, delayTime, realTime };
|
|
86969
87206
|
if (this._zoomAttr.enable) {
|
|
86970
87207
|
this.initZoomEventOfRegions(this._regions, null, this._handleChartZoom, option);
|
|
@@ -87196,20 +87433,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87196
87433
|
}
|
|
87197
87434
|
}
|
|
87198
87435
|
_updateScaleRange() {
|
|
87436
|
+
var _a, _b;
|
|
87199
87437
|
const handlerSize = (this._startHandlerSize + this._endHandlerSize) / 2;
|
|
87200
87438
|
if (!this._stateScale || !this._valueScale) {
|
|
87201
87439
|
return;
|
|
87202
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];
|
|
87203
87446
|
if (this._isHorizontal) {
|
|
87204
|
-
this.
|
|
87447
|
+
stateScaleRange = this._visible ? [0, this._computeWidth() - handlerSize] : defaultRange;
|
|
87448
|
+
this._stateScale.range(stateScaleRange);
|
|
87205
87449
|
this._valueScale.range([this._computeHeight() - this._middleHandlerSize, 0]);
|
|
87206
87450
|
}
|
|
87207
87451
|
else if (this.layoutOrient === 'left') {
|
|
87208
|
-
this.
|
|
87452
|
+
stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
|
|
87453
|
+
this._stateScale.range(stateScaleRange);
|
|
87209
87454
|
this._valueScale.range([this._computeWidth() - this._middleHandlerSize, 0]);
|
|
87210
87455
|
}
|
|
87211
87456
|
else {
|
|
87212
|
-
this.
|
|
87457
|
+
stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
|
|
87458
|
+
this._stateScale.range(stateScaleRange);
|
|
87213
87459
|
this._valueScale.range([0, this._computeWidth() - this._middleHandlerSize]);
|
|
87214
87460
|
}
|
|
87215
87461
|
if (this._component) {
|