st-comp 0.0.33 → 0.0.34
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/bundle.js +1335 -1336
- package/lib/bundle.umd.cjs +24 -24
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/Kline/index.vue +11 -10
- package/packages/Kline/utils.ts +2 -1
package/package.json
CHANGED
package/packages/Kline/index.vue
CHANGED
|
@@ -491,7 +491,7 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
491
491
|
// 只有选中或者按ctrl才激活按键
|
|
492
492
|
if (!(e.ctrlKey || props.isSelect)) return;
|
|
493
493
|
const option = echartsInstance.getOption() as EChartsOption;
|
|
494
|
-
let { startValue, endValue } = (option.dataZoom as DataZoomComponentOption[])[0] as {
|
|
494
|
+
let { startValue, endValue, start, end } = (option.dataZoom as DataZoomComponentOption[])[0] as {
|
|
495
495
|
startValue: number;
|
|
496
496
|
endValue: number;
|
|
497
497
|
};
|
|
@@ -537,11 +537,11 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
537
537
|
if (endValue - startValue < 5) {
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
540
|
+
// 以鼠标指定的K线为中心点进行放大
|
|
541
|
+
const startDiff = Math.floor((activeIndex.value - startValue) / 2) + 1;
|
|
542
|
+
const endDiff = Math.floor((endValue - activeIndex.value) / 2) + 1;
|
|
543
|
+
startValue = startValue + startDiff;
|
|
544
|
+
endValue = endValue - endDiff;
|
|
545
545
|
echartsInstance.dispatchAction({
|
|
546
546
|
type: "dataZoom",
|
|
547
547
|
startValue,
|
|
@@ -551,12 +551,13 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
551
551
|
};
|
|
552
552
|
const handleDown = () => {
|
|
553
553
|
// 下按键-缩小
|
|
554
|
-
const diff = Math.min(
|
|
555
|
-
startValue = startValue - diff - 1;
|
|
554
|
+
// const diff = Math.min(50, activeIndex.value - startValue);
|
|
555
|
+
// startValue = startValue - diff - 1;
|
|
556
|
+
start = start - (end - start) / 4;
|
|
556
557
|
echartsInstance.dispatchAction({
|
|
557
558
|
type: "dataZoom",
|
|
558
|
-
|
|
559
|
-
|
|
559
|
+
start,
|
|
560
|
+
end,
|
|
560
561
|
actionIsWheel: true, // 标记为缩放
|
|
561
562
|
});
|
|
562
563
|
};
|
package/packages/Kline/utils.ts
CHANGED
|
@@ -551,7 +551,8 @@ const handleSellBuyConfig = (data: any[], originData: KlineDataType) => {
|
|
|
551
551
|
const startX = next.time;
|
|
552
552
|
const startY = yAxisValue + "";
|
|
553
553
|
const endX = target.time;
|
|
554
|
-
const
|
|
554
|
+
const endItem = originData.find((item: any) => item[0] === target.time)
|
|
555
|
+
const endY = endItem ? endItem[3] : null;
|
|
555
556
|
return [
|
|
556
557
|
{
|
|
557
558
|
coord: [startX, startY],
|