@visactor/vchart 2.0.0-alpha.4 → 2.0.1-alpha.0
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 +2 -2
- package/build/index.es.js +401 -237
- package/build/index.js +401 -236
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/interface.d.ts +1 -0
- package/cjs/animation/interface.js.map +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -0
- package/cjs/chart/base/base-chart.js +3 -0
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/histogram/base/histogram-base-transformer.js +1 -1
- package/cjs/chart/histogram/base/histogram-base-transformer.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +1 -0
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/compile/compiler.js +6 -2
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/interface/common.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +1 -1
- package/cjs/component/brush/brush.js +24 -20
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +1 -0
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +1 -1
- package/cjs/component/crosshair/base.js +5 -4
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/cartesian.js +3 -2
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/crosshair/interface/common.d.ts +3 -1
- package/cjs/component/crosshair/interface/common.js.map +1 -1
- package/cjs/component/crosshair/interface/spec.d.ts +1 -0
- package/cjs/component/crosshair/interface/spec.js.map +1 -1
- package/cjs/component/crosshair/interface/theme.d.ts +2 -0
- package/cjs/component/crosshair/interface/theme.js.map +1 -1
- package/cjs/component/crosshair/utils/cartesian.js +15 -13
- package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
- package/cjs/component/crosshair/utils/common.js +8 -4
- package/cjs/component/crosshair/utils/common.js.map +1 -1
- package/cjs/component/marker/utils.js +14 -9
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +3 -0
- package/cjs/component/tooltip/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/tooltip-transformer.js +3 -1
- package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +6 -7
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +3 -1
- package/cjs/mark/base/base-mark.js +49 -43
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/group.d.ts +1 -1
- package/cjs/mark/group.js +14 -10
- package/cjs/mark/group.js.map +1 -1
- package/cjs/mark/interface/common.d.ts +1 -1
- package/cjs/mark/interface/common.js.map +1 -1
- package/cjs/model/base-model.d.ts +1 -0
- package/cjs/model/base-model.js +1 -0
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +1 -0
- package/cjs/model/interface.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +2 -3
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/cjs/series/bar/bar.d.ts +3 -0
- package/cjs/series/bar/bar.js +28 -7
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/bar/interface.d.ts +1 -0
- package/cjs/series/bar/interface.js.map +1 -1
- package/cjs/series/base/base-series.js +2 -3
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/funnel/funnel.js +0 -2
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/map/map.js +1 -2
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/pie/pie.js +0 -1
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/util/mark.d.ts +1 -0
- package/cjs/util/mark.js +10 -1
- package/cjs/util/mark.js.map +1 -1
- package/esm/animation/interface.d.ts +1 -0
- package/esm/animation/interface.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -0
- package/esm/chart/base/base-chart.js +3 -0
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/histogram/base/histogram-base-transformer.js +1 -1
- package/esm/chart/histogram/base/histogram-base-transformer.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +1 -0
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/compile/compiler.js +7 -4
- package/esm/compile/compiler.js.map +1 -1
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/interface/common.js.map +1 -1
- package/esm/component/brush/brush.d.ts +1 -1
- package/esm/component/brush/brush.js +24 -20
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +1 -0
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +1 -1
- package/esm/component/crosshair/base.js +5 -4
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/cartesian.js +3 -2
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/crosshair/interface/common.d.ts +3 -1
- package/esm/component/crosshair/interface/common.js.map +1 -1
- package/esm/component/crosshair/interface/spec.d.ts +1 -0
- package/esm/component/crosshair/interface/spec.js.map +1 -1
- package/esm/component/crosshair/interface/theme.d.ts +2 -0
- package/esm/component/crosshair/interface/theme.js.map +1 -1
- package/esm/component/crosshair/utils/cartesian.js +15 -13
- package/esm/component/crosshair/utils/cartesian.js.map +1 -1
- package/esm/component/crosshair/utils/common.js +8 -4
- package/esm/component/crosshair/utils/common.js.map +1 -1
- package/esm/component/marker/utils.js +15 -8
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +3 -0
- package/esm/component/tooltip/interface/theme.js.map +1 -1
- package/esm/component/tooltip/tooltip-transformer.js +3 -1
- package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +5 -6
- package/esm/core/vchart.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +3 -1
- package/esm/mark/base/base-mark.js +50 -42
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/group.d.ts +1 -1
- package/esm/mark/group.js +17 -9
- package/esm/mark/group.js.map +1 -1
- package/esm/mark/interface/common.d.ts +1 -1
- package/esm/mark/interface/common.js.map +1 -1
- package/esm/model/base-model.d.ts +1 -0
- package/esm/model/base-model.js +1 -0
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +1 -0
- package/esm/model/interface.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +2 -3
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/esm/series/bar/bar.d.ts +3 -0
- package/esm/series/bar/bar.js +26 -7
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/bar/interface.d.ts +1 -0
- package/esm/series/bar/interface.js.map +1 -1
- package/esm/series/base/base-series.js +2 -3
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/funnel/funnel.js +0 -2
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/map/map.js +1 -2
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/pie/pie.js +0 -1
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/util/mark.d.ts +1 -0
- package/esm/util/mark.js +7 -0
- package/esm/util/mark.js.map +1 -1
- package/package.json +6 -6
package/build/index.js
CHANGED
|
@@ -14173,9 +14173,9 @@
|
|
|
14173
14173
|
setWidthHeightWithoutTransform(aabbBounds) {
|
|
14174
14174
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
14175
14175
|
}
|
|
14176
|
-
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
14176
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
|
|
14177
14177
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
14178
|
-
Object.keys(params).forEach(key => {
|
|
14178
|
+
(animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
|
|
14179
14179
|
animate.preventAttr(key);
|
|
14180
14180
|
});
|
|
14181
14181
|
});
|
|
@@ -14346,7 +14346,7 @@
|
|
|
14346
14346
|
});
|
|
14347
14347
|
} else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
|
|
14348
14348
|
type: AttributeUpdateType.STATE
|
|
14349
|
-
});
|
|
14349
|
+
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
14350
14350
|
this._emitCustomEvent("afterStateUpdate", {
|
|
14351
14351
|
type: AttributeUpdateType.STATE
|
|
14352
14352
|
});
|
|
@@ -23552,6 +23552,18 @@
|
|
|
23552
23552
|
const changeEvent = new CustomEvent(eventName, details);
|
|
23553
23553
|
changeEvent.manager = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem.manager, this.dispatchEvent(changeEvent);
|
|
23554
23554
|
}
|
|
23555
|
+
eventPosToStagePos(e) {
|
|
23556
|
+
var _a, _b;
|
|
23557
|
+
const result = {
|
|
23558
|
+
x: 0,
|
|
23559
|
+
y: 0
|
|
23560
|
+
},
|
|
23561
|
+
stagePoints = null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventPointTransform(e)) && void 0 !== _b ? _b : {
|
|
23562
|
+
x: 0,
|
|
23563
|
+
y: 0
|
|
23564
|
+
};
|
|
23565
|
+
return this.globalTransMatrix.transformPoint(stagePoints, result), result;
|
|
23566
|
+
}
|
|
23555
23567
|
}
|
|
23556
23568
|
|
|
23557
23569
|
const MathPickerContribution = Symbol.for("MathPickerContribution");
|
|
@@ -31542,6 +31554,10 @@
|
|
|
31542
31554
|
target.attribute.x = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31543
31555
|
}, this.y = (key, from, to, ratio, step, target) => {
|
|
31544
31556
|
target.attribute.y = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31557
|
+
}, this.dx = (key, from, to, ratio, step, target) => {
|
|
31558
|
+
target.attribute.dx = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31559
|
+
}, this.dy = (key, from, to, ratio, step, target) => {
|
|
31560
|
+
target.attribute.dy = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31545
31561
|
}, this.angle = (key, from, to, ratio, step, target) => {
|
|
31546
31562
|
target.attribute.angle = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31547
31563
|
}, this.scaleX = (key, from, to, ratio, step, target) => {
|
|
@@ -31718,7 +31734,7 @@
|
|
|
31718
31734
|
return this._animateCount;
|
|
31719
31735
|
}
|
|
31720
31736
|
constructor() {
|
|
31721
|
-
super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
|
|
31737
|
+
super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this._animationEndFlag = !0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
|
|
31722
31738
|
}
|
|
31723
31739
|
isRunning() {
|
|
31724
31740
|
return !this.paused && this._animateCount > 0;
|
|
@@ -31747,10 +31763,11 @@
|
|
|
31747
31763
|
}
|
|
31748
31764
|
tick(delta) {
|
|
31749
31765
|
if (this.paused) return;
|
|
31766
|
+
this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
|
|
31750
31767
|
const scaledDelta = delta * this._playSpeed;
|
|
31751
31768
|
this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
|
|
31752
31769
|
animate.status === AnimateStatus.END ? this.removeAnimate(animate, !0) : animate.status !== AnimateStatus.RUNNING && animate.status !== AnimateStatus.INITIAL || animate.advance(scaledDelta);
|
|
31753
|
-
}), 0 === this._animateCount && this.emit("animationEnd");
|
|
31770
|
+
}), 0 === this._animateCount && (this._animationEndFlag = !0, this.emit("animationEnd"));
|
|
31754
31771
|
}
|
|
31755
31772
|
clear() {
|
|
31756
31773
|
this.forEachAccessAnimate(animate => {
|
|
@@ -31814,7 +31831,9 @@
|
|
|
31814
31831
|
return this._timeline;
|
|
31815
31832
|
}
|
|
31816
31833
|
bind(target) {
|
|
31817
|
-
return this.target = target, this.target.
|
|
31834
|
+
return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
|
|
31835
|
+
this.stop(), this.target.animates.delete(this.id);
|
|
31836
|
+
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
31818
31837
|
}
|
|
31819
31838
|
to(props, duration = 300, easing = "linear") {
|
|
31820
31839
|
const step = new Step(AnimateStepType.to, props, duration, easing);
|
|
@@ -32028,8 +32047,8 @@
|
|
|
32028
32047
|
}
|
|
32029
32048
|
init() {
|
|
32030
32049
|
this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
|
|
32031
|
-
this.initHandler();
|
|
32032
|
-
}), application.global.env && this.initHandler();
|
|
32050
|
+
this.initHandler(!1);
|
|
32051
|
+
}), application.global.env && this.initHandler(!1);
|
|
32033
32052
|
}
|
|
32034
32053
|
addTimeline(timeline) {
|
|
32035
32054
|
this.timelines.push(timeline);
|
|
@@ -32040,10 +32059,11 @@
|
|
|
32040
32059
|
getTimelines() {
|
|
32041
32060
|
return this.timelines;
|
|
32042
32061
|
}
|
|
32043
|
-
initHandler() {
|
|
32044
|
-
this.setupTickHandler();
|
|
32062
|
+
initHandler(force = !1) {
|
|
32063
|
+
this.setupTickHandler(force);
|
|
32045
32064
|
}
|
|
32046
|
-
setupTickHandler() {
|
|
32065
|
+
setupTickHandler(force = !1) {
|
|
32066
|
+
if (!force && this.tickerHandler) return !0;
|
|
32047
32067
|
const handler = new RAFTickHandler();
|
|
32048
32068
|
return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
|
|
32049
32069
|
}
|
|
@@ -32094,7 +32114,7 @@
|
|
|
32094
32114
|
return this.status = STATUS$1.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
|
|
32095
32115
|
}
|
|
32096
32116
|
stop() {
|
|
32097
|
-
this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
|
|
32117
|
+
this.status = STATUS$1.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
|
|
32098
32118
|
}
|
|
32099
32119
|
trySyncTickStatus() {
|
|
32100
32120
|
this.status === STATUS$1.INITIAL && this.timelines.some(timeline => timeline.isRunning()) ? this.start() : this.status === STATUS$1.RUNNING && this.timelines.every(timeline => !timeline.isRunning()) && this.stop();
|
|
@@ -32402,7 +32422,11 @@
|
|
|
32402
32422
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
32403
32423
|
var _a, _b, _c, _d;
|
|
32404
32424
|
if (custom && customType) {
|
|
32405
|
-
const customParams =
|
|
32425
|
+
const customParams = Object.assign({
|
|
32426
|
+
width: graphic.stage.width,
|
|
32427
|
+
height: graphic.stage.height,
|
|
32428
|
+
group: this._target.parent
|
|
32429
|
+
}, this.resolveValue(customParameters, graphic)),
|
|
32406
32430
|
objOptions = isFunction$1(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
|
|
32407
32431
|
customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
|
|
32408
32432
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
@@ -32667,7 +32691,6 @@
|
|
|
32667
32691
|
}
|
|
32668
32692
|
animate(params) {
|
|
32669
32693
|
var _a, _b, _c;
|
|
32670
|
-
this.animates || (this.animates = new Map());
|
|
32671
32694
|
const animate = new Animate(null == params ? void 0 : params.id, null !== (_b = null !== (_a = null == params ? void 0 : params.timeline) && void 0 !== _a ? _a : this.stage && this.stage.getTimeline()) && void 0 !== _b ? _b : defaultTimeline, null == params ? void 0 : params.slience);
|
|
32672
32695
|
if (animate.bind(this), params) {
|
|
32673
32696
|
const {
|
|
@@ -32677,9 +32700,7 @@
|
|
|
32677
32700
|
} = params;
|
|
32678
32701
|
null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
|
|
32679
32702
|
}
|
|
32680
|
-
return this.
|
|
32681
|
-
animate.stop(), this.animates.delete(animate.id);
|
|
32682
|
-
}), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
|
|
32703
|
+
return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
|
|
32683
32704
|
}
|
|
32684
32705
|
createTimeline() {
|
|
32685
32706
|
return new DefaultTimeline();
|
|
@@ -32718,7 +32739,7 @@
|
|
|
32718
32739
|
|
|
32719
32740
|
class ACustomAnimate extends Step {
|
|
32720
32741
|
constructor(customFrom, customTo, duration, easing, params) {
|
|
32721
|
-
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
|
|
32742
|
+
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
|
|
32722
32743
|
}
|
|
32723
32744
|
update(end, ratio, out) {
|
|
32724
32745
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
@@ -35795,18 +35816,19 @@
|
|
|
35795
35816
|
}
|
|
35796
35817
|
};
|
|
35797
35818
|
const moveOut = (graphic, options, animationParameters) => {
|
|
35798
|
-
var _a, _b, _c, _d
|
|
35819
|
+
var _a, _b, _c, _d;
|
|
35799
35820
|
const {
|
|
35800
35821
|
offset = 0,
|
|
35801
35822
|
orient: orient,
|
|
35802
35823
|
direction: direction,
|
|
35803
35824
|
point: pointOpt
|
|
35804
35825
|
} = null != options ? options : {},
|
|
35805
|
-
|
|
35806
|
-
|
|
35826
|
+
groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
|
|
35827
|
+
groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
|
|
35828
|
+
groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
|
|
35807
35829
|
changedX = ("negative" === orient ? groupWidth : 0) + offset,
|
|
35808
35830
|
changedY = ("negative" === orient ? groupHeight : 0) + offset,
|
|
35809
|
-
point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (
|
|
35831
|
+
point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, animationParameters) : pointOpt,
|
|
35810
35832
|
fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
|
|
35811
35833
|
fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
|
|
35812
35834
|
switch (direction) {
|
|
@@ -35965,11 +35987,11 @@
|
|
|
35965
35987
|
}
|
|
35966
35988
|
onBind() {
|
|
35967
35989
|
var _a, _b;
|
|
35968
|
-
super.onBind()
|
|
35990
|
+
super.onBind(), Object.keys(this.from).forEach(key => {
|
|
35991
|
+
null == this.props[key] && (this.props[key] = this.target.getGraphicAttribute(key));
|
|
35992
|
+
});
|
|
35969
35993
|
const finalAttribute = this.target.getFinalAttribute();
|
|
35970
|
-
|
|
35971
|
-
null == this.props[key] && (this.props[key] = finalAttribute[key]);
|
|
35972
|
-
}), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
|
|
35994
|
+
"appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
|
|
35973
35995
|
}
|
|
35974
35996
|
onFirstRun() {
|
|
35975
35997
|
this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
|
|
@@ -35979,6 +36001,9 @@
|
|
|
35979
36001
|
this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
|
|
35980
36002
|
}), this.target.setAttributes(this.from);
|
|
35981
36003
|
}
|
|
36004
|
+
deleteSelfAttr(key) {
|
|
36005
|
+
super.deleteSelfAttr(key), delete this.from[key];
|
|
36006
|
+
}
|
|
35982
36007
|
update(end, ratio, out) {
|
|
35983
36008
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
35984
36009
|
const easedRatio = this.easing(ratio);
|
|
@@ -36975,7 +37000,7 @@
|
|
|
36975
37000
|
const MIN_TICK_GAP = 12;
|
|
36976
37001
|
const calculateFlushPos = (basePosition, size, rangePosition, otherEnd) => rangePosition < basePosition ? Math.max(basePosition - size / 2, rangePosition) : rangePosition > basePosition ? Math.min(basePosition - size / 2, rangePosition - size) : rangePosition < otherEnd ? rangePosition : rangePosition - size;
|
|
36977
37002
|
const getCartesianLabelBounds = (scale, domain, op) => {
|
|
36978
|
-
var _a;
|
|
37003
|
+
var _a, _b, _c;
|
|
36979
37004
|
const {
|
|
36980
37005
|
labelStyle: labelStyle,
|
|
36981
37006
|
axisOrientType: axisOrientType,
|
|
@@ -36991,27 +37016,32 @@
|
|
|
36991
37016
|
scaleY = 0;
|
|
36992
37017
|
isHorizontal || (isVertical ? (scaleX = 0, scaleY = 1) : startAngle && (scaleX = Math.cos(startAngle), scaleY = -Math.sin(startAngle)));
|
|
36993
37018
|
const textMeasure = initTextMeasure$1(labelStyle),
|
|
36994
|
-
range = scale.range()
|
|
36995
|
-
|
|
36996
|
-
|
|
36997
|
-
|
|
36998
|
-
|
|
36999
|
-
|
|
37000
|
-
|
|
37001
|
-
|
|
37002
|
-
|
|
37003
|
-
|
|
37004
|
-
|
|
37005
|
-
|
|
37006
|
-
|
|
37007
|
-
|
|
37008
|
-
|
|
37009
|
-
|
|
37010
|
-
|
|
37011
|
-
|
|
37012
|
-
|
|
37013
|
-
|
|
37014
|
-
|
|
37019
|
+
range = scale.range();
|
|
37020
|
+
let labelBoundsList = [];
|
|
37021
|
+
for (let i = 0; i < domain.length; i++) {
|
|
37022
|
+
const v = domain[i],
|
|
37023
|
+
str = labelFormatter ? labelFormatter(v) : `${v}`;
|
|
37024
|
+
if (isPlainObject$1(str)) {
|
|
37025
|
+
labelBoundsList = void 0;
|
|
37026
|
+
break;
|
|
37027
|
+
}
|
|
37028
|
+
const {
|
|
37029
|
+
width: width,
|
|
37030
|
+
height: height
|
|
37031
|
+
} = textMeasure.quickMeasure(str),
|
|
37032
|
+
textWidth = Math.max(width, 12),
|
|
37033
|
+
textHeight = Math.max(height, 12),
|
|
37034
|
+
pos = scale.scale(v),
|
|
37035
|
+
baseTextX = scaleX * pos,
|
|
37036
|
+
baseTextY = scaleY * pos;
|
|
37037
|
+
let align,
|
|
37038
|
+
baseline,
|
|
37039
|
+
textX = baseTextX,
|
|
37040
|
+
textY = baseTextY;
|
|
37041
|
+
labelFlush && isHorizontal && 0 === i ? textX = calculateFlushPos(baseTextX, textWidth, range[0], range[range.length - 1]) : labelFlush && isHorizontal && i === domain.length - 1 ? textX = calculateFlushPos(baseTextX, textWidth, range[range.length - 1], range[0]) : align = null !== (_b = labelStyle.textAlign) && void 0 !== _b ? _b : "center", "right" === align ? textX -= textWidth : "center" === align && (textX -= textWidth / 2), labelFlush && isVertical && 0 === i ? textY = calculateFlushPos(baseTextY, textHeight, range[0], range[range.length - 1]) : labelFlush && isVertical && i === domain.length - 1 ? textY = calculateFlushPos(baseTextY, textHeight, range[range.length - 1], range[0]) : baseline = null !== (_c = labelStyle.textBaseline) && void 0 !== _c ? _c : "middle", "bottom" === baseline ? textY -= textHeight : "middle" === baseline && (textY -= textHeight / 2);
|
|
37042
|
+
const bounds = new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight);
|
|
37043
|
+
labelAngle && bounds.rotate(labelAngle, baseTextX, baseTextY), labelBoundsList.push(bounds);
|
|
37044
|
+
}
|
|
37015
37045
|
return labelBoundsList;
|
|
37016
37046
|
};
|
|
37017
37047
|
const isAxisHorizontal = axisOrientType => ["bottom", "top", "z"].includes(axisOrientType);
|
|
@@ -38031,7 +38061,7 @@
|
|
|
38031
38061
|
}
|
|
38032
38062
|
}
|
|
38033
38063
|
const continuousTicks = (scale, op) => {
|
|
38034
|
-
var _a, _b;
|
|
38064
|
+
var _a, _b, _c, _d;
|
|
38035
38065
|
if (!isContinuous(scale.type)) return convertDomainToTickData(scale.domain());
|
|
38036
38066
|
const range = scale.range(),
|
|
38037
38067
|
rangeSize = Math.abs(range[range.length - 1] - range[0]);
|
|
@@ -38083,23 +38113,25 @@
|
|
|
38083
38113
|
step = Math.floor(scaleTicks.length * MIN_FONT_SIZE / rangeSize);
|
|
38084
38114
|
scaleTicks.forEach((tick, index) => {
|
|
38085
38115
|
index % step != 0 && index !== scaleTicks.length - 1 || samplingScaleTicks.push(tick);
|
|
38086
|
-
}), items = getCartesianLabelBounds(scale, samplingScaleTicks, op).map((bounds, i) => ({
|
|
38116
|
+
}), items = null === (_c = getCartesianLabelBounds(scale, samplingScaleTicks, op)) || void 0 === _c ? void 0 : _c.map((bounds, i) => ({
|
|
38087
38117
|
AABBBounds: bounds,
|
|
38088
38118
|
value: samplingScaleTicks[i]
|
|
38089
38119
|
}));
|
|
38090
|
-
} else items = getCartesianLabelBounds(scale, scaleTicks, op).map((bounds, i) => ({
|
|
38120
|
+
} else items = null === (_d = getCartesianLabelBounds(scale, scaleTicks, op)) || void 0 === _d ? void 0 : _d.map((bounds, i) => ({
|
|
38091
38121
|
AABBBounds: bounds,
|
|
38092
38122
|
value: scaleTicks[i]
|
|
38093
38123
|
}));
|
|
38094
|
-
|
|
38095
|
-
|
|
38096
|
-
|
|
38097
|
-
|
|
38098
|
-
|
|
38099
|
-
|
|
38100
|
-
|
|
38101
|
-
|
|
38102
|
-
|
|
38124
|
+
if (items) {
|
|
38125
|
+
const firstSourceItem = items[0],
|
|
38126
|
+
lastSourceItem = last(items),
|
|
38127
|
+
samplingMethod = breakData && breakData() ? methods$1.greedy : methods$1.parity;
|
|
38128
|
+
for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = samplingMethod(items, labelGap);
|
|
38129
|
+
const checkFirst = op.labelFirstVisible;
|
|
38130
|
+
let checkLast = op.labelLastVisible;
|
|
38131
|
+
textIntersect(firstSourceItem, lastSourceItem, labelGap) && items.includes(lastSourceItem) && items.length > 1 && checkFirst && checkLast && (items.splice(items.indexOf(lastSourceItem), 1), checkLast = !1), forceItemVisible(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, labelGap)), forceItemVisible(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, labelGap) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, labelGap), !0);
|
|
38132
|
+
const ticks = items.map(item => item.value);
|
|
38133
|
+
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
|
|
38134
|
+
}
|
|
38103
38135
|
}
|
|
38104
38136
|
return convertDomainToTickData(scaleTicks);
|
|
38105
38137
|
};
|
|
@@ -38113,7 +38145,10 @@
|
|
|
38113
38145
|
}
|
|
38114
38146
|
};
|
|
38115
38147
|
|
|
38116
|
-
const getOneDimensionalLabelBounds = (scale, domain, op, isHorizontal) =>
|
|
38148
|
+
const getOneDimensionalLabelBounds = (scale, domain, op, isHorizontal) => {
|
|
38149
|
+
const labelBoundsList = getCartesianLabelBounds(scale, domain, op);
|
|
38150
|
+
return labelBoundsList && labelBoundsList.map(bounds => isHorizontal ? [bounds.x1, bounds.x2, bounds.width()] : [bounds.y1, bounds.y2, bounds.height()]);
|
|
38151
|
+
},
|
|
38117
38152
|
boundsOverlap = (prevBounds, nextBounds, gap = 0) => Math.max(prevBounds[0], nextBounds[0]) - gap / 2 <= Math.min(prevBounds[1], nextBounds[1]) + gap / 2;
|
|
38118
38153
|
const boundsDistance = (prevBounds, nextBounds) => prevBounds[1] < nextBounds[0] ? nextBounds[0] - prevBounds[1] : nextBounds[1] < prevBounds[0] ? prevBounds[0] - nextBounds[1] : 0;
|
|
38119
38154
|
const linearDiscreteTicks = (scale, op) => {
|
|
@@ -38144,23 +38179,27 @@
|
|
|
38144
38179
|
rangeStart = minInArray(range),
|
|
38145
38180
|
rangeEnd = maxInArray(range);
|
|
38146
38181
|
if (domain.length <= rangeSize / fontSize) {
|
|
38147
|
-
const
|
|
38148
|
-
|
|
38149
|
-
minBoundsLength = Math.min(...labelBoundsList.map(bounds => bounds[2])),
|
|
38150
|
-
|
|
38151
|
-
|
|
38182
|
+
const labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal);
|
|
38183
|
+
if (labelBoundsList) {
|
|
38184
|
+
const minBoundsLength = Math.min(...labelBoundsList.map(bounds => bounds[2])),
|
|
38185
|
+
incrementUnit = (rangeEnd - rangeStart) / domain.length,
|
|
38186
|
+
stepResult = getStep$1(domain, labelBoundsList, labelGap, op.labelLastVisible, Math.floor(minBoundsLength / incrementUnit), !1);
|
|
38187
|
+
scaleTicks = scale.stepTicks(stepResult.step), op.labelLastVisible && (stepResult.delCount && (scaleTicks = scaleTicks.slice(0, scaleTicks.length - stepResult.delCount)), scaleTicks.push(domain[domain.length - 1]));
|
|
38188
|
+
}
|
|
38152
38189
|
} else {
|
|
38153
38190
|
const tempDomain = [domain[0], domain[Math.floor(domain.length / 2)], domain[domain.length - 1]],
|
|
38154
38191
|
tempList = getOneDimensionalLabelBounds(scale, tempDomain, op, isHorizontal);
|
|
38155
|
-
|
|
38156
|
-
|
|
38157
|
-
|
|
38158
|
-
|
|
38159
|
-
|
|
38160
|
-
|
|
38192
|
+
if (tempList) {
|
|
38193
|
+
let maxBounds = null;
|
|
38194
|
+
tempList.forEach(current => {
|
|
38195
|
+
maxBounds ? maxBounds[2] < current[2] && (maxBounds = current) : maxBounds = current;
|
|
38196
|
+
});
|
|
38197
|
+
const step = rangeEnd - rangeStart - labelGap > 0 ? Math.ceil(domain.length * (labelGap + maxBounds[2]) / (rangeEnd - rangeStart - labelGap)) : domain.length - 1;
|
|
38198
|
+
scaleTicks = scale.stepTicks(step), !op.labelLastVisible || scaleTicks.length && scaleTicks[scaleTicks.length - 1] === domain[domain.length - 1] || (scaleTicks.length && Math.abs(scale.scale(scaleTicks[scaleTicks.length - 1]) - scale.scale(domain[domain.length - 1])) < maxBounds[2] && (scaleTicks = scaleTicks.slice(0, -1)), scaleTicks.push(domain[domain.length - 1]));
|
|
38199
|
+
}
|
|
38161
38200
|
}
|
|
38162
|
-
}
|
|
38163
|
-
return convertDomainToTickData(scaleTicks);
|
|
38201
|
+
}
|
|
38202
|
+
return isNil$1(scaleTicks) && (scaleTicks = scale.domain()), convertDomainToTickData(scaleTicks);
|
|
38164
38203
|
};
|
|
38165
38204
|
const getStep$1 = (domain, labelBoundsList, labelGap, labelLastVisible, defaultStep, areAllBoundsSame) => {
|
|
38166
38205
|
let resultDelCount = 0,
|
|
@@ -41056,13 +41095,6 @@
|
|
|
41056
41095
|
end: end
|
|
41057
41096
|
}));
|
|
41058
41097
|
}
|
|
41059
|
-
eventPosToStagePos(e) {
|
|
41060
|
-
var _a, _b;
|
|
41061
|
-
return null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventPointTransform(e)) && void 0 !== _b ? _b : {
|
|
41062
|
-
x: 0,
|
|
41063
|
-
y: 0
|
|
41064
|
-
};
|
|
41065
|
-
}
|
|
41066
41098
|
_clearDragEvents() {
|
|
41067
41099
|
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
41068
41100
|
triggers = getEndTriggersOfDrag();
|
|
@@ -41221,7 +41253,13 @@
|
|
|
41221
41253
|
} = this.attribute.startTextStyle;
|
|
41222
41254
|
if (new Bounds().set(x1, y1, x2, y2).intersects(endTextBounds)) {
|
|
41223
41255
|
const direction = "bottom" === this.attribute.orient || "right" === this.attribute.orient ? -1 : 1;
|
|
41224
|
-
this._isHorizontal
|
|
41256
|
+
if (this._isHorizontal) {
|
|
41257
|
+
const boundsYDiff = Math.abs(endTextBounds.y1 - endTextBounds.y2);
|
|
41258
|
+
this._startText.setAttribute("dy", startTextDy + direction * (Number.isFinite(boundsYDiff) ? boundsYDiff : 0));
|
|
41259
|
+
} else {
|
|
41260
|
+
const boundsXDiff = Math.abs(endTextBounds.x1 - endTextBounds.x2);
|
|
41261
|
+
this._startText.setAttribute("dx", startTextDx + direction * (Number.isFinite(boundsXDiff) ? boundsXDiff : 0));
|
|
41262
|
+
}
|
|
41225
41263
|
} else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
|
|
41226
41264
|
}
|
|
41227
41265
|
getLayoutAttrFromConfig() {
|
|
@@ -46371,8 +46409,7 @@
|
|
|
46371
46409
|
loadBrushComponent();
|
|
46372
46410
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
46373
46411
|
constructor(attributes, options) {
|
|
46374
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._firstUpdate = !0, this._onBrushStart = e => {
|
|
46375
|
-
if (this._outOfInteractiveRange(e)) return void (this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)));
|
|
46412
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeBrushState = !1, this._activeDrawState = !1, this._cacheDrawPoints = [], this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._firstUpdate = !0, this._onBrushStart = e => {
|
|
46376
46413
|
const {
|
|
46377
46414
|
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
46378
46415
|
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
@@ -46400,7 +46437,7 @@
|
|
|
46400
46437
|
brushMode: brushMode
|
|
46401
46438
|
} = this.attribute,
|
|
46402
46439
|
pos = this.eventPosToStagePos(e);
|
|
46403
|
-
this._cacheDrawPoints.push(pos), "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e),
|
|
46440
|
+
this._cacheDrawPoints.push(pos), "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e), this._activeBrushState = !1;
|
|
46404
46441
|
}
|
|
46405
46442
|
_initMove(e) {
|
|
46406
46443
|
var _a, _b;
|
|
@@ -46430,7 +46467,8 @@
|
|
|
46430
46467
|
var _a;
|
|
46431
46468
|
const pos = this.eventPosToStagePos(e),
|
|
46432
46469
|
{
|
|
46433
|
-
brushType: brushType
|
|
46470
|
+
brushType: brushType,
|
|
46471
|
+
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
46434
46472
|
} = this.attribute,
|
|
46435
46473
|
cacheLength = this._cacheDrawPoints.length;
|
|
46436
46474
|
if (cacheLength > 0) {
|
|
@@ -46439,7 +46477,16 @@
|
|
|
46439
46477
|
}
|
|
46440
46478
|
"polygon" === brushType || cacheLength <= 1 ? this._cacheDrawPoints.push(pos) : this._cacheDrawPoints[cacheLength - 1] = pos;
|
|
46441
46479
|
const maskPoints = this._computeMaskPoints();
|
|
46442
|
-
this._operatingMask.setAttribute("points", maskPoints)
|
|
46480
|
+
this._operatingMask.setAttribute("points", maskPoints);
|
|
46481
|
+
const {
|
|
46482
|
+
x: x1,
|
|
46483
|
+
y: y1
|
|
46484
|
+
} = this._startPos,
|
|
46485
|
+
{
|
|
46486
|
+
x: x2,
|
|
46487
|
+
y: y2
|
|
46488
|
+
} = this.eventPosToStagePos(e);
|
|
46489
|
+
(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold) && (1 !== Object.keys(this._brushMaskAABBBoundsDict).length || this._activeBrushState ? this._dispatchBrushEvent(IOperateType.drawing, e) : (this._activeBrushState = !0, this._dispatchBrushEvent(IOperateType.brushActive, e)));
|
|
46443
46490
|
}
|
|
46444
46491
|
_moving(e) {
|
|
46445
46492
|
const startPos = this._cacheMovePoint,
|
|
@@ -46579,9 +46626,6 @@
|
|
|
46579
46626
|
pos = this.eventPosToStagePos(e);
|
|
46580
46627
|
return pos.x > maxX || pos.x < minX || pos.y > maxY || pos.y < minY;
|
|
46581
46628
|
}
|
|
46582
|
-
eventPosToStagePos(e) {
|
|
46583
|
-
return this.stage.eventPointTransform(e);
|
|
46584
|
-
}
|
|
46585
46629
|
_dispatchBrushEvent(operateType, e) {
|
|
46586
46630
|
this._dispatchEvent(operateType, {
|
|
46587
46631
|
operateMask: this._operatingMask,
|
|
@@ -46590,7 +46634,7 @@
|
|
|
46590
46634
|
});
|
|
46591
46635
|
}
|
|
46592
46636
|
_clearMask() {
|
|
46593
|
-
this._brushMaskAABBBoundsDict = {}, this._container.
|
|
46637
|
+
this._brushMaskAABBBoundsDict = {}, this._container.removeAllChild(), this._operatingMask = null;
|
|
46594
46638
|
}
|
|
46595
46639
|
_isEmptyMask() {
|
|
46596
46640
|
return isEmpty(this._brushMaskAABBBoundsDict) || Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty());
|
|
@@ -49072,6 +49116,16 @@
|
|
|
49072
49116
|
}
|
|
49073
49117
|
return null;
|
|
49074
49118
|
};
|
|
49119
|
+
const getDiffAttributesOfGraphic = (g, newAttrs) => {
|
|
49120
|
+
const prevAttrs = g.getAttributes(true);
|
|
49121
|
+
const diffAttrs = {};
|
|
49122
|
+
Object.keys(newAttrs).forEach(key => {
|
|
49123
|
+
if (prevAttrs[key] !== newAttrs[key]) {
|
|
49124
|
+
diffAttrs[key] = newAttrs[key];
|
|
49125
|
+
}
|
|
49126
|
+
});
|
|
49127
|
+
return diffAttrs;
|
|
49128
|
+
};
|
|
49075
49129
|
|
|
49076
49130
|
let Event$1 = class Event {
|
|
49077
49131
|
getComposedEventMap() {
|
|
@@ -49973,6 +50027,28 @@
|
|
|
49973
50027
|
return attrs;
|
|
49974
50028
|
};
|
|
49975
50029
|
|
|
50030
|
+
function toRenderMode(mode) {
|
|
50031
|
+
switch (mode) {
|
|
50032
|
+
case exports.RenderModeEnum['desktop-browser']:
|
|
50033
|
+
case exports.RenderModeEnum['mobile-browser']:
|
|
50034
|
+
return 'browser';
|
|
50035
|
+
case exports.RenderModeEnum.node:
|
|
50036
|
+
case exports.RenderModeEnum.worker:
|
|
50037
|
+
return 'node';
|
|
50038
|
+
case exports.RenderModeEnum.miniApp:
|
|
50039
|
+
case exports.RenderModeEnum['desktop-miniApp']:
|
|
50040
|
+
return 'feishu';
|
|
50041
|
+
case exports.RenderModeEnum.lynx:
|
|
50042
|
+
return 'lynx';
|
|
50043
|
+
case exports.RenderModeEnum.wx:
|
|
50044
|
+
return 'wx';
|
|
50045
|
+
case exports.RenderModeEnum.tt:
|
|
50046
|
+
return 'tt';
|
|
50047
|
+
case exports.RenderModeEnum.harmony:
|
|
50048
|
+
return 'harmony';
|
|
50049
|
+
}
|
|
50050
|
+
return 'browser';
|
|
50051
|
+
}
|
|
49976
50052
|
function traverseGroupMark(group, apply, filter, leafFirst, stop) {
|
|
49977
50053
|
const traverse = (mark) => {
|
|
49978
50054
|
if (!leafFirst) {
|
|
@@ -50162,7 +50238,8 @@
|
|
|
50162
50238
|
if (this._stage) {
|
|
50163
50239
|
return;
|
|
50164
50240
|
}
|
|
50165
|
-
const { autoRefreshDpr, dpr, mode, gestureConfig, interactive, clickInterval, autoPreventDefault, background } = this._option;
|
|
50241
|
+
const { autoRefreshDpr, dpr, mode, modeParams, gestureConfig, interactive, clickInterval, autoPreventDefault, background } = this._option;
|
|
50242
|
+
vglobal.setEnv(toRenderMode(mode), modeParams !== null && modeParams !== void 0 ? modeParams : {});
|
|
50166
50243
|
this._stage =
|
|
50167
50244
|
(_a = this._option.stage) !== null && _a !== void 0 ? _a : new Stage({
|
|
50168
50245
|
background,
|
|
@@ -50173,7 +50250,11 @@
|
|
|
50173
50250
|
dpr,
|
|
50174
50251
|
viewBox: this._option.viewBox,
|
|
50175
50252
|
canvasControled: this._option.canvasControled,
|
|
50176
|
-
beforeRender:
|
|
50253
|
+
beforeRender: (stage) => {
|
|
50254
|
+
var _a, _b, _c;
|
|
50255
|
+
(_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.onBeforeRender();
|
|
50256
|
+
(_c = (_b = this._option).beforeRender) === null || _c === void 0 ? void 0 : _c.call(_b, stage);
|
|
50257
|
+
},
|
|
50177
50258
|
afterRender: this._option.afterRender,
|
|
50178
50259
|
disableDirtyBounds: true,
|
|
50179
50260
|
autoRender: true,
|
|
@@ -51020,6 +51101,8 @@
|
|
|
51020
51101
|
}
|
|
51021
51102
|
onEvaluateEnd(ctx) {
|
|
51022
51103
|
}
|
|
51104
|
+
onBeforeRender() {
|
|
51105
|
+
}
|
|
51023
51106
|
onDataUpdate() {
|
|
51024
51107
|
}
|
|
51025
51108
|
beforeRelease() {
|
|
@@ -53169,20 +53252,24 @@
|
|
|
53169
53252
|
return this._animationConfig;
|
|
53170
53253
|
}
|
|
53171
53254
|
setAnimationConfig(config) {
|
|
53172
|
-
const
|
|
53173
|
-
|
|
53174
|
-
|
|
53255
|
+
const defaultPrams = this.type === 'group' ? { selfOnly: true } : {};
|
|
53256
|
+
const animationConfig = {};
|
|
53257
|
+
Object.keys(config).forEach(key => {
|
|
53258
|
+
const value = config[key];
|
|
53175
53259
|
if (isArray$1(value)) {
|
|
53176
|
-
value.
|
|
53260
|
+
animationConfig[key] = value.map(item => {
|
|
53177
53261
|
var _a;
|
|
53178
53262
|
const options = (_a = item.options) !== null && _a !== void 0 ? _a : {};
|
|
53179
|
-
item
|
|
53180
|
-
|
|
53181
|
-
|
|
53182
|
-
|
|
53183
|
-
|
|
53263
|
+
return Object.assign(Object.assign(Object.assign({}, defaultPrams), item), { options: (...args) => {
|
|
53264
|
+
var _a, _b;
|
|
53265
|
+
const _options = typeof options === 'function' ? options(...args) : options;
|
|
53266
|
+
return Object.assign(Object.assign({}, _options), { layoutRect: (_b = (_a = this.model).getLayoutRect) === null || _b === void 0 ? void 0 : _b.call(_a) });
|
|
53267
|
+
} });
|
|
53184
53268
|
});
|
|
53185
53269
|
}
|
|
53270
|
+
else {
|
|
53271
|
+
animationConfig[key] = Object.assign(Object.assign({}, defaultPrams), config[key]);
|
|
53272
|
+
}
|
|
53186
53273
|
});
|
|
53187
53274
|
this._animationConfig = animationConfig;
|
|
53188
53275
|
}
|
|
@@ -53810,6 +53897,7 @@
|
|
|
53810
53897
|
this._dataByGroup = groupData(data, this._groupKeyGetter);
|
|
53811
53898
|
}
|
|
53812
53899
|
createAnimationStateList(type, animationConfig) {
|
|
53900
|
+
var _a;
|
|
53813
53901
|
let config = animationConfig[type];
|
|
53814
53902
|
if (config && Array.isArray(config)) {
|
|
53815
53903
|
config = config.length === 1 ? config[0] : config;
|
|
@@ -53820,7 +53908,8 @@
|
|
|
53820
53908
|
return (Object.assign(Object.assign({}, item), { priority: (_a = item.priority) !== null && _a !== void 0 ? _a : Infinity }));
|
|
53821
53909
|
});
|
|
53822
53910
|
}
|
|
53823
|
-
return config
|
|
53911
|
+
return config
|
|
53912
|
+
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
|
|
53824
53913
|
}
|
|
53825
53914
|
tryRunMorphing(graphics) {
|
|
53826
53915
|
if (this._lastMark) {
|
|
@@ -53904,13 +53993,21 @@
|
|
|
53904
53993
|
this._product.applyAnimationState(['normal'], [normalConfig]);
|
|
53905
53994
|
}
|
|
53906
53995
|
}
|
|
53996
|
+
_setAnimationState(g) {
|
|
53997
|
+
const customizedState = this._aniamtionStateCallback ? this._aniamtionStateCallback(g) : undefined;
|
|
53998
|
+
g.context.animationState = customizedState !== null && customizedState !== void 0 ? customizedState : g.context.diffState;
|
|
53999
|
+
if (g.context.animationState === DiffState.exit) {
|
|
54000
|
+
g.context.reusing = true;
|
|
54001
|
+
g.animates && g.animates.forEach((a) => a.stop());
|
|
54002
|
+
}
|
|
54003
|
+
}
|
|
53907
54004
|
_runJoin(data) {
|
|
53908
54005
|
const newGroupedData = this._getDataByKey(data);
|
|
53909
54006
|
const prevGroupedData = this._prevDataByKey;
|
|
53910
|
-
const
|
|
54007
|
+
const allGraphics = [];
|
|
53911
54008
|
const enterGraphics = new Set(this._graphics.filter(g => g.context.diffState === DiffState.enter));
|
|
53912
54009
|
const callback = (key, newData, prevData) => {
|
|
53913
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
54010
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53914
54011
|
let g;
|
|
53915
54012
|
let diffState;
|
|
53916
54013
|
if (isNil$1(newData)) {
|
|
@@ -53928,23 +54025,20 @@
|
|
|
53928
54025
|
}
|
|
53929
54026
|
diffState = DiffState.enter;
|
|
53930
54027
|
g.isExiting = false;
|
|
53931
|
-
if (((_a = g.context) === null || _a === void 0 ? void 0 : _a.diffState) === DiffState.exit) {
|
|
53932
|
-
g.context.reusing = true;
|
|
53933
|
-
g.animates && g.animates.forEach((a) => a.stop());
|
|
53934
|
-
}
|
|
53935
54028
|
this._graphicMap.set(key, g);
|
|
53936
|
-
|
|
54029
|
+
allGraphics.push(g);
|
|
53937
54030
|
}
|
|
53938
54031
|
else {
|
|
53939
54032
|
g = this._graphicMap.get(key);
|
|
53940
54033
|
if (g) {
|
|
53941
54034
|
diffState = DiffState.update;
|
|
53942
|
-
|
|
54035
|
+
allGraphics.push(g);
|
|
53943
54036
|
}
|
|
53944
54037
|
}
|
|
53945
54038
|
if (g) {
|
|
53946
|
-
g.context = Object.assign(Object.assign({}, this._getCommonContext()), { diffState, reusing: (_b = g.context) === null || _b === void 0 ? void 0 : _b.reusing, originalFieldX: (_c = g.context) === null || _c === void 0 ? void 0 : _c.originalFieldX, originalFieldY: (_d = g.context) === null || _d === void 0 ? void 0 : _d.originalFieldY, fieldX: (_e = g.context) === null || _e === void 0 ? void 0 : _e.fieldX, fieldY: (_f = g.context) === null || _f === void 0 ? void 0 : _f.fieldY, animationState: diffState, data: newData !== null && newData !== void 0 ? newData : (_g = g.context) === null || _g === void 0 ? void 0 : _g.data, uniqueKey: key, key: newData ? this._keyGetter(newData[0]) : (_h = g.context) === null || _h === void 0 ? void 0 : _h.key, groupKey: newData ? this._groupKeyGetter(newData[0]) : (_j = g.context) === null || _j === void 0 ? void 0 : _j.groupKey, indexKey: '__VCHART_DEFAULT_DATA_INDEX', stateAnimateConfig: (_k = this.getAnimationConfig()) === null || _k === void 0 ? void 0 : _k.state });
|
|
53947
54039
|
enterGraphics.delete(g);
|
|
54040
|
+
g.context = Object.assign(Object.assign({}, this._getCommonContext()), { diffState, reusing: (_a = g.context) === null || _a === void 0 ? void 0 : _a.reusing, originalFieldX: (_b = g.context) === null || _b === void 0 ? void 0 : _b.originalFieldX, originalFieldY: (_c = g.context) === null || _c === void 0 ? void 0 : _c.originalFieldY, fieldX: (_d = g.context) === null || _d === void 0 ? void 0 : _d.fieldX, fieldY: (_e = g.context) === null || _e === void 0 ? void 0 : _e.fieldY, data: newData !== null && newData !== void 0 ? newData : (_f = g.context) === null || _f === void 0 ? void 0 : _f.data, uniqueKey: key, key: newData ? this._keyGetter(newData[0]) : (_g = g.context) === null || _g === void 0 ? void 0 : _g.key, groupKey: newData ? this._groupKeyGetter(newData[0]) : (_h = g.context) === null || _h === void 0 ? void 0 : _h.groupKey, indexKey: '__VCHART_DEFAULT_DATA_INDEX', stateAnimateConfig: (_j = this.getAnimationConfig()) === null || _j === void 0 ? void 0 : _j.state });
|
|
54041
|
+
this._setAnimationState(g);
|
|
53948
54042
|
}
|
|
53949
54043
|
return g;
|
|
53950
54044
|
};
|
|
@@ -53982,13 +54076,13 @@
|
|
|
53982
54076
|
}
|
|
53983
54077
|
g.release();
|
|
53984
54078
|
});
|
|
53985
|
-
const graphicCount =
|
|
53986
|
-
|
|
54079
|
+
const graphicCount = allGraphics.length;
|
|
54080
|
+
allGraphics.forEach((g, index) => {
|
|
53987
54081
|
g.context.graphicCount = graphicCount;
|
|
53988
54082
|
g.context.graphicIndex = index;
|
|
53989
54083
|
});
|
|
53990
54084
|
this._dataByKey = newGroupedData;
|
|
53991
|
-
this._graphics =
|
|
54085
|
+
this._graphics = allGraphics;
|
|
53992
54086
|
this.needClear = true;
|
|
53993
54087
|
}
|
|
53994
54088
|
_runEncoderOfGraphic(styles, g, attrs = {}) {
|
|
@@ -54071,13 +54165,7 @@
|
|
|
54071
54165
|
}
|
|
54072
54166
|
}
|
|
54073
54167
|
else {
|
|
54074
|
-
const
|
|
54075
|
-
const diffAttrs = {};
|
|
54076
|
-
Object.keys(finalAttrs).forEach(key => {
|
|
54077
|
-
if (prevAttrs[key] !== finalAttrs[key]) {
|
|
54078
|
-
diffAttrs[key] = finalAttrs[key];
|
|
54079
|
-
}
|
|
54080
|
-
});
|
|
54168
|
+
const diffAttrs = getDiffAttributesOfGraphic(g, finalAttrs);
|
|
54081
54169
|
g.context.diffAttrs = diffAttrs;
|
|
54082
54170
|
if (g.context.reusing) {
|
|
54083
54171
|
g.context.lastAttrs = g.attribute;
|
|
@@ -54246,24 +54334,25 @@
|
|
|
54246
54334
|
}
|
|
54247
54335
|
};
|
|
54248
54336
|
this._graphicMap.forEach((g, key) => {
|
|
54249
|
-
if (g.context.diffState
|
|
54250
|
-
|
|
54251
|
-
|
|
54252
|
-
|
|
54253
|
-
|
|
54254
|
-
|
|
54255
|
-
|
|
54256
|
-
|
|
54257
|
-
}
|
|
54258
|
-
|
|
54259
|
-
|
|
54260
|
-
|
|
54261
|
-
|
|
54262
|
-
|
|
54263
|
-
else {
|
|
54264
|
-
doRemove(g, key);
|
|
54337
|
+
if (g.context.diffState !== DiffState.exit || g.isExiting) {
|
|
54338
|
+
return;
|
|
54339
|
+
}
|
|
54340
|
+
if (g.context.animationState === DiffState.exit && this.hasAnimationByState('exit')) {
|
|
54341
|
+
g.isExiting = true;
|
|
54342
|
+
const animationConfig = this.getAnimationConfig();
|
|
54343
|
+
if (animationConfig.exit && animationConfig.exit.length) {
|
|
54344
|
+
const exitConfigList = animationConfig.exit.map((item, index) => ({
|
|
54345
|
+
name: `exit_${index}`,
|
|
54346
|
+
animation: Object.assign(Object.assign({}, item), { customParameters: g.context })
|
|
54347
|
+
}));
|
|
54348
|
+
g.applyAnimationState(['exit'], [exitConfigList.length === 1 ? exitConfigList[0] : exitConfigList], () => {
|
|
54349
|
+
doRemove(g, key);
|
|
54350
|
+
});
|
|
54265
54351
|
}
|
|
54266
54352
|
}
|
|
54353
|
+
else {
|
|
54354
|
+
doRemove(g, key);
|
|
54355
|
+
}
|
|
54267
54356
|
});
|
|
54268
54357
|
}
|
|
54269
54358
|
isProgressive() {
|
|
@@ -54409,11 +54498,7 @@
|
|
|
54409
54498
|
}
|
|
54410
54499
|
}
|
|
54411
54500
|
updateAnimationState(callback) {
|
|
54412
|
-
|
|
54413
|
-
this._graphics.forEach(g => {
|
|
54414
|
-
g.context.animationState = callback(g);
|
|
54415
|
-
});
|
|
54416
|
-
}
|
|
54501
|
+
this._aniamtionStateCallback = callback;
|
|
54417
54502
|
}
|
|
54418
54503
|
hasAnimationByState(state) {
|
|
54419
54504
|
if (!state || !this._animationConfig || !this._animationConfig[state]) {
|
|
@@ -54433,6 +54518,30 @@
|
|
|
54433
54518
|
}
|
|
54434
54519
|
}
|
|
54435
54520
|
|
|
54521
|
+
exports.MarkTypeEnum = void 0;
|
|
54522
|
+
(function (MarkTypeEnum) {
|
|
54523
|
+
MarkTypeEnum["group"] = "group";
|
|
54524
|
+
MarkTypeEnum["symbol"] = "symbol";
|
|
54525
|
+
MarkTypeEnum["rule"] = "rule";
|
|
54526
|
+
MarkTypeEnum["line"] = "line";
|
|
54527
|
+
MarkTypeEnum["text"] = "text";
|
|
54528
|
+
MarkTypeEnum["rect"] = "rect";
|
|
54529
|
+
MarkTypeEnum["image"] = "image";
|
|
54530
|
+
MarkTypeEnum["path"] = "path";
|
|
54531
|
+
MarkTypeEnum["area"] = "area";
|
|
54532
|
+
MarkTypeEnum["arc"] = "arc";
|
|
54533
|
+
MarkTypeEnum["polygon"] = "polygon";
|
|
54534
|
+
MarkTypeEnum["boxPlot"] = "boxPlot";
|
|
54535
|
+
MarkTypeEnum["linkPath"] = "linkPath";
|
|
54536
|
+
MarkTypeEnum["cell"] = "cell";
|
|
54537
|
+
MarkTypeEnum["ripple"] = "ripple";
|
|
54538
|
+
MarkTypeEnum["liquid"] = "liquid";
|
|
54539
|
+
MarkTypeEnum["component"] = "component";
|
|
54540
|
+
MarkTypeEnum["dataLabel"] = "dataLabel";
|
|
54541
|
+
MarkTypeEnum["label"] = "label";
|
|
54542
|
+
MarkTypeEnum["pictogram"] = "pictogram";
|
|
54543
|
+
})(exports.MarkTypeEnum || (exports.MarkTypeEnum = {}));
|
|
54544
|
+
|
|
54436
54545
|
class GroupMark extends BaseMark {
|
|
54437
54546
|
constructor() {
|
|
54438
54547
|
super(...arguments);
|
|
@@ -54495,13 +54604,29 @@
|
|
|
54495
54604
|
return [this._product];
|
|
54496
54605
|
}
|
|
54497
54606
|
renderInner() {
|
|
54498
|
-
var _a;
|
|
54607
|
+
var _a, _b;
|
|
54499
54608
|
if (!this._product) {
|
|
54500
54609
|
return;
|
|
54501
54610
|
}
|
|
54502
54611
|
const style = (_a = this._simpleStyle) !== null && _a !== void 0 ? _a : this.getAttributesOfState({});
|
|
54503
|
-
|
|
54504
|
-
this._product.
|
|
54612
|
+
const prevState = (_b = this._product.context) === null || _b === void 0 ? void 0 : _b.diffState;
|
|
54613
|
+
this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: prevState ? DiffState.update : DiffState.enter });
|
|
54614
|
+
this._setAnimationState(this._product);
|
|
54615
|
+
const newAttrs = this._getAttrsFromConfig(style);
|
|
54616
|
+
if (this._product.context.diffState === DiffState.update) {
|
|
54617
|
+
const hasAnimation = this.hasAnimation();
|
|
54618
|
+
const diffAttrs = getDiffAttributesOfGraphic(this._product, newAttrs);
|
|
54619
|
+
this._product.context.diffAttrs = diffAttrs;
|
|
54620
|
+
if (!this.hasAnimationByState(this._product.context.animationState)) {
|
|
54621
|
+
hasAnimation ? this._product.setAttributesAndPreventAnimate(diffAttrs) : this._product.setAttributes(diffAttrs);
|
|
54622
|
+
}
|
|
54623
|
+
if (hasAnimation) {
|
|
54624
|
+
this._product.setFinalAttributes(newAttrs);
|
|
54625
|
+
}
|
|
54626
|
+
}
|
|
54627
|
+
else {
|
|
54628
|
+
this._product.setAttributes(newAttrs);
|
|
54629
|
+
}
|
|
54505
54630
|
this.needClear = true;
|
|
54506
54631
|
}
|
|
54507
54632
|
render() {
|
|
@@ -54515,11 +54640,7 @@
|
|
|
54515
54640
|
});
|
|
54516
54641
|
}
|
|
54517
54642
|
updateAnimationState(callback) {
|
|
54518
|
-
|
|
54519
|
-
if (g) {
|
|
54520
|
-
g.context = Object.assign(Object.assign({}, g.context), { animationState: callback(g) });
|
|
54521
|
-
}
|
|
54522
|
-
});
|
|
54643
|
+
super.updateAnimationState(callback);
|
|
54523
54644
|
this.getMarks().forEach(mark => {
|
|
54524
54645
|
mark.updateAnimationState(callback);
|
|
54525
54646
|
});
|
|
@@ -55815,7 +55936,7 @@
|
|
|
55815
55936
|
var _a;
|
|
55816
55937
|
const diffState = (_a = graphic.context) === null || _a === void 0 ? void 0 : _a.diffState;
|
|
55817
55938
|
if (initial) {
|
|
55818
|
-
return diffState === 'exit' ?
|
|
55939
|
+
return diffState === 'exit' ? AnimationStateEnum.none : AnimationStateEnum.appear;
|
|
55819
55940
|
}
|
|
55820
55941
|
return diffState;
|
|
55821
55942
|
};
|
|
@@ -55904,11 +56025,11 @@
|
|
|
55904
56025
|
}
|
|
55905
56026
|
if (this._chart) {
|
|
55906
56027
|
this._chart.updateData(id, data, true, parserOptions);
|
|
55907
|
-
this._compiler.render();
|
|
55908
56028
|
if (userUpdateOptions === null || userUpdateOptions === void 0 ? void 0 : userUpdateOptions.reAnimate) {
|
|
55909
56029
|
this.stopAnimation();
|
|
55910
56030
|
this._updateAnimateState(true);
|
|
55911
56031
|
}
|
|
56032
|
+
this._compiler.render();
|
|
55912
56033
|
return this;
|
|
55913
56034
|
}
|
|
55914
56035
|
this._spec.data = array(this._spec.data);
|
|
@@ -55919,11 +56040,11 @@
|
|
|
55919
56040
|
if (this._chart) {
|
|
55920
56041
|
this._chart.updateFullData(data);
|
|
55921
56042
|
if (reRender) {
|
|
55922
|
-
this._compiler.render();
|
|
55923
56043
|
if (userUpdateOptions === null || userUpdateOptions === void 0 ? void 0 : userUpdateOptions.reAnimate) {
|
|
55924
56044
|
this.stopAnimation();
|
|
55925
56045
|
this._updateAnimateState(true);
|
|
55926
56046
|
}
|
|
56047
|
+
this._compiler.render();
|
|
55927
56048
|
}
|
|
55928
56049
|
return this;
|
|
55929
56050
|
}
|
|
@@ -56730,7 +56851,7 @@
|
|
|
56730
56851
|
});
|
|
56731
56852
|
};
|
|
56732
56853
|
|
|
56733
|
-
const version = "2.0.
|
|
56854
|
+
const version = "2.0.1-alpha.0";
|
|
56734
56855
|
|
|
56735
56856
|
const addVChartProperty = (data, op) => {
|
|
56736
56857
|
const context = op.beforeCall();
|
|
@@ -58543,14 +58664,11 @@
|
|
|
58543
58664
|
}
|
|
58544
58665
|
if (isNil$1(dataView)) {
|
|
58545
58666
|
m.setData(this._data);
|
|
58546
|
-
m.setSkipBeforeLayouted(true);
|
|
58547
58667
|
}
|
|
58548
58668
|
else if (dataView !== false) {
|
|
58549
58669
|
m.setDataView(dataView);
|
|
58550
58670
|
}
|
|
58551
|
-
|
|
58552
|
-
m.setSkipBeforeLayouted(skipBeforeLayouted);
|
|
58553
|
-
}
|
|
58671
|
+
m.setSkipBeforeLayouted(skipBeforeLayouted !== false);
|
|
58554
58672
|
if (!isNil$1(groupKey)) {
|
|
58555
58673
|
m.setGroupKey(groupKey);
|
|
58556
58674
|
}
|
|
@@ -59775,30 +59893,6 @@
|
|
|
59775
59893
|
|
|
59776
59894
|
const lineSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), lineLikeSeriesMark);
|
|
59777
59895
|
|
|
59778
|
-
exports.MarkTypeEnum = void 0;
|
|
59779
|
-
(function (MarkTypeEnum) {
|
|
59780
|
-
MarkTypeEnum["group"] = "group";
|
|
59781
|
-
MarkTypeEnum["symbol"] = "symbol";
|
|
59782
|
-
MarkTypeEnum["rule"] = "rule";
|
|
59783
|
-
MarkTypeEnum["line"] = "line";
|
|
59784
|
-
MarkTypeEnum["text"] = "text";
|
|
59785
|
-
MarkTypeEnum["rect"] = "rect";
|
|
59786
|
-
MarkTypeEnum["image"] = "image";
|
|
59787
|
-
MarkTypeEnum["path"] = "path";
|
|
59788
|
-
MarkTypeEnum["area"] = "area";
|
|
59789
|
-
MarkTypeEnum["arc"] = "arc";
|
|
59790
|
-
MarkTypeEnum["polygon"] = "polygon";
|
|
59791
|
-
MarkTypeEnum["boxPlot"] = "boxPlot";
|
|
59792
|
-
MarkTypeEnum["linkPath"] = "linkPath";
|
|
59793
|
-
MarkTypeEnum["cell"] = "cell";
|
|
59794
|
-
MarkTypeEnum["ripple"] = "ripple";
|
|
59795
|
-
MarkTypeEnum["liquid"] = "liquid";
|
|
59796
|
-
MarkTypeEnum["component"] = "component";
|
|
59797
|
-
MarkTypeEnum["dataLabel"] = "dataLabel";
|
|
59798
|
-
MarkTypeEnum["label"] = "label";
|
|
59799
|
-
MarkTypeEnum["pictogram"] = "pictogram";
|
|
59800
|
-
})(exports.MarkTypeEnum || (exports.MarkTypeEnum = {}));
|
|
59801
|
-
|
|
59802
59896
|
const isStopsEqual = (prev, next) => {
|
|
59803
59897
|
var _a, _b;
|
|
59804
59898
|
if (prev === next) {
|
|
@@ -60675,7 +60769,7 @@
|
|
|
60675
60769
|
const getCartesianCrosshairTheme = (getTheme, chartSpec) => {
|
|
60676
60770
|
var _a, _b;
|
|
60677
60771
|
const axes = array((_a = chartSpec.axes) !== null && _a !== void 0 ? _a : []);
|
|
60678
|
-
const { bandField, linearField, xField, yField } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60772
|
+
const { bandField, linearField, xField, yField, trigger, triggerOff } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60679
60773
|
const xAxis = axes.find(axis => isXAxis(axis.orient));
|
|
60680
60774
|
let newXField;
|
|
60681
60775
|
if (isValid$1(xAxis)) {
|
|
@@ -60694,13 +60788,15 @@
|
|
|
60694
60788
|
}
|
|
60695
60789
|
return {
|
|
60696
60790
|
xField: newXField,
|
|
60697
|
-
yField: newYField
|
|
60791
|
+
yField: newYField,
|
|
60792
|
+
trigger,
|
|
60793
|
+
triggerOff
|
|
60698
60794
|
};
|
|
60699
60795
|
};
|
|
60700
60796
|
const getPolarCrosshairTheme = (getTheme, chartSpec) => {
|
|
60701
60797
|
var _a, _b;
|
|
60702
60798
|
const axes = array((_a = chartSpec.axes) !== null && _a !== void 0 ? _a : []);
|
|
60703
|
-
const { bandField, linearField, categoryField, valueField } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60799
|
+
const { bandField, linearField, categoryField, valueField, trigger, triggerOff } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60704
60800
|
const angleAxis = axes.find(axis => axis.orient === 'angle');
|
|
60705
60801
|
let newAngleField;
|
|
60706
60802
|
if (isValid$1(angleAxis)) {
|
|
@@ -60719,7 +60815,9 @@
|
|
|
60719
60815
|
}
|
|
60720
60816
|
return {
|
|
60721
60817
|
categoryField: newAngleField,
|
|
60722
|
-
valueField: newRadiusField
|
|
60818
|
+
valueField: newRadiusField,
|
|
60819
|
+
trigger,
|
|
60820
|
+
triggerOff
|
|
60723
60821
|
};
|
|
60724
60822
|
};
|
|
60725
60823
|
|
|
@@ -64877,6 +64975,10 @@
|
|
|
64877
64975
|
const elements = [...this._components, ...this._regions, ...this._series];
|
|
64878
64976
|
elements.forEach(element => element.onEvaluateEnd(option));
|
|
64879
64977
|
}
|
|
64978
|
+
onBeforeRender() {
|
|
64979
|
+
const elements = [...this._components, ...this._regions, ...this._series];
|
|
64980
|
+
elements.forEach(element => element.onBeforeRender());
|
|
64981
|
+
}
|
|
64880
64982
|
getLayoutElements() {
|
|
64881
64983
|
return this.getAllModels()
|
|
64882
64984
|
.map(i => i.layout)
|
|
@@ -66235,9 +66337,11 @@
|
|
|
66235
66337
|
layoutStartPoint = { x: 0, y: 0 };
|
|
66236
66338
|
}
|
|
66237
66339
|
Object.keys(stateByField).forEach(field => {
|
|
66340
|
+
var _a, _b, _c, _d, _e, _f;
|
|
66238
66341
|
const { currentValue, cacheInfo, labelsComp, attributes, coordKey } = stateByField[field];
|
|
66239
66342
|
let axis = null;
|
|
66240
66343
|
let coord = 0;
|
|
66344
|
+
let axisLabel = null;
|
|
66241
66345
|
if (currentValue.size) {
|
|
66242
66346
|
const item = Array.from(currentValue.values())[0];
|
|
66243
66347
|
coord =
|
|
@@ -66245,6 +66349,8 @@
|
|
|
66245
66349
|
item.axis.getLayoutStartPoint()[coordKey] -
|
|
66246
66350
|
layoutStartPoint[coordKey];
|
|
66247
66351
|
axis = item.axis;
|
|
66352
|
+
axisLabel = (_f = (_e = (_d = (_c = (_b = (_a = axis
|
|
66353
|
+
.getVRenderComponents()[0]) === null || _a === void 0 ? void 0 : _a.children[0]) === null || _b === void 0 ? void 0 : _b.children[0]) === null || _c === void 0 ? void 0 : _c.children[0]) === null || _d === void 0 ? void 0 : _d.getChildByName('axis-label-container')) === null || _e === void 0 ? void 0 : _e.getChildByName('axis-label-container-layer-0')) === null || _f === void 0 ? void 0 : _f.children[0];
|
|
66248
66354
|
}
|
|
66249
66355
|
const isVisible = !!currentValue.size && Number.isFinite(coord) && !Number.isNaN(coord);
|
|
66250
66356
|
const useCache = enableRemain && !isVisible && isValid$1(cacheInfo);
|
|
@@ -66262,7 +66368,8 @@
|
|
|
66262
66368
|
}, {})
|
|
66263
66369
|
: null,
|
|
66264
66370
|
visible: isVisible,
|
|
66265
|
-
axis
|
|
66371
|
+
axis,
|
|
66372
|
+
axisLabel: axisLabel
|
|
66266
66373
|
};
|
|
66267
66374
|
if (newCacheInfo) {
|
|
66268
66375
|
newCacheInfo._isCache = useCache;
|
|
@@ -66271,7 +66378,7 @@
|
|
|
66271
66378
|
let offsetSize = 0;
|
|
66272
66379
|
if (attributes) {
|
|
66273
66380
|
currentValue.forEach(({ axis, datum: value = '' }) => {
|
|
66274
|
-
var _a;
|
|
66381
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
66275
66382
|
let niceLabelFormatter = null;
|
|
66276
66383
|
const scale = axis.getScale();
|
|
66277
66384
|
if (isDiscrete(scale.type)) {
|
|
@@ -66300,36 +66407,37 @@
|
|
|
66300
66407
|
if (newCacheInfo && ((_a = attributes.label) === null || _a === void 0 ? void 0 : _a.visible) && !useCache) {
|
|
66301
66408
|
const labelOffset = getAxisLabelOffset(axis.getSpec());
|
|
66302
66409
|
const axisOrient = axis.getOrient();
|
|
66410
|
+
const syncAxisLabelAngle = (_b = attributes.label) === null || _b === void 0 ? void 0 : _b.syncAxisLabelAngle;
|
|
66303
66411
|
if (newCacheInfo.labels[axisOrient]) {
|
|
66304
66412
|
newCacheInfo.labels[axisOrient].visible = true;
|
|
66305
66413
|
newCacheInfo.labels[axisOrient].text = value;
|
|
66306
66414
|
if (axisOrient === 'left') {
|
|
66307
66415
|
newCacheInfo.labels[axisOrient].dx = -labelOffset;
|
|
66308
66416
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66309
|
-
textAlign: 'right',
|
|
66310
|
-
textBaseline: 'middle'
|
|
66417
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_c = axisLabel.attribute.textAlign) !== null && _c !== void 0 ? _c : 'right' : 'right',
|
|
66418
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_d = axisLabel.attribute.textBaseline) !== null && _d !== void 0 ? _d : 'middle' : 'middle'
|
|
66311
66419
|
};
|
|
66312
66420
|
}
|
|
66313
66421
|
else if (axisOrient === 'right') {
|
|
66314
66422
|
newCacheInfo.labels[axisOrient].dx = labelOffset;
|
|
66315
66423
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66316
|
-
textAlign: 'left',
|
|
66317
|
-
textBaseline: 'middle'
|
|
66424
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_e = axisLabel.attribute.textAlign) !== null && _e !== void 0 ? _e : 'left' : 'left',
|
|
66425
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_f = axisLabel.attribute.textBaseline) !== null && _f !== void 0 ? _f : 'middle' : 'middle'
|
|
66318
66426
|
};
|
|
66319
66427
|
}
|
|
66320
66428
|
else if (axisOrient === 'top') {
|
|
66321
66429
|
newCacheInfo.labels[axisOrient].y = 0;
|
|
66322
66430
|
newCacheInfo.labels[axisOrient].dy = -labelOffset;
|
|
66323
66431
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66324
|
-
textAlign: 'center',
|
|
66325
|
-
textBaseline: 'bottom'
|
|
66432
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_g = axisLabel.attribute.textAlign) !== null && _g !== void 0 ? _g : 'center' : 'center',
|
|
66433
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_h = axisLabel.attribute.textBaseline) !== null && _h !== void 0 ? _h : 'bottom' : 'bottom'
|
|
66326
66434
|
};
|
|
66327
66435
|
}
|
|
66328
66436
|
else if (axisOrient === 'bottom') {
|
|
66329
66437
|
newCacheInfo.labels[axisOrient].dy = labelOffset;
|
|
66330
66438
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66331
|
-
textAlign: 'center',
|
|
66332
|
-
textBaseline: 'top'
|
|
66439
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_j = axisLabel.attribute.textAlign) !== null && _j !== void 0 ? _j : 'center' : 'center',
|
|
66440
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_k = axisLabel.attribute.textBaseline) !== null && _k !== void 0 ? _k : 'top' : 'top'
|
|
66333
66441
|
};
|
|
66334
66442
|
}
|
|
66335
66443
|
newCacheInfo.labels[axisOrient].defaultFormatter = niceLabelFormatter;
|
|
@@ -67479,6 +67587,26 @@
|
|
|
67479
67587
|
this._barMarkType = "rect";
|
|
67480
67588
|
this.transformerConstructor = BarSeriesSpecTransformer;
|
|
67481
67589
|
this._bandPosition = 0;
|
|
67590
|
+
this._getLinearBarRange = (start, end) => {
|
|
67591
|
+
let [x, x1] = [start, end].sort((a, b) => a - b);
|
|
67592
|
+
const realBarWidth = x1 - x;
|
|
67593
|
+
if (this._spec.barGap) {
|
|
67594
|
+
const halfBarGap = this._spec.barGap * 0.5;
|
|
67595
|
+
const tempX = x + halfBarGap;
|
|
67596
|
+
const tempX1 = x1 - halfBarGap;
|
|
67597
|
+
x = tempX;
|
|
67598
|
+
x1 = tempX1;
|
|
67599
|
+
}
|
|
67600
|
+
const curBarWidth = x1 - x;
|
|
67601
|
+
const barMinWidth = getActualNumValue(this._spec.barMinWidth || 2, realBarWidth);
|
|
67602
|
+
if (curBarWidth < barMinWidth) {
|
|
67603
|
+
const widthDiff = barMinWidth - curBarWidth;
|
|
67604
|
+
const halfWidthDiff = widthDiff / 2;
|
|
67605
|
+
x -= halfWidthDiff;
|
|
67606
|
+
x1 += halfWidthDiff;
|
|
67607
|
+
}
|
|
67608
|
+
return [x, x1];
|
|
67609
|
+
};
|
|
67482
67610
|
this._getBarXStart = (datum, scale, useWholeRange) => {
|
|
67483
67611
|
if (this._shouldDoPreCalculate()) {
|
|
67484
67612
|
this._calculateStackRectPosition(false);
|
|
@@ -67496,6 +67624,11 @@
|
|
|
67496
67624
|
}
|
|
67497
67625
|
return valueInScaleRange(this._dataToPosX1(datum), scale, useWholeRange);
|
|
67498
67626
|
};
|
|
67627
|
+
this._getLinearBarXRange = (datum, scale, useWholeRange) => {
|
|
67628
|
+
const x = valueInScaleRange(this._dataToPosX(datum), scale, useWholeRange);
|
|
67629
|
+
const x1 = valueInScaleRange(this._dataToPosX1(datum), scale, useWholeRange);
|
|
67630
|
+
return this._getLinearBarRange(x, x1);
|
|
67631
|
+
};
|
|
67499
67632
|
this._getBarYStart = (datum, scale) => {
|
|
67500
67633
|
if (this._shouldDoPreCalculate()) {
|
|
67501
67634
|
this._calculateStackRectPosition(true);
|
|
@@ -67513,6 +67646,11 @@
|
|
|
67513
67646
|
}
|
|
67514
67647
|
return valueInScaleRange(this._dataToPosY1(datum), scale);
|
|
67515
67648
|
};
|
|
67649
|
+
this._getLinearBarYRange = (datum, scale, useWholeRange) => {
|
|
67650
|
+
const y = valueInScaleRange(this._dataToPosY(datum), scale, useWholeRange);
|
|
67651
|
+
const y1 = valueInScaleRange(this._dataToPosY1(datum), scale, useWholeRange);
|
|
67652
|
+
return this._getLinearBarRange(y, y1);
|
|
67653
|
+
};
|
|
67516
67654
|
this._getBarBackgroundXStart = (scale) => {
|
|
67517
67655
|
const range = scale.range();
|
|
67518
67656
|
const min = Math.min(range[0], range[range.length - 1]);
|
|
@@ -67866,8 +68004,8 @@
|
|
|
67866
68004
|
if (this.direction === "horizontal") {
|
|
67867
68005
|
const yChannels = isValid$1(this._fieldY2)
|
|
67868
68006
|
? {
|
|
67869
|
-
y: (datum) =>
|
|
67870
|
-
y1: (datum) =>
|
|
68007
|
+
y: (datum) => this._getLinearBarYRange(datum, yScale, true)[0],
|
|
68008
|
+
y1: (datum) => this._getLinearBarYRange(datum, yScale, true)[1]
|
|
67871
68009
|
}
|
|
67872
68010
|
: {
|
|
67873
68011
|
y: (datum) => valueInScaleRange(this._dataToPosY(datum) - this._getBarWidth(this._yAxisHelper) / 2, yScale, true),
|
|
@@ -67879,8 +68017,8 @@
|
|
|
67879
68017
|
else {
|
|
67880
68018
|
const xChannels = isValid$1(this._fieldX2)
|
|
67881
68019
|
? {
|
|
67882
|
-
x: (datum) =>
|
|
67883
|
-
x1: (datum) =>
|
|
68020
|
+
x: (datum) => this._getLinearBarXRange(datum, xScale, true)[0],
|
|
68021
|
+
x1: (datum) => this._getLinearBarXRange(datum, xScale, true)[1]
|
|
67884
68022
|
}
|
|
67885
68023
|
: {
|
|
67886
68024
|
x: (datum) => valueInScaleRange(this._dataToPosX(datum) - this._getBarWidth(this._xAxisHelper) / 2, xScale, true),
|
|
@@ -69590,8 +69728,7 @@
|
|
|
69590
69728
|
initMark() {
|
|
69591
69729
|
this._pathMark = this._createMark(MapSeries.mark.area, {
|
|
69592
69730
|
groupKey: this.getDimensionField()[0],
|
|
69593
|
-
isSeriesMark: true
|
|
69594
|
-
skipBeforeLayouted: true
|
|
69731
|
+
isSeriesMark: true
|
|
69595
69732
|
}, {
|
|
69596
69733
|
morph: shouldMarkDoMorph(this._spec, MapSeries.mark.area.name),
|
|
69597
69734
|
morphElementKey: this.getDimensionField()[0]
|
|
@@ -73077,7 +73214,6 @@
|
|
|
73077
73214
|
this._pieMark = this._createMark(Object.assign(Object.assign({}, BasePieSeries.mark.pie), { name: this._pieMarkName, type: this._pieMarkType }), {
|
|
73078
73215
|
key: DEFAULT_DATA_KEY,
|
|
73079
73216
|
groupKey: this._seriesField,
|
|
73080
|
-
skipBeforeLayouted: true,
|
|
73081
73217
|
isSeriesMark: true
|
|
73082
73218
|
}, {
|
|
73083
73219
|
morph: shouldMarkDoMorph(this._spec, this._pieMarkName),
|
|
@@ -80736,7 +80872,6 @@
|
|
|
80736
80872
|
if (this._spec.isTransform) {
|
|
80737
80873
|
this._funnelTransformMark = this._createMark(Object.assign(Object.assign({}, FunnelSeries.mark.transform), { name: this._transformMarkName, type: this._transformMarkType }), {
|
|
80738
80874
|
themeSpec: (_b = this._theme) === null || _b === void 0 ? void 0 : _b.transform,
|
|
80739
|
-
skipBeforeLayouted: true,
|
|
80740
80875
|
noSeparateStyle: true
|
|
80741
80876
|
});
|
|
80742
80877
|
if (this._funnelTransformMark) {
|
|
@@ -80749,7 +80884,6 @@
|
|
|
80749
80884
|
this._funnelOuterLabelMark.label = this._createMark(FunnelSeries.mark.outerLabel, {
|
|
80750
80885
|
themeSpec: (_h = this._theme) === null || _h === void 0 ? void 0 : _h.outerLabel,
|
|
80751
80886
|
markSpec: this._spec.outerLabel,
|
|
80752
|
-
skipBeforeLayouted: true,
|
|
80753
80887
|
noSeparateStyle: true,
|
|
80754
80888
|
parent: false
|
|
80755
80889
|
});
|
|
@@ -87092,7 +87226,7 @@
|
|
|
87092
87226
|
spec.axes.forEach((axis) => (axis.type = 'linear'));
|
|
87093
87227
|
}
|
|
87094
87228
|
_getDefaultSeriesSpec(spec) {
|
|
87095
|
-
return super._getDefaultSeriesSpec(spec, ['x2Field', 'y2Field', 'barMinHeight', 'barBackground']);
|
|
87229
|
+
return super._getDefaultSeriesSpec(spec, ['x2Field', 'y2Field', 'barMinHeight', 'barBackground', 'barGap']);
|
|
87096
87230
|
}
|
|
87097
87231
|
}
|
|
87098
87232
|
|
|
@@ -89384,11 +89518,13 @@
|
|
|
89384
89518
|
return false;
|
|
89385
89519
|
}
|
|
89386
89520
|
_initTheme(spec, chartSpec) {
|
|
89387
|
-
var _a;
|
|
89521
|
+
var _a, _b, _c;
|
|
89388
89522
|
const { spec: newSpec, theme } = super._initTheme(spec, chartSpec);
|
|
89389
89523
|
newSpec.style = mergeSpec({}, this._theme, newSpec.style);
|
|
89390
89524
|
newSpec.offset = mergeSpec({}, theme.offset, spec.offset);
|
|
89391
89525
|
newSpec.transitionDuration = (_a = spec.transitionDuration) !== null && _a !== void 0 ? _a : theme.transitionDuration;
|
|
89526
|
+
newSpec.trigger = (_b = spec.trigger) !== null && _b !== void 0 ? _b : theme.trigger;
|
|
89527
|
+
newSpec.triggerOff = (_c = spec.triggerOff) !== null && _c !== void 0 ? _c : theme.triggerOff;
|
|
89392
89528
|
return { spec: newSpec, theme };
|
|
89393
89529
|
}
|
|
89394
89530
|
_transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
|
|
@@ -90235,7 +90371,7 @@
|
|
|
90235
90371
|
this.event.off(eventName, handler);
|
|
90236
90372
|
}
|
|
90237
90373
|
}
|
|
90238
|
-
|
|
90374
|
+
onBeforeRender() {
|
|
90239
90375
|
this._limitBounds = null;
|
|
90240
90376
|
this._showDefaultCrosshair();
|
|
90241
90377
|
}
|
|
@@ -90378,7 +90514,7 @@
|
|
|
90378
90514
|
}
|
|
90379
90515
|
}
|
|
90380
90516
|
_parseField(field, fieldName) {
|
|
90381
|
-
var _a, _b;
|
|
90517
|
+
var _a, _b, _c;
|
|
90382
90518
|
const hair = {};
|
|
90383
90519
|
const { line = {}, label = {}, visible } = field;
|
|
90384
90520
|
hair.visible = visible;
|
|
@@ -90389,7 +90525,7 @@
|
|
|
90389
90525
|
else {
|
|
90390
90526
|
const style = line.style || {};
|
|
90391
90527
|
const { stroke, fill, lineWidth } = style;
|
|
90392
|
-
const
|
|
90528
|
+
const _d = style, { strokeOpacity, fillOpacity, opacity } = _d, restStyle = __rest$e(_d, ["strokeOpacity", "fillOpacity", "opacity"]);
|
|
90393
90529
|
const isLineType = hair.type === 'line';
|
|
90394
90530
|
let finalOpacity = isLineType ? strokeOpacity : fillOpacity;
|
|
90395
90531
|
if (isNumber$1(opacity)) {
|
|
@@ -90417,8 +90553,9 @@
|
|
|
90417
90553
|
}
|
|
90418
90554
|
if (!!label.visible) {
|
|
90419
90555
|
const labelBackground = label.labelBackground || {};
|
|
90556
|
+
const syncAxisLabelAngle = (_c = label.syncAxisLabelAngle) !== null && _c !== void 0 ? _c : false;
|
|
90420
90557
|
const labelStyle = label.style || {};
|
|
90421
|
-
const
|
|
90558
|
+
const _e = labelBackground.style || {}, { fill: rectFill = 'rgba(47, 59, 82, 0.9)', stroke: rectStroke, outerBorder } = _e, rectStyle = __rest$e(_e, ["fill", "stroke", "outerBorder"]);
|
|
90422
90559
|
hair.label = {
|
|
90423
90560
|
visible: true,
|
|
90424
90561
|
formatMethod: label.formatMethod,
|
|
@@ -90426,6 +90563,7 @@
|
|
|
90426
90563
|
minWidth: labelBackground.minWidth,
|
|
90427
90564
|
maxWidth: labelBackground.maxWidth,
|
|
90428
90565
|
padding: labelBackground.padding,
|
|
90566
|
+
syncAxisLabelAngle,
|
|
90429
90567
|
textStyle: Object.assign(Object.assign({ fontSize: 14, pickable: false }, labelStyle), { fill: labelStyle.fill || '#fff', stroke: get$1(labelStyle, 'stroke') }),
|
|
90430
90568
|
panel: (isBoolean$1(labelBackground.visible) ? labelBackground.visible : !!labelBackground)
|
|
90431
90569
|
? Object.assign({ visible: true, pickable: false, fill: rectFill, stroke: rectStroke, outerBorder: Object.assign({ stroke: rectFill, distance: 0, lineWidth: 3 }, outerBorder) }, rectStyle) : { visible: false },
|
|
@@ -90693,9 +90831,9 @@
|
|
|
90693
90831
|
const positionAttribute = layoutCrosshair$1(this._stateByField[field]);
|
|
90694
90832
|
this._updateCrosshairByField(field, positionAttribute);
|
|
90695
90833
|
Object.keys(labels).forEach(labelKey => {
|
|
90696
|
-
var _a;
|
|
90834
|
+
var _a, _b, _c;
|
|
90697
90835
|
if (labels[labelKey].visible) {
|
|
90698
|
-
const updateAttrs = Object.assign(Object.assign(Object.assign({ [coordKey]: coord + bandSize / 2 }, labels[labelKey]), attributes.label), { textStyle: Object.assign(Object.assign({}, (
|
|
90836
|
+
const updateAttrs = Object.assign(Object.assign(Object.assign({ [coordKey]: coord + bandSize / 2 }, labels[labelKey]), attributes.label), { angle: attributes.label.syncAxisLabelAngle ? (_b = (_a = cacheInfo.axisLabel) === null || _a === void 0 ? void 0 : _a.attribute.angle) !== null && _b !== void 0 ? _b : 0 : 0, textStyle: Object.assign(Object.assign({}, (_c = attributes.label) === null || _c === void 0 ? void 0 : _c.textStyle), labelsTextStyle[labelKey]), zIndex: this.labelZIndex, visible: true });
|
|
90699
90837
|
this._updateCrosshairLabel(labelsComp[labelKey], updateAttrs, label => {
|
|
90700
90838
|
label.name = `crosshair-${field.replace('Field', '')}-${labelKey}-label`;
|
|
90701
90839
|
labelsComp[labelKey] = label;
|
|
@@ -92836,7 +92974,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92836
92974
|
x = convertPercentToValue(datum.x, regionWidth) + regionStartLayoutStartPoint.x;
|
|
92837
92975
|
}
|
|
92838
92976
|
else {
|
|
92839
|
-
x =
|
|
92977
|
+
x =
|
|
92978
|
+
convertDatumToValue(relativeSeries.getXAxisHelper(), [datum.x]) +
|
|
92979
|
+
regionStartLayoutStartPoint.x;
|
|
92840
92980
|
}
|
|
92841
92981
|
return x;
|
|
92842
92982
|
}
|
|
@@ -92851,7 +92991,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92851
92991
|
y = convertPercentToValue(datum.y, regionHeight) + regionStartLayoutStartPoint.y;
|
|
92852
92992
|
}
|
|
92853
92993
|
else {
|
|
92854
|
-
y =
|
|
92994
|
+
y =
|
|
92995
|
+
convertDatumToValue(relativeSeries.getYAxisHelper(), [datum.y]) +
|
|
92996
|
+
regionStartLayoutStartPoint.y;
|
|
92855
92997
|
}
|
|
92856
92998
|
return y;
|
|
92857
92999
|
}
|
|
@@ -92861,7 +93003,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92861
93003
|
isNumber$1(datum.angle) &&
|
|
92862
93004
|
isNeedExtendDomain(angleDomain, datum.angle, autoRange) &&
|
|
92863
93005
|
((_b = (_a = relativeSeries.angleAxisHelper) === null || _a === void 0 ? void 0 : _a.setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_angleAxis_extend', datum.angle));
|
|
92864
|
-
return relativeSeries.angleAxisHelper
|
|
93006
|
+
return convertDatumToValue(relativeSeries.angleAxisHelper, [datum.angle]);
|
|
92865
93007
|
}
|
|
92866
93008
|
function getRadiusValue(datum, radiusDomain, autoRange, refSeries) {
|
|
92867
93009
|
var _a, _b;
|
|
@@ -92869,11 +93011,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92869
93011
|
isNumber$1(datum.radius) &&
|
|
92870
93012
|
isNeedExtendDomain(radiusDomain, datum.radius, autoRange) &&
|
|
92871
93013
|
((_b = (_a = relativeSeries.radiusAxisHelper) === null || _a === void 0 ? void 0 : _a.setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_radiusAxis_extend', datum.radius));
|
|
92872
|
-
return relativeSeries.radiusAxisHelper
|
|
93014
|
+
return convertDatumToValue(relativeSeries.radiusAxisHelper, [datum.radius]);
|
|
92873
93015
|
}
|
|
92874
93016
|
function convertPercentToValue(percent, relativeLength) {
|
|
92875
93017
|
return (Number(percent.substring(0, percent.length - 1)) * relativeLength) / 100;
|
|
92876
93018
|
}
|
|
93019
|
+
function convertDatumToValue(axisHelper, datum) {
|
|
93020
|
+
const scale = axisHelper.getScale(0);
|
|
93021
|
+
if (isContinuous(scale.type) && scale.domain()[0] === scale.domain()[1] && datum[0] !== scale.domain()[0]) {
|
|
93022
|
+
return NaN;
|
|
93023
|
+
}
|
|
93024
|
+
return axisHelper.dataToPosition(datum);
|
|
93025
|
+
}
|
|
92877
93026
|
function isAggrSpec(spec) {
|
|
92878
93027
|
return AGGR_TYPE.includes(spec);
|
|
92879
93028
|
}
|
|
@@ -93038,8 +93187,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93038
93187
|
isNeedExtendDomain(yDomain, yValue[0], autoRange) &&
|
|
93039
93188
|
((_d = (_c = refRelativeSeries.getYAxisHelper()) === null || _c === void 0 ? void 0 : _c.setExtendDomain) === null || _d === void 0 ? void 0 : _d.call(_c, 'marker_yAxis_extend', yValue[0]));
|
|
93040
93189
|
points.push({
|
|
93041
|
-
x: refRelativeSeries.getXAxisHelper()
|
|
93042
|
-
y: refRelativeSeries.getYAxisHelper()
|
|
93190
|
+
x: convertDatumToValue(refRelativeSeries.getXAxisHelper(), xValue) + regionStartLayoutStartPoint.x + offsetX,
|
|
93191
|
+
y: convertDatumToValue(refRelativeSeries.getYAxisHelper(), yValue) + regionStartLayoutStartPoint.y + offsetY
|
|
93043
93192
|
});
|
|
93044
93193
|
});
|
|
93045
93194
|
return points;
|
|
@@ -93063,8 +93212,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93063
93212
|
isNeedExtendDomain(radiusDomain, radiusValue[0], autoRange) &&
|
|
93064
93213
|
((_d = (_c = refRelativeSeries.radiusAxisHelper) === null || _c === void 0 ? void 0 : _c.setExtendDomain) === null || _d === void 0 ? void 0 : _d.call(_c, 'marker_yAxis_extend', radiusValue[0]));
|
|
93065
93214
|
points.push({
|
|
93066
|
-
angle: refRelativeSeries.angleAxisHelper
|
|
93067
|
-
radius: refRelativeSeries.radiusAxisHelper
|
|
93215
|
+
angle: convertDatumToValue(refRelativeSeries.angleAxisHelper, angleValue),
|
|
93216
|
+
radius: convertDatumToValue(refRelativeSeries.radiusAxisHelper, radiusValue)
|
|
93068
93217
|
});
|
|
93069
93218
|
});
|
|
93070
93219
|
return points;
|
|
@@ -96147,7 +96296,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96147
96296
|
this._linkedInBrushElementsMap = {};
|
|
96148
96297
|
this._linkedOutOfBrushElementsMap = {};
|
|
96149
96298
|
this._cacheInteractiveRangeAttrs = [];
|
|
96150
|
-
this._needDisablePickable = false;
|
|
96151
96299
|
this._releatedAxes = [];
|
|
96152
96300
|
this._regionAxisMap = {};
|
|
96153
96301
|
this._axisDataZoomMap = {};
|
|
@@ -96299,34 +96447,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96299
96447
|
this._emitEvent(exports.ChartEvent.brushActive, region);
|
|
96300
96448
|
});
|
|
96301
96449
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
96450
|
+
this._setRegionMarkPickable(region, true);
|
|
96302
96451
|
this._emitEvent(exports.ChartEvent.brushStart, region);
|
|
96303
96452
|
});
|
|
96304
96453
|
brush.addEventListener(IOperateType.moveStart, (e) => {
|
|
96454
|
+
this._setRegionMarkPickable(region, true);
|
|
96305
96455
|
this._emitEvent(exports.ChartEvent.brushStart, region);
|
|
96306
96456
|
});
|
|
96307
96457
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
96308
|
-
this.
|
|
96458
|
+
this._setRegionMarkPickable(region, false);
|
|
96309
96459
|
this._handleBrushChange(region, e);
|
|
96310
96460
|
this._emitEvent(exports.ChartEvent.brushChange, region);
|
|
96311
96461
|
});
|
|
96312
96462
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
96463
|
+
this._setRegionMarkPickable(region, false);
|
|
96313
96464
|
this._handleBrushChange(region, e);
|
|
96314
96465
|
this._emitEvent(exports.ChartEvent.brushChange, region);
|
|
96315
96466
|
});
|
|
96316
96467
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
96468
|
+
this._setRegionMarkPickable(region, true);
|
|
96317
96469
|
this._initMarkBrushState(componentIndex, '');
|
|
96318
|
-
this._needDisablePickable = false;
|
|
96319
96470
|
this._emitEvent(exports.ChartEvent.brushClear, region);
|
|
96320
96471
|
});
|
|
96321
96472
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
96322
96473
|
var _a;
|
|
96323
|
-
this.
|
|
96474
|
+
this._setRegionMarkPickable(region, true);
|
|
96324
96475
|
const { operateMask } = e.detail;
|
|
96476
|
+
const { updateElementsState = true } = this._spec;
|
|
96325
96477
|
if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.onBrushEnd) {
|
|
96326
96478
|
if (this._spec.onBrushEnd(e) === true) {
|
|
96327
96479
|
this.clearGraphic();
|
|
96328
96480
|
this._initMarkBrushState(componentIndex, '');
|
|
96329
|
-
this._needDisablePickable = false;
|
|
96330
96481
|
this._emitEvent(exports.ChartEvent.brushClear, region);
|
|
96331
96482
|
}
|
|
96332
96483
|
else {
|
|
@@ -96336,16 +96487,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96336
96487
|
}
|
|
96337
96488
|
else {
|
|
96338
96489
|
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
96339
|
-
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
96490
|
+
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
|
|
96340
96491
|
this._setAxisAndDataZoom(operateMask, region);
|
|
96341
96492
|
}
|
|
96342
96493
|
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
96343
96494
|
}
|
|
96344
96495
|
});
|
|
96345
96496
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
96497
|
+
this._setRegionMarkPickable(region, true);
|
|
96346
96498
|
const { operateMask } = e.detail;
|
|
96499
|
+
const { updateElementsState = true } = this._spec;
|
|
96347
96500
|
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
96348
|
-
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
96501
|
+
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
|
|
96349
96502
|
this._setAxisAndDataZoom(operateMask, region);
|
|
96350
96503
|
}
|
|
96351
96504
|
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
@@ -96387,8 +96540,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96387
96540
|
}
|
|
96388
96541
|
_handleBrushChange(region, e) {
|
|
96389
96542
|
const { operateMask } = e.detail;
|
|
96390
|
-
this.
|
|
96391
|
-
|
|
96543
|
+
const { updateElementsState = true } = this._spec;
|
|
96544
|
+
if (updateElementsState) {
|
|
96545
|
+
this._reconfigItem(operateMask, region);
|
|
96546
|
+
this._reconfigLinkedItem(operateMask, region);
|
|
96547
|
+
}
|
|
96392
96548
|
}
|
|
96393
96549
|
_extendDataInBrush(elementsMap) {
|
|
96394
96550
|
var _a, _b;
|
|
@@ -96468,7 +96624,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96468
96624
|
this._outOfBrushElementsMap[elementKey] = graphicItem;
|
|
96469
96625
|
delete this._inBrushElementsMap[operateMask.name][elementKey];
|
|
96470
96626
|
}
|
|
96471
|
-
graphicItem.setAttribute('pickable', !this._needDisablePickable);
|
|
96472
96627
|
});
|
|
96473
96628
|
});
|
|
96474
96629
|
}
|
|
@@ -96526,7 +96681,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96526
96681
|
graphicItem.addState(OUT_BRUSH_STATE, true);
|
|
96527
96682
|
this._linkedOutOfBrushElementsMap[elementKey] = graphicItem;
|
|
96528
96683
|
}
|
|
96529
|
-
graphicItem.setAttribute('pickable', !this._needDisablePickable);
|
|
96530
96684
|
});
|
|
96531
96685
|
});
|
|
96532
96686
|
}
|
|
@@ -96592,6 +96746,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96592
96746
|
this._initItemMap(this._itemMap, this._outOfBrushElementsMap, stateName);
|
|
96593
96747
|
this._initItemMap(this._linkedItemMap, this._linkedOutOfBrushElementsMap, stateName);
|
|
96594
96748
|
}
|
|
96749
|
+
_setRegionMarkPickable(region, pickable) {
|
|
96750
|
+
region
|
|
96751
|
+
.getGroupMark()
|
|
96752
|
+
.getGraphics()
|
|
96753
|
+
.forEach(g => g.setAttribute('childrenPickable', pickable));
|
|
96754
|
+
}
|
|
96595
96755
|
_stateClamp(state) {
|
|
96596
96756
|
return Math.min(Math.max(0, state), 1);
|
|
96597
96757
|
}
|
|
@@ -96671,7 +96831,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96671
96831
|
const container = this.getContainer();
|
|
96672
96832
|
this._brushComponents.forEach((brush, index) => {
|
|
96673
96833
|
this._initMarkBrushState(index, '');
|
|
96674
|
-
this._needDisablePickable = false;
|
|
96675
96834
|
brush.removeAllChild();
|
|
96676
96835
|
brush.releaseBrushEvents();
|
|
96677
96836
|
if (container) {
|
|
@@ -97897,12 +98056,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97897
98056
|
const rowStyle = this._domStyle.row;
|
|
97898
98057
|
const chilren = [...this._rootDom.children];
|
|
97899
98058
|
let titleDom = chilren.find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));
|
|
98059
|
+
let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
|
|
97900
98060
|
if (!titleDom && title.visible !== false) {
|
|
97901
98061
|
titleDom = document.createElement('h2');
|
|
97902
98062
|
const span = document.createElement('span');
|
|
97903
98063
|
titleDom.appendChild(span);
|
|
97904
98064
|
titleDom.classList.add(TOOLTIP_TITLE_CLASS_NAME);
|
|
97905
|
-
this._rootDom.
|
|
98065
|
+
if (this._rootDom.firstChild) {
|
|
98066
|
+
this._rootDom.insertBefore(titleDom, this._rootDom.firstChild);
|
|
98067
|
+
}
|
|
98068
|
+
else {
|
|
98069
|
+
this._rootDom.appendChild(titleDom);
|
|
98070
|
+
}
|
|
97906
98071
|
}
|
|
97907
98072
|
if (titleDom && title.visible !== false) {
|
|
97908
98073
|
setStyleToDom(titleDom, Object.assign(Object.assign(Object.assign({}, this._domStyle.title), (hasContent ? rowStyle : { marginBottom: '0px' })), { marginTop: '0px' }));
|
|
@@ -97911,7 +98076,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97911
98076
|
else if (titleDom && title.visible === false) {
|
|
97912
98077
|
titleDom.parentNode.removeChild(titleDom);
|
|
97913
98078
|
}
|
|
97914
|
-
let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
|
|
97915
98079
|
const columns = ['shape', 'key', 'value'];
|
|
97916
98080
|
if (!contentDom && hasContent) {
|
|
97917
98081
|
contentDom = document.createElement('div');
|
|
@@ -100184,6 +100348,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100184
100348
|
exports.getCombinedSizeOfRegions = getCombinedSizeOfRegions;
|
|
100185
100349
|
exports.getDataScheme = getDataScheme;
|
|
100186
100350
|
exports.getDatumOfGraphic = getDatumOfGraphic;
|
|
100351
|
+
exports.getDiffAttributesOfGraphic = getDiffAttributesOfGraphic;
|
|
100187
100352
|
exports.getDimensionInfoByValue = getDimensionInfoByValue;
|
|
100188
100353
|
exports.getFieldAlias = getFieldAlias;
|
|
100189
100354
|
exports.getFunnelTheme = getFunnelTheme;
|