st-comp 0.0.37 → 0.0.38
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 +3594 -3586
- package/lib/bundle.umd.cjs +38 -38
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/Kline/index.vue +7 -0
- package/packages/Kline/option.ts +2 -1
- package/packages/Kline/type.d.ts +1 -0
package/package.json
CHANGED
package/packages/Kline/index.vue
CHANGED
|
@@ -78,6 +78,7 @@ const defaultConfig: InConfig = {
|
|
|
78
78
|
totalBarCount: 2000,
|
|
79
79
|
defaultShowBarCount: 200,
|
|
80
80
|
preBarCount: 800,
|
|
81
|
+
maxValueSpan: 10000,
|
|
81
82
|
gridLeft: 60,
|
|
82
83
|
gridTop: 0,
|
|
83
84
|
gridRight: 60,
|
|
@@ -295,6 +296,7 @@ const draw = async (type?: string) => {
|
|
|
295
296
|
type: "inside",
|
|
296
297
|
xAxisIndex: [0, 0],
|
|
297
298
|
zoomLock: config.value.zoomLock,
|
|
299
|
+
maxValueSpan: config.value.maxValueSpan,
|
|
298
300
|
startValue: chartOption.dataZoom[0].startValue + addDataLength,
|
|
299
301
|
endValue: chartOption.dataZoom[0].endValue + addDataLength,
|
|
300
302
|
},
|
|
@@ -506,6 +508,7 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
506
508
|
type: "dataZoom",
|
|
507
509
|
startValue,
|
|
508
510
|
endValue,
|
|
511
|
+
maxValueSpan: config.value.maxValueSpan,
|
|
509
512
|
});
|
|
510
513
|
};
|
|
511
514
|
const handleRight = () => {
|
|
@@ -518,6 +521,7 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
518
521
|
type: "dataZoom",
|
|
519
522
|
startValue,
|
|
520
523
|
endValue,
|
|
524
|
+
maxValueSpan: config.value.maxValueSpan,
|
|
521
525
|
});
|
|
522
526
|
} else {
|
|
523
527
|
if (endValue === option.xAxis[0].data.length - 1) {
|
|
@@ -529,6 +533,7 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
529
533
|
type: "dataZoom",
|
|
530
534
|
startValue,
|
|
531
535
|
endValue,
|
|
536
|
+
maxValueSpan: config.value.maxValueSpan,
|
|
532
537
|
});
|
|
533
538
|
}
|
|
534
539
|
};
|
|
@@ -547,6 +552,7 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
547
552
|
startValue,
|
|
548
553
|
endValue,
|
|
549
554
|
actionIsWheel: true, // 标记为缩放
|
|
555
|
+
maxValueSpan: config.value.maxValueSpan,
|
|
550
556
|
});
|
|
551
557
|
};
|
|
552
558
|
const handleDown = () => {
|
|
@@ -559,6 +565,7 @@ const keyDownEvent = (e: KeyboardEvent) => {
|
|
|
559
565
|
start,
|
|
560
566
|
end,
|
|
561
567
|
actionIsWheel: true, // 标记为缩放
|
|
568
|
+
maxValueSpan: config.value.maxValueSpan,
|
|
562
569
|
});
|
|
563
570
|
};
|
|
564
571
|
const callBackMap = new Map([
|
package/packages/Kline/option.ts
CHANGED
|
@@ -28,7 +28,7 @@ export const getOption = async (
|
|
|
28
28
|
config: InConfig,
|
|
29
29
|
netPositionData: any
|
|
30
30
|
) => {
|
|
31
|
-
const { totalBarCount, defaultShowBarCount, gridLeft, gridTop, gridRight, gridBottom, zoomLock } = config;
|
|
31
|
+
const { totalBarCount, defaultShowBarCount, maxValueSpan, gridLeft, gridTop, gridRight, gridBottom, zoomLock } = config;
|
|
32
32
|
/**
|
|
33
33
|
* @todo: 1.数据处理
|
|
34
34
|
* @returns {Array<'YYYY-MM-DD HH:mm:ss'>} time 用于X轴的时间数组
|
|
@@ -186,6 +186,7 @@ export const getOption = async (
|
|
|
186
186
|
type: "inside",
|
|
187
187
|
xAxisIndex: [0, 0],
|
|
188
188
|
zoomLock,
|
|
189
|
+
maxValueSpan,
|
|
189
190
|
start: kLine.length >= defaultShowBarCount ? ((kLine.length - defaultShowBarCount) / kLine.length) * 100 : 0,
|
|
190
191
|
end: 99.99,
|
|
191
192
|
// startValue: kLine.length >= defaultShowBarCount ? kLine.length - defaultShowBarCount : 0,
|
package/packages/Kline/type.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface InConfig {
|
|
|
19
19
|
totalBarCount: number // k线总条数
|
|
20
20
|
defaultShowBarCount: number // k线默认展示条数
|
|
21
21
|
preBarCount: number // k线预加载条数,用于计算指标线
|
|
22
|
+
maxValueSpan: number // k线一屏最大数量
|
|
22
23
|
gridLeft: number // k线组件 grid.left
|
|
23
24
|
gridTop: number // k线组件 grid.top
|
|
24
25
|
gridRight: number // k线组件 grid.right
|