@visactor/vchart 1.2.0-beta.2 → 1.2.0-beta.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/index.js +275 -129
- package/build/index.min.js +1 -1
- package/cjs/chart/waterfall/waterfall.js +1 -0
- package/cjs/chart/waterfall/waterfall.js.map +1 -1
- package/cjs/component/axis/cartesian/index.d.ts +1 -0
- package/cjs/component/axis/cartesian/index.js +1 -1
- package/cjs/component/axis/cartesian/index.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/spec.d.ts +4 -1
- package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
- package/cjs/component/axis/cartesian/linear-axis.d.ts +3 -2
- package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/log-axis.d.ts +15 -0
- package/cjs/component/axis/cartesian/log-axis.js +23 -0
- package/cjs/component/axis/cartesian/log-axis.js.map +1 -0
- package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +2 -0
- package/cjs/component/axis/mixin/linear-axis-mixin.js +13 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/base/util.js +3 -0
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +2 -3
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +6 -6
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/index.d.ts +4 -4
- package/cjs/component/index.js +6 -1
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/interface/type.d.ts +1 -0
- package/cjs/component/interface/type.js +12 -12
- package/cjs/component/interface/type.js.map +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +1 -1
- package/cjs/component/tooltip/handler/base.js +1 -1
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +1 -0
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +11 -4
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -0
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +3 -0
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/interface/event.d.ts +8 -0
- package/cjs/component/tooltip/interface/event.js +6 -0
- package/cjs/component/tooltip/interface/event.js.map +1 -0
- package/cjs/component/tooltip/interface/spec.d.ts +2 -2
- package/cjs/component/tooltip/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/processor/base.js +6 -2
- package/cjs/component/tooltip/processor/base.js.map +1 -1
- package/cjs/component/tooltip/processor/dimension-tooltip.js +3 -4
- package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/cjs/component/tooltip/processor/mark-tooltip.js +1 -2
- package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +4 -2
- package/cjs/component/tooltip/tooltip.js +21 -9
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/event.d.ts +3 -1
- package/cjs/constant/event.js +2 -1
- package/cjs/constant/event.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/data/transforms/sankey.js +10 -2
- package/cjs/data/transforms/sankey.js.map +1 -1
- package/cjs/event/interface.d.ts +3 -0
- package/cjs/event/interface.js.map +1 -1
- package/cjs/series/geo/geo.js +2 -1
- package/cjs/series/geo/geo.js.map +1 -1
- package/cjs/series/map/map.js +2 -2
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/word-cloud/base.d.ts +1 -0
- package/cjs/series/word-cloud/base.js +35 -32
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/series/word-cloud/word-cloud-3d.js +33 -33
- package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/axis/log-axis.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/axis/log-axis.js +22 -0
- package/cjs/theme/buildin-theme/light/component/axis/log-axis.js.map +1 -0
- package/cjs/typings/tooltip/handler.d.ts +1 -0
- package/cjs/typings/tooltip/handler.js.map +1 -1
- package/cjs/vchart-all.js +1 -1
- package/cjs/vchart-all.js.map +1 -1
- package/esm/chart/waterfall/waterfall.js +1 -0
- package/esm/chart/waterfall/waterfall.js.map +1 -1
- package/esm/component/axis/cartesian/index.d.ts +1 -0
- package/esm/component/axis/cartesian/index.js +2 -0
- package/esm/component/axis/cartesian/index.js.map +1 -1
- package/esm/component/axis/cartesian/interface/spec.d.ts +4 -1
- package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
- package/esm/component/axis/cartesian/linear-axis.d.ts +3 -2
- package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
- package/esm/component/axis/cartesian/log-axis.d.ts +15 -0
- package/esm/component/axis/cartesian/log-axis.js +24 -0
- package/esm/component/axis/cartesian/log-axis.js.map +1 -0
- package/esm/component/axis/mixin/linear-axis-mixin.d.ts +2 -0
- package/esm/component/axis/mixin/linear-axis-mixin.js +8 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/base/util.js +3 -0
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +2 -3
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +6 -6
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/index.d.ts +4 -4
- package/esm/component/index.js +2 -2
- package/esm/component/index.js.map +1 -1
- package/esm/component/interface/type.d.ts +1 -0
- package/esm/component/interface/type.js +12 -12
- package/esm/component/interface/type.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +1 -1
- package/esm/component/tooltip/handler/base.js +1 -1
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +1 -0
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +11 -4
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -0
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +3 -0
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/interface/event.d.ts +8 -0
- package/esm/component/tooltip/interface/event.js +2 -0
- package/esm/component/tooltip/interface/event.js.map +1 -0
- package/esm/component/tooltip/interface/spec.d.ts +2 -2
- package/esm/component/tooltip/interface/spec.js.map +1 -1
- package/esm/component/tooltip/processor/base.js +7 -1
- package/esm/component/tooltip/processor/base.js.map +1 -1
- package/esm/component/tooltip/processor/dimension-tooltip.js +2 -7
- package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/esm/component/tooltip/processor/mark-tooltip.js +0 -3
- package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +4 -2
- package/esm/component/tooltip/tooltip.js +23 -9
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/event.d.ts +3 -1
- package/esm/constant/event.js +2 -1
- package/esm/constant/event.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/data/transforms/sankey.js +10 -2
- package/esm/data/transforms/sankey.js.map +1 -1
- package/esm/event/interface.d.ts +3 -0
- package/esm/event/interface.js.map +1 -1
- package/esm/series/geo/geo.js +2 -1
- package/esm/series/geo/geo.js.map +1 -1
- package/esm/series/map/map.js +2 -2
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/word-cloud/base.d.ts +1 -0
- package/esm/series/word-cloud/base.js +35 -32
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/series/word-cloud/word-cloud-3d.js +33 -33
- package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/axis/log-axis.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/axis/log-axis.js +18 -0
- package/esm/theme/buildin-theme/light/component/axis/log-axis.js.map +1 -0
- package/esm/typings/tooltip/handler.d.ts +1 -0
- package/esm/typings/tooltip/handler.js.map +1 -1
- package/esm/vchart-all.js +2 -2
- package/esm/vchart-all.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -2588,6 +2588,7 @@
|
|
|
2588
2588
|
ComponentTypeEnum["cartesianBandAxis"] = "cartesianAxis-band";
|
|
2589
2589
|
ComponentTypeEnum["cartesianLinearAxis"] = "cartesianAxis-linear";
|
|
2590
2590
|
ComponentTypeEnum["cartesianTimeAxis"] = "cartesianAxis-time";
|
|
2591
|
+
ComponentTypeEnum["cartesianLogAxis"] = "cartesianAxis-log";
|
|
2591
2592
|
ComponentTypeEnum["polarAxis"] = "polarAxis";
|
|
2592
2593
|
ComponentTypeEnum["polarBandAxis"] = "polarAxis-band";
|
|
2593
2594
|
ComponentTypeEnum["polarLinearAxis"] = "polarAxis-linear";
|
|
@@ -17830,11 +17831,13 @@
|
|
|
17830
17831
|
return console.error("暂不支持该函数"), nodes;
|
|
17831
17832
|
}
|
|
17832
17833
|
insertBefore(newNode, referenceNode) {
|
|
17834
|
+
if (!referenceNode) return this.appendChild(newNode);
|
|
17833
17835
|
if (this._uid === newNode._uid) return null;
|
|
17834
17836
|
if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");
|
|
17835
17837
|
return referenceNode.parent !== this ? null : (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, newNode._prev = referenceNode._prev, referenceNode._prev ? referenceNode._prev._next = newNode : this._firstChild = newNode, referenceNode._prev = newNode, newNode._next = referenceNode, this._idMap || (this._idMap = new Map()), this._idMap.set(newNode._uid, newNode), this._structEdit = !0, this.setCount(newNode.count), newNode);
|
|
17836
17838
|
}
|
|
17837
17839
|
insertAfter(newNode, referenceNode) {
|
|
17840
|
+
if (!referenceNode) return this.appendChild(newNode);
|
|
17838
17841
|
if (this._uid === newNode._uid) return null;
|
|
17839
17842
|
if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");
|
|
17840
17843
|
return referenceNode.parent !== this ? null : (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, referenceNode._next ? (referenceNode._next._prev = newNode, newNode._next = referenceNode._next) : this._lastChild = newNode, referenceNode._next = newNode, newNode._prev = referenceNode, this._idMap || (this._idMap = new Map()), this._idMap.set(newNode._uid, newNode), this._structEdit = !0, this.setCount(newNode.count), newNode);
|
|
@@ -35659,10 +35662,12 @@
|
|
|
35659
35662
|
};
|
|
35660
35663
|
|
|
35661
35664
|
const transform$9 = (options, upstreamData) => {
|
|
35665
|
+
var _a;
|
|
35662
35666
|
const positiveValues = new Map(),
|
|
35663
35667
|
negativeValues = new Map(),
|
|
35664
35668
|
needSum = options.asPercentStack || options.asPrevPercentStack || options.asPercent || options.asSum,
|
|
35665
|
-
|
|
35669
|
+
orient = null !== (_a = options.orient) && void 0 !== _a ? _a : "positive",
|
|
35670
|
+
data = "negative" === orient ? upstreamData.slice().reverse() : upstreamData,
|
|
35666
35671
|
defaultDimValue = Symbol("dim");
|
|
35667
35672
|
let stackedValues = data.map(datum => {
|
|
35668
35673
|
var _a, _b, _c;
|
|
@@ -35693,7 +35698,7 @@
|
|
|
35693
35698
|
newDatum = Object.assign({}, datum),
|
|
35694
35699
|
sum = null !== (_a = (value >= 0 ? positiveValues : negativeValues).get(dimension)) && void 0 !== _a ? _a : 0;
|
|
35695
35700
|
return options.asSum && (newDatum[options.asSum] = sum), options.asPercent && (newDatum[options.asPercent] = 0 === sum ? 0 : value / sum), options.asPercentStack && (newDatum[options.asPercentStack] = 0 === sum ? 0 : stack / sum), options.asPrevPercentStack && (newDatum[options.asPrevPercentStack] = 0 === sum ? 0 : prevStack / sum), options.asPrevStack && (newDatum[options.asPrevStack] = prevStack), newDatum[null !== (_b = options.asStack) && void 0 !== _b ? _b : options.stackField] = stack, newDatum;
|
|
35696
|
-
})), "negative" ===
|
|
35701
|
+
})), "negative" === orient ? stackedValues.reverse() : stackedValues;
|
|
35697
35702
|
};
|
|
35698
35703
|
|
|
35699
35704
|
const transform$8 = (options, upstreamData) => {
|
|
@@ -36164,9 +36169,9 @@
|
|
|
36164
36169
|
}
|
|
36165
36170
|
}],
|
|
36166
36171
|
[GrammarMarkType.area]: [{
|
|
36167
|
-
channels: ["x", "y", "x1", "y1"
|
|
36172
|
+
channels: ["x", "y", "x1", "y1"],
|
|
36168
36173
|
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
36169
|
-
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
36174
|
+
graphicAttributes.x = 0, graphicAttributes.y = 0, graphicAttributes.x1 = 0, graphicAttributes.y1 = 0;
|
|
36170
36175
|
}
|
|
36171
36176
|
}],
|
|
36172
36177
|
[GrammarMarkType.line]: [{
|
|
@@ -37996,7 +38001,7 @@
|
|
|
37996
38001
|
y: y
|
|
37997
38002
|
}
|
|
37998
38003
|
};
|
|
37999
|
-
return isValidNumber(min) && (animateAttributes.to.min = center, animateAttributes.from.min = min), isValidNumber(max) && (animateAttributes.to.max = center, animateAttributes.from.max = max), isValidNumber(q1) && (animateAttributes.to.q1 = center, animateAttributes.from.q1 = q1), isValidNumber(q3) && (animateAttributes.to.q3 = center, animateAttributes.from.q3 = q3), isValidNumber(median) && (animateAttributes.to.median = center, animateAttributes.from.median =
|
|
38004
|
+
return isValidNumber(min) && (animateAttributes.to.min = center, animateAttributes.from.min = min), isValidNumber(max) && (animateAttributes.to.max = center, animateAttributes.from.max = max), isValidNumber(q1) && (animateAttributes.to.q1 = center, animateAttributes.from.q1 = q1), isValidNumber(q3) && (animateAttributes.to.q3 = center, animateAttributes.from.q3 = q3), isValidNumber(median) && (animateAttributes.to.median = center, animateAttributes.from.median = median), animateAttributes;
|
|
38000
38005
|
},
|
|
38001
38006
|
computeBoxplotCenter = (glyphElement, direction, options) => {
|
|
38002
38007
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -38082,6 +38087,8 @@
|
|
|
38082
38087
|
x1: x + width / 2
|
|
38083
38088
|
}))), attributes;
|
|
38084
38089
|
};
|
|
38090
|
+
const boxplotScaleIn = scaleIn(computeBoxplotCenter);
|
|
38091
|
+
const boxplotScaleOut = scaleOut(computeBoxplotCenter);
|
|
38085
38092
|
function registerBoxplotGlyph() {
|
|
38086
38093
|
registerGlyph("boxplot", {
|
|
38087
38094
|
shaft: "rule",
|
|
@@ -38199,7 +38206,7 @@
|
|
|
38199
38206
|
median: {
|
|
38200
38207
|
visible: !1
|
|
38201
38208
|
}
|
|
38202
|
-
})), registerAnimationType("boxplotScaleIn",
|
|
38209
|
+
})), registerAnimationType("boxplotScaleIn", boxplotScaleIn), registerAnimationType("boxplotScaleOut", boxplotScaleOut);
|
|
38203
38210
|
}
|
|
38204
38211
|
const computeBarBoxplotCenter = (glyphElement, direction, options) => {
|
|
38205
38212
|
var _a, _b, _c, _d;
|
|
@@ -38277,6 +38284,8 @@
|
|
|
38277
38284
|
x1: x + width / 2
|
|
38278
38285
|
}))), attributes;
|
|
38279
38286
|
};
|
|
38287
|
+
const barBoxplotScaleIn = scaleIn(computeBarBoxplotCenter);
|
|
38288
|
+
const barBoxplotScaleOut = scaleOut(computeBarBoxplotCenter);
|
|
38280
38289
|
function registerBarBoxplotGlyph() {
|
|
38281
38290
|
registerGlyph("barBoxplot", {
|
|
38282
38291
|
minMaxBox: "rect",
|
|
@@ -38371,7 +38380,7 @@
|
|
|
38371
38380
|
median: {
|
|
38372
38381
|
visible: !1
|
|
38373
38382
|
}
|
|
38374
|
-
})), registerAnimationType("barBoxplotScaleIn",
|
|
38383
|
+
})), registerAnimationType("barBoxplotScaleIn", barBoxplotScaleIn), registerAnimationType("barBoxplotScaleOut", barBoxplotScaleOut);
|
|
38375
38384
|
}
|
|
38376
38385
|
|
|
38377
38386
|
const getHorizontalPath = (options, ratio) => {
|
|
@@ -38622,7 +38631,7 @@
|
|
|
38622
38631
|
Object.keys(from).forEach(channel => {
|
|
38623
38632
|
isNil(from[channel]) && delete from[channel];
|
|
38624
38633
|
});
|
|
38625
|
-
const computePoints = isValidPointsChannel(Object.keys(from), element.mark.markType);
|
|
38634
|
+
const computePoints = isValidPointsChannel(Object.keys(from), element.mark.markType) && !isValid(from.segments);
|
|
38626
38635
|
if (computePoints) {
|
|
38627
38636
|
const items = element.items.map(item => Object.assign({}, item, {
|
|
38628
38637
|
nextAttrs: from
|
|
@@ -38635,7 +38644,7 @@
|
|
|
38635
38644
|
Object.keys(to).forEach(channel => {
|
|
38636
38645
|
isNil(to[channel]) && delete to[channel];
|
|
38637
38646
|
});
|
|
38638
|
-
const computePoints = isValidPointsChannel(Object.keys(to), element.mark.markType);
|
|
38647
|
+
const computePoints = isValidPointsChannel(Object.keys(to), element.mark.markType) && !isValid(to.segments);
|
|
38639
38648
|
if (computePoints) {
|
|
38640
38649
|
const items = element.items.map(item => Object.assign({}, item, {
|
|
38641
38650
|
nextAttrs: to
|
|
@@ -39445,10 +39454,11 @@
|
|
|
39445
39454
|
});
|
|
39446
39455
|
}
|
|
39447
39456
|
encodeCustom(nextAttrs) {
|
|
39457
|
+
var _a;
|
|
39448
39458
|
let customEncodeValues = {};
|
|
39449
39459
|
const channelEncoder = this.glyphMeta.getChannelEncoder(),
|
|
39450
39460
|
functionEncoder = this.glyphMeta.getFunctionEncoder();
|
|
39451
|
-
if (functionEncoder && (customEncodeValues = functionEncoder.call(null, nextAttrs, this.getDatum(), this, this.mark.getGlyphConfig())), channelEncoder) {
|
|
39461
|
+
if (functionEncoder && (customEncodeValues = functionEncoder.call(null, Object.assign({}, null === (_a = this.graphicItem) || void 0 === _a ? void 0 : _a.attribute, nextAttrs), this.getDatum(), this, this.mark.getGlyphConfig())), channelEncoder) {
|
|
39452
39462
|
let allAttrs;
|
|
39453
39463
|
Object.keys(channelEncoder).forEach(channel => {
|
|
39454
39464
|
var _a;
|
|
@@ -39834,7 +39844,7 @@
|
|
|
39834
39844
|
}
|
|
39835
39845
|
getScalesByChannel() {
|
|
39836
39846
|
const encoders = this.spec.encode;
|
|
39837
|
-
if (!encoders) return;
|
|
39847
|
+
if (!encoders) return {};
|
|
39838
39848
|
const res = {},
|
|
39839
39849
|
params = this.parameters();
|
|
39840
39850
|
return Object.keys(encoders).forEach(state => {
|
|
@@ -40575,8 +40585,7 @@
|
|
|
40575
40585
|
maxWidth: maxWidth,
|
|
40576
40586
|
padding = 4,
|
|
40577
40587
|
visible: visible,
|
|
40578
|
-
state: state
|
|
40579
|
-
formatMethod: formatMethod
|
|
40588
|
+
state: state
|
|
40580
40589
|
} = this.attribute,
|
|
40581
40590
|
parsedPadding = normalizePadding$1(padding),
|
|
40582
40591
|
group = this.createOrUpdateChild("tag-content", {
|
|
@@ -40608,7 +40617,7 @@
|
|
|
40608
40617
|
}
|
|
40609
40618
|
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
40610
40619
|
const textAttrs = Object.assign(Object.assign({
|
|
40611
|
-
text:
|
|
40620
|
+
text: text,
|
|
40612
40621
|
visible: isValid(text) && !1 !== visible,
|
|
40613
40622
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
40614
40623
|
}, textStyle), {
|
|
@@ -41415,6 +41424,24 @@
|
|
|
41415
41424
|
function defaultLabelPosition(type) {
|
|
41416
41425
|
return "rect" === type ? DefaultRectPositions : DefaultPositions;
|
|
41417
41426
|
}
|
|
41427
|
+
function clampText(text, width, height) {
|
|
41428
|
+
const {
|
|
41429
|
+
x1: x1,
|
|
41430
|
+
x2: x2,
|
|
41431
|
+
y1: y1,
|
|
41432
|
+
y2: y2
|
|
41433
|
+
} = text.AABBBounds,
|
|
41434
|
+
minX = Math.min(x1, x2),
|
|
41435
|
+
maxX = Math.max(x1, x2),
|
|
41436
|
+
minY = Math.min(y1, y2),
|
|
41437
|
+
maxY = Math.max(y1, y2);
|
|
41438
|
+
let dx = 0,
|
|
41439
|
+
dy = 0;
|
|
41440
|
+
return minX < 0 && maxX - minX <= width ? dx = -minX : maxX > width && minX - (maxX - width) >= 0 && (dx = width - maxX), minY < 0 && maxY - minY <= height ? dy = -minY : maxY > height && minY - (maxY - height) >= 0 && (dy = height - maxY), {
|
|
41441
|
+
dx: dx,
|
|
41442
|
+
dy: dy
|
|
41443
|
+
};
|
|
41444
|
+
}
|
|
41418
41445
|
|
|
41419
41446
|
const fadeIn = function () {
|
|
41420
41447
|
let textAttribute = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -41493,9 +41520,17 @@
|
|
|
41493
41520
|
this._bmpTool = bmpTool;
|
|
41494
41521
|
}
|
|
41495
41522
|
render() {
|
|
41496
|
-
|
|
41497
|
-
|
|
41498
|
-
|
|
41523
|
+
this._prepare();
|
|
41524
|
+
const {
|
|
41525
|
+
overlap: overlap,
|
|
41526
|
+
smartInvert: smartInvert,
|
|
41527
|
+
dataFilter: dataFilter,
|
|
41528
|
+
customLayoutFunc: customLayoutFunc,
|
|
41529
|
+
customOverlapFunc: customOverlapFunc
|
|
41530
|
+
} = this.attribute;
|
|
41531
|
+
let labels,
|
|
41532
|
+
data = this.attribute.data;
|
|
41533
|
+
isFunction(dataFilter) && (data = dataFilter(data)), isFunction(customLayoutFunc) ? labels = customLayoutFunc(data, d => this._idToGraphic.get(d.id)) : (labels = this.layout(data), isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, d => this._idToGraphic.get(d.id)) : !1 !== overlap && (labels = this._overlapping(labels))), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels);
|
|
41499
41534
|
}
|
|
41500
41535
|
_bindEvent(target) {
|
|
41501
41536
|
if (!target) return;
|
|
@@ -41514,52 +41549,53 @@
|
|
|
41514
41549
|
const text = createText(attributes);
|
|
41515
41550
|
return this._bindEvent(text), this._setStates(text), text;
|
|
41516
41551
|
}
|
|
41517
|
-
|
|
41552
|
+
_prepare() {
|
|
41518
41553
|
var _a;
|
|
41519
41554
|
const baseMarks = this.getBaseMarks(),
|
|
41520
41555
|
currentBaseMarks = [];
|
|
41521
|
-
|
|
41556
|
+
if (baseMarks.forEach(mark => {
|
|
41522
41557
|
"willRelease" !== mark.releaseStatus && currentBaseMarks.push(mark);
|
|
41523
|
-
}),
|
|
41524
|
-
}
|
|
41525
|
-
layout(currentMarks) {
|
|
41558
|
+
}), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), this._baseMarks = currentBaseMarks, !currentBaseMarks || 0 === currentBaseMarks.length) return;
|
|
41526
41559
|
const {
|
|
41527
|
-
textStyle: textStyle,
|
|
41528
|
-
position: position,
|
|
41529
|
-
offset: offset
|
|
41530
|
-
} = this.attribute;
|
|
41531
|
-
let {
|
|
41532
41560
|
data: data
|
|
41533
41561
|
} = this.attribute;
|
|
41534
|
-
if (
|
|
41535
|
-
|
|
41536
|
-
|
|
41562
|
+
if (data && 0 !== data.length) {
|
|
41563
|
+
this._idToGraphic || (this._idToGraphic = new Map());
|
|
41564
|
+
for (let i = 0; i < currentBaseMarks.length; i++) {
|
|
41565
|
+
const textData = data[i],
|
|
41566
|
+
baseMark = currentBaseMarks[i];
|
|
41567
|
+
textData && baseMark && (isValid(textData.id) || (textData.id = `vrender-component-${this.name}-${i}`), this._idToGraphic.set(textData.id, baseMark));
|
|
41568
|
+
}
|
|
41569
|
+
}
|
|
41570
|
+
}
|
|
41571
|
+
layout() {
|
|
41572
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
41573
|
+
const {
|
|
41574
|
+
textStyle = {},
|
|
41575
|
+
position: position,
|
|
41576
|
+
offset: offset
|
|
41577
|
+
} = this.attribute,
|
|
41578
|
+
labels = [];
|
|
41537
41579
|
for (let i = 0; i < data.length; i++) {
|
|
41538
41580
|
const textData = data[i],
|
|
41539
|
-
baseMark =
|
|
41540
|
-
labelAttribute = Object.assign(Object.assign(
|
|
41541
|
-
|
|
41542
|
-
|
|
41543
|
-
|
|
41544
|
-
|
|
41545
|
-
|
|
41546
|
-
|
|
41547
|
-
|
|
41548
|
-
|
|
41549
|
-
y: textData.y
|
|
41550
|
-
}),
|
|
41551
|
-
textAttributes = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
|
|
41552
|
-
if (!textAttributes) continue;
|
|
41553
|
-
labelAttribute.x = textAttributes.x, labelAttribute.y = textAttributes.y, labels.push(labelAttribute);
|
|
41554
|
-
}
|
|
41581
|
+
baseMark = this._idToGraphic.get(textData.id),
|
|
41582
|
+
labelAttribute = Object.assign(Object.assign({}, textStyle), textData),
|
|
41583
|
+
text = this._createLabelText(labelAttribute),
|
|
41584
|
+
textBounds = this.getGraphicBounds(text),
|
|
41585
|
+
graphicBounds = this.getGraphicBounds(baseMark, {
|
|
41586
|
+
x: textData.x,
|
|
41587
|
+
y: textData.y
|
|
41588
|
+
}),
|
|
41589
|
+
textLocation = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
|
|
41590
|
+
textLocation && (labelAttribute.x = textLocation.x, labelAttribute.y = textLocation.y, text.setAttributes(textLocation), labels.push(text));
|
|
41555
41591
|
}
|
|
41556
|
-
return
|
|
41592
|
+
return labels;
|
|
41557
41593
|
}
|
|
41558
|
-
|
|
41559
|
-
|
|
41560
|
-
var _a, _b, _c, _d, _e;
|
|
41594
|
+
_overlapping(labels) {
|
|
41595
|
+
var _a, _b, _c, _d;
|
|
41561
41596
|
if (0 === labels.length) return [];
|
|
41562
|
-
const
|
|
41597
|
+
const option = this.attribute.overlap,
|
|
41598
|
+
result = [],
|
|
41563
41599
|
baseMarkGroup = this.getBaseMarkGroup(),
|
|
41564
41600
|
size = null !== (_a = option.size) && void 0 !== _a ? _a : {
|
|
41565
41601
|
width: null !== (_b = null == baseMarkGroup ? void 0 : baseMarkGroup.AABBBounds.width()) && void 0 !== _b ? _b : 0,
|
|
@@ -41580,27 +41616,45 @@
|
|
|
41580
41616
|
}));
|
|
41581
41617
|
for (let i = 0; i < labels.length; i++) {
|
|
41582
41618
|
if (!1 === labels[i].visible) continue;
|
|
41583
|
-
const text =
|
|
41584
|
-
baseMark =
|
|
41619
|
+
const text = labels[i],
|
|
41620
|
+
baseMark = this._idToGraphic.get(text.attribute.id);
|
|
41585
41621
|
if (text.update(), canPlace(bmpTool, bitmap, text.AABBBounds, clampForce)) {
|
|
41586
41622
|
if (!checkBounds) {
|
|
41587
|
-
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(
|
|
41623
|
+
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
41588
41624
|
continue;
|
|
41589
41625
|
}
|
|
41590
41626
|
if (checkBounds && (null == baseMark ? void 0 : baseMark.AABBBounds) && canPlaceInside(text.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds)) {
|
|
41591
|
-
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(
|
|
41627
|
+
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
41592
41628
|
continue;
|
|
41593
41629
|
}
|
|
41594
41630
|
}
|
|
41595
41631
|
let hasPlace = !1;
|
|
41596
41632
|
for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this.getGraphicBounds(baseMark, labels[i]), this.labeling), !1 !== hasPlace) {
|
|
41597
|
-
|
|
41633
|
+
text.setAttributes({
|
|
41598
41634
|
x: hasPlace.x,
|
|
41599
41635
|
y: hasPlace.y
|
|
41600
|
-
}));
|
|
41636
|
+
}), result.push(text);
|
|
41601
41637
|
break;
|
|
41602
41638
|
}
|
|
41603
|
-
|
|
41639
|
+
if (clampForce) {
|
|
41640
|
+
const {
|
|
41641
|
+
dx = 0,
|
|
41642
|
+
dy = 0
|
|
41643
|
+
} = clampText(text, bmpTool.width, bmpTool.height);
|
|
41644
|
+
if ((0 !== dx || 0 !== dy) && canPlace(bmpTool, bitmap, {
|
|
41645
|
+
x1: text.AABBBounds.x1 + dx,
|
|
41646
|
+
x2: text.AABBBounds.x2 + dx,
|
|
41647
|
+
y1: text.AABBBounds.y1 + dy,
|
|
41648
|
+
y2: text.AABBBounds.y2 + dy
|
|
41649
|
+
})) {
|
|
41650
|
+
text.setAttributes({
|
|
41651
|
+
x: text.attribute.x + dx,
|
|
41652
|
+
y: text.attribute.y + dy
|
|
41653
|
+
}), bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
41654
|
+
continue;
|
|
41655
|
+
}
|
|
41656
|
+
}
|
|
41657
|
+
!hasPlace && !hideOnHit && result.push(text);
|
|
41604
41658
|
}
|
|
41605
41659
|
return isFunction(this.onAfterLabelOverlap) && this.onAfterLabelOverlap(bitmap), result;
|
|
41606
41660
|
}
|
|
@@ -41632,17 +41686,16 @@
|
|
|
41632
41686
|
easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : DefaultLabelAnimation.easing,
|
|
41633
41687
|
delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0,
|
|
41634
41688
|
currentTextMap = new Map(),
|
|
41635
|
-
prevTextMap = this.
|
|
41689
|
+
prevTextMap = this._graphicToText || new Map(),
|
|
41636
41690
|
texts = [];
|
|
41637
|
-
labels.forEach((
|
|
41638
|
-
const
|
|
41639
|
-
relatedGraphic = this._relationMap.get(label._relatedIndex),
|
|
41691
|
+
labels.forEach((text, index) => {
|
|
41692
|
+
const relatedGraphic = this._idToGraphic.get(text.attribute.id),
|
|
41640
41693
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
|
|
41641
41694
|
if ("enter" === state) if (texts.push(text), currentTextMap.set(relatedGraphic, text), !disableAnimation && relatedGraphic) {
|
|
41642
41695
|
const {
|
|
41643
41696
|
from: from,
|
|
41644
41697
|
to: to
|
|
41645
|
-
} = getAnimationAttributes(
|
|
41698
|
+
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
41646
41699
|
this.add(text), relatedGraphic.onAnimateBind = () => {
|
|
41647
41700
|
text.setAttributes(from);
|
|
41648
41701
|
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {
|
|
@@ -41667,7 +41720,7 @@
|
|
|
41667
41720
|
disableAnimation ? this.removeChild(label) : null == label || label.animate().to(getAnimationAttributes(label.attribute, "fadeOut").to, duration, easing).onEnd(() => {
|
|
41668
41721
|
this.removeChild(label);
|
|
41669
41722
|
});
|
|
41670
|
-
}), this.
|
|
41723
|
+
}), this._graphicToText = currentTextMap;
|
|
41671
41724
|
}
|
|
41672
41725
|
_afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, _ref) {
|
|
41673
41726
|
let {
|
|
@@ -41710,21 +41763,32 @@
|
|
|
41710
41763
|
return listener;
|
|
41711
41764
|
}
|
|
41712
41765
|
_smartInvert(labels) {
|
|
41713
|
-
|
|
41714
|
-
|
|
41715
|
-
|
|
41766
|
+
const option = this.attribute.smartInvert || {},
|
|
41767
|
+
{
|
|
41768
|
+
textType: textType,
|
|
41769
|
+
contrastRatiosThreshold: contrastRatiosThreshold,
|
|
41770
|
+
alternativeColors: alternativeColors
|
|
41771
|
+
} = option;
|
|
41772
|
+
for (let i = 0; i < labels.length; i++) {
|
|
41773
|
+
const label = labels[i];
|
|
41716
41774
|
if (!label) continue;
|
|
41717
|
-
const
|
|
41718
|
-
|
|
41719
|
-
|
|
41720
|
-
|
|
41721
|
-
|
|
41722
|
-
|
|
41723
|
-
|
|
41724
|
-
label.
|
|
41725
|
-
|
|
41726
|
-
|
|
41727
|
-
|
|
41775
|
+
const baseMark = this._idToGraphic.get(label.attribute.id),
|
|
41776
|
+
isInside = canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds);
|
|
41777
|
+
if (label.attribute.stroke && label.attribute.lineWidth > 0) label.setAttributes({
|
|
41778
|
+
fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
|
|
41779
|
+
});else if (isInside) {
|
|
41780
|
+
const backgroundColor = baseMark.attribute.fill,
|
|
41781
|
+
foregroundColor = label.attribute.fill;
|
|
41782
|
+
label.setAttributes({
|
|
41783
|
+
fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
|
|
41784
|
+
});
|
|
41785
|
+
} else if (label.attribute.lineWidth > 0) {
|
|
41786
|
+
const backgroundColor = label.attribute.stroke,
|
|
41787
|
+
foregroundColor = label.attribute.fill;
|
|
41788
|
+
label.setAttributes({
|
|
41789
|
+
stroke: baseMark.attribute.fill,
|
|
41790
|
+
fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
|
|
41791
|
+
});
|
|
41728
41792
|
}
|
|
41729
41793
|
}
|
|
41730
41794
|
}
|
|
@@ -42107,6 +42171,9 @@
|
|
|
42107
42171
|
line.name = "line", line.id = this._getNodeId("line"), isEmpty(null == state ? void 0 : state.line) || (line.states = state.line), this.line = line, this.add(line);
|
|
42108
42172
|
}
|
|
42109
42173
|
renderSymbol(attribute, dim) {
|
|
42174
|
+
const {
|
|
42175
|
+
autoRotate = !0
|
|
42176
|
+
} = attribute;
|
|
42110
42177
|
let symbol;
|
|
42111
42178
|
if (null == attribute ? void 0 : attribute.visible) {
|
|
42112
42179
|
const startAngle = this._startAngle,
|
|
@@ -42135,7 +42202,7 @@
|
|
|
42135
42202
|
}, rotate = endAngle + Math.PI / 2), symbol = createSymbol(Object.assign(Object.assign(Object.assign({}, position), {
|
|
42136
42203
|
symbolType: symbolType,
|
|
42137
42204
|
size: size,
|
|
42138
|
-
angle: rotate + refAngle,
|
|
42205
|
+
angle: autoRotate ? rotate + refAngle : 0,
|
|
42139
42206
|
strokeBoundsBuffer: 0
|
|
42140
42207
|
}), style)), symbol.name = `${dim}-symbol`, symbol.id = this._getNodeId(`${dim}-symbol`), isEmpty(null == state ? void 0 : state.symbol) || (symbol.states = state.symbol), this.add(symbol);
|
|
42141
42208
|
}
|
|
@@ -42156,6 +42223,7 @@
|
|
|
42156
42223
|
},
|
|
42157
42224
|
startSymbol: {
|
|
42158
42225
|
visible: !1,
|
|
42226
|
+
autoRotate: !0,
|
|
42159
42227
|
symbolType: "triangle",
|
|
42160
42228
|
size: 12,
|
|
42161
42229
|
refX: 0,
|
|
@@ -42168,6 +42236,7 @@
|
|
|
42168
42236
|
},
|
|
42169
42237
|
endSymbol: {
|
|
42170
42238
|
visible: !1,
|
|
42239
|
+
autoRotate: !0,
|
|
42171
42240
|
symbolType: "triangle",
|
|
42172
42241
|
size: 12,
|
|
42173
42242
|
refX: 0,
|
|
@@ -47840,7 +47909,7 @@
|
|
|
47840
47909
|
super(view, ComponentEnum.axis, group), this.spec.componentType = ComponentEnum.axis, this.spec.axisType = "line", this.mode = mode;
|
|
47841
47910
|
}
|
|
47842
47911
|
parseAddition(spec) {
|
|
47843
|
-
return super.parseAddition(spec), this.tickCount(spec.tickCount), this.inside(spec.inside), this.baseValue(spec.baseValue), this;
|
|
47912
|
+
return super.parseAddition(spec), this.axisType(spec.axisType), this.tickCount(spec.tickCount), this.inside(spec.inside), this.baseValue(spec.baseValue), this;
|
|
47844
47913
|
}
|
|
47845
47914
|
axisType(axisType) {
|
|
47846
47915
|
return this.spec.axisType = axisType, this._axisComponentType = null, this._prepareRejoin(), this.commit(), this;
|
|
@@ -51599,6 +51668,8 @@
|
|
|
51599
51668
|
ChartEvent["legendItemClick"] = "legendItemClick";
|
|
51600
51669
|
ChartEvent["legendItemHover"] = "legendItemHover";
|
|
51601
51670
|
ChartEvent["legendItemUnHover"] = "legendItemUnHover";
|
|
51671
|
+
ChartEvent["tooltipShow"] = "tooltipShow";
|
|
51672
|
+
ChartEvent["tooltipHide"] = "tooltipHide";
|
|
51602
51673
|
})(ChartEvent || (ChartEvent = {}));
|
|
51603
51674
|
var Event_Source_Type;
|
|
51604
51675
|
(function (Event_Source_Type) {
|
|
@@ -58168,7 +58239,7 @@
|
|
|
58168
58239
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
58169
58240
|
Factory.registerRegion('region', Region);
|
|
58170
58241
|
Factory.registerLayout('base', Layout);
|
|
58171
|
-
const version = "1.2.0-beta.
|
|
58242
|
+
const version = "1.2.0-beta.4";
|
|
58172
58243
|
Logger.getInstance(LoggerLevel.Error);
|
|
58173
58244
|
|
|
58174
58245
|
var SeriesMarkNameEnum;
|
|
@@ -65116,7 +65187,7 @@
|
|
|
65116
65187
|
coordinate = 'geo';
|
|
65117
65188
|
_mapViewData;
|
|
65118
65189
|
getMapViewData() {
|
|
65119
|
-
return this._mapViewData
|
|
65190
|
+
return this._mapViewData?.getDataView();
|
|
65120
65191
|
}
|
|
65121
65192
|
_mapViewDataStatistics;
|
|
65122
65193
|
_nameField;
|
|
@@ -65469,7 +65540,9 @@
|
|
|
65469
65540
|
spec?.nameMap !== nameMap ||
|
|
65470
65541
|
spec?.valueField !== valueField ||
|
|
65471
65542
|
spec?.nameProperty !== nameProperty) {
|
|
65543
|
+
result.change = true;
|
|
65472
65544
|
result.reRender = true;
|
|
65545
|
+
result.reMake = true;
|
|
65473
65546
|
}
|
|
65474
65547
|
return result;
|
|
65475
65548
|
}
|
|
@@ -69005,7 +69078,7 @@
|
|
|
69005
69078
|
for (this.data = data; i < n;) {
|
|
69006
69079
|
if (this.layoutWord(i) && i++, this.progressiveIndex = i, this.exceedTime()) break;
|
|
69007
69080
|
}
|
|
69008
|
-
if (!this.options.clip && this.options.enlarge && this.shrinkBoard(this._bounds), ["cardioid", "triangle", "triangle-upright"].includes(this.options.shape)) {
|
|
69081
|
+
if (!this.options.clip && this.options.enlarge && this._bounds && this.shrinkBoard(this._bounds), this._bounds && ["cardioid", "triangle", "triangle-upright"].includes(this.options.shape)) {
|
|
69009
69082
|
const currentCenterY = (this._bounds[0].y + this._bounds[1].y) / 2;
|
|
69010
69083
|
this._dy = -(currentCenterY - this._size[1] / 2);
|
|
69011
69084
|
}
|
|
@@ -69530,8 +69603,9 @@
|
|
|
69530
69603
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
69531
69604
|
if (options.size && (!options.size[0] || !options.size[1])) return upstreamData;
|
|
69532
69605
|
const data = upstreamData,
|
|
69533
|
-
canvasSize = null !== (_a = options.size) && void 0 !== _a ? _a : [500, 500]
|
|
69534
|
-
|
|
69606
|
+
canvasSize = (null !== (_a = options.size) && void 0 !== _a ? _a : [500, 500]).slice();
|
|
69607
|
+
canvasSize[0] = Math.floor(canvasSize[0]), canvasSize[1] = Math.floor(canvasSize[1]);
|
|
69608
|
+
const fontFamily = options.fontFamily ? field$1(options.fontFamily) : "sans-serif",
|
|
69535
69609
|
fontStyle = options.fontStyle ? field$1(options.fontStyle) : "normal",
|
|
69536
69610
|
fontWeight = options.fontWeight ? field$1(options.fontWeight) : "normal",
|
|
69537
69611
|
rotate = options.rotate ? field$1(options.rotate) : 0,
|
|
@@ -70877,15 +70951,11 @@
|
|
|
70877
70951
|
});
|
|
70878
70952
|
}
|
|
70879
70953
|
const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
|
|
70880
|
-
const srView = this.getCompiler().getVGrammarView();
|
|
70881
70954
|
if (!this._isWordCloudShape) {
|
|
70882
70955
|
wordCloudTransforms.push({
|
|
70883
70956
|
type: 'wordcloud',
|
|
70884
70957
|
layoutType: !isTrueBrowser(this._option.mode) ? 'fast' : this._wordCloudConfig.layoutMode,
|
|
70885
|
-
size: [
|
|
70886
|
-
srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
|
|
70887
|
-
srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
|
|
70888
|
-
],
|
|
70958
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70889
70959
|
shape: this._maskShape,
|
|
70890
70960
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
70891
70961
|
text: { field: textField },
|
|
@@ -70910,7 +70980,7 @@
|
|
|
70910
70980
|
wordCloudTransforms.push({
|
|
70911
70981
|
type: 'wordcloudShape',
|
|
70912
70982
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
70913
|
-
size: [
|
|
70983
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70914
70984
|
shape: this._maskShape,
|
|
70915
70985
|
text: { field: this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField },
|
|
70916
70986
|
fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],
|
|
@@ -70985,6 +71055,10 @@
|
|
|
70985
71055
|
}
|
|
70986
71056
|
setValueFieldToPercent() {
|
|
70987
71057
|
}
|
|
71058
|
+
onLayoutEnd(ctx) {
|
|
71059
|
+
super.onLayoutEnd(ctx);
|
|
71060
|
+
this.compile();
|
|
71061
|
+
}
|
|
70988
71062
|
updateSpec(spec) {
|
|
70989
71063
|
const originalSpec = this._originalSpec;
|
|
70990
71064
|
const result = super.updateSpec(spec);
|
|
@@ -71050,15 +71124,11 @@
|
|
|
71050
71124
|
});
|
|
71051
71125
|
}
|
|
71052
71126
|
const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
|
|
71053
|
-
const srView = this.getCompiler().getVGrammarView();
|
|
71054
71127
|
if (!this._isWordCloudShape) {
|
|
71055
71128
|
wordCloudTransforms.push({
|
|
71056
71129
|
type: 'wordcloud',
|
|
71057
71130
|
layoutType: this._wordCloudConfig.layoutMode,
|
|
71058
|
-
size: [
|
|
71059
|
-
srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
|
|
71060
|
-
srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
|
|
71061
|
-
],
|
|
71131
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
71062
71132
|
shape: this._maskShape,
|
|
71063
71133
|
postProjection: this._spec.postProjection ?? 'StereographicProjection',
|
|
71064
71134
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
@@ -71084,7 +71154,7 @@
|
|
|
71084
71154
|
else {
|
|
71085
71155
|
wordCloudTransforms.push({
|
|
71086
71156
|
type: 'wordcloudShape',
|
|
71087
|
-
size: [
|
|
71157
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
71088
71158
|
shape: this._maskShape,
|
|
71089
71159
|
postProjection: this._spec.postProjection ?? 'StereographicProjection',
|
|
71090
71160
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
@@ -74004,11 +74074,25 @@
|
|
|
74004
74074
|
view.y1 - view.y0 === Infinity) {
|
|
74005
74075
|
return data;
|
|
74006
74076
|
}
|
|
74007
|
-
if (data
|
|
74008
|
-
|
|
74077
|
+
if (data.length > 1) {
|
|
74078
|
+
const updateData = {
|
|
74079
|
+
links: [],
|
|
74080
|
+
nodes: []
|
|
74081
|
+
};
|
|
74082
|
+
data.forEach((datum) => {
|
|
74083
|
+
if (datum.id === 'links' || datum.id === 'nodes') {
|
|
74084
|
+
updateData[datum.id] = datum.values;
|
|
74085
|
+
}
|
|
74086
|
+
});
|
|
74087
|
+
data = updateData;
|
|
74009
74088
|
}
|
|
74010
74089
|
else {
|
|
74011
|
-
|
|
74090
|
+
if (data[0]?.latestData) {
|
|
74091
|
+
data = data[0].latestData[0];
|
|
74092
|
+
}
|
|
74093
|
+
else {
|
|
74094
|
+
data = data[0];
|
|
74095
|
+
}
|
|
74012
74096
|
}
|
|
74013
74097
|
if (op.sourceField !== 'source' || op.targetField !== 'target') {
|
|
74014
74098
|
for (const key in data) {
|
|
@@ -77398,6 +77482,7 @@
|
|
|
77398
77482
|
_getDefaultSeriesSpec(spec) {
|
|
77399
77483
|
return {
|
|
77400
77484
|
...super._getDefaultSeriesSpec(spec),
|
|
77485
|
+
bar: spec.bar,
|
|
77401
77486
|
stackLabel: spec.stackLabel,
|
|
77402
77487
|
leaderLine: spec.leaderLine,
|
|
77403
77488
|
total: spec.total
|
|
@@ -77593,6 +77678,8 @@
|
|
|
77593
77678
|
return getCartesianAxisTheme(getOrient(componentSpec), 'band', theme);
|
|
77594
77679
|
case ComponentTypeEnum.cartesianLinearAxis:
|
|
77595
77680
|
return getCartesianAxisTheme(getOrient(componentSpec), 'linear', theme);
|
|
77681
|
+
case ComponentTypeEnum.cartesianLogAxis:
|
|
77682
|
+
return getCartesianAxisTheme(getOrient(componentSpec), 'log', theme);
|
|
77596
77683
|
case ComponentTypeEnum.cartesianAxis:
|
|
77597
77684
|
case ComponentTypeEnum.cartesianTimeAxis:
|
|
77598
77685
|
return getCartesianAxisTheme(getOrient(componentSpec), undefined, theme);
|
|
@@ -78145,9 +78232,6 @@
|
|
|
78145
78232
|
return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
|
|
78146
78233
|
}
|
|
78147
78234
|
_handleStateChange = (startValue, endValue) => {
|
|
78148
|
-
if (startValue === this._startValue && endValue === this._endValue) {
|
|
78149
|
-
return false;
|
|
78150
|
-
}
|
|
78151
78235
|
this._startValue = startValue;
|
|
78152
78236
|
this._endValue = endValue;
|
|
78153
78237
|
this._newDomain = this._parseDomainFromState(this._startValue, this._endValue);
|
|
@@ -78394,12 +78478,12 @@
|
|
|
78394
78478
|
this._middleHandlerSize = this._computeMiddleHandlerSize();
|
|
78395
78479
|
this._width = this._computeWidth();
|
|
78396
78480
|
this._height = this._computeHeight();
|
|
78397
|
-
if (this._originalSpec
|
|
78481
|
+
if (isNil(this._originalSpec?.startHandler?.style?.size)) {
|
|
78398
78482
|
this._spec.startHandler.style.size = this._isHorizontal
|
|
78399
78483
|
? this._height - this._middleHandlerSize
|
|
78400
78484
|
: this._width - this._middleHandlerSize;
|
|
78401
78485
|
}
|
|
78402
|
-
if (this._originalSpec
|
|
78486
|
+
if (isNil(this._originalSpec?.startHandler?.style?.size)) {
|
|
78403
78487
|
this._spec.endHandler.style.size = this._isHorizontal
|
|
78404
78488
|
? this._height - this._middleHandlerSize
|
|
78405
78489
|
: this._width - this._middleHandlerSize;
|
|
@@ -78482,7 +78566,8 @@
|
|
|
78482
78566
|
const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
|
|
78483
78567
|
const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
|
|
78484
78568
|
const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
|
|
78485
|
-
|
|
78569
|
+
const xField = this._isHorizontal ? this._stateField : this._valueField;
|
|
78570
|
+
return xScale.scale(datum[xField]) + this.getLayoutStartPoint().x + offsetLeft + offsetHandler;
|
|
78486
78571
|
};
|
|
78487
78572
|
_dataToPositionX2 = (datum) => {
|
|
78488
78573
|
const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
|
|
@@ -78495,7 +78580,8 @@
|
|
|
78495
78580
|
const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
|
|
78496
78581
|
const offsetHandler = this._isHorizontal ? 0 : this._startHandlerSize / 2;
|
|
78497
78582
|
const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
|
|
78498
|
-
|
|
78583
|
+
const yField = this._isHorizontal ? this._valueField : this._stateField;
|
|
78584
|
+
return yScale.scale(datum[yField]) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
|
|
78499
78585
|
};
|
|
78500
78586
|
_dataToPositionY2 = (datum) => {
|
|
78501
78587
|
const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
|
|
@@ -81252,7 +81338,7 @@
|
|
|
81252
81338
|
transformScaleDomain() {
|
|
81253
81339
|
this.setScaleNice();
|
|
81254
81340
|
}
|
|
81255
|
-
|
|
81341
|
+
setLinearScaleNice() {
|
|
81256
81342
|
let tickCount = this._spec.tick?.forceTickCount ?? this._spec.tick?.tickCount ?? 10;
|
|
81257
81343
|
if (this._spec.niceType === 'accurateFirst') {
|
|
81258
81344
|
tickCount = Math.max(10, tickCount);
|
|
@@ -81267,6 +81353,25 @@
|
|
|
81267
81353
|
this._nice && this._scale.niceMin(tickCount);
|
|
81268
81354
|
}
|
|
81269
81355
|
}
|
|
81356
|
+
setLogScaleNice() {
|
|
81357
|
+
if (isNil(this._domain?.min) && isNil(this._domain?.max)) {
|
|
81358
|
+
this._nice && this._scale.nice();
|
|
81359
|
+
}
|
|
81360
|
+
else if (isValid(this._domain?.min) && isNil(this._domain?.max)) {
|
|
81361
|
+
this._nice && this._scale.niceMax();
|
|
81362
|
+
}
|
|
81363
|
+
else if (isNil(this._domain?.min) && isValid(this._domain?.max)) {
|
|
81364
|
+
this._nice && this._scale.niceMin();
|
|
81365
|
+
}
|
|
81366
|
+
}
|
|
81367
|
+
setScaleNice() {
|
|
81368
|
+
if (this._spec.type === 'log') {
|
|
81369
|
+
this.setLogScaleNice();
|
|
81370
|
+
}
|
|
81371
|
+
else {
|
|
81372
|
+
this.setLinearScaleNice();
|
|
81373
|
+
}
|
|
81374
|
+
}
|
|
81270
81375
|
dataToPosition(values, cfg) {
|
|
81271
81376
|
return this.valueToPosition(values[0]);
|
|
81272
81377
|
}
|
|
@@ -81690,6 +81795,20 @@
|
|
|
81690
81795
|
}
|
|
81691
81796
|
}
|
|
81692
81797
|
|
|
81798
|
+
class CartesianLogAxis extends CartesianLinearAxis {
|
|
81799
|
+
static type = ComponentTypeEnum.cartesianLogAxis;
|
|
81800
|
+
type = ComponentTypeEnum.cartesianLogAxis;
|
|
81801
|
+
_zero = false;
|
|
81802
|
+
_scale = new LogScale();
|
|
81803
|
+
initScales() {
|
|
81804
|
+
super.initScales();
|
|
81805
|
+
this._scale.base(this._spec.base ?? 10);
|
|
81806
|
+
}
|
|
81807
|
+
transformScaleDomain() {
|
|
81808
|
+
}
|
|
81809
|
+
}
|
|
81810
|
+
mixin(CartesianLogAxis, LinearAxisMixin);
|
|
81811
|
+
|
|
81693
81812
|
class PolarAxis extends AxisComponent {
|
|
81694
81813
|
static type = ComponentTypeEnum.polarAxis;
|
|
81695
81814
|
type = ComponentTypeEnum.polarAxis;
|
|
@@ -86600,7 +86719,7 @@
|
|
|
86600
86719
|
return TooltipResult.success;
|
|
86601
86720
|
};
|
|
86602
86721
|
hideTooltip(params) {
|
|
86603
|
-
this.changeTooltip(false, params);
|
|
86722
|
+
return this.changeTooltip(false, params);
|
|
86604
86723
|
}
|
|
86605
86724
|
release() {
|
|
86606
86725
|
this._cacheViewSpec = undefined;
|
|
@@ -87664,6 +87783,9 @@
|
|
|
87664
87783
|
_getParentElement(spec) {
|
|
87665
87784
|
return this._container ?? super._getParentElement(spec);
|
|
87666
87785
|
}
|
|
87786
|
+
isTooltipShown() {
|
|
87787
|
+
return this.getVisibility();
|
|
87788
|
+
}
|
|
87667
87789
|
reInit() {
|
|
87668
87790
|
super.reInit();
|
|
87669
87791
|
this._initStyle();
|
|
@@ -87715,7 +87837,9 @@
|
|
|
87715
87837
|
if (!visible) {
|
|
87716
87838
|
if (this._tooltipComponent && this._tooltipComponent.attribute.visible) {
|
|
87717
87839
|
this._tooltipComponent.hideAll();
|
|
87718
|
-
|
|
87840
|
+
this._tooltipComponent.setAttributes({
|
|
87841
|
+
visibleAll: false
|
|
87842
|
+
});
|
|
87719
87843
|
}
|
|
87720
87844
|
return;
|
|
87721
87845
|
}
|
|
@@ -87725,7 +87849,6 @@
|
|
|
87725
87849
|
const pos = actualTooltip?.position;
|
|
87726
87850
|
if (!params.changePositionOnly) {
|
|
87727
87851
|
this._tooltipComponent.setAttributes({
|
|
87728
|
-
visible: true,
|
|
87729
87852
|
...this._attributeCache,
|
|
87730
87853
|
...pos
|
|
87731
87854
|
});
|
|
@@ -87735,8 +87858,14 @@
|
|
|
87735
87858
|
}
|
|
87736
87859
|
if (!this._tooltipComponent.attribute.visible) {
|
|
87737
87860
|
this._tooltipComponent.showAll();
|
|
87861
|
+
this._tooltipComponent.setAttributes({
|
|
87862
|
+
visibleAll: true
|
|
87863
|
+
});
|
|
87738
87864
|
}
|
|
87739
87865
|
}
|
|
87866
|
+
isTooltipShown() {
|
|
87867
|
+
return this._tooltipComponent?.attribute.visibleAll;
|
|
87868
|
+
}
|
|
87740
87869
|
release() {
|
|
87741
87870
|
super.release();
|
|
87742
87871
|
this._layer?.release();
|
|
@@ -87750,6 +87879,12 @@
|
|
|
87750
87879
|
this.component = component;
|
|
87751
87880
|
}
|
|
87752
87881
|
_showTooltipByHandler = (data, params) => {
|
|
87882
|
+
this.component.event.emit(ChartEvent.tooltipShow, {
|
|
87883
|
+
...params,
|
|
87884
|
+
tooltipData: data,
|
|
87885
|
+
activeType: this.activeType,
|
|
87886
|
+
tooltip: this.component
|
|
87887
|
+
});
|
|
87753
87888
|
if (this.component.tooltipHandler?.showTooltip && isValid(data)) {
|
|
87754
87889
|
return this.component.tooltipHandler.showTooltip(this.activeType, data, params) ?? TooltipResult.success;
|
|
87755
87890
|
}
|
|
@@ -87772,14 +87907,9 @@
|
|
|
87772
87907
|
if (isNil(info)) {
|
|
87773
87908
|
return false;
|
|
87774
87909
|
}
|
|
87775
|
-
if (![TooltipHandlerType.dom, TooltipHandlerType.canvas].includes(this.component.tooltipHandler.type)) {
|
|
87776
|
-
return true;
|
|
87777
|
-
}
|
|
87778
87910
|
const helper = params.model?.tooltipHelper;
|
|
87779
|
-
|
|
87780
|
-
|
|
87781
|
-
}
|
|
87782
|
-
if (!helper.activeType.includes('dimension')) {
|
|
87911
|
+
const activeType = helper?.activeType ?? this.component.getSpec().activeType;
|
|
87912
|
+
if (!activeType.includes('dimension')) {
|
|
87783
87913
|
return false;
|
|
87784
87914
|
}
|
|
87785
87915
|
return true;
|
|
@@ -87868,9 +87998,6 @@
|
|
|
87868
87998
|
if (isNil(info)) {
|
|
87869
87999
|
return false;
|
|
87870
88000
|
}
|
|
87871
|
-
if (![TooltipHandlerType.dom, TooltipHandlerType.canvas].includes(this.component.tooltipHandler.type)) {
|
|
87872
|
-
return true;
|
|
87873
|
-
}
|
|
87874
88001
|
const helper = params.model?.tooltipHelper;
|
|
87875
88002
|
if (!helper?.activeType.includes('mark')) {
|
|
87876
88003
|
return false;
|
|
@@ -87930,6 +88057,10 @@
|
|
|
87930
88057
|
_cacheInfo;
|
|
87931
88058
|
_eventList = [];
|
|
87932
88059
|
_processor;
|
|
88060
|
+
_isTooltipShown = false;
|
|
88061
|
+
isTooltipShown() {
|
|
88062
|
+
return this._isTooltipShown;
|
|
88063
|
+
}
|
|
87933
88064
|
changeRegions(regions) {
|
|
87934
88065
|
}
|
|
87935
88066
|
_registerEvent() {
|
|
@@ -87956,6 +88087,7 @@
|
|
|
87956
88087
|
});
|
|
87957
88088
|
this._eventList = [];
|
|
87958
88089
|
this.tooltipHandler?.release?.();
|
|
88090
|
+
this._isTooltipShown = false;
|
|
87959
88091
|
}
|
|
87960
88092
|
_initHandler() {
|
|
87961
88093
|
const renderMode = this._spec.renderMode ?? 'html';
|
|
@@ -88070,6 +88202,9 @@
|
|
|
88070
88202
|
this._cacheInfo = tooltipInfo;
|
|
88071
88203
|
}
|
|
88072
88204
|
}
|
|
88205
|
+
if (success) {
|
|
88206
|
+
this._isTooltipShown = true;
|
|
88207
|
+
}
|
|
88073
88208
|
const vchart = this._option.globalInstance;
|
|
88074
88209
|
if (success && VChart.globalConfig.uniqueTooltip) {
|
|
88075
88210
|
VChart.hideTooltip(vchart.id);
|
|
@@ -88089,9 +88224,21 @@
|
|
|
88089
88224
|
return result;
|
|
88090
88225
|
};
|
|
88091
88226
|
_hideTooltipByHandler = (params) => {
|
|
88227
|
+
if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {
|
|
88228
|
+
return TooltipResult.success;
|
|
88229
|
+
}
|
|
88230
|
+
this.event.emit(ChartEvent.tooltipHide, {
|
|
88231
|
+
...params,
|
|
88232
|
+
tooltip: this
|
|
88233
|
+
});
|
|
88092
88234
|
if (this.tooltipHandler?.hideTooltip) {
|
|
88093
|
-
this.tooltipHandler.hideTooltip(params);
|
|
88235
|
+
const result = this.tooltipHandler.hideTooltip(params);
|
|
88236
|
+
if (!result) {
|
|
88237
|
+
this._isTooltipShown = false;
|
|
88238
|
+
}
|
|
88239
|
+
return result;
|
|
88094
88240
|
}
|
|
88241
|
+
return TooltipResult.failed;
|
|
88095
88242
|
};
|
|
88096
88243
|
_initTheme(theme) {
|
|
88097
88244
|
super._initTheme(theme);
|
|
@@ -88162,17 +88309,14 @@
|
|
|
88162
88309
|
return result;
|
|
88163
88310
|
}
|
|
88164
88311
|
hideTooltip() {
|
|
88165
|
-
|
|
88166
|
-
return false;
|
|
88167
|
-
}
|
|
88168
|
-
this._alwaysShow = false;
|
|
88169
|
-
this.tooltipHandler.hideTooltip({
|
|
88312
|
+
const params = {
|
|
88170
88313
|
changePositionOnly: false,
|
|
88171
88314
|
item: undefined,
|
|
88172
88315
|
datum: undefined,
|
|
88173
88316
|
source: Event_Source_Type.chart
|
|
88174
|
-
}
|
|
88175
|
-
|
|
88317
|
+
};
|
|
88318
|
+
this._alwaysShow = false;
|
|
88319
|
+
return !this._hideTooltipByHandler(params);
|
|
88176
88320
|
}
|
|
88177
88321
|
_isSameAsCacheInfo(nextInfo) {
|
|
88178
88322
|
if (nextInfo === this._cacheInfo) {
|
|
@@ -89024,6 +89168,7 @@
|
|
|
89024
89168
|
CartesianLinearAxis,
|
|
89025
89169
|
CartesianBandAxis,
|
|
89026
89170
|
CartesianTimeAxis,
|
|
89171
|
+
CartesianLogAxis,
|
|
89027
89172
|
PolarBandAxis,
|
|
89028
89173
|
PolarLinearAxis,
|
|
89029
89174
|
DiscreteLegend,
|
|
@@ -89069,6 +89214,7 @@
|
|
|
89069
89214
|
exports.CartesianChart = CartesianChart;
|
|
89070
89215
|
exports.CartesianCrossHair = CartesianCrossHair;
|
|
89071
89216
|
exports.CartesianLinearAxis = CartesianLinearAxis;
|
|
89217
|
+
exports.CartesianLogAxis = CartesianLogAxis;
|
|
89072
89218
|
exports.CartesianSeries = CartesianSeries;
|
|
89073
89219
|
exports.CartesianTimeAxis = CartesianTimeAxis;
|
|
89074
89220
|
exports.CellMark = CellMark;
|