@visactor/vrender-components 0.17.11-alpha.1 → 0.17.11-alpha.2
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/axis/util.js +1 -2
- package/cjs/brush/type.js +2 -1
- package/cjs/data-zoom/data-zoom.d.ts +5 -1
- package/cjs/data-zoom/data-zoom.js +141 -89
- 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/marker/base.d.ts +1 -0
- package/cjs/marker/base.js +6 -3
- package/cjs/marker/base.js.map +1 -1
- package/dist/index.js +163 -92
- package/dist/index.min.js +1 -1
- package/es/axis/util.js +1 -2
- package/es/brush/type.js +2 -1
- package/es/data-zoom/data-zoom.d.ts +5 -1
- package/es/data-zoom/data-zoom.js +127 -70
- 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/marker/base.d.ts +1 -0
- package/es/marker/base.js +6 -3
- package/es/marker/base.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -8267,12 +8267,10 @@
|
|
|
8267
8267
|
get: function get() {
|
|
8268
8268
|
var textTheme = getTheme(this).text,
|
|
8269
8269
|
attribute = this.attribute;
|
|
8270
|
-
if (this.
|
|
8270
|
+
if (!this.isSimplify()) return;
|
|
8271
8271
|
var _attribute$maxLineWid2 = attribute.maxLineWidth,
|
|
8272
8272
|
maxLineWidth = _attribute$maxLineWid2 === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid2;
|
|
8273
|
-
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(),
|
|
8274
|
-
return item.text;
|
|
8275
|
-
}).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
8273
|
+
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
8276
8274
|
}
|
|
8277
8275
|
}, {
|
|
8278
8276
|
key: "multilineLayout",
|
|
@@ -24289,6 +24287,23 @@
|
|
|
24289
24287
|
};
|
|
24290
24288
|
loadDataZoomComponent();
|
|
24291
24289
|
class DataZoom extends AbstractComponent {
|
|
24290
|
+
setPropsFromAttrs() {
|
|
24291
|
+
const { start, end, orient, previewData, previewPointsX, previewPointsY, previewPointsX1, previewPointsY1 } = this
|
|
24292
|
+
.attribute;
|
|
24293
|
+
start && (this.state.start = start);
|
|
24294
|
+
end && (this.state.end = end);
|
|
24295
|
+
const { width, height } = this.getLayoutAttrFromConfig();
|
|
24296
|
+
this._spanCache = this.state.end - this.state.start;
|
|
24297
|
+
this._isHorizontal = orient === 'top' || orient === 'bottom';
|
|
24298
|
+
this._layoutCache.max = this._isHorizontal ? width : height;
|
|
24299
|
+
this._layoutCache.attPos = this._isHorizontal ? 'x' : 'y';
|
|
24300
|
+
this._layoutCache.attSize = this._isHorizontal ? 'width' : 'height';
|
|
24301
|
+
previewData && (this._previewData = previewData);
|
|
24302
|
+
vutils.isFunction(previewPointsX) && (this._previewPointsX = previewPointsX);
|
|
24303
|
+
vutils.isFunction(previewPointsY) && (this._previewPointsY = previewPointsY);
|
|
24304
|
+
vutils.isFunction(previewPointsX1) && (this._previewPointsX1 = previewPointsX1);
|
|
24305
|
+
vutils.isFunction(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
|
|
24306
|
+
}
|
|
24292
24307
|
constructor(attributes, options) {
|
|
24293
24308
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : vutils.merge({}, DataZoom.defaultAttributes, attributes));
|
|
24294
24309
|
this.name = 'dataZoom';
|
|
@@ -24384,15 +24399,7 @@
|
|
|
24384
24399
|
});
|
|
24385
24400
|
}
|
|
24386
24401
|
}, this.attribute.delayTime);
|
|
24387
|
-
const {
|
|
24388
|
-
const { width, height } = size;
|
|
24389
|
-
start && (this.state.start = start);
|
|
24390
|
-
end && (this.state.end = end);
|
|
24391
|
-
this._spanCache = this.state.end - this.state.start;
|
|
24392
|
-
this._isHorizontal = orient === 'top' || orient === 'bottom';
|
|
24393
|
-
this._layoutCache.max = this._isHorizontal ? width : height;
|
|
24394
|
-
this._layoutCache.attPos = this._isHorizontal ? 'x' : 'y';
|
|
24395
|
-
this._layoutCache.attSize = this._isHorizontal ? 'width' : 'height';
|
|
24402
|
+
const { position, showDetail } = attributes;
|
|
24396
24403
|
this._activeCache.startPos = position;
|
|
24397
24404
|
this._activeCache.lastPos = position;
|
|
24398
24405
|
if (showDetail === 'auto') {
|
|
@@ -24401,11 +24408,11 @@
|
|
|
24401
24408
|
else {
|
|
24402
24409
|
this._showText = showDetail;
|
|
24403
24410
|
}
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24411
|
+
this.setPropsFromAttrs();
|
|
24412
|
+
}
|
|
24413
|
+
setAttributes(params, forceUpdateTag) {
|
|
24414
|
+
super.setAttributes(params, forceUpdateTag);
|
|
24415
|
+
this.setPropsFromAttrs();
|
|
24409
24416
|
}
|
|
24410
24417
|
bindEvents() {
|
|
24411
24418
|
if (this.attribute.disableTriggerEvent) {
|
|
@@ -24553,66 +24560,126 @@
|
|
|
24553
24560
|
0 }, dragMaskStyle), 'rect');
|
|
24554
24561
|
}
|
|
24555
24562
|
}
|
|
24563
|
+
isTextOverflow(componentBoundsLike, textPosition, textMeasure, textValue, layout) {
|
|
24564
|
+
const { width: textWidth, height: textHeight } = textMeasure.fullMeasure(textValue);
|
|
24565
|
+
if (this._isHorizontal) {
|
|
24566
|
+
if (layout === 'start') {
|
|
24567
|
+
const x1 = textPosition.x - textWidth;
|
|
24568
|
+
if (x1 < componentBoundsLike.x1) {
|
|
24569
|
+
return true;
|
|
24570
|
+
}
|
|
24571
|
+
}
|
|
24572
|
+
else {
|
|
24573
|
+
const x2 = textPosition.x + textWidth;
|
|
24574
|
+
if (x2 > componentBoundsLike.x2) {
|
|
24575
|
+
return true;
|
|
24576
|
+
}
|
|
24577
|
+
}
|
|
24578
|
+
}
|
|
24579
|
+
else {
|
|
24580
|
+
if (layout === 'start') {
|
|
24581
|
+
const y1 = textPosition.y - textHeight;
|
|
24582
|
+
if (y1 < componentBoundsLike.y1) {
|
|
24583
|
+
return true;
|
|
24584
|
+
}
|
|
24585
|
+
}
|
|
24586
|
+
else {
|
|
24587
|
+
const y2 = textPosition.y + textHeight;
|
|
24588
|
+
if (y2 > componentBoundsLike.y2) {
|
|
24589
|
+
return true;
|
|
24590
|
+
}
|
|
24591
|
+
}
|
|
24592
|
+
}
|
|
24593
|
+
return false;
|
|
24594
|
+
}
|
|
24556
24595
|
renderText() {
|
|
24557
24596
|
const { startTextStyle, endTextStyle } = this.attribute;
|
|
24558
|
-
const { formatMethod: startTextFormat } = startTextStyle,
|
|
24597
|
+
const { formatMethod: startTextFormat } = startTextStyle, restStartTextStyle = __rest(startTextStyle, ["formatMethod"]);
|
|
24559
24598
|
const { formatMethod: endTextFormat } = endTextStyle, restEndTextStyle = __rest(endTextStyle, ["formatMethod"]);
|
|
24560
24599
|
const { start, end } = this.state;
|
|
24561
24600
|
this._startValue = this._statePointToData(start);
|
|
24562
24601
|
this._endValue = this._statePointToData(end);
|
|
24563
24602
|
const { position, width, height } = this.getLayoutAttrFromConfig();
|
|
24603
|
+
const startTextValue = startTextFormat ? startTextFormat(this._startValue) : this._startValue;
|
|
24604
|
+
const endTextValue = endTextFormat ? endTextFormat(this._endValue) : this._endValue;
|
|
24605
|
+
const startTextMeasure = new vutils.TextMeasure({
|
|
24606
|
+
defaultFontParams: restStartTextStyle.textStyle
|
|
24607
|
+
});
|
|
24608
|
+
const endTextMeasure = new vutils.TextMeasure({
|
|
24609
|
+
defaultFontParams: restEndTextStyle.textStyle
|
|
24610
|
+
});
|
|
24611
|
+
const componentBoundsLike = {
|
|
24612
|
+
x1: position.x,
|
|
24613
|
+
y1: position.y,
|
|
24614
|
+
x2: position.x + width,
|
|
24615
|
+
y2: position.y + height
|
|
24616
|
+
};
|
|
24617
|
+
let startTextPosition;
|
|
24618
|
+
let endTextPosition;
|
|
24619
|
+
let startTextAlignStyle;
|
|
24620
|
+
let endTextAlignStyle;
|
|
24564
24621
|
if (this._isHorizontal) {
|
|
24565
|
-
|
|
24566
|
-
text: startTextFormat ? startTextFormat(this._startValue) : this._startValue,
|
|
24622
|
+
startTextPosition = {
|
|
24567
24623
|
x: position.x + start * width,
|
|
24568
|
-
y: position.y + height / 2
|
|
24569
|
-
|
|
24570
|
-
|
|
24571
|
-
childrenPickable: false,
|
|
24572
|
-
textStyle: {
|
|
24573
|
-
textAlign: 'right',
|
|
24574
|
-
textBaseline: 'middle'
|
|
24575
|
-
}
|
|
24576
|
-
}), `data-zoom-start-text-${position}`);
|
|
24577
|
-
this._endText = this.maybeAddLabel(this._container, vutils.merge({}, restEndTextStyle, {
|
|
24578
|
-
text: endTextFormat ? endTextFormat(this._endValue) : this._endValue,
|
|
24624
|
+
y: position.y + height / 2
|
|
24625
|
+
};
|
|
24626
|
+
endTextPosition = {
|
|
24579
24627
|
x: position.x + end * width,
|
|
24580
|
-
y: position.y + height / 2
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
|
|
24584
|
-
|
|
24585
|
-
|
|
24586
|
-
|
|
24587
|
-
|
|
24588
|
-
|
|
24628
|
+
y: position.y + height / 2
|
|
24629
|
+
};
|
|
24630
|
+
startTextAlignStyle = {
|
|
24631
|
+
textAlign: this.isTextOverflow(componentBoundsLike, startTextPosition, startTextMeasure, startTextValue, 'start')
|
|
24632
|
+
? 'left'
|
|
24633
|
+
: 'right',
|
|
24634
|
+
textBaseline: 'middle'
|
|
24635
|
+
};
|
|
24636
|
+
endTextAlignStyle = {
|
|
24637
|
+
textAlign: this.isTextOverflow(componentBoundsLike, endTextPosition, endTextMeasure, endTextValue, 'end')
|
|
24638
|
+
? 'right'
|
|
24639
|
+
: 'left',
|
|
24640
|
+
textBaseline: 'middle'
|
|
24641
|
+
};
|
|
24589
24642
|
}
|
|
24590
24643
|
else {
|
|
24591
|
-
|
|
24592
|
-
text: startTextFormat ? startTextFormat(this._startValue) : this._startValue,
|
|
24644
|
+
startTextPosition = {
|
|
24593
24645
|
x: position.x + width / 2,
|
|
24594
|
-
y: position.y + start * height
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
childrenPickable: false,
|
|
24598
|
-
textStyle: {
|
|
24599
|
-
textAlign: 'center',
|
|
24600
|
-
textBaseline: 'bottom'
|
|
24601
|
-
}
|
|
24602
|
-
}), `data-zoom-start-text-${position}`);
|
|
24603
|
-
this._endText = this.maybeAddLabel(this._container, vutils.merge({}, restEndTextStyle, {
|
|
24604
|
-
text: endTextFormat ? endTextFormat(this._endValue) : this._endValue,
|
|
24646
|
+
y: position.y + start * height
|
|
24647
|
+
};
|
|
24648
|
+
endTextPosition = {
|
|
24605
24649
|
x: position.x + width / 2,
|
|
24606
|
-
y: position.y + end * height
|
|
24607
|
-
|
|
24608
|
-
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
|
|
24650
|
+
y: position.y + end * height
|
|
24651
|
+
};
|
|
24652
|
+
startTextAlignStyle = {
|
|
24653
|
+
textAlign: 'center',
|
|
24654
|
+
textBaseline: this.isTextOverflow(componentBoundsLike, startTextPosition, startTextMeasure, startTextValue, 'start')
|
|
24655
|
+
? 'top'
|
|
24656
|
+
: 'bottom'
|
|
24657
|
+
};
|
|
24658
|
+
endTextAlignStyle = {
|
|
24659
|
+
textAlign: 'center',
|
|
24660
|
+
textBaseline: this.isTextOverflow(componentBoundsLike, endTextPosition, endTextMeasure, endTextValue, 'end')
|
|
24661
|
+
? 'bottom'
|
|
24662
|
+
: 'top'
|
|
24663
|
+
};
|
|
24615
24664
|
}
|
|
24665
|
+
this._startText = this.maybeAddLabel(this._container, vutils.merge({}, restStartTextStyle, {
|
|
24666
|
+
text: startTextValue,
|
|
24667
|
+
x: startTextPosition.x,
|
|
24668
|
+
y: startTextPosition.y,
|
|
24669
|
+
visible: this._showText,
|
|
24670
|
+
pickable: false,
|
|
24671
|
+
childrenPickable: false,
|
|
24672
|
+
textStyle: startTextAlignStyle
|
|
24673
|
+
}), `data-zoom-start-text-${position}`);
|
|
24674
|
+
this._endText = this.maybeAddLabel(this._container, vutils.merge({}, restEndTextStyle, {
|
|
24675
|
+
text: endTextValue,
|
|
24676
|
+
x: endTextPosition.x,
|
|
24677
|
+
y: endTextPosition.y,
|
|
24678
|
+
visible: this._showText,
|
|
24679
|
+
pickable: false,
|
|
24680
|
+
childrenPickable: false,
|
|
24681
|
+
textStyle: endTextAlignStyle
|
|
24682
|
+
}), `data-zoom-end-text-${position}`);
|
|
24616
24683
|
}
|
|
24617
24684
|
getLayoutAttrFromConfig() {
|
|
24618
24685
|
var _a, _b, _c, _d;
|
|
@@ -24676,23 +24743,23 @@
|
|
|
24676
24743
|
render() {
|
|
24677
24744
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
24678
24745
|
this._layoutAttrFromConfig = null;
|
|
24679
|
-
const { orient, backgroundStyle, backgroundChartStyle = {}, selectedBackgroundStyle = {}, selectedBackgroundChartStyle = {}, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, brushSelect } = this.attribute;
|
|
24746
|
+
const { orient, backgroundStyle, backgroundChartStyle = {}, selectedBackgroundStyle = {}, selectedBackgroundChartStyle = {}, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, brushSelect, zoomLock } = this.attribute;
|
|
24680
24747
|
const { start, end } = this.state;
|
|
24681
24748
|
const { position, width, height } = this.getLayoutAttrFromConfig();
|
|
24682
24749
|
const startHandlerMinSize = (_a = startHandlerStyle.triggerMinSize) !== null && _a !== void 0 ? _a : 40;
|
|
24683
24750
|
const endHandlerMinSize = (_b = endHandlerStyle.triggerMinSize) !== null && _b !== void 0 ? _b : 40;
|
|
24684
24751
|
const group = this.createOrUpdateChild('dataZoom-container', {}, 'group');
|
|
24685
24752
|
this._container = group;
|
|
24686
|
-
this._background = group.createOrUpdateChild('background', Object.assign({ x: position.x, y: position.y, width,
|
|
24687
|
-
height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), 'rect');
|
|
24753
|
+
this._background = group.createOrUpdateChild('background', Object.assign(Object.assign({ x: position.x, y: position.y, width,
|
|
24754
|
+
height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), { pickable: !zoomLock }), 'rect');
|
|
24688
24755
|
((_c = backgroundChartStyle.line) === null || _c === void 0 ? void 0 : _c.visible) && this.setPreviewAttributes('line', group);
|
|
24689
24756
|
((_d = backgroundChartStyle.area) === null || _d === void 0 ? void 0 : _d.visible) && this.setPreviewAttributes('area', group);
|
|
24690
24757
|
brushSelect && this.renderDragMask();
|
|
24691
24758
|
if (this._isHorizontal) {
|
|
24692
|
-
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), 'rect');
|
|
24759
|
+
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: !zoomLock }), 'rect');
|
|
24693
24760
|
}
|
|
24694
24761
|
else {
|
|
24695
|
-
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), 'rect');
|
|
24762
|
+
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: !zoomLock }), 'rect');
|
|
24696
24763
|
}
|
|
24697
24764
|
((_e = selectedBackgroundChartStyle.line) === null || _e === void 0 ? void 0 : _e.visible) && this.setSelectedPreviewAttributes('line', group);
|
|
24698
24765
|
((_f = selectedBackgroundChartStyle.area) === null || _f === void 0 ? void 0 : _f.visible) && this.setSelectedPreviewAttributes('area', group);
|
|
@@ -24702,34 +24769,34 @@
|
|
|
24702
24769
|
if (this._isHorizontal) {
|
|
24703
24770
|
if (middleHandlerStyle.visible) {
|
|
24704
24771
|
const middleHandlerBackgroundSize = ((_g = middleHandlerStyle.background) === null || _g === void 0 ? void 0 : _g.size) || 10;
|
|
24705
|
-
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: position.x + start * width, y: position.y - middleHandlerBackgroundSize, width: (end - start) * width, height: middleHandlerBackgroundSize }, (_h = middleHandlerStyle.background) === null || _h === void 0 ? void 0 : _h.style), 'rect');
|
|
24706
|
-
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - middleHandlerBackgroundSize / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_k = (_j = middleHandlerStyle.icon) === null || _j === void 0 ? void 0 : _j.symbolType) !== null && _k !== void 0 ? _k : 'square' }, middleHandlerStyle.icon), 'symbol');
|
|
24772
|
+
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: position.x + start * width, y: position.y - middleHandlerBackgroundSize, width: (end - start) * width, height: middleHandlerBackgroundSize }, (_h = middleHandlerStyle.background) === null || _h === void 0 ? void 0 : _h.style), { pickable: !zoomLock }), 'rect');
|
|
24773
|
+
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - middleHandlerBackgroundSize / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_k = (_j = middleHandlerStyle.icon) === null || _j === void 0 ? void 0 : _j.symbolType) !== null && _k !== void 0 ? _k : 'square' }, middleHandlerStyle.icon), { pickable: !zoomLock }), 'symbol');
|
|
24707
24774
|
}
|
|
24708
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (_l = startHandlerStyle.symbolType) !== null && _l !== void 0 ? _l : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), 'symbol');
|
|
24709
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (_m = endHandlerStyle.symbolType) !== null && _m !== void 0 ? _m : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), 'symbol');
|
|
24775
|
+
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (_l = startHandlerStyle.symbolType) !== null && _l !== void 0 ? _l : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), { pickable: !zoomLock }), 'symbol');
|
|
24776
|
+
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (_m = endHandlerStyle.symbolType) !== null && _m !== void 0 ? _m : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), { pickable: !zoomLock }), 'symbol');
|
|
24710
24777
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
24711
24778
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
24712
24779
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
24713
24780
|
const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
|
|
24714
|
-
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign({ x: position.x + start * width - startHandlerWidth / 2, y: position.y + height / 2 - startHandlerHeight / 2, width: startHandlerWidth, height: startHandlerHeight, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), 'rect');
|
|
24715
|
-
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign({ x: position.x + end * width - endHandlerWidth / 2, y: position.y + height / 2 - endHandlerHeight / 2, width: endHandlerWidth, height: endHandlerHeight, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), 'rect');
|
|
24781
|
+
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign(Object.assign({ x: position.x + start * width - startHandlerWidth / 2, y: position.y + height / 2 - startHandlerHeight / 2, width: startHandlerWidth, height: startHandlerHeight, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), { pickable: !zoomLock }), 'rect');
|
|
24782
|
+
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign(Object.assign({ x: position.x + end * width - endHandlerWidth / 2, y: position.y + height / 2 - endHandlerHeight / 2, width: endHandlerWidth, height: endHandlerHeight, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), { pickable: !zoomLock }), 'rect');
|
|
24716
24783
|
}
|
|
24717
24784
|
else {
|
|
24718
24785
|
if (middleHandlerStyle.visible) {
|
|
24719
24786
|
const middleHandlerBackgroundSize = ((_o = middleHandlerStyle.background) === null || _o === void 0 ? void 0 : _o.size) || 10;
|
|
24720
|
-
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: orient === 'left' ? position.x - middleHandlerBackgroundSize : position.x + width, y: position.y + start * height, width: middleHandlerBackgroundSize, height: (end - start) * height }, (_p = middleHandlerStyle.background) === null || _p === void 0 ? void 0 : _p.style), 'rect');
|
|
24721
|
-
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: orient === 'left'
|
|
24787
|
+
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: orient === 'left' ? position.x - middleHandlerBackgroundSize : position.x + width, y: position.y + start * height, width: middleHandlerBackgroundSize, height: (end - start) * height }, (_p = middleHandlerStyle.background) === null || _p === void 0 ? void 0 : _p.style), { pickable: !zoomLock }), 'rect');
|
|
24788
|
+
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: orient === 'left'
|
|
24722
24789
|
? position.x - middleHandlerBackgroundSize / 2
|
|
24723
|
-
: position.x + width + middleHandlerBackgroundSize / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_r = (_q = middleHandlerStyle.icon) === null || _q === void 0 ? void 0 : _q.symbolType) !== null && _r !== void 0 ? _r : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle.icon), 'symbol');
|
|
24790
|
+
: position.x + width + middleHandlerBackgroundSize / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_r = (_q = middleHandlerStyle.icon) === null || _q === void 0 ? void 0 : _q.symbolType) !== null && _r !== void 0 ? _r : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle.icon), { pickable: !zoomLock }), 'symbol');
|
|
24724
24791
|
}
|
|
24725
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (_s = startHandlerStyle.symbolType) !== null && _s !== void 0 ? _s : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), 'symbol');
|
|
24726
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_t = endHandlerStyle.symbolType) !== null && _t !== void 0 ? _t : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), 'symbol');
|
|
24792
|
+
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (_s = startHandlerStyle.symbolType) !== null && _s !== void 0 ? _s : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), { pickable: !zoomLock }), 'symbol');
|
|
24793
|
+
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_t = endHandlerStyle.symbolType) !== null && _t !== void 0 ? _t : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), { pickable: !zoomLock }), 'symbol');
|
|
24727
24794
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
24728
24795
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
24729
24796
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
24730
24797
|
const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
|
|
24731
|
-
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign({ x: position.x + width / 2 + startHandlerWidth / 2, y: position.y + start * height - startHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), 'rect');
|
|
24732
|
-
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign({ x: position.x + width / 2 + endHandlerWidth / 2, y: position.y + end * height - endHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), 'rect');
|
|
24798
|
+
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + startHandlerWidth / 2, y: position.y + start * height - startHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
|
|
24799
|
+
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + endHandlerWidth / 2, y: position.y + end * height - endHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
|
|
24733
24800
|
}
|
|
24734
24801
|
}
|
|
24735
24802
|
computeBasePoints() {
|
|
@@ -24970,6 +25037,12 @@
|
|
|
24970
25037
|
super(...arguments);
|
|
24971
25038
|
this.name = 'marker';
|
|
24972
25039
|
}
|
|
25040
|
+
setAttribute(key, value, forceUpdateTag) {
|
|
25041
|
+
super.setAttribute(key, value, forceUpdateTag);
|
|
25042
|
+
if (key === 'visible') {
|
|
25043
|
+
this.render();
|
|
25044
|
+
}
|
|
25045
|
+
}
|
|
24973
25046
|
_initContainer() {
|
|
24974
25047
|
var _a, _b;
|
|
24975
25048
|
const { limitRect = {}, clipInRange } = this.attribute;
|
|
@@ -25014,22 +25087,20 @@
|
|
|
25014
25087
|
if (this.attribute.interactive === false) {
|
|
25015
25088
|
this.setAttribute('childrenPickable', false);
|
|
25016
25089
|
}
|
|
25017
|
-
if (markerVisible) {
|
|
25018
|
-
if (!this._container
|
|
25090
|
+
if (markerVisible && this.isValidPoints()) {
|
|
25091
|
+
if (!this._container) {
|
|
25019
25092
|
this._initContainer();
|
|
25020
25093
|
this.initMarker(this._container);
|
|
25021
25094
|
}
|
|
25022
25095
|
else {
|
|
25023
|
-
|
|
25024
|
-
|
|
25025
|
-
this.removeAllChild();
|
|
25026
|
-
}
|
|
25027
|
-
else {
|
|
25028
|
-
this._updateContainer();
|
|
25029
|
-
this.updateMarker();
|
|
25030
|
-
}
|
|
25096
|
+
this._updateContainer();
|
|
25097
|
+
this.updateMarker();
|
|
25031
25098
|
}
|
|
25032
25099
|
}
|
|
25100
|
+
else {
|
|
25101
|
+
this._container = null;
|
|
25102
|
+
this.removeAllChild();
|
|
25103
|
+
}
|
|
25033
25104
|
}
|
|
25034
25105
|
}
|
|
25035
25106
|
|
|
@@ -29862,7 +29933,7 @@
|
|
|
29862
29933
|
}
|
|
29863
29934
|
};
|
|
29864
29935
|
|
|
29865
|
-
const version = "0.17.11-alpha.
|
|
29936
|
+
const version = "0.17.11-alpha.2";
|
|
29866
29937
|
|
|
29867
29938
|
exports.AbstractComponent = AbstractComponent;
|
|
29868
29939
|
exports.ArcInfo = ArcInfo;
|