@visactor/react-vchart 2.0.23-alpha.6 → 2.0.23-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +44 -49
- package/build/index.min.js +3 -3
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -57833,7 +57833,7 @@
|
|
|
57833
57833
|
this._interaction = new Interaction();
|
|
57834
57834
|
const series = this.getAllSeries(),
|
|
57835
57835
|
mergedTriggers = [],
|
|
57836
|
-
|
|
57836
|
+
mergedTriggersMarks = {};
|
|
57837
57837
|
series.forEach(s => {
|
|
57838
57838
|
const triggers = s.getInteractionTriggers();
|
|
57839
57839
|
if (triggers && triggers.length) {
|
|
@@ -57842,17 +57842,12 @@
|
|
|
57842
57842
|
trigger: trigger,
|
|
57843
57843
|
marks: marks
|
|
57844
57844
|
}) => {
|
|
57845
|
-
const
|
|
57846
|
-
|
|
57847
|
-
|
|
57848
|
-
|
|
57849
|
-
|
|
57850
|
-
|
|
57851
|
-
regionId: regionId,
|
|
57852
|
-
config: Object.assign({}, trigger),
|
|
57853
|
-
trigger: mergedTrigger
|
|
57854
|
-
}), mergedTriggers.push(mergedTrigger);
|
|
57855
|
-
}
|
|
57845
|
+
const interactionId = `${regionId}-${trigger.type}`;
|
|
57846
|
+
mergedTriggersMarks[interactionId] ? marks.forEach(m => {
|
|
57847
|
+
mergedTriggersMarks[interactionId].marks.push(m);
|
|
57848
|
+
}) : (mergedTriggersMarks[interactionId] = Object.assign(Object.assign({}, trigger), {
|
|
57849
|
+
marks: marks
|
|
57850
|
+
}), mergedTriggers.push(mergedTriggersMarks[interactionId]));
|
|
57856
57851
|
});
|
|
57857
57852
|
}
|
|
57858
57853
|
}), mergedTriggers.forEach(trigger => {
|
|
@@ -60327,7 +60322,7 @@
|
|
|
60327
60322
|
fieldsY = this._fieldY,
|
|
60328
60323
|
fieldsX = this._fieldX;
|
|
60329
60324
|
this._data.setTransform([{
|
|
60330
|
-
type: "
|
|
60325
|
+
type: "dataSampling",
|
|
60331
60326
|
size: "horizontal" === this._direction ? height : width,
|
|
60332
60327
|
factor: this._spec.samplingFactor,
|
|
60333
60328
|
yfield: "horizontal" === this._direction ? fieldsX[0] : fieldsY[0],
|
|
@@ -60572,7 +60567,7 @@
|
|
|
60572
60567
|
visible: !0
|
|
60573
60568
|
}, "normal", AttributeLevel.Series) : this.setMarkStyle(this._symbolMark, {
|
|
60574
60569
|
visible: this._getInvalidDefined.bind(this)
|
|
60575
|
-
}, "normal", AttributeLevel.Series), this._symbolMark.getProduct() && this._symbolMark.compileEncode();
|
|
60570
|
+
}, "normal", AttributeLevel.Series), this._symbolMark.getProduct() && this._symbolMark.compileEncode(), this._isGeoCoordinateSeries() && (this._updateSymbolGraphicPosition(), this._refreshLabelComponent(!0, !0));
|
|
60576
60571
|
}
|
|
60577
60572
|
initLabelMarkStyle(labelMark) {
|
|
60578
60573
|
labelMark && (this._labelMark = labelMark, this.setMarkStyle(labelMark, {
|
|
@@ -60603,6 +60598,22 @@
|
|
|
60603
60598
|
postMatrix: new Matrix()
|
|
60604
60599
|
}), labelGraphic;
|
|
60605
60600
|
}
|
|
60601
|
+
_isGeoCoordinateSeries() {
|
|
60602
|
+
var _a, _b;
|
|
60603
|
+
return (null === (_b = null === (_a = this.getXAxisHelper()) || void 0 === _a ? void 0 : _a.getAxisType) || void 0 === _b ? void 0 : _b.call(_a)) === ComponentTypeEnum.geoCoordinate;
|
|
60604
|
+
}
|
|
60605
|
+
_refreshLabelComponent(resetPostMatrix = !1, disableAnimation = !1) {
|
|
60606
|
+
var _a, _b;
|
|
60607
|
+
const vgrammarLabel = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent(),
|
|
60608
|
+
labelGraphic = null === (_b = null == vgrammarLabel ? void 0 : vgrammarLabel.getComponent) || void 0 === _b ? void 0 : _b.call(vgrammarLabel);
|
|
60609
|
+
resetPostMatrix && (null == labelGraphic ? void 0 : labelGraphic.attribute.postMatrix) && labelGraphic.setAttributes({
|
|
60610
|
+
postMatrix: new Matrix()
|
|
60611
|
+
}), disableAnimation && (null == labelGraphic ? void 0 : labelGraphic.disableAnimation) && (labelGraphic.disableAnimation(), this._enableLabelAnimationHook || (this._enableLabelAnimationHook = () => {
|
|
60612
|
+
var _a, _b, _c, _d;
|
|
60613
|
+
const currentLabelGraphic = null === (_c = null === (_b = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent()) || void 0 === _b ? void 0 : _b.getComponent) || void 0 === _c ? void 0 : _c.call(_b);
|
|
60614
|
+
null === (_d = null == currentLabelGraphic ? void 0 : currentLabelGraphic.enableAnimation) || void 0 === _d || _d.call(currentLabelGraphic), this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook), this._enableLabelAnimationHook = void 0;
|
|
60615
|
+
}, this.event.on(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook))), (null == vgrammarLabel ? void 0 : vgrammarLabel.getProduct()) && vgrammarLabel.renderInner();
|
|
60616
|
+
}
|
|
60606
60617
|
handleZoom(e) {
|
|
60607
60618
|
const {
|
|
60608
60619
|
scale: scale,
|
|
@@ -60623,14 +60634,12 @@
|
|
|
60623
60634
|
labelGraphic && labelGraphic.translate(delta[0], delta[1]);
|
|
60624
60635
|
}
|
|
60625
60636
|
onLayoutEnd() {
|
|
60626
|
-
var _a, _b
|
|
60637
|
+
var _a, _b;
|
|
60627
60638
|
super.onLayoutEnd(), this._updateSymbolGraphicPosition();
|
|
60628
60639
|
const labelGraphic = null === (_b = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent()) || void 0 === _b ? void 0 : _b.getComponent();
|
|
60629
60640
|
(null == labelGraphic ? void 0 : labelGraphic.attribute.postMatrix) && labelGraphic.setAttributes({
|
|
60630
60641
|
postMatrix: new Matrix()
|
|
60631
|
-
});
|
|
60632
|
-
const vgrammarLabel = null === (_c = this._labelMark) || void 0 === _c ? void 0 : _c.getComponent();
|
|
60633
|
-
vgrammarLabel && vgrammarLabel.renderInner();
|
|
60642
|
+
}), this._refreshLabelComponent();
|
|
60634
60643
|
}
|
|
60635
60644
|
getDefaultShapeType() {
|
|
60636
60645
|
return "circle";
|
|
@@ -76147,12 +76156,11 @@
|
|
|
76147
76156
|
|
|
76148
76157
|
class RadarChartSpecTransformer extends RoseLikeChartSpecTransformer {
|
|
76149
76158
|
_getDefaultSeriesSpec(spec) {
|
|
76150
|
-
var _a
|
|
76151
|
-
const series = super._getDefaultSeriesSpec(spec)
|
|
76152
|
-
areaTheme = null === (_b = (_a = this._option).getTheme) || void 0 === _b ? void 0 : _b.call(_a, "series", "radar", "area");
|
|
76159
|
+
var _a;
|
|
76160
|
+
const series = super._getDefaultSeriesSpec(spec);
|
|
76153
76161
|
return series.line = spec.line, series.point = spec.point, series.stack = spec.stack, series.percent = spec.percent, series.area = mergeSpec({
|
|
76154
|
-
visible:
|
|
76155
|
-
}, spec.area), series.seriesMark = null !== (
|
|
76162
|
+
visible: !1
|
|
76163
|
+
}, spec.area), series.seriesMark = null !== (_a = spec.seriesMark) && void 0 !== _a ? _a : "area", series.activePoint = spec.activePoint, series.pointDis = spec.pointDis, series.pointDisMul = spec.pointDisMul, series.markOverlap = spec.markOverlap, series;
|
|
76156
76164
|
}
|
|
76157
76165
|
transformSpec(spec) {
|
|
76158
76166
|
var _a;
|
|
@@ -82123,7 +82131,7 @@
|
|
|
82123
82131
|
};
|
|
82124
82132
|
}
|
|
82125
82133
|
_markerLayout() {
|
|
82126
|
-
var _a, _b, _c, _d, _e
|
|
82134
|
+
var _a, _b, _c, _d, _e;
|
|
82127
82135
|
const updateAttrs = this._getUpdateMarkerAttrs();
|
|
82128
82136
|
if ("type-step" === this._spec.type) {
|
|
82129
82137
|
const startRelativeSeries = this._startRelativeSeries,
|
|
@@ -82133,26 +82141,9 @@
|
|
|
82133
82141
|
mainSegmentIndex: mainSegmentIndex
|
|
82134
82142
|
} = this._spec.line || {},
|
|
82135
82143
|
{
|
|
82136
|
-
connectDirection: connectDirection
|
|
82144
|
+
connectDirection: connectDirection,
|
|
82145
|
+
expandDistance = 0
|
|
82137
82146
|
} = this._spec;
|
|
82138
|
-
let {
|
|
82139
|
-
expandDistance = 0
|
|
82140
|
-
} = this._spec;
|
|
82141
|
-
const {
|
|
82142
|
-
points: points,
|
|
82143
|
-
limitRect: limitRect
|
|
82144
|
-
} = updateAttrs,
|
|
82145
|
-
coordinatePoints = array(points).filter(Boolean);
|
|
82146
|
-
if (isFunction$1(expandDistance)) {
|
|
82147
|
-
const startRegion = null === (_a = null == startRelativeSeries ? void 0 : startRelativeSeries.getRegion) || void 0 === _a ? void 0 : _a.call(startRelativeSeries),
|
|
82148
|
-
endRegion = null === (_b = null == endRelativeSeries ? void 0 : endRelativeSeries.getRegion) || void 0 === _b ? void 0 : _b.call(endRelativeSeries);
|
|
82149
|
-
expandDistance = expandDistance(this._markerData, Object.assign(Object.assign({}, this.getMarkAttributeContext()), {
|
|
82150
|
-
region: null === (_d = null === (_c = this._relativeSeries) || void 0 === _c ? void 0 : _c.getRegion) || void 0 === _d ? void 0 : _d.call(_c),
|
|
82151
|
-
startRegion: startRegion,
|
|
82152
|
-
endRegion: endRegion,
|
|
82153
|
-
coordinatePoints: coordinatePoints
|
|
82154
|
-
}));
|
|
82155
|
-
}
|
|
82156
82147
|
let expandDistanceValue;
|
|
82157
82148
|
if (isPercent(expandDistance)) {
|
|
82158
82149
|
const regionStart = startRelativeSeries.getRegion(),
|
|
@@ -82167,7 +82158,11 @@
|
|
|
82167
82158
|
expandDistanceValue = Number(expandDistance.substring(0, expandDistance.length - 1)) * regionWidth / 100;
|
|
82168
82159
|
}
|
|
82169
82160
|
} else expandDistanceValue = expandDistance;
|
|
82170
|
-
|
|
82161
|
+
const {
|
|
82162
|
+
points: points,
|
|
82163
|
+
limitRect: limitRect
|
|
82164
|
+
} = updateAttrs;
|
|
82165
|
+
if (!points || points.length < 2) return void (null === (_a = this._markerComponent) || void 0 === _a || _a.setAttributes(updateAttrs));
|
|
82171
82166
|
const joinPoints = getInsertPoints(points[0], points[1], connectDirection, expandDistanceValue);
|
|
82172
82167
|
let labelPositionAttrs;
|
|
82173
82168
|
labelPositionAttrs = multiSegment && isValid$1(mainSegmentIndex) ? {
|
|
@@ -82177,11 +82172,11 @@
|
|
|
82177
82172
|
position: "start",
|
|
82178
82173
|
autoRotate: !1
|
|
82179
82174
|
}, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
|
|
82180
|
-
const markerComponentAttr = null !== (
|
|
82175
|
+
const markerComponentAttr = null !== (_c = null === (_b = this._markerComponent) || void 0 === _b ? void 0 : _b.attribute) && void 0 !== _c ? _c : {},
|
|
82181
82176
|
prevLabelAttrs = array(markerComponentAttr.label),
|
|
82182
82177
|
updateLabels = array(updateAttrs.label),
|
|
82183
82178
|
labelsInSpec = array(this._spec.label);
|
|
82184
|
-
null === (
|
|
82179
|
+
null === (_d = this._markerComponent) || void 0 === _d || _d.setAttributes({
|
|
82185
82180
|
points: multiSegment ? [[joinPoints[0], joinPoints[1]], [joinPoints[1], joinPoints[2]], [joinPoints[2], joinPoints[3]]] : joinPoints,
|
|
82186
82181
|
label: updateLabels.map((labelItem, index) => {
|
|
82187
82182
|
var _a, _b, _c, _d;
|
|
@@ -82207,7 +82202,7 @@
|
|
|
82207
82202
|
dx: this._layoutOffsetX,
|
|
82208
82203
|
dy: this._layoutOffsetY
|
|
82209
82204
|
});
|
|
82210
|
-
} else null === (
|
|
82205
|
+
} else null === (_e = this._markerComponent) || void 0 === _e || _e.setAttributes(updateAttrs);
|
|
82211
82206
|
}
|
|
82212
82207
|
_computeOptions() {
|
|
82213
82208
|
let options,
|
|
@@ -85843,7 +85838,7 @@
|
|
|
85843
85838
|
} = this.options,
|
|
85844
85839
|
statedGraphics = interaction.getStatedGraphics(this),
|
|
85845
85840
|
g = null != graphic ? graphic : null == statedGraphics ? void 0 : statedGraphics[0];
|
|
85846
|
-
g &&
|
|
85841
|
+
g && statedGraphics.includes(g) && (g.removeState(state), interaction.setStatedGraphics(this, statedGraphics.filter(sg => sg !== g)));
|
|
85847
85842
|
}
|
|
85848
85843
|
}
|
|
85849
85844
|
ElementActive.type = "element-active", ElementActive.defaultOptions = defaultOptions$3;
|
|
@@ -89286,7 +89281,7 @@
|
|
|
89286
89281
|
|
|
89287
89282
|
const VChartSimple = createChart('VChartSimple');
|
|
89288
89283
|
|
|
89289
|
-
const version = "2.0.
|
|
89284
|
+
const version = "2.0.23-alpha.5";
|
|
89290
89285
|
|
|
89291
89286
|
exports.Area = Area;
|
|
89292
89287
|
exports.AreaChart = AreaChart;
|