@visactor/vchart 2.0.0-alpha.4 → 2.0.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 +230 -123
- package/build/index.js +230 -123
- 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/histogram/base/histogram-base-transformer.js +1 -1
- package/cjs/chart/histogram/base/histogram-base-transformer.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +1 -1
- package/cjs/component/brush/brush.js +18 -14
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/base.js +4 -3
- 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/mark/base/base-mark.js +16 -12
- package/cjs/mark/base/base-mark.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/esm/animation/interface.d.ts +1 -0
- package/esm/animation/interface.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/component/brush/brush.d.ts +1 -1
- package/esm/component/brush/brush.js +18 -14
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/base.js +4 -3
- 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/mark/base/base-mark.js +16 -12
- package/esm/mark/base/base-mark.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/package.json +6 -6
package/build/index.es.js
CHANGED
|
@@ -23546,6 +23546,18 @@ class AbstractComponent extends Group$1 {
|
|
|
23546
23546
|
const changeEvent = new CustomEvent(eventName, details);
|
|
23547
23547
|
changeEvent.manager = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem.manager, this.dispatchEvent(changeEvent);
|
|
23548
23548
|
}
|
|
23549
|
+
eventPosToStagePos(e) {
|
|
23550
|
+
var _a, _b;
|
|
23551
|
+
const result = {
|
|
23552
|
+
x: 0,
|
|
23553
|
+
y: 0
|
|
23554
|
+
},
|
|
23555
|
+
stagePoints = null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventPointTransform(e)) && void 0 !== _b ? _b : {
|
|
23556
|
+
x: 0,
|
|
23557
|
+
y: 0
|
|
23558
|
+
};
|
|
23559
|
+
return this.globalTransMatrix.transformPoint(stagePoints, result), result;
|
|
23560
|
+
}
|
|
23549
23561
|
}
|
|
23550
23562
|
|
|
23551
23563
|
const MathPickerContribution = Symbol.for("MathPickerContribution");
|
|
@@ -31536,6 +31548,10 @@ class InterpolateUpdateStore {
|
|
|
31536
31548
|
target.attribute.x = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31537
31549
|
}, this.y = (key, from, to, ratio, step, target) => {
|
|
31538
31550
|
target.attribute.y = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31551
|
+
}, this.dx = (key, from, to, ratio, step, target) => {
|
|
31552
|
+
target.attribute.dx = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31553
|
+
}, this.dy = (key, from, to, ratio, step, target) => {
|
|
31554
|
+
target.attribute.dy = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31539
31555
|
}, this.angle = (key, from, to, ratio, step, target) => {
|
|
31540
31556
|
target.attribute.angle = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
31541
31557
|
}, this.scaleX = (key, from, to, ratio, step, target) => {
|
|
@@ -32396,7 +32412,10 @@ class AnimateExecutor {
|
|
|
32396
32412
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
32397
32413
|
var _a, _b, _c, _d;
|
|
32398
32414
|
if (custom && customType) {
|
|
32399
|
-
const customParams = this.resolveValue(customParameters, graphic, {
|
|
32415
|
+
const customParams = this.resolveValue(customParameters, graphic, {
|
|
32416
|
+
width: graphic.stage.width,
|
|
32417
|
+
height: graphic.stage.height
|
|
32418
|
+
}),
|
|
32400
32419
|
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;
|
|
32401
32420
|
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);
|
|
32402
32421
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
@@ -35959,11 +35978,11 @@ class FromTo extends ACustomAnimate {
|
|
|
35959
35978
|
}
|
|
35960
35979
|
onBind() {
|
|
35961
35980
|
var _a, _b;
|
|
35962
|
-
super.onBind()
|
|
35981
|
+
super.onBind(), Object.keys(this.from).forEach(key => {
|
|
35982
|
+
null == this.props[key] && (this.props[key] = this.target.getGraphicAttribute(key));
|
|
35983
|
+
});
|
|
35963
35984
|
const finalAttribute = this.target.getFinalAttribute();
|
|
35964
|
-
|
|
35965
|
-
null == this.props[key] && (this.props[key] = finalAttribute[key]);
|
|
35966
|
-
}), "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);
|
|
35985
|
+
"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);
|
|
35967
35986
|
}
|
|
35968
35987
|
onFirstRun() {
|
|
35969
35988
|
this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
|
|
@@ -36969,7 +36988,7 @@ const labelOverlap = (prevLabel, nextLabel, gap = 0) => {
|
|
|
36969
36988
|
const MIN_TICK_GAP = 12;
|
|
36970
36989
|
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;
|
|
36971
36990
|
const getCartesianLabelBounds = (scale, domain, op) => {
|
|
36972
|
-
var _a;
|
|
36991
|
+
var _a, _b, _c;
|
|
36973
36992
|
const {
|
|
36974
36993
|
labelStyle: labelStyle,
|
|
36975
36994
|
axisOrientType: axisOrientType,
|
|
@@ -36985,27 +37004,32 @@ const getCartesianLabelBounds = (scale, domain, op) => {
|
|
|
36985
37004
|
scaleY = 0;
|
|
36986
37005
|
isHorizontal || (isVertical ? (scaleX = 0, scaleY = 1) : startAngle && (scaleX = Math.cos(startAngle), scaleY = -Math.sin(startAngle)));
|
|
36987
37006
|
const textMeasure = initTextMeasure$1(labelStyle),
|
|
36988
|
-
range = scale.range()
|
|
36989
|
-
|
|
36990
|
-
|
|
36991
|
-
|
|
36992
|
-
|
|
36993
|
-
|
|
36994
|
-
|
|
36995
|
-
|
|
36996
|
-
|
|
36997
|
-
|
|
36998
|
-
|
|
36999
|
-
|
|
37000
|
-
|
|
37001
|
-
|
|
37002
|
-
|
|
37003
|
-
|
|
37004
|
-
|
|
37005
|
-
|
|
37006
|
-
|
|
37007
|
-
|
|
37008
|
-
|
|
37007
|
+
range = scale.range();
|
|
37008
|
+
let labelBoundsList = [];
|
|
37009
|
+
for (let i = 0; i < domain.length; i++) {
|
|
37010
|
+
const v = domain[i],
|
|
37011
|
+
str = labelFormatter ? labelFormatter(v) : `${v}`;
|
|
37012
|
+
if (isPlainObject$1(str)) {
|
|
37013
|
+
labelBoundsList = void 0;
|
|
37014
|
+
break;
|
|
37015
|
+
}
|
|
37016
|
+
const {
|
|
37017
|
+
width: width,
|
|
37018
|
+
height: height
|
|
37019
|
+
} = textMeasure.quickMeasure(str),
|
|
37020
|
+
textWidth = Math.max(width, 12),
|
|
37021
|
+
textHeight = Math.max(height, 12),
|
|
37022
|
+
pos = scale.scale(v),
|
|
37023
|
+
baseTextX = scaleX * pos,
|
|
37024
|
+
baseTextY = scaleY * pos;
|
|
37025
|
+
let align,
|
|
37026
|
+
baseline,
|
|
37027
|
+
textX = baseTextX,
|
|
37028
|
+
textY = baseTextY;
|
|
37029
|
+
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);
|
|
37030
|
+
const bounds = new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight);
|
|
37031
|
+
labelAngle && bounds.rotate(labelAngle, baseTextX, baseTextY), labelBoundsList.push(bounds);
|
|
37032
|
+
}
|
|
37009
37033
|
return labelBoundsList;
|
|
37010
37034
|
};
|
|
37011
37035
|
const isAxisHorizontal = axisOrientType => ["bottom", "top", "z"].includes(axisOrientType);
|
|
@@ -38025,7 +38049,7 @@ function forceItemVisible(sourceItem, items, check, comparator, inverse = !1) {
|
|
|
38025
38049
|
}
|
|
38026
38050
|
}
|
|
38027
38051
|
const continuousTicks = (scale, op) => {
|
|
38028
|
-
var _a, _b;
|
|
38052
|
+
var _a, _b, _c, _d;
|
|
38029
38053
|
if (!isContinuous(scale.type)) return convertDomainToTickData(scale.domain());
|
|
38030
38054
|
const range = scale.range(),
|
|
38031
38055
|
rangeSize = Math.abs(range[range.length - 1] - range[0]);
|
|
@@ -38077,23 +38101,25 @@ const continuousTicks = (scale, op) => {
|
|
|
38077
38101
|
step = Math.floor(scaleTicks.length * MIN_FONT_SIZE / rangeSize);
|
|
38078
38102
|
scaleTicks.forEach((tick, index) => {
|
|
38079
38103
|
index % step != 0 && index !== scaleTicks.length - 1 || samplingScaleTicks.push(tick);
|
|
38080
|
-
}), items = getCartesianLabelBounds(scale, samplingScaleTicks, op).map((bounds, i) => ({
|
|
38104
|
+
}), items = null === (_c = getCartesianLabelBounds(scale, samplingScaleTicks, op)) || void 0 === _c ? void 0 : _c.map((bounds, i) => ({
|
|
38081
38105
|
AABBBounds: bounds,
|
|
38082
38106
|
value: samplingScaleTicks[i]
|
|
38083
38107
|
}));
|
|
38084
|
-
} else items = getCartesianLabelBounds(scale, scaleTicks, op).map((bounds, i) => ({
|
|
38108
|
+
} else items = null === (_d = getCartesianLabelBounds(scale, scaleTicks, op)) || void 0 === _d ? void 0 : _d.map((bounds, i) => ({
|
|
38085
38109
|
AABBBounds: bounds,
|
|
38086
38110
|
value: scaleTicks[i]
|
|
38087
38111
|
}));
|
|
38088
|
-
|
|
38089
|
-
|
|
38090
|
-
|
|
38091
|
-
|
|
38092
|
-
|
|
38093
|
-
|
|
38094
|
-
|
|
38095
|
-
|
|
38096
|
-
|
|
38112
|
+
if (items) {
|
|
38113
|
+
const firstSourceItem = items[0],
|
|
38114
|
+
lastSourceItem = last(items),
|
|
38115
|
+
samplingMethod = breakData && breakData() ? methods$1.greedy : methods$1.parity;
|
|
38116
|
+
for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = samplingMethod(items, labelGap);
|
|
38117
|
+
const checkFirst = op.labelFirstVisible;
|
|
38118
|
+
let checkLast = op.labelLastVisible;
|
|
38119
|
+
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);
|
|
38120
|
+
const ticks = items.map(item => item.value);
|
|
38121
|
+
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
|
|
38122
|
+
}
|
|
38097
38123
|
}
|
|
38098
38124
|
return convertDomainToTickData(scaleTicks);
|
|
38099
38125
|
};
|
|
@@ -38107,7 +38133,10 @@ const methods$1 = {
|
|
|
38107
38133
|
}
|
|
38108
38134
|
};
|
|
38109
38135
|
|
|
38110
|
-
const getOneDimensionalLabelBounds = (scale, domain, op, isHorizontal) =>
|
|
38136
|
+
const getOneDimensionalLabelBounds = (scale, domain, op, isHorizontal) => {
|
|
38137
|
+
const labelBoundsList = getCartesianLabelBounds(scale, domain, op);
|
|
38138
|
+
return labelBoundsList && labelBoundsList.map(bounds => isHorizontal ? [bounds.x1, bounds.x2, bounds.width()] : [bounds.y1, bounds.y2, bounds.height()]);
|
|
38139
|
+
},
|
|
38111
38140
|
boundsOverlap = (prevBounds, nextBounds, gap = 0) => Math.max(prevBounds[0], nextBounds[0]) - gap / 2 <= Math.min(prevBounds[1], nextBounds[1]) + gap / 2;
|
|
38112
38141
|
const boundsDistance = (prevBounds, nextBounds) => prevBounds[1] < nextBounds[0] ? nextBounds[0] - prevBounds[1] : nextBounds[1] < prevBounds[0] ? prevBounds[0] - nextBounds[1] : 0;
|
|
38113
38142
|
const linearDiscreteTicks = (scale, op) => {
|
|
@@ -38138,23 +38167,27 @@ const linearDiscreteTicks = (scale, op) => {
|
|
|
38138
38167
|
rangeStart = minInArray(range),
|
|
38139
38168
|
rangeEnd = maxInArray(range);
|
|
38140
38169
|
if (domain.length <= rangeSize / fontSize) {
|
|
38141
|
-
const
|
|
38142
|
-
|
|
38143
|
-
minBoundsLength = Math.min(...labelBoundsList.map(bounds => bounds[2])),
|
|
38144
|
-
|
|
38145
|
-
|
|
38170
|
+
const labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal);
|
|
38171
|
+
if (labelBoundsList) {
|
|
38172
|
+
const minBoundsLength = Math.min(...labelBoundsList.map(bounds => bounds[2])),
|
|
38173
|
+
incrementUnit = (rangeEnd - rangeStart) / domain.length,
|
|
38174
|
+
stepResult = getStep$1(domain, labelBoundsList, labelGap, op.labelLastVisible, Math.floor(minBoundsLength / incrementUnit), !1);
|
|
38175
|
+
scaleTicks = scale.stepTicks(stepResult.step), op.labelLastVisible && (stepResult.delCount && (scaleTicks = scaleTicks.slice(0, scaleTicks.length - stepResult.delCount)), scaleTicks.push(domain[domain.length - 1]));
|
|
38176
|
+
}
|
|
38146
38177
|
} else {
|
|
38147
38178
|
const tempDomain = [domain[0], domain[Math.floor(domain.length / 2)], domain[domain.length - 1]],
|
|
38148
38179
|
tempList = getOneDimensionalLabelBounds(scale, tempDomain, op, isHorizontal);
|
|
38149
|
-
|
|
38150
|
-
|
|
38151
|
-
|
|
38152
|
-
|
|
38153
|
-
|
|
38154
|
-
|
|
38180
|
+
if (tempList) {
|
|
38181
|
+
let maxBounds = null;
|
|
38182
|
+
tempList.forEach(current => {
|
|
38183
|
+
maxBounds ? maxBounds[2] < current[2] && (maxBounds = current) : maxBounds = current;
|
|
38184
|
+
});
|
|
38185
|
+
const step = rangeEnd - rangeStart - labelGap > 0 ? Math.ceil(domain.length * (labelGap + maxBounds[2]) / (rangeEnd - rangeStart - labelGap)) : domain.length - 1;
|
|
38186
|
+
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]));
|
|
38187
|
+
}
|
|
38155
38188
|
}
|
|
38156
|
-
}
|
|
38157
|
-
return convertDomainToTickData(scaleTicks);
|
|
38189
|
+
}
|
|
38190
|
+
return isNil$1(scaleTicks) && (scaleTicks = scale.domain()), convertDomainToTickData(scaleTicks);
|
|
38158
38191
|
};
|
|
38159
38192
|
const getStep$1 = (domain, labelBoundsList, labelGap, labelLastVisible, defaultStep, areAllBoundsSame) => {
|
|
38160
38193
|
let resultDelCount = 0,
|
|
@@ -41050,13 +41083,6 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
|
|
|
41050
41083
|
end: end
|
|
41051
41084
|
}));
|
|
41052
41085
|
}
|
|
41053
|
-
eventPosToStagePos(e) {
|
|
41054
|
-
var _a, _b;
|
|
41055
|
-
return null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventPointTransform(e)) && void 0 !== _b ? _b : {
|
|
41056
|
-
x: 0,
|
|
41057
|
-
y: 0
|
|
41058
|
-
};
|
|
41059
|
-
}
|
|
41060
41086
|
_clearDragEvents() {
|
|
41061
41087
|
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
41062
41088
|
triggers = getEndTriggersOfDrag();
|
|
@@ -41215,7 +41241,13 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
|
|
|
41215
41241
|
} = this.attribute.startTextStyle;
|
|
41216
41242
|
if (new Bounds().set(x1, y1, x2, y2).intersects(endTextBounds)) {
|
|
41217
41243
|
const direction = "bottom" === this.attribute.orient || "right" === this.attribute.orient ? -1 : 1;
|
|
41218
|
-
this._isHorizontal
|
|
41244
|
+
if (this._isHorizontal) {
|
|
41245
|
+
const boundsYDiff = Math.abs(endTextBounds.y1 - endTextBounds.y2);
|
|
41246
|
+
this._startText.setAttribute("dy", startTextDy + direction * (Number.isFinite(boundsYDiff) ? boundsYDiff : 0));
|
|
41247
|
+
} else {
|
|
41248
|
+
const boundsXDiff = Math.abs(endTextBounds.x1 - endTextBounds.x2);
|
|
41249
|
+
this._startText.setAttribute("dx", startTextDx + direction * (Number.isFinite(boundsXDiff) ? boundsXDiff : 0));
|
|
41250
|
+
}
|
|
41219
41251
|
} else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
|
|
41220
41252
|
}
|
|
41221
41253
|
getLayoutAttrFromConfig() {
|
|
@@ -46365,8 +46397,7 @@ const delayMap$1 = {
|
|
|
46365
46397
|
loadBrushComponent();
|
|
46366
46398
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
46367
46399
|
constructor(attributes, options) {
|
|
46368
|
-
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 => {
|
|
46369
|
-
if (this._outOfInteractiveRange(e)) return void (this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)));
|
|
46400
|
+
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 => {
|
|
46370
46401
|
const {
|
|
46371
46402
|
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
46372
46403
|
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
@@ -46394,7 +46425,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
46394
46425
|
brushMode: brushMode
|
|
46395
46426
|
} = this.attribute,
|
|
46396
46427
|
pos = this.eventPosToStagePos(e);
|
|
46397
|
-
this._cacheDrawPoints.push(pos), "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e),
|
|
46428
|
+
this._cacheDrawPoints.push(pos), "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e), this._activeBrushState = !1;
|
|
46398
46429
|
}
|
|
46399
46430
|
_initMove(e) {
|
|
46400
46431
|
var _a, _b;
|
|
@@ -46424,7 +46455,8 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
46424
46455
|
var _a;
|
|
46425
46456
|
const pos = this.eventPosToStagePos(e),
|
|
46426
46457
|
{
|
|
46427
|
-
brushType: brushType
|
|
46458
|
+
brushType: brushType,
|
|
46459
|
+
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
46428
46460
|
} = this.attribute,
|
|
46429
46461
|
cacheLength = this._cacheDrawPoints.length;
|
|
46430
46462
|
if (cacheLength > 0) {
|
|
@@ -46433,7 +46465,16 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
46433
46465
|
}
|
|
46434
46466
|
"polygon" === brushType || cacheLength <= 1 ? this._cacheDrawPoints.push(pos) : this._cacheDrawPoints[cacheLength - 1] = pos;
|
|
46435
46467
|
const maskPoints = this._computeMaskPoints();
|
|
46436
|
-
this._operatingMask.setAttribute("points", maskPoints)
|
|
46468
|
+
this._operatingMask.setAttribute("points", maskPoints);
|
|
46469
|
+
const {
|
|
46470
|
+
x: x1,
|
|
46471
|
+
y: y1
|
|
46472
|
+
} = this._startPos,
|
|
46473
|
+
{
|
|
46474
|
+
x: x2,
|
|
46475
|
+
y: y2
|
|
46476
|
+
} = this.eventPosToStagePos(e);
|
|
46477
|
+
(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)));
|
|
46437
46478
|
}
|
|
46438
46479
|
_moving(e) {
|
|
46439
46480
|
const startPos = this._cacheMovePoint,
|
|
@@ -46573,9 +46614,6 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
46573
46614
|
pos = this.eventPosToStagePos(e);
|
|
46574
46615
|
return pos.x > maxX || pos.x < minX || pos.y > maxY || pos.y < minY;
|
|
46575
46616
|
}
|
|
46576
|
-
eventPosToStagePos(e) {
|
|
46577
|
-
return this.stage.eventPointTransform(e);
|
|
46578
|
-
}
|
|
46579
46617
|
_dispatchBrushEvent(operateType, e) {
|
|
46580
46618
|
this._dispatchEvent(operateType, {
|
|
46581
46619
|
operateMask: this._operatingMask,
|
|
@@ -46584,7 +46622,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
46584
46622
|
});
|
|
46585
46623
|
}
|
|
46586
46624
|
_clearMask() {
|
|
46587
|
-
this._brushMaskAABBBoundsDict = {}, this._container.
|
|
46625
|
+
this._brushMaskAABBBoundsDict = {}, this._container.removeAllChild(), this._operatingMask = null;
|
|
46588
46626
|
}
|
|
46589
46627
|
_isEmptyMask() {
|
|
46590
46628
|
return isEmpty(this._brushMaskAABBBoundsDict) || Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty());
|
|
@@ -53163,20 +53201,24 @@ class BaseMark extends GrammarItem {
|
|
|
53163
53201
|
return this._animationConfig;
|
|
53164
53202
|
}
|
|
53165
53203
|
setAnimationConfig(config) {
|
|
53166
|
-
const
|
|
53167
|
-
|
|
53168
|
-
|
|
53204
|
+
const defaultPrams = this.type === 'group' ? { selfOnly: true } : {};
|
|
53205
|
+
const animationConfig = {};
|
|
53206
|
+
Object.keys(config).forEach(key => {
|
|
53207
|
+
const value = config[key];
|
|
53169
53208
|
if (isArray$1(value)) {
|
|
53170
|
-
value.
|
|
53209
|
+
animationConfig[key] = value.map(item => {
|
|
53171
53210
|
var _a;
|
|
53172
53211
|
const options = (_a = item.options) !== null && _a !== void 0 ? _a : {};
|
|
53173
|
-
item
|
|
53174
|
-
|
|
53175
|
-
|
|
53176
|
-
|
|
53177
|
-
|
|
53212
|
+
return Object.assign(Object.assign(Object.assign({}, defaultPrams), item), { options: (...args) => {
|
|
53213
|
+
var _a, _b;
|
|
53214
|
+
const _options = typeof options === 'function' ? options(...args) : options;
|
|
53215
|
+
return Object.assign(Object.assign({}, _options), { layoutRect: (_b = (_a = this.model).getLayoutRect) === null || _b === void 0 ? void 0 : _b.call(_a) });
|
|
53216
|
+
} });
|
|
53178
53217
|
});
|
|
53179
53218
|
}
|
|
53219
|
+
else {
|
|
53220
|
+
animationConfig[key] = Object.assign(Object.assign({}, defaultPrams), config[key]);
|
|
53221
|
+
}
|
|
53180
53222
|
});
|
|
53181
53223
|
this._animationConfig = animationConfig;
|
|
53182
53224
|
}
|
|
@@ -56724,7 +56766,7 @@ const lookup = (data, opt) => {
|
|
|
56724
56766
|
});
|
|
56725
56767
|
};
|
|
56726
56768
|
|
|
56727
|
-
const version = "2.0.0
|
|
56769
|
+
const version = "2.0.0";
|
|
56728
56770
|
|
|
56729
56771
|
const addVChartProperty = (data, op) => {
|
|
56730
56772
|
const context = op.beforeCall();
|
|
@@ -60669,7 +60711,7 @@ function getDatumByValue(data, value, startField, endField) {
|
|
|
60669
60711
|
const getCartesianCrosshairTheme = (getTheme, chartSpec) => {
|
|
60670
60712
|
var _a, _b;
|
|
60671
60713
|
const axes = array((_a = chartSpec.axes) !== null && _a !== void 0 ? _a : []);
|
|
60672
|
-
const { bandField, linearField, xField, yField } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60714
|
+
const { bandField, linearField, xField, yField, trigger, triggerOff } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60673
60715
|
const xAxis = axes.find(axis => isXAxis(axis.orient));
|
|
60674
60716
|
let newXField;
|
|
60675
60717
|
if (isValid$1(xAxis)) {
|
|
@@ -60688,13 +60730,15 @@ const getCartesianCrosshairTheme = (getTheme, chartSpec) => {
|
|
|
60688
60730
|
}
|
|
60689
60731
|
return {
|
|
60690
60732
|
xField: newXField,
|
|
60691
|
-
yField: newYField
|
|
60733
|
+
yField: newYField,
|
|
60734
|
+
trigger,
|
|
60735
|
+
triggerOff
|
|
60692
60736
|
};
|
|
60693
60737
|
};
|
|
60694
60738
|
const getPolarCrosshairTheme = (getTheme, chartSpec) => {
|
|
60695
60739
|
var _a, _b;
|
|
60696
60740
|
const axes = array((_a = chartSpec.axes) !== null && _a !== void 0 ? _a : []);
|
|
60697
|
-
const { bandField, linearField, categoryField, valueField } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60741
|
+
const { bandField, linearField, categoryField, valueField, trigger, triggerOff } = (_b = getComponentThemeFromOption(ComponentTypeEnum.crosshair, getTheme)) !== null && _b !== void 0 ? _b : {};
|
|
60698
60742
|
const angleAxis = axes.find(axis => axis.orient === 'angle');
|
|
60699
60743
|
let newAngleField;
|
|
60700
60744
|
if (isValid$1(angleAxis)) {
|
|
@@ -60713,7 +60757,9 @@ const getPolarCrosshairTheme = (getTheme, chartSpec) => {
|
|
|
60713
60757
|
}
|
|
60714
60758
|
return {
|
|
60715
60759
|
categoryField: newAngleField,
|
|
60716
|
-
valueField: newRadiusField
|
|
60760
|
+
valueField: newRadiusField,
|
|
60761
|
+
trigger,
|
|
60762
|
+
triggerOff
|
|
60717
60763
|
};
|
|
60718
60764
|
};
|
|
60719
60765
|
|
|
@@ -66229,9 +66275,11 @@ const layoutByValue$1 = (stateByField, series, layoutStartPoint, enableRemain =
|
|
|
66229
66275
|
layoutStartPoint = { x: 0, y: 0 };
|
|
66230
66276
|
}
|
|
66231
66277
|
Object.keys(stateByField).forEach(field => {
|
|
66278
|
+
var _a, _b, _c, _d, _e;
|
|
66232
66279
|
const { currentValue, cacheInfo, labelsComp, attributes, coordKey } = stateByField[field];
|
|
66233
66280
|
let axis = null;
|
|
66234
66281
|
let coord = 0;
|
|
66282
|
+
let axisLabel = null;
|
|
66235
66283
|
if (currentValue.size) {
|
|
66236
66284
|
const item = Array.from(currentValue.values())[0];
|
|
66237
66285
|
coord =
|
|
@@ -66239,6 +66287,8 @@ const layoutByValue$1 = (stateByField, series, layoutStartPoint, enableRemain =
|
|
|
66239
66287
|
item.axis.getLayoutStartPoint()[coordKey] -
|
|
66240
66288
|
layoutStartPoint[coordKey];
|
|
66241
66289
|
axis = item.axis;
|
|
66290
|
+
axisLabel = (_e = (_d = (_c = (_b = (_a = axis
|
|
66291
|
+
.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.getChildByName('axis-label-container')) === null || _d === void 0 ? void 0 : _d.getChildByName('axis-label-container-layer-0')) === null || _e === void 0 ? void 0 : _e.children[0];
|
|
66242
66292
|
}
|
|
66243
66293
|
const isVisible = !!currentValue.size && Number.isFinite(coord) && !Number.isNaN(coord);
|
|
66244
66294
|
const useCache = enableRemain && !isVisible && isValid$1(cacheInfo);
|
|
@@ -66256,7 +66306,8 @@ const layoutByValue$1 = (stateByField, series, layoutStartPoint, enableRemain =
|
|
|
66256
66306
|
}, {})
|
|
66257
66307
|
: null,
|
|
66258
66308
|
visible: isVisible,
|
|
66259
|
-
axis
|
|
66309
|
+
axis,
|
|
66310
|
+
axisLabel: axisLabel
|
|
66260
66311
|
};
|
|
66261
66312
|
if (newCacheInfo) {
|
|
66262
66313
|
newCacheInfo._isCache = useCache;
|
|
@@ -66265,7 +66316,7 @@ const layoutByValue$1 = (stateByField, series, layoutStartPoint, enableRemain =
|
|
|
66265
66316
|
let offsetSize = 0;
|
|
66266
66317
|
if (attributes) {
|
|
66267
66318
|
currentValue.forEach(({ axis, datum: value = '' }) => {
|
|
66268
|
-
var _a;
|
|
66319
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
66269
66320
|
let niceLabelFormatter = null;
|
|
66270
66321
|
const scale = axis.getScale();
|
|
66271
66322
|
if (isDiscrete(scale.type)) {
|
|
@@ -66294,36 +66345,37 @@ const layoutByValue$1 = (stateByField, series, layoutStartPoint, enableRemain =
|
|
|
66294
66345
|
if (newCacheInfo && ((_a = attributes.label) === null || _a === void 0 ? void 0 : _a.visible) && !useCache) {
|
|
66295
66346
|
const labelOffset = getAxisLabelOffset(axis.getSpec());
|
|
66296
66347
|
const axisOrient = axis.getOrient();
|
|
66348
|
+
const syncAxisLabelAngle = (_b = attributes.label) === null || _b === void 0 ? void 0 : _b.syncAxisLabelAngle;
|
|
66297
66349
|
if (newCacheInfo.labels[axisOrient]) {
|
|
66298
66350
|
newCacheInfo.labels[axisOrient].visible = true;
|
|
66299
66351
|
newCacheInfo.labels[axisOrient].text = value;
|
|
66300
66352
|
if (axisOrient === 'left') {
|
|
66301
66353
|
newCacheInfo.labels[axisOrient].dx = -labelOffset;
|
|
66302
66354
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66303
|
-
textAlign: 'right',
|
|
66304
|
-
textBaseline: 'middle'
|
|
66355
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_c = axisLabel.attribute.textAlign) !== null && _c !== void 0 ? _c : 'right' : 'right',
|
|
66356
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_d = axisLabel.attribute.textBaseline) !== null && _d !== void 0 ? _d : 'middle' : 'middle'
|
|
66305
66357
|
};
|
|
66306
66358
|
}
|
|
66307
66359
|
else if (axisOrient === 'right') {
|
|
66308
66360
|
newCacheInfo.labels[axisOrient].dx = labelOffset;
|
|
66309
66361
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66310
|
-
textAlign: 'left',
|
|
66311
|
-
textBaseline: 'middle'
|
|
66362
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_e = axisLabel.attribute.textAlign) !== null && _e !== void 0 ? _e : 'left' : 'left',
|
|
66363
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_f = axisLabel.attribute.textBaseline) !== null && _f !== void 0 ? _f : 'middle' : 'middle'
|
|
66312
66364
|
};
|
|
66313
66365
|
}
|
|
66314
66366
|
else if (axisOrient === 'top') {
|
|
66315
66367
|
newCacheInfo.labels[axisOrient].y = 0;
|
|
66316
66368
|
newCacheInfo.labels[axisOrient].dy = -labelOffset;
|
|
66317
66369
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66318
|
-
textAlign: 'center',
|
|
66319
|
-
textBaseline: 'bottom'
|
|
66370
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_g = axisLabel.attribute.textAlign) !== null && _g !== void 0 ? _g : 'center' : 'center',
|
|
66371
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_h = axisLabel.attribute.textBaseline) !== null && _h !== void 0 ? _h : 'bottom' : 'bottom'
|
|
66320
66372
|
};
|
|
66321
66373
|
}
|
|
66322
66374
|
else if (axisOrient === 'bottom') {
|
|
66323
66375
|
newCacheInfo.labels[axisOrient].dy = labelOffset;
|
|
66324
66376
|
newCacheInfo.labelsTextStyle[axisOrient] = {
|
|
66325
|
-
textAlign: 'center',
|
|
66326
|
-
textBaseline: 'top'
|
|
66377
|
+
textAlign: syncAxisLabelAngle && axisLabel ? (_j = axisLabel.attribute.textAlign) !== null && _j !== void 0 ? _j : 'center' : 'center',
|
|
66378
|
+
textBaseline: syncAxisLabelAngle && axisLabel ? (_k = axisLabel.attribute.textBaseline) !== null && _k !== void 0 ? _k : 'top' : 'top'
|
|
66327
66379
|
};
|
|
66328
66380
|
}
|
|
66329
66381
|
newCacheInfo.labels[axisOrient].defaultFormatter = niceLabelFormatter;
|
|
@@ -67473,6 +67525,26 @@ class BarSeries extends CartesianSeries {
|
|
|
67473
67525
|
this._barMarkType = "rect";
|
|
67474
67526
|
this.transformerConstructor = BarSeriesSpecTransformer;
|
|
67475
67527
|
this._bandPosition = 0;
|
|
67528
|
+
this._getLinearBarRange = (start, end) => {
|
|
67529
|
+
let [x, x1] = [start, end].sort((a, b) => a - b);
|
|
67530
|
+
const realBarWidth = x1 - x;
|
|
67531
|
+
if (this._spec.barGap) {
|
|
67532
|
+
const halfBarGap = this._spec.barGap * 0.5;
|
|
67533
|
+
const tempX = x + halfBarGap;
|
|
67534
|
+
const tempX1 = x1 - halfBarGap;
|
|
67535
|
+
x = tempX;
|
|
67536
|
+
x1 = tempX1;
|
|
67537
|
+
}
|
|
67538
|
+
const curBarWidth = x1 - x;
|
|
67539
|
+
const barMinWidth = getActualNumValue(this._spec.barMinWidth || 2, realBarWidth);
|
|
67540
|
+
if (curBarWidth < barMinWidth) {
|
|
67541
|
+
const widthDiff = barMinWidth - curBarWidth;
|
|
67542
|
+
const halfWidthDiff = widthDiff / 2;
|
|
67543
|
+
x -= halfWidthDiff;
|
|
67544
|
+
x1 += halfWidthDiff;
|
|
67545
|
+
}
|
|
67546
|
+
return [x, x1];
|
|
67547
|
+
};
|
|
67476
67548
|
this._getBarXStart = (datum, scale, useWholeRange) => {
|
|
67477
67549
|
if (this._shouldDoPreCalculate()) {
|
|
67478
67550
|
this._calculateStackRectPosition(false);
|
|
@@ -67490,6 +67562,11 @@ class BarSeries extends CartesianSeries {
|
|
|
67490
67562
|
}
|
|
67491
67563
|
return valueInScaleRange(this._dataToPosX1(datum), scale, useWholeRange);
|
|
67492
67564
|
};
|
|
67565
|
+
this._getLinearBarXRange = (datum, scale, useWholeRange) => {
|
|
67566
|
+
const x = valueInScaleRange(this._dataToPosX(datum), scale, useWholeRange);
|
|
67567
|
+
const x1 = valueInScaleRange(this._dataToPosX1(datum), scale, useWholeRange);
|
|
67568
|
+
return this._getLinearBarRange(x, x1);
|
|
67569
|
+
};
|
|
67493
67570
|
this._getBarYStart = (datum, scale) => {
|
|
67494
67571
|
if (this._shouldDoPreCalculate()) {
|
|
67495
67572
|
this._calculateStackRectPosition(true);
|
|
@@ -67507,6 +67584,11 @@ class BarSeries extends CartesianSeries {
|
|
|
67507
67584
|
}
|
|
67508
67585
|
return valueInScaleRange(this._dataToPosY1(datum), scale);
|
|
67509
67586
|
};
|
|
67587
|
+
this._getLinearBarYRange = (datum, scale, useWholeRange) => {
|
|
67588
|
+
const y = valueInScaleRange(this._dataToPosY(datum), scale, useWholeRange);
|
|
67589
|
+
const y1 = valueInScaleRange(this._dataToPosY1(datum), scale, useWholeRange);
|
|
67590
|
+
return this._getLinearBarRange(y, y1);
|
|
67591
|
+
};
|
|
67510
67592
|
this._getBarBackgroundXStart = (scale) => {
|
|
67511
67593
|
const range = scale.range();
|
|
67512
67594
|
const min = Math.min(range[0], range[range.length - 1]);
|
|
@@ -67860,8 +67942,8 @@ class BarSeries extends CartesianSeries {
|
|
|
67860
67942
|
if (this.direction === "horizontal") {
|
|
67861
67943
|
const yChannels = isValid$1(this._fieldY2)
|
|
67862
67944
|
? {
|
|
67863
|
-
y: (datum) =>
|
|
67864
|
-
y1: (datum) =>
|
|
67945
|
+
y: (datum) => this._getLinearBarYRange(datum, yScale, true)[0],
|
|
67946
|
+
y1: (datum) => this._getLinearBarYRange(datum, yScale, true)[1]
|
|
67865
67947
|
}
|
|
67866
67948
|
: {
|
|
67867
67949
|
y: (datum) => valueInScaleRange(this._dataToPosY(datum) - this._getBarWidth(this._yAxisHelper) / 2, yScale, true),
|
|
@@ -67873,8 +67955,8 @@ class BarSeries extends CartesianSeries {
|
|
|
67873
67955
|
else {
|
|
67874
67956
|
const xChannels = isValid$1(this._fieldX2)
|
|
67875
67957
|
? {
|
|
67876
|
-
x: (datum) =>
|
|
67877
|
-
x1: (datum) =>
|
|
67958
|
+
x: (datum) => this._getLinearBarXRange(datum, xScale, true)[0],
|
|
67959
|
+
x1: (datum) => this._getLinearBarXRange(datum, xScale, true)[1]
|
|
67878
67960
|
}
|
|
67879
67961
|
: {
|
|
67880
67962
|
x: (datum) => valueInScaleRange(this._dataToPosX(datum) - this._getBarWidth(this._xAxisHelper) / 2, xScale, true),
|
|
@@ -87086,7 +87168,7 @@ class BaseHistogramChartSpecTransformer extends CartesianChartSpecTransformer {
|
|
|
87086
87168
|
spec.axes.forEach((axis) => (axis.type = 'linear'));
|
|
87087
87169
|
}
|
|
87088
87170
|
_getDefaultSeriesSpec(spec) {
|
|
87089
|
-
return super._getDefaultSeriesSpec(spec, ['x2Field', 'y2Field', 'barMinHeight', 'barBackground']);
|
|
87171
|
+
return super._getDefaultSeriesSpec(spec, ['x2Field', 'y2Field', 'barMinHeight', 'barBackground', 'barGap']);
|
|
87090
87172
|
}
|
|
87091
87173
|
}
|
|
87092
87174
|
|
|
@@ -89378,11 +89460,13 @@ class TooltipSpecTransformer extends BaseComponentSpecTransformer {
|
|
|
89378
89460
|
return false;
|
|
89379
89461
|
}
|
|
89380
89462
|
_initTheme(spec, chartSpec) {
|
|
89381
|
-
var _a;
|
|
89463
|
+
var _a, _b, _c;
|
|
89382
89464
|
const { spec: newSpec, theme } = super._initTheme(spec, chartSpec);
|
|
89383
89465
|
newSpec.style = mergeSpec({}, this._theme, newSpec.style);
|
|
89384
89466
|
newSpec.offset = mergeSpec({}, theme.offset, spec.offset);
|
|
89385
89467
|
newSpec.transitionDuration = (_a = spec.transitionDuration) !== null && _a !== void 0 ? _a : theme.transitionDuration;
|
|
89468
|
+
newSpec.trigger = (_b = spec.trigger) !== null && _b !== void 0 ? _b : theme.trigger;
|
|
89469
|
+
newSpec.triggerOff = (_c = spec.triggerOff) !== null && _c !== void 0 ? _c : theme.triggerOff;
|
|
89386
89470
|
return { spec: newSpec, theme };
|
|
89387
89471
|
}
|
|
89388
89472
|
_transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
|
|
@@ -90372,7 +90456,7 @@ class BaseCrossHair extends BaseComponent {
|
|
|
90372
90456
|
}
|
|
90373
90457
|
}
|
|
90374
90458
|
_parseField(field, fieldName) {
|
|
90375
|
-
var _a, _b;
|
|
90459
|
+
var _a, _b, _c;
|
|
90376
90460
|
const hair = {};
|
|
90377
90461
|
const { line = {}, label = {}, visible } = field;
|
|
90378
90462
|
hair.visible = visible;
|
|
@@ -90383,7 +90467,7 @@ class BaseCrossHair extends BaseComponent {
|
|
|
90383
90467
|
else {
|
|
90384
90468
|
const style = line.style || {};
|
|
90385
90469
|
const { stroke, fill, lineWidth } = style;
|
|
90386
|
-
const
|
|
90470
|
+
const _d = style, { strokeOpacity, fillOpacity, opacity } = _d, restStyle = __rest$e(_d, ["strokeOpacity", "fillOpacity", "opacity"]);
|
|
90387
90471
|
const isLineType = hair.type === 'line';
|
|
90388
90472
|
let finalOpacity = isLineType ? strokeOpacity : fillOpacity;
|
|
90389
90473
|
if (isNumber$1(opacity)) {
|
|
@@ -90411,8 +90495,9 @@ class BaseCrossHair extends BaseComponent {
|
|
|
90411
90495
|
}
|
|
90412
90496
|
if (!!label.visible) {
|
|
90413
90497
|
const labelBackground = label.labelBackground || {};
|
|
90498
|
+
const syncAxisLabelAngle = (_c = label.syncAxisLabelAngle) !== null && _c !== void 0 ? _c : false;
|
|
90414
90499
|
const labelStyle = label.style || {};
|
|
90415
|
-
const
|
|
90500
|
+
const _e = labelBackground.style || {}, { fill: rectFill = 'rgba(47, 59, 82, 0.9)', stroke: rectStroke, outerBorder } = _e, rectStyle = __rest$e(_e, ["fill", "stroke", "outerBorder"]);
|
|
90416
90501
|
hair.label = {
|
|
90417
90502
|
visible: true,
|
|
90418
90503
|
formatMethod: label.formatMethod,
|
|
@@ -90420,6 +90505,7 @@ class BaseCrossHair extends BaseComponent {
|
|
|
90420
90505
|
minWidth: labelBackground.minWidth,
|
|
90421
90506
|
maxWidth: labelBackground.maxWidth,
|
|
90422
90507
|
padding: labelBackground.padding,
|
|
90508
|
+
syncAxisLabelAngle,
|
|
90423
90509
|
textStyle: Object.assign(Object.assign({ fontSize: 14, pickable: false }, labelStyle), { fill: labelStyle.fill || '#fff', stroke: get$1(labelStyle, 'stroke') }),
|
|
90424
90510
|
panel: (isBoolean$1(labelBackground.visible) ? labelBackground.visible : !!labelBackground)
|
|
90425
90511
|
? Object.assign({ visible: true, pickable: false, fill: rectFill, stroke: rectStroke, outerBorder: Object.assign({ stroke: rectFill, distance: 0, lineWidth: 3 }, outerBorder) }, rectStyle) : { visible: false },
|
|
@@ -90687,9 +90773,9 @@ class CartesianCrossHair extends BaseCrossHair {
|
|
|
90687
90773
|
const positionAttribute = layoutCrosshair$1(this._stateByField[field]);
|
|
90688
90774
|
this._updateCrosshairByField(field, positionAttribute);
|
|
90689
90775
|
Object.keys(labels).forEach(labelKey => {
|
|
90690
|
-
var _a;
|
|
90776
|
+
var _a, _b, _c;
|
|
90691
90777
|
if (labels[labelKey].visible) {
|
|
90692
|
-
const updateAttrs = Object.assign(Object.assign(Object.assign({ [coordKey]: coord + bandSize / 2 }, labels[labelKey]), attributes.label), { textStyle: Object.assign(Object.assign({}, (
|
|
90778
|
+
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 });
|
|
90693
90779
|
this._updateCrosshairLabel(labelsComp[labelKey], updateAttrs, label => {
|
|
90694
90780
|
label.name = `crosshair-${field.replace('Field', '')}-${labelKey}-label`;
|
|
90695
90781
|
labelsComp[labelKey] = label;
|
|
@@ -92830,7 +92916,9 @@ function getXValue(datum, xDomain, autoRange, refSeries, regionWidth, regionStar
|
|
|
92830
92916
|
x = convertPercentToValue(datum.x, regionWidth) + regionStartLayoutStartPoint.x;
|
|
92831
92917
|
}
|
|
92832
92918
|
else {
|
|
92833
|
-
x =
|
|
92919
|
+
x =
|
|
92920
|
+
convertDatumToValue(relativeSeries.getXAxisHelper(), [datum.x]) +
|
|
92921
|
+
regionStartLayoutStartPoint.x;
|
|
92834
92922
|
}
|
|
92835
92923
|
return x;
|
|
92836
92924
|
}
|
|
@@ -92845,7 +92933,9 @@ function getYValue(datum, yDomain, autoRange, refSeries, regionHeight, regionSta
|
|
|
92845
92933
|
y = convertPercentToValue(datum.y, regionHeight) + regionStartLayoutStartPoint.y;
|
|
92846
92934
|
}
|
|
92847
92935
|
else {
|
|
92848
|
-
y =
|
|
92936
|
+
y =
|
|
92937
|
+
convertDatumToValue(relativeSeries.getYAxisHelper(), [datum.y]) +
|
|
92938
|
+
regionStartLayoutStartPoint.y;
|
|
92849
92939
|
}
|
|
92850
92940
|
return y;
|
|
92851
92941
|
}
|
|
@@ -92855,7 +92945,7 @@ function getAngleValue(datum, angleDomain, autoRange, refSeries) {
|
|
|
92855
92945
|
isNumber$1(datum.angle) &&
|
|
92856
92946
|
isNeedExtendDomain(angleDomain, datum.angle, autoRange) &&
|
|
92857
92947
|
((_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));
|
|
92858
|
-
return relativeSeries.angleAxisHelper
|
|
92948
|
+
return convertDatumToValue(relativeSeries.angleAxisHelper, [datum.angle]);
|
|
92859
92949
|
}
|
|
92860
92950
|
function getRadiusValue(datum, radiusDomain, autoRange, refSeries) {
|
|
92861
92951
|
var _a, _b;
|
|
@@ -92863,11 +92953,18 @@ function getRadiusValue(datum, radiusDomain, autoRange, refSeries) {
|
|
|
92863
92953
|
isNumber$1(datum.radius) &&
|
|
92864
92954
|
isNeedExtendDomain(radiusDomain, datum.radius, autoRange) &&
|
|
92865
92955
|
((_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));
|
|
92866
|
-
return relativeSeries.radiusAxisHelper
|
|
92956
|
+
return convertDatumToValue(relativeSeries.radiusAxisHelper, [datum.radius]);
|
|
92867
92957
|
}
|
|
92868
92958
|
function convertPercentToValue(percent, relativeLength) {
|
|
92869
92959
|
return (Number(percent.substring(0, percent.length - 1)) * relativeLength) / 100;
|
|
92870
92960
|
}
|
|
92961
|
+
function convertDatumToValue(axisHelper, datum) {
|
|
92962
|
+
const scale = axisHelper.getScale(0);
|
|
92963
|
+
if (isContinuous(scale.type) && scale.domain()[0] === scale.domain()[1] && datum[0] !== scale.domain()[0]) {
|
|
92964
|
+
return NaN;
|
|
92965
|
+
}
|
|
92966
|
+
return axisHelper.dataToPosition(datum);
|
|
92967
|
+
}
|
|
92871
92968
|
function isAggrSpec(spec) {
|
|
92872
92969
|
return AGGR_TYPE.includes(spec);
|
|
92873
92970
|
}
|
|
@@ -93032,8 +93129,8 @@ function cartesianCoordinateLayout(data, relativeSeries, autoRange, coordinatesO
|
|
|
93032
93129
|
isNeedExtendDomain(yDomain, yValue[0], autoRange) &&
|
|
93033
93130
|
((_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]));
|
|
93034
93131
|
points.push({
|
|
93035
|
-
x: refRelativeSeries.getXAxisHelper()
|
|
93036
|
-
y: refRelativeSeries.getYAxisHelper()
|
|
93132
|
+
x: convertDatumToValue(refRelativeSeries.getXAxisHelper(), xValue) + regionStartLayoutStartPoint.x + offsetX,
|
|
93133
|
+
y: convertDatumToValue(refRelativeSeries.getYAxisHelper(), yValue) + regionStartLayoutStartPoint.y + offsetY
|
|
93037
93134
|
});
|
|
93038
93135
|
});
|
|
93039
93136
|
return points;
|
|
@@ -93057,8 +93154,8 @@ function polarCoordinateLayout(data, relativeSeries, autoRange) {
|
|
|
93057
93154
|
isNeedExtendDomain(radiusDomain, radiusValue[0], autoRange) &&
|
|
93058
93155
|
((_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]));
|
|
93059
93156
|
points.push({
|
|
93060
|
-
angle: refRelativeSeries.angleAxisHelper
|
|
93061
|
-
radius: refRelativeSeries.radiusAxisHelper
|
|
93157
|
+
angle: convertDatumToValue(refRelativeSeries.angleAxisHelper, angleValue),
|
|
93158
|
+
radius: convertDatumToValue(refRelativeSeries.radiusAxisHelper, radiusValue)
|
|
93062
93159
|
});
|
|
93063
93160
|
});
|
|
93064
93161
|
return points;
|
|
@@ -96141,7 +96238,6 @@ class Brush extends BaseComponent {
|
|
|
96141
96238
|
this._linkedInBrushElementsMap = {};
|
|
96142
96239
|
this._linkedOutOfBrushElementsMap = {};
|
|
96143
96240
|
this._cacheInteractiveRangeAttrs = [];
|
|
96144
|
-
this._needDisablePickable = false;
|
|
96145
96241
|
this._releatedAxes = [];
|
|
96146
96242
|
this._regionAxisMap = {};
|
|
96147
96243
|
this._axisDataZoomMap = {};
|
|
@@ -96293,34 +96389,36 @@ class Brush extends BaseComponent {
|
|
|
96293
96389
|
this._emitEvent(ChartEvent.brushActive, region);
|
|
96294
96390
|
});
|
|
96295
96391
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
96392
|
+
this._setRegionMarkPickable(region, true);
|
|
96296
96393
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
96297
96394
|
});
|
|
96298
96395
|
brush.addEventListener(IOperateType.moveStart, (e) => {
|
|
96396
|
+
this._setRegionMarkPickable(region, true);
|
|
96299
96397
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
96300
96398
|
});
|
|
96301
96399
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
96302
|
-
this.
|
|
96400
|
+
this._setRegionMarkPickable(region, false);
|
|
96303
96401
|
this._handleBrushChange(region, e);
|
|
96304
96402
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
96305
96403
|
});
|
|
96306
96404
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
96405
|
+
this._setRegionMarkPickable(region, false);
|
|
96307
96406
|
this._handleBrushChange(region, e);
|
|
96308
96407
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
96309
96408
|
});
|
|
96310
96409
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
96410
|
+
this._setRegionMarkPickable(region, true);
|
|
96311
96411
|
this._initMarkBrushState(componentIndex, '');
|
|
96312
|
-
this._needDisablePickable = false;
|
|
96313
96412
|
this._emitEvent(ChartEvent.brushClear, region);
|
|
96314
96413
|
});
|
|
96315
96414
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
96316
96415
|
var _a;
|
|
96317
|
-
this.
|
|
96416
|
+
this._setRegionMarkPickable(region, true);
|
|
96318
96417
|
const { operateMask } = e.detail;
|
|
96319
96418
|
if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.onBrushEnd) {
|
|
96320
96419
|
if (this._spec.onBrushEnd(e) === true) {
|
|
96321
96420
|
this.clearGraphic();
|
|
96322
96421
|
this._initMarkBrushState(componentIndex, '');
|
|
96323
|
-
this._needDisablePickable = false;
|
|
96324
96422
|
this._emitEvent(ChartEvent.brushClear, region);
|
|
96325
96423
|
}
|
|
96326
96424
|
else {
|
|
@@ -96337,6 +96435,7 @@ class Brush extends BaseComponent {
|
|
|
96337
96435
|
}
|
|
96338
96436
|
});
|
|
96339
96437
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
96438
|
+
this._setRegionMarkPickable(region, true);
|
|
96340
96439
|
const { operateMask } = e.detail;
|
|
96341
96440
|
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
96342
96441
|
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
@@ -96462,7 +96561,6 @@ class Brush extends BaseComponent {
|
|
|
96462
96561
|
this._outOfBrushElementsMap[elementKey] = graphicItem;
|
|
96463
96562
|
delete this._inBrushElementsMap[operateMask.name][elementKey];
|
|
96464
96563
|
}
|
|
96465
|
-
graphicItem.setAttribute('pickable', !this._needDisablePickable);
|
|
96466
96564
|
});
|
|
96467
96565
|
});
|
|
96468
96566
|
}
|
|
@@ -96520,7 +96618,6 @@ class Brush extends BaseComponent {
|
|
|
96520
96618
|
graphicItem.addState(OUT_BRUSH_STATE, true);
|
|
96521
96619
|
this._linkedOutOfBrushElementsMap[elementKey] = graphicItem;
|
|
96522
96620
|
}
|
|
96523
|
-
graphicItem.setAttribute('pickable', !this._needDisablePickable);
|
|
96524
96621
|
});
|
|
96525
96622
|
});
|
|
96526
96623
|
}
|
|
@@ -96586,6 +96683,12 @@ class Brush extends BaseComponent {
|
|
|
96586
96683
|
this._initItemMap(this._itemMap, this._outOfBrushElementsMap, stateName);
|
|
96587
96684
|
this._initItemMap(this._linkedItemMap, this._linkedOutOfBrushElementsMap, stateName);
|
|
96588
96685
|
}
|
|
96686
|
+
_setRegionMarkPickable(region, pickable) {
|
|
96687
|
+
region
|
|
96688
|
+
.getGroupMark()
|
|
96689
|
+
.getGraphics()
|
|
96690
|
+
.forEach(g => g.setAttribute('childrenPickable', pickable));
|
|
96691
|
+
}
|
|
96589
96692
|
_stateClamp(state) {
|
|
96590
96693
|
return Math.min(Math.max(0, state), 1);
|
|
96591
96694
|
}
|
|
@@ -96665,7 +96768,6 @@ class Brush extends BaseComponent {
|
|
|
96665
96768
|
const container = this.getContainer();
|
|
96666
96769
|
this._brushComponents.forEach((brush, index) => {
|
|
96667
96770
|
this._initMarkBrushState(index, '');
|
|
96668
|
-
this._needDisablePickable = false;
|
|
96669
96771
|
brush.removeAllChild();
|
|
96670
96772
|
brush.releaseBrushEvents();
|
|
96671
96773
|
if (container) {
|
|
@@ -97891,12 +97993,18 @@ class DomTooltipHandler extends BaseTooltipHandler {
|
|
|
97891
97993
|
const rowStyle = this._domStyle.row;
|
|
97892
97994
|
const chilren = [...this._rootDom.children];
|
|
97893
97995
|
let titleDom = chilren.find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));
|
|
97996
|
+
let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
|
|
97894
97997
|
if (!titleDom && title.visible !== false) {
|
|
97895
97998
|
titleDom = document.createElement('h2');
|
|
97896
97999
|
const span = document.createElement('span');
|
|
97897
98000
|
titleDom.appendChild(span);
|
|
97898
98001
|
titleDom.classList.add(TOOLTIP_TITLE_CLASS_NAME);
|
|
97899
|
-
this._rootDom.
|
|
98002
|
+
if (this._rootDom.firstChild) {
|
|
98003
|
+
this._rootDom.insertBefore(titleDom, this._rootDom.firstChild);
|
|
98004
|
+
}
|
|
98005
|
+
else {
|
|
98006
|
+
this._rootDom.appendChild(titleDom);
|
|
98007
|
+
}
|
|
97900
98008
|
}
|
|
97901
98009
|
if (titleDom && title.visible !== false) {
|
|
97902
98010
|
setStyleToDom(titleDom, Object.assign(Object.assign(Object.assign({}, this._domStyle.title), (hasContent ? rowStyle : { marginBottom: '0px' })), { marginTop: '0px' }));
|
|
@@ -97905,7 +98013,6 @@ class DomTooltipHandler extends BaseTooltipHandler {
|
|
|
97905
98013
|
else if (titleDom && title.visible === false) {
|
|
97906
98014
|
titleDom.parentNode.removeChild(titleDom);
|
|
97907
98015
|
}
|
|
97908
|
-
let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
|
|
97909
98016
|
const columns = ['shape', 'key', 'value'];
|
|
97910
98017
|
if (!contentDom && hasContent) {
|
|
97911
98018
|
contentDom = document.createElement('div');
|