@visactor/vrender-components 0.15.3 → 0.16.0-alpha.1
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/cjs/brush/brush.d.ts +0 -5
- package/cjs/brush/brush.js +14 -18
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/brush/config.d.ts +0 -5
- package/cjs/brush/config.js +0 -5
- package/cjs/brush/config.js.map +1 -1
- package/cjs/brush/type.d.ts +1 -6
- package/cjs/brush/type.js.map +1 -1
- package/cjs/data-zoom/data-zoom.d.ts +0 -1
- package/cjs/data-zoom/data-zoom.js +3 -14
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.js +12 -24
- package/cjs/label/arc.js.map +1 -1
- package/cjs/poptip/contribution.js +2 -2
- package/cjs/poptip/contribution.js.map +1 -1
- package/cjs/poptip/poptip-plugin.js +3 -3
- package/cjs/poptip/poptip-plugin.js.map +1 -1
- package/cjs/poptip/register.d.ts +1 -1
- package/cjs/poptip/register.js +2 -2
- package/cjs/poptip/register.js.map +1 -1
- package/dist/index.js +40 -98
- package/dist/index.min.js +1 -1
- package/es/brush/brush.d.ts +0 -5
- package/es/brush/brush.js +14 -17
- package/es/brush/brush.js.map +1 -1
- package/es/brush/config.d.ts +0 -5
- package/es/brush/config.js +0 -5
- package/es/brush/config.js.map +1 -1
- package/es/brush/type.d.ts +1 -6
- package/es/brush/type.js.map +1 -1
- package/es/data-zoom/data-zoom.d.ts +0 -1
- package/es/data-zoom/data-zoom.js +4 -15
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/arc.js +8 -20
- package/es/label/arc.js.map +1 -1
- package/es/poptip/contribution.js +1 -1
- package/es/poptip/contribution.js.map +1 -1
- package/es/poptip/poptip-plugin.js +1 -3
- package/es/poptip/poptip-plugin.js.map +1 -1
- package/es/poptip/register.d.ts +1 -1
- package/es/poptip/register.js +1 -3
- package/es/poptip/register.js.map +1 -1
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -896,35 +896,6 @@
|
|
|
896
896
|
padding: 10
|
|
897
897
|
};
|
|
898
898
|
|
|
899
|
-
var PARAM_TYPES = "inversify:paramtypes";
|
|
900
|
-
var DESIGN_PARAM_TYPES = "design:paramtypes";
|
|
901
|
-
|
|
902
|
-
var idCounter = 0;
|
|
903
|
-
function id() {
|
|
904
|
-
return idCounter++;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
var DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
|
|
908
|
-
|
|
909
|
-
var ContainerModule = function () {
|
|
910
|
-
function ContainerModule(registry) {
|
|
911
|
-
this.id = id();
|
|
912
|
-
this.registry = registry;
|
|
913
|
-
}
|
|
914
|
-
return ContainerModule;
|
|
915
|
-
}();
|
|
916
|
-
|
|
917
|
-
function injectable() {
|
|
918
|
-
return function (target) {
|
|
919
|
-
if (Reflect.hasOwnMetadata(PARAM_TYPES, target)) {
|
|
920
|
-
throw new Error(DUPLICATED_INJECTABLE_DECORATOR);
|
|
921
|
-
}
|
|
922
|
-
var types = Reflect.getMetadata(DESIGN_PARAM_TYPES, target) || [];
|
|
923
|
-
Reflect.defineMetadata(PARAM_TYPES, types, target);
|
|
924
|
-
return target;
|
|
925
|
-
};
|
|
926
|
-
}
|
|
927
|
-
|
|
928
899
|
const DEFAULT_THEME = {
|
|
929
900
|
visible: true,
|
|
930
901
|
position: 'auto',
|
|
@@ -995,7 +966,7 @@
|
|
|
995
966
|
}
|
|
996
967
|
};
|
|
997
968
|
PopTipRenderContribution = __decorate([
|
|
998
|
-
injectable()
|
|
969
|
+
vrender.injectable()
|
|
999
970
|
], PopTipRenderContribution);
|
|
1000
971
|
|
|
1001
972
|
let PopTipPlugin = class PopTipPlugin {
|
|
@@ -1048,7 +1019,7 @@
|
|
|
1048
1019
|
}
|
|
1049
1020
|
};
|
|
1050
1021
|
PopTipPlugin = __decorate([
|
|
1051
|
-
injectable()
|
|
1022
|
+
vrender.injectable()
|
|
1052
1023
|
], PopTipPlugin);
|
|
1053
1024
|
let PopTipForClipedTextPlugin = class PopTipForClipedTextPlugin {
|
|
1054
1025
|
constructor() {
|
|
@@ -1100,10 +1071,10 @@
|
|
|
1100
1071
|
}
|
|
1101
1072
|
};
|
|
1102
1073
|
PopTipForClipedTextPlugin = __decorate([
|
|
1103
|
-
injectable()
|
|
1074
|
+
vrender.injectable()
|
|
1104
1075
|
], PopTipForClipedTextPlugin);
|
|
1105
1076
|
|
|
1106
|
-
const popTipModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
1077
|
+
const popTipModule = new vrender.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
1107
1078
|
if (!isBound(PopTipRenderContribution)) {
|
|
1108
1079
|
bind(PopTipRenderContribution).toSelf().inSingletonScope();
|
|
1109
1080
|
bind(vrender.InteractiveSubRenderContribution).toService(PopTipRenderContribution);
|
|
@@ -2473,7 +2444,7 @@
|
|
|
2473
2444
|
const arcs = this.layoutArcLabels(this.attribute.position, this.attribute, Array.from(this._idToGraphic.values()), data, textBoundsArray, ellipsisWidth);
|
|
2474
2445
|
for (let i = 0; i < data.length; i++) {
|
|
2475
2446
|
const textData = data[i];
|
|
2476
|
-
const basedArc = arcs.find(arc =>
|
|
2447
|
+
const basedArc = arcs.find(arc => arc.refDatum.id === textData.id);
|
|
2477
2448
|
const labelAttribute = {
|
|
2478
2449
|
visible: basedArc.labelVisible,
|
|
2479
2450
|
x: basedArc.labelPosition.x,
|
|
@@ -2503,26 +2474,24 @@
|
|
|
2503
2474
|
var _a, _b;
|
|
2504
2475
|
const graphicAttribute = currentMark.attribute;
|
|
2505
2476
|
const center = { x: (_a = graphicAttribute === null || graphicAttribute === void 0 ? void 0 : graphicAttribute.x) !== null && _a !== void 0 ? _a : 0, y: (_b = graphicAttribute === null || graphicAttribute === void 0 ? void 0 : graphicAttribute.y) !== null && _b !== void 0 ? _b : 0 };
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
this._arcLeft.set(arc.refDatum, arc);
|
|
2525
|
-
}
|
|
2477
|
+
const item = data[index];
|
|
2478
|
+
const textBounds = textBoundsArray[index];
|
|
2479
|
+
const arcMiddleAngle = (graphicAttribute.startAngle + graphicAttribute.endAngle) / 2;
|
|
2480
|
+
const intervalAngle = graphicAttribute.endAngle - graphicAttribute.startAngle;
|
|
2481
|
+
const arcQuadrant = computeQuadrant(graphicAttribute.endAngle - intervalAngle / 2);
|
|
2482
|
+
const arcMiddle = circlePoint(center.x, center.y, graphicAttribute.outerRadius, arcMiddleAngle);
|
|
2483
|
+
const outerArcMiddle = circlePoint(center.x, center.y, maxRadius + attribute.line.line1MinLength, arcMiddleAngle);
|
|
2484
|
+
const arc = new ArcInfo(item, arcMiddle, outerArcMiddle, arcQuadrant, intervalAngle, arcMiddleAngle, graphicAttribute.innerRadius, graphicAttribute.outerRadius, center);
|
|
2485
|
+
arc.pointA = circlePoint(center.x, center.y, this.computeDatumRadius(center.x * 2, center.y * 2, graphicAttribute.outerRadius), arc.middleAngle);
|
|
2486
|
+
arc.labelSize = {
|
|
2487
|
+
width: textBounds.x2 - textBounds.x1,
|
|
2488
|
+
height: textBounds.y2 - textBounds.y1
|
|
2489
|
+
};
|
|
2490
|
+
if (isQuadrantRight(arc.quadrant)) {
|
|
2491
|
+
this._arcRight.set(arc.refDatum, arc);
|
|
2492
|
+
}
|
|
2493
|
+
else if (isQuadrantLeft(arc.quadrant)) {
|
|
2494
|
+
this._arcLeft.set(arc.refDatum, arc);
|
|
2526
2495
|
}
|
|
2527
2496
|
});
|
|
2528
2497
|
const leftArcs = Array.from(this._arcLeft.values());
|
|
@@ -2729,8 +2698,7 @@
|
|
|
2729
2698
|
return vutils.isNil(textAlign) || textAlign === 'auto' ? 'center' : textAlign;
|
|
2730
2699
|
}
|
|
2731
2700
|
_getFormatLabelText(value, limit) {
|
|
2732
|
-
|
|
2733
|
-
return (_a = value === null || value === void 0 ? void 0 : value.text) !== null && _a !== void 0 ? _a : '';
|
|
2701
|
+
return value.text;
|
|
2734
2702
|
}
|
|
2735
2703
|
_adjustY(arcs, maxLabels, attribute, currentMarks) {
|
|
2736
2704
|
var _a, _b, _c, _d;
|
|
@@ -5526,7 +5494,6 @@
|
|
|
5526
5494
|
end: this.state.end
|
|
5527
5495
|
});
|
|
5528
5496
|
this._updateStateCallback && this._updateStateCallback(this.state.start, this.state.end);
|
|
5529
|
-
this._dispatchChangeEvent(this.state.start, this.state.end);
|
|
5530
5497
|
}
|
|
5531
5498
|
};
|
|
5532
5499
|
const { start, end, size, orient, showDetail, position, previewData, previewCallbackX, previewCallbackY, previewCallbackX1, previewCallbackY1, updateStateCallback } = this.attribute;
|
|
@@ -5626,7 +5593,6 @@
|
|
|
5626
5593
|
end: this.state.end
|
|
5627
5594
|
});
|
|
5628
5595
|
this._updateStateCallback && this._updateStateCallback(this.state.start, this.state.end);
|
|
5629
|
-
this._dispatchChangeEvent(this.state.start, this.state.end);
|
|
5630
5596
|
}
|
|
5631
5597
|
}
|
|
5632
5598
|
_onHandlerPointerEnter(e) {
|
|
@@ -5986,15 +5952,6 @@
|
|
|
5986
5952
|
container.add(labelShape);
|
|
5987
5953
|
return labelShape;
|
|
5988
5954
|
}
|
|
5989
|
-
_dispatchChangeEvent(start, end) {
|
|
5990
|
-
var _a;
|
|
5991
|
-
const changeEvent = new vrender.CustomEvent('change', {
|
|
5992
|
-
start,
|
|
5993
|
-
end
|
|
5994
|
-
});
|
|
5995
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
5996
|
-
this.dispatchEvent(changeEvent);
|
|
5997
|
-
}
|
|
5998
5955
|
setStartAndEnd(start, end) {
|
|
5999
5956
|
const { start: startAttr, end: endAttr } = this.attribute;
|
|
6000
5957
|
if (vutils.isValid(start) && vutils.isValid(end) && (start !== this.state.start || end !== this.state.end)) {
|
|
@@ -6003,7 +5960,6 @@
|
|
|
6003
5960
|
if (startAttr !== this.state.start || endAttr !== this.state.end) {
|
|
6004
5961
|
this.setAttributes({ start, end });
|
|
6005
5962
|
this._updateStateCallback && this._updateStateCallback(start, end);
|
|
6006
|
-
this._dispatchChangeEvent(start, end);
|
|
6007
5963
|
}
|
|
6008
5964
|
}
|
|
6009
5965
|
}
|
|
@@ -9796,11 +9752,6 @@
|
|
|
9796
9752
|
})(exports.IOperateType || (exports.IOperateType = {}));
|
|
9797
9753
|
|
|
9798
9754
|
const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
9799
|
-
trigger: 'pointerdown',
|
|
9800
|
-
updateTrigger: 'pointermove',
|
|
9801
|
-
endTrigger: 'pointerup',
|
|
9802
|
-
resetTrigger: 'pointerupoutside',
|
|
9803
|
-
hasMask: true,
|
|
9804
9755
|
brushMode: 'single',
|
|
9805
9756
|
brushType: 'rect',
|
|
9806
9757
|
brushStyle: {
|
|
@@ -9862,7 +9813,6 @@
|
|
|
9862
9813
|
const { removeOnClick = true } = this.attribute;
|
|
9863
9814
|
if (this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick) {
|
|
9864
9815
|
this._container.incrementalClearChild();
|
|
9865
|
-
this._brushMaskAABBBoundsDict = {};
|
|
9866
9816
|
this._updateDragMaskCallback &&
|
|
9867
9817
|
this._updateDragMaskCallback({
|
|
9868
9818
|
operateType: exports.IOperateType.brushClear,
|
|
@@ -9885,11 +9835,11 @@
|
|
|
9885
9835
|
};
|
|
9886
9836
|
}
|
|
9887
9837
|
bindBrushEvents() {
|
|
9888
|
-
const { delayType = 'throttle', delayTime = 0
|
|
9889
|
-
this.stage.addEventListener(
|
|
9890
|
-
this.stage.addEventListener(
|
|
9891
|
-
this.stage.addEventListener(
|
|
9892
|
-
this.stage.addEventListener(
|
|
9838
|
+
const { delayType = 'throttle', delayTime = 0 } = this.attribute;
|
|
9839
|
+
this.stage.addEventListener('pointerdown', this._onBrushStart);
|
|
9840
|
+
this.stage.addEventListener('pointermove', delayMap[delayType](this._onBrushing, delayTime));
|
|
9841
|
+
this.stage.addEventListener('pointerup', this._onBrushEnd);
|
|
9842
|
+
this.stage.addEventListener('pointerupoutside', this._onBrushEnd);
|
|
9893
9843
|
}
|
|
9894
9844
|
_isPosInBrushMask(e) {
|
|
9895
9845
|
const pos = this.eventPosToStagePos(e);
|
|
@@ -9915,7 +9865,6 @@
|
|
|
9915
9865
|
this._cacheDrawPoints = [pos];
|
|
9916
9866
|
this._isDrawedBeforeEnd = false;
|
|
9917
9867
|
if (brushMode === 'single') {
|
|
9918
|
-
this._brushMaskAABBBoundsDict = {};
|
|
9919
9868
|
this._container.incrementalClearChild();
|
|
9920
9869
|
}
|
|
9921
9870
|
this._addBrushMask();
|
|
@@ -9952,21 +9901,15 @@
|
|
|
9952
9901
|
var _a;
|
|
9953
9902
|
const pos = this.eventPosToStagePos(e);
|
|
9954
9903
|
const { x1 = 0, x2 = 0, y1 = 0, y2 = 0 } = (_a = this._operatingMask) === null || _a === void 0 ? void 0 : _a._AABBBounds;
|
|
9955
|
-
const { sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
9956
|
-
const cacheLength = this._cacheDrawPoints.length;
|
|
9904
|
+
const { sizeThreshold = DEFAULT_SIZE_THRESHOLD } = this.attribute;
|
|
9957
9905
|
this._isDrawedBeforeEnd = !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold);
|
|
9958
|
-
if (
|
|
9906
|
+
if (this._cacheDrawPoints.length > 0) {
|
|
9959
9907
|
const lastPos = this._cacheDrawPoints[this._cacheDrawPoints.length - 1];
|
|
9960
9908
|
if (pos.x === (lastPos === null || lastPos === void 0 ? void 0 : lastPos.x) && pos.y === (lastPos === null || lastPos === void 0 ? void 0 : lastPos.y)) {
|
|
9961
9909
|
return;
|
|
9962
9910
|
}
|
|
9963
9911
|
}
|
|
9964
|
-
|
|
9965
|
-
this._cacheDrawPoints.push(pos);
|
|
9966
|
-
}
|
|
9967
|
-
else {
|
|
9968
|
-
this._cacheDrawPoints[cacheLength - 1] = pos;
|
|
9969
|
-
}
|
|
9912
|
+
this._cacheDrawPoints.push(pos);
|
|
9970
9913
|
const maskPoints = this._computeMaskPoints();
|
|
9971
9914
|
this._operatingMask.setAttribute('points', maskPoints);
|
|
9972
9915
|
this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
|
|
@@ -10066,9 +10009,8 @@
|
|
|
10066
10009
|
return maskPoints;
|
|
10067
10010
|
}
|
|
10068
10011
|
_addBrushMask() {
|
|
10069
|
-
|
|
10070
|
-
const {
|
|
10071
|
-
const brushMask = vrender.createPolygon(Object.assign(Object.assign({ points: vutils.cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle), { opacity: hasMask ? (_a = brushStyle.opacity) !== null && _a !== void 0 ? _a : 1 : 0 }));
|
|
10012
|
+
const { brushStyle } = this.attribute;
|
|
10013
|
+
const brushMask = vrender.createPolygon(Object.assign({ points: vutils.cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle));
|
|
10072
10014
|
brushMask.name = `brush-${Date.now()}`;
|
|
10073
10015
|
this._operatingMask = brushMask;
|
|
10074
10016
|
this._container.add(brushMask);
|
|
@@ -10100,11 +10042,11 @@
|
|
|
10100
10042
|
vutils.isFunction(callback) && (this._updateDragMaskCallback = callback);
|
|
10101
10043
|
}
|
|
10102
10044
|
releaseBrushEvents() {
|
|
10103
|
-
const { delayType = 'throttle', delayTime = 0
|
|
10104
|
-
this.stage.removeEventListener(
|
|
10105
|
-
this.stage.removeEventListener(
|
|
10106
|
-
this.stage.removeEventListener(
|
|
10107
|
-
this.stage.removeEventListener(
|
|
10045
|
+
const { delayType = 'throttle', delayTime = 0 } = this.attribute;
|
|
10046
|
+
this.stage.removeEventListener('pointerdown', this._onBrushStart);
|
|
10047
|
+
this.stage.removeEventListener('pointermove', delayMap[delayType](this._onBrushing, delayTime));
|
|
10048
|
+
this.stage.removeEventListener('pointerup', this._onBrushEnd);
|
|
10049
|
+
this.stage.removeEventListener('pointerupoutside', this._onBrushEnd);
|
|
10108
10050
|
}
|
|
10109
10051
|
}
|
|
10110
10052
|
Brush.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
@@ -10495,7 +10437,7 @@
|
|
|
10495
10437
|
return new Tag(params ? params.attribute : {});
|
|
10496
10438
|
}
|
|
10497
10439
|
|
|
10498
|
-
const version = "0.
|
|
10440
|
+
const version = "0.16.0-alpha.1";
|
|
10499
10441
|
|
|
10500
10442
|
exports.AbstractComponent = AbstractComponent;
|
|
10501
10443
|
exports.ArcInfo = ArcInfo;
|