tvcharts 0.9.33 → 0.9.35
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/lib/chart/playbackOrder/PlaybackHtmlContent.js +5 -1
- package/lib/chart/playbackOrder/PlaybackOrderView.js +13 -0
- package/lib/component/playback/PlaybackOrderView.js +17 -8
- package/lib/component/playback/PlaybackSelectModel.js +4 -1
- package/lib/component/playback/PlaybackSelectView.js +81 -31
- package/lib/core/echarts.js +1 -1
- package/package.json +1 -1
- package/types/src/chart/playbackOrder/PlaybackOrderSeries.d.ts +1 -0
- package/types/src/chart/playbackOrder/PlaybackOrderView.d.ts +2 -0
- package/types/src/component/playback/PlaybackSelectModel.d.ts +2 -0
- package/types/src/component/playback/PlaybackSelectView.d.ts +8 -0
|
@@ -122,6 +122,7 @@ var TooltipHTMLContent = /** @class */function () {
|
|
|
122
122
|
x = _a.x,
|
|
123
123
|
y = _a.y,
|
|
124
124
|
precision = _a.precision;
|
|
125
|
+
this._show = true;
|
|
125
126
|
var el = this.el;
|
|
126
127
|
var style = el.style;
|
|
127
128
|
style.position = "absolute";
|
|
@@ -141,7 +142,7 @@ var TooltipHTMLContent = /** @class */function () {
|
|
|
141
142
|
each(orders, function (item) {
|
|
142
143
|
totalPrice_1 = totalPrice_1 + item.price;
|
|
143
144
|
totalSize_1 += item.size;
|
|
144
|
-
ordersHtml = ordersHtml + "<div style=\"height: 18px; margin-bottom: 2px; font-size: 12px; margin-left: 4px;\">" + formatAmount(item.size) + " @ " + item.price.toFixed(precision) + "<span style=\"margin-left: 12px; color: var(--placeholder-text-color);\">
|
|
145
|
+
ordersHtml = ordersHtml + "<div style=\"height: 18px; margin-bottom: 2px; font-size: 12px; margin-left: 4px;\">" + formatAmount(item.size) + " @ " + item.price.toFixed(precision) + "<span style=\"margin-left: 12px; color: var(--placeholder-text-color);\">" + formatTime + "</span></div>";
|
|
145
146
|
});
|
|
146
147
|
title = formatAmount(totalSize_1) + " @ " + (totalPrice_1 / orders.length).toFixed(precision) + " avg price";
|
|
147
148
|
}
|
|
@@ -159,6 +160,9 @@ var TooltipHTMLContent = /** @class */function () {
|
|
|
159
160
|
return [el.offsetWidth, el.offsetHeight];
|
|
160
161
|
};
|
|
161
162
|
TooltipHTMLContent.prototype.hide = function () {
|
|
163
|
+
if (!this._show) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
162
166
|
var style = this.el.style;
|
|
163
167
|
style.visibility = 'hidden';
|
|
164
168
|
style.opacity = '0';
|
|
@@ -71,7 +71,9 @@ var PlaybackOrderView = /** @class */function (_super) {
|
|
|
71
71
|
this.htmlContent = new PlaybackHtmlContent(api);
|
|
72
72
|
api.getZr().on('mousedown', this._clickGlobal, this);
|
|
73
73
|
}
|
|
74
|
+
this._isSmallSize = seriesModel.get('isMobile') && api.getWidth() <= 600;
|
|
74
75
|
var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);
|
|
76
|
+
this.api = api;
|
|
75
77
|
if (clipPath) {
|
|
76
78
|
this.group.setClipPath(clipPath);
|
|
77
79
|
} else {
|
|
@@ -170,6 +172,16 @@ var PlaybackOrderView = /** @class */function (_super) {
|
|
|
170
172
|
if (!orders) {
|
|
171
173
|
return;
|
|
172
174
|
}
|
|
175
|
+
var isSmallSize = this._isSmallSize;
|
|
176
|
+
if (isSmallSize) {
|
|
177
|
+
this.api.trigger('playbackorderclick', {
|
|
178
|
+
isUp: isUp,
|
|
179
|
+
orders: orders,
|
|
180
|
+
time: dataModal.get('time'),
|
|
181
|
+
precision: seriesModel.get('precision')
|
|
182
|
+
});
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
173
185
|
this.htmlContent.show({
|
|
174
186
|
isUp: isUp,
|
|
175
187
|
orders: orders,
|
|
@@ -296,6 +308,7 @@ var PlaybackOrderView = /** @class */function (_super) {
|
|
|
296
308
|
this._symbolGroup && this._symbolGroup.removeAll();
|
|
297
309
|
this._symbolGroup = null;
|
|
298
310
|
this.group.removeAll();
|
|
311
|
+
this.api = null;
|
|
299
312
|
};
|
|
300
313
|
PlaybackOrderView.prototype.dispose = function (ecModel, api) {
|
|
301
314
|
this.remove(ecModel, api);
|
|
@@ -594,7 +594,9 @@ var PlaybackOrderView = /** @class */function (_super) {
|
|
|
594
594
|
var rect = this.rect;
|
|
595
595
|
var playbackOrderModel = this.playbackOrderModel;
|
|
596
596
|
var order = playbackOrderModel.get('order');
|
|
597
|
-
var
|
|
597
|
+
var isLong = order.direction === 'long';
|
|
598
|
+
var color = isLong ? longColor : shortColor;
|
|
599
|
+
var yOffset = isLong ? 26 : -26;
|
|
598
600
|
if (!this.orderGroupEls) {
|
|
599
601
|
this.createOrderEl();
|
|
600
602
|
}
|
|
@@ -671,27 +673,33 @@ var PlaybackOrderView = /** @class */function (_super) {
|
|
|
671
673
|
var closeWidth = descClosePadding * 2 + 10;
|
|
672
674
|
var descRectWidth = sizeRectWidth + profitWidth + closeWidth;
|
|
673
675
|
var leftRectWidth = rect.width / 2;
|
|
674
|
-
var
|
|
676
|
+
var circleMargin = 30;
|
|
677
|
+
var isOverlap = rect.width < descRectWidth + labelRectWidth * 3 + orderTpLMargin + 1 + descLMargin + circleR + circleMargin * 2;
|
|
678
|
+
if (isOverlap) {
|
|
679
|
+
circleMargin = 15;
|
|
680
|
+
}
|
|
681
|
+
var buttonCount = isOverlap ? 1 : 1 + (order.stopProfit ? 0 : 1) + (order.stopLoss ? 0 : 1);
|
|
675
682
|
var buttonWidth = labelRectWidth * buttonCount + orderTpLMargin + 1 + descLMargin;
|
|
676
683
|
var isOverlay = rect.width < descRectWidth + buttonWidth + circleR;
|
|
677
684
|
// let baseX = rect.width / 2;
|
|
678
685
|
// let circleMargin = Math.min(maxCircleMargin, (leftRectWidth - circleR - descRectWidth /2) / 2);
|
|
679
686
|
var baseX = rect.width - circleR - descRectWidth / 2 - 60;
|
|
680
|
-
var circleMargin = 30;
|
|
681
687
|
if (isOverlay) {
|
|
682
688
|
baseX = rect.width - circleR - descRectWidth / 2;
|
|
683
689
|
circleMargin = 0;
|
|
684
690
|
} else if (leftRectWidth < descRectWidth / 2 + buttonWidth) {
|
|
685
691
|
baseX = buttonWidth + descRectWidth / 2;
|
|
686
|
-
circleMargin = Math.max(Math.min(
|
|
692
|
+
circleMargin = Math.max(Math.min(circleMargin - 2, (rect.width - baseX - descRectWidth / 2 - circleR) / 2), 0);
|
|
687
693
|
}
|
|
688
694
|
var startX = rect.x + baseX - descRectWidth / 2 - buttonWidth;
|
|
689
|
-
orderClosePositionEl.attr('x', startX);
|
|
695
|
+
orderClosePositionEl.attr('x', isOverlap ? startX + labelRectWidth * (buttonCount - 1) + 1 + descLMargin : startX);
|
|
690
696
|
var tpX = startX + labelRectWidth + orderTpLMargin;
|
|
691
697
|
var circleX = Math.floor(rect.x + baseX + descRectWidth / 2 + circleMargin) + 0.5;
|
|
692
698
|
this.circleX = circleX;
|
|
693
699
|
this.circleMargin = circleMargin;
|
|
694
|
-
|
|
700
|
+
var orderDescX = startX + labelRectWidth * buttonCount + orderTpLMargin + 1 + descLMargin;
|
|
701
|
+
orderTpEl.attr('x', isOverlap ? orderDescX : tpX);
|
|
702
|
+
orderTpEl.attr('y', isOverlap ? -yOffset : 0);
|
|
695
703
|
if (this.dragType === 'TP' && this.dragPrice) {
|
|
696
704
|
orderTpEl.ignore = true;
|
|
697
705
|
this.dragStartX = tpX;
|
|
@@ -706,7 +714,8 @@ var PlaybackOrderView = /** @class */function (_super) {
|
|
|
706
714
|
this.removeStop('profit');
|
|
707
715
|
}
|
|
708
716
|
var slX = order.stopProfit ? startX + labelRectWidth + orderTpLMargin + 1 : startX + labelRectWidth * 2 + orderTpLMargin + 1;
|
|
709
|
-
orderSlEl.attr('x', slX);
|
|
717
|
+
orderSlEl.attr('x', isOverlap ? orderDescX : slX);
|
|
718
|
+
orderSlEl.attr('y', isOverlap ? yOffset : 0);
|
|
710
719
|
if (this.dragType === 'SL' && this.dragPrice) {
|
|
711
720
|
orderSlEl.ignore = true;
|
|
712
721
|
this.dragStartX = slX;
|
|
@@ -723,7 +732,7 @@ var PlaybackOrderView = /** @class */function (_super) {
|
|
|
723
732
|
} else {
|
|
724
733
|
this.removeStop('loss');
|
|
725
734
|
}
|
|
726
|
-
orderDescEl.attr('x',
|
|
735
|
+
orderDescEl.attr('x', orderDescX);
|
|
727
736
|
orderDescEl.childAt(0).attr({
|
|
728
737
|
shape: {
|
|
729
738
|
y: -9,
|
|
@@ -39,6 +39,9 @@ var PlaybackSelectModel = /** @class */function (_super) {
|
|
|
39
39
|
PlaybackSelectModel.prototype.setPlaybackSelect = function (payload) {
|
|
40
40
|
this.option.startIndex = payload.startIndex;
|
|
41
41
|
this.option.yData = payload.uid === this.uid ? payload.yData : void 0;
|
|
42
|
+
if (payload.show !== undefined) {
|
|
43
|
+
this.option.show = payload.show;
|
|
44
|
+
}
|
|
42
45
|
};
|
|
43
46
|
PlaybackSelectModel.type = 'playbackSelect';
|
|
44
47
|
PlaybackSelectModel.defaultOption = {
|
|
@@ -47,7 +50,7 @@ var PlaybackSelectModel = /** @class */function (_super) {
|
|
|
47
50
|
show: false,
|
|
48
51
|
color: 'rgb(41,98,255)',
|
|
49
52
|
bgColor: 'rgb(255,255,255)',
|
|
50
|
-
startIndex:
|
|
53
|
+
startIndex: null,
|
|
51
54
|
icon: 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAD/UlEQVRYhb1ZjXWbMBCWO0BNJ7A7QRiBDcoIjMAIZANvUHsDugHZAG/ACHiBXN+HOeU4nQQkfb337gUL6fTp/kUcEW3hgohaetKViM4b1zFnYv1ARPU8Zs1dcDBg8Pn9/f1BIZU7AHbBaqJxC8hgwOCGJdZ1TX3f79qAiCpe0DTNJENQbczfDXA6fdd15JyjPM/lBq0xX/Mg14PFIS/G/AV/cxup7/tpIv6+vr7yol/OuTIhoXHOnaaHpvGDbdvyYx6s0GShtjR4vV69BpQWYqbO5nfUtu1iLWTN1BnrPueDACQ32WDqC788n8+LtTA3u6WxbjfAkqVlWbbYCE4vSEa1R3+5XBZrnkbzVBn77QaYeWlVFWwWMfWkonEcg0OVZSkBrubTYCDCrWXmiKmr1IGE/w2RvT4F0B+7KIpgU2XqUacVZmgTWt3qf3sAmvksYuqJoNmVg2wql8FAgr3pLC1KUwOIfo9IFtq7Jvb5NECvxWEYAudnDVl+CkYuBM11fXOzEQyscOFVoBK39DM9trf+fgWgkwnYynEp02+pHP8CoBO9nZlKIlEbK4lJTr5MMDbyYWuBBDgV2XlCXpQ3dzOKRufcwEPDMAQTsixzLy8v/PMNjVAwaQvFkK+w93orpUTy3p4O/Es+6L0+lrQjCfy/+GDN9xOrEUDEatBGFO8CGQxEOJcXH4DTpQxgkcAtsytT93M+je21C2Am8x6bVTegqgmdSM9RIFmbq0CDAeVrA0uDdqx0Etk8MDX3gqxlBTRa+oKBmSt5FwYAq4RxEyColRFuzQfjoBLovJfZXQcDMkrha1bnEqmzHKV+fexQcq2oNGSBtHxuZJNavpYwr+yQJ1o7HEe5ApmnAPoaq6MUm1kawbiMDalB64CQoYErkF0MoHcmqD5mBquDEVTIlkzPE/eRyUIIGumX6qABQH/vYO2pboT0+zWAUuNK0x5kRI4vi7JZmD5DPB4P/5mjLEt3PB75/Q/n3B0PVVUtmgJFnReYf3zZqOuaH//MstzpdHJFUfg59/t9gQUUdDMCkOu6Tr6CfX468Z2GDyFo0bFI8OM48iMQXfiH7IRE9/NBwsTeBtKEukLA5JFmQH7+mPxCXgtUTaaV94Xlg/4Lgg4EODAuPQgY6VdKqMxhPhrkYfEMUJClqxL2FJRZAJ2su2s5THXMo5JzZi1ajcVKqmpiaYa1OLBgmQYS4CjSjPqskAKp0liv5Rye6WpBsNvb4XD4zpGFD44cGIg6RLEIphsCO3DuJ2H8t594u01yEDCIcMgSgfGYA2h5NTBOziayPnx7mgv8ljsuNBkm0yUhwMxGdk04HF8DhRngq3v+FYHNcRjIYrCQA2DxuwqR+wu+HnkxU9Zp7AAAAABJRU5ErkJggg=='
|
|
52
55
|
};
|
|
53
56
|
return PlaybackSelectModel;
|
|
@@ -35,7 +35,21 @@ var PlaybackSelectView = /** @class */function (_super) {
|
|
|
35
35
|
function PlaybackSelectView() {
|
|
36
36
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37
37
|
_this.type = PlaybackSelectView.type;
|
|
38
|
+
_this.initPosition = {
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0
|
|
41
|
+
};
|
|
42
|
+
_this.initDownPosition = {
|
|
43
|
+
x: 0,
|
|
44
|
+
y: 0
|
|
45
|
+
};
|
|
46
|
+
_this.currentPosition = {
|
|
47
|
+
x: 0,
|
|
48
|
+
y: 0
|
|
49
|
+
};
|
|
50
|
+
_this.isDown = false;
|
|
38
51
|
_this.isMountEvent = false;
|
|
52
|
+
_this.mouseIndex = 0;
|
|
39
53
|
return _this;
|
|
40
54
|
}
|
|
41
55
|
PlaybackSelectView.prototype.init = function (ecModel, api) {
|
|
@@ -56,17 +70,26 @@ var PlaybackSelectView = /** @class */function (_super) {
|
|
|
56
70
|
// const z = playbackSelectModel.get('z');
|
|
57
71
|
var rect = grid.coordinateSystem.getRect();
|
|
58
72
|
var startIndex = playbackSelectModel.get('startIndex');
|
|
59
|
-
|
|
73
|
+
var isMobile = playbackSelectModel.get('isMobile');
|
|
74
|
+
var xAxis = ecModel.getComponent('xAxis', 0);
|
|
75
|
+
var xAxis2D = xAxis.axis;
|
|
76
|
+
if (startIndex === null || startIndex === void 0) {
|
|
60
77
|
this.clear();
|
|
61
78
|
return;
|
|
79
|
+
// if (!isMobile) {
|
|
80
|
+
// this.clear();
|
|
81
|
+
// return;
|
|
82
|
+
// }
|
|
83
|
+
// const [start, end] = xAxis2D.scale.getExtent();
|
|
84
|
+
// const lastIndex =(xAxis2D.scale as OrdinalScale).getOrdinalMeta().getCategoriesSize() - 1;
|
|
85
|
+
// startIndex = Math.min(Math.floor((end + start) / 2), lastIndex);
|
|
62
86
|
}
|
|
87
|
+
|
|
63
88
|
this._rect = rect;
|
|
64
89
|
var bgColor = playbackSelectModel.get('bgColor');
|
|
65
90
|
var color = playbackSelectModel.get('color');
|
|
66
91
|
var icon = playbackSelectModel.get('icon');
|
|
67
92
|
var yData = playbackSelectModel.get('yData');
|
|
68
|
-
var xAxis = ecModel.getComponent('xAxis', 0);
|
|
69
|
-
var xAxis2D = xAxis.axis;
|
|
70
93
|
var x = Math.floor(xAxis2D.toGlobalCoord(xAxis2D.dataToCoord(startIndex)));
|
|
71
94
|
var lineStyle = {
|
|
72
95
|
lineWidth: 2,
|
|
@@ -132,25 +155,47 @@ var PlaybackSelectView = /** @class */function (_super) {
|
|
|
132
155
|
group.remove(this.imgEl);
|
|
133
156
|
this.imgEl = null;
|
|
134
157
|
}
|
|
158
|
+
this.currentPosition.x = x;
|
|
159
|
+
this.currentPosition.y = yData;
|
|
160
|
+
this.isMobile = isMobile;
|
|
135
161
|
};
|
|
136
162
|
PlaybackSelectView.prototype._onMouseMove = function (e) {
|
|
137
163
|
var offsetX = e.offsetX;
|
|
138
164
|
var offsetY = e.offsetY;
|
|
165
|
+
var isMobile = this.isMobile;
|
|
166
|
+
if (isMobile) {
|
|
167
|
+
if (!this.isDown) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
var initPosition = this.initPosition;
|
|
171
|
+
var initDownPosition = this.initDownPosition;
|
|
172
|
+
var diffX = offsetX - initDownPosition.x;
|
|
173
|
+
offsetX = initPosition.x + diffX;
|
|
174
|
+
if (initPosition.y) {
|
|
175
|
+
var diffY = offsetY - initDownPosition.y;
|
|
176
|
+
offsetY = initPosition.y + diffY;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
139
179
|
var ecModel = this.ecModel;
|
|
140
180
|
var xAxis = ecModel.getComponent('xAxis', 0);
|
|
141
181
|
if (offsetX > this._rect.x + this._rect.width) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
182
|
+
if (isMobile) {
|
|
183
|
+
offsetX = this._rect.x + this._rect.width;
|
|
184
|
+
} else {
|
|
185
|
+
this.api.dispatchAction({
|
|
186
|
+
type: 'playbackSelect',
|
|
187
|
+
playbackSelect: {
|
|
188
|
+
startIndex: null
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
149
193
|
}
|
|
150
194
|
var xAxis2D = xAxis.axis;
|
|
151
195
|
var index = xAxis2D.coordToData(xAxis2D.toLocalCoord(offsetX));
|
|
152
196
|
var list = xAxis2D.scale.getOrdinalMeta().getCategories();
|
|
153
197
|
var selectedIndex = Math.max(Math.min(index, list.length - 1), 0);
|
|
198
|
+
isMobile && (this.mouseIndex = selectedIndex);
|
|
154
199
|
this.api.dispatchAction({
|
|
155
200
|
type: 'playbackSelect',
|
|
156
201
|
playbackSelect: {
|
|
@@ -163,6 +208,12 @@ var PlaybackSelectView = /** @class */function (_super) {
|
|
|
163
208
|
};
|
|
164
209
|
PlaybackSelectView.prototype._onClick = function (e) {
|
|
165
210
|
var offsetX = e.offsetX;
|
|
211
|
+
if (this.isMobile) {
|
|
212
|
+
this.api.trigger('playbackselected', {
|
|
213
|
+
startIndex: this.mouseIndex
|
|
214
|
+
});
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
166
217
|
var ecModel = this.ecModel;
|
|
167
218
|
var xAxis = ecModel.getComponent('xAxis', 0);
|
|
168
219
|
var xAxis2D = xAxis.axis;
|
|
@@ -181,27 +232,22 @@ var PlaybackSelectView = /** @class */function (_super) {
|
|
|
181
232
|
}
|
|
182
233
|
});
|
|
183
234
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
// yData,
|
|
201
|
-
// time: list[startIndex as number],
|
|
202
|
-
// }
|
|
203
|
-
// })
|
|
204
|
-
// }
|
|
235
|
+
PlaybackSelectView.prototype._onMousedown = function (e) {
|
|
236
|
+
if (!this.isMobile) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this.initDownPosition.x = e.offsetX;
|
|
240
|
+
this.initDownPosition.y = e.offsetY;
|
|
241
|
+
this.initPosition.x = this.currentPosition.x;
|
|
242
|
+
this.initPosition.y = this.currentPosition.y;
|
|
243
|
+
this.isDown = true;
|
|
244
|
+
};
|
|
245
|
+
PlaybackSelectView.prototype._onMouseUp = function (e) {
|
|
246
|
+
if (!this.isDown) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
this.isDown = false;
|
|
250
|
+
};
|
|
205
251
|
PlaybackSelectView.prototype.mountEvent = function () {
|
|
206
252
|
if (this.isMountEvent) {
|
|
207
253
|
return;
|
|
@@ -210,6 +256,8 @@ var PlaybackSelectView = /** @class */function (_super) {
|
|
|
210
256
|
zr.on('mousemove', this._onMouseMove, this);
|
|
211
257
|
zr.on('click', this._onClick, this);
|
|
212
258
|
zr.on('globalout', this._globalout, this);
|
|
259
|
+
zr.on('mousedown', this._onMousedown, this);
|
|
260
|
+
zr.on('mouseup', this._onMouseUp, this);
|
|
213
261
|
// zr.on('mousewheel', this._onMousewheel, this);
|
|
214
262
|
this.isMountEvent = true;
|
|
215
263
|
};
|
|
@@ -221,6 +269,8 @@ var PlaybackSelectView = /** @class */function (_super) {
|
|
|
221
269
|
zr.off('mousemove', this._onMouseMove);
|
|
222
270
|
zr.off('click', this._onClick);
|
|
223
271
|
zr.off('globalout', this._globalout);
|
|
272
|
+
zr.off('mousedown', this._onMousedown);
|
|
273
|
+
zr.off('mouseup', this._onMouseUp);
|
|
224
274
|
// zr.off('mousewheel', this._onMousewheel);
|
|
225
275
|
this.isMountEvent = false;
|
|
226
276
|
};
|
package/lib/core/echarts.js
CHANGED
|
@@ -1070,7 +1070,7 @@ var ECharts = /** @class */function (_super) {
|
|
|
1070
1070
|
});
|
|
1071
1071
|
// Extra events
|
|
1072
1072
|
// TODO register?
|
|
1073
|
-
each(['selectchanged', 'selectitem', 'loadmore', 'zoomend', 'extraclick', 'visiblechanged', 'dataappend', 'alarmchanged', 'alarmdelete', 'selectidchanged', 'playbackselected', 'snapshotzoom', 'playbackorder', 'events'], function (eventType) {
|
|
1073
|
+
each(['selectchanged', 'selectitem', 'loadmore', 'zoomend', 'extraclick', 'visiblechanged', 'dataappend', 'alarmchanged', 'alarmdelete', 'selectidchanged', 'playbackselected', 'snapshotzoom', 'playbackorder', 'events', "playbackorderclick"], function (eventType) {
|
|
1074
1074
|
_this._messageCenter.on(eventType, function (event) {
|
|
1075
1075
|
this.trigger(eventType, event);
|
|
1076
1076
|
}, _this);
|
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ export interface PlaybackOrderDataItemOption extends LinesStateOption, StatesOpt
|
|
|
28
28
|
export interface PlaybackOrderSeriesOption extends SeriesOption, LinesStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnPolarOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesOnCalendarOptionMixin, SeriesLargeOptionMixin {
|
|
29
29
|
type?: 'playbackOrder';
|
|
30
30
|
coordinateSystem?: string;
|
|
31
|
+
isMobile?: boolean;
|
|
31
32
|
clip?: boolean;
|
|
32
33
|
data?: PlaybackOrderDataItemOption[] | ArrayLike<number>;
|
|
33
34
|
format?: (value: string) => string;
|
|
@@ -12,6 +12,8 @@ declare class PlaybackOrderView extends ChartView {
|
|
|
12
12
|
private _hoverParams;
|
|
13
13
|
htmlContent: PlaybackHtmlContent;
|
|
14
14
|
seriesModel: PlaybackOrderSeriesModel;
|
|
15
|
+
private _isSmallSize;
|
|
16
|
+
private api;
|
|
15
17
|
render(seriesModel: PlaybackOrderSeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void;
|
|
16
18
|
_renderHover(): void;
|
|
17
19
|
_clickGlobal(): void;
|
|
@@ -6,6 +6,7 @@ export interface PlaybackSelectOption extends ComponentOption, BoxLayoutOptionMi
|
|
|
6
6
|
color: string;
|
|
7
7
|
bgColor: string;
|
|
8
8
|
startIndex: number | string | null;
|
|
9
|
+
isMobile?: boolean;
|
|
9
10
|
yData?: number;
|
|
10
11
|
icon: string;
|
|
11
12
|
}
|
|
@@ -13,6 +14,7 @@ export interface PlaybackSelectPayload {
|
|
|
13
14
|
startIndex: number | string | null;
|
|
14
15
|
uid: string;
|
|
15
16
|
yData?: number;
|
|
17
|
+
show?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare class PlaybackSelectModel extends ComponentModel<PlaybackSelectOption> {
|
|
18
20
|
static type: "playbackSelect";
|
|
@@ -8,7 +8,13 @@ export declare class PlaybackSelectView extends ComponentView {
|
|
|
8
8
|
private lineEl;
|
|
9
9
|
private rectEl;
|
|
10
10
|
private imgEl;
|
|
11
|
+
private initPosition;
|
|
12
|
+
private initDownPosition;
|
|
13
|
+
private currentPosition;
|
|
14
|
+
private isDown;
|
|
15
|
+
private isMobile;
|
|
11
16
|
private isMountEvent;
|
|
17
|
+
private mouseIndex;
|
|
12
18
|
ecModel: GlobalModel;
|
|
13
19
|
api: ExtensionAPI;
|
|
14
20
|
playbackSelectModel: PlaybackSelectModel;
|
|
@@ -18,6 +24,8 @@ export declare class PlaybackSelectView extends ComponentView {
|
|
|
18
24
|
private _onMouseMove;
|
|
19
25
|
private _onClick;
|
|
20
26
|
private _globalout;
|
|
27
|
+
private _onMousedown;
|
|
28
|
+
private _onMouseUp;
|
|
21
29
|
mountEvent(): void;
|
|
22
30
|
unmountEvent(): void;
|
|
23
31
|
clear(): void;
|