kline-charts-react 0.0.1 → 0.0.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/README.md +65 -23
- package/dist/components/IndicatorDisplay/IndicatorDisplay.d.ts +3 -2
- package/dist/index.cjs +7 -51
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1627 -25707
- package/dist/index.umd.js +7 -51
- package/dist/types/theme.d.ts +4 -0
- package/dist/utils/optionBuilder.d.ts +20 -1
- package/package.json +8 -4
package/dist/types/theme.d.ts
CHANGED
|
@@ -32,6 +32,10 @@ export interface ThemeConfig {
|
|
|
32
32
|
areaColor: string;
|
|
33
33
|
/** 选中高亮色 */
|
|
34
34
|
activeColor: string;
|
|
35
|
+
/** BOLL 指标颜色 [上轨, 中轨, 下轨] */
|
|
36
|
+
bollColors: [string, string, string];
|
|
37
|
+
/** KC 指标颜色 [上轨, 中轨, 下轨] */
|
|
38
|
+
kcColors: [string, string, string];
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* 浅色主题
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
|
-
import { KlineWithIndicators, ThemeConfig, IndicatorType, PaneConfig } from '../types';
|
|
2
|
+
import { KlineWithIndicators, ThemeConfig, IndicatorType, PaneConfig, IndicatorOptions } from '../types';
|
|
3
3
|
export declare const DATA_ZOOM_INSIDE_ID = "kline-zoom-inside";
|
|
4
4
|
export declare const DATA_ZOOM_SLIDER_ID = "kline-zoom-slider";
|
|
5
5
|
/**
|
|
@@ -14,6 +14,24 @@ interface GetDefaultPanesOptions {
|
|
|
14
14
|
* 每个副图指标独立一个面板
|
|
15
15
|
*/
|
|
16
16
|
export declare function getDefaultPanes(indicators: IndicatorType[], options?: GetDefaultPanesOptions): PaneConfig[];
|
|
17
|
+
/** 布局常量 */
|
|
18
|
+
export declare const LAYOUT: {
|
|
19
|
+
readonly gap: 25;
|
|
20
|
+
readonly topMargin: 50;
|
|
21
|
+
readonly bottomMargin: 55;
|
|
22
|
+
readonly leftMargin: 60;
|
|
23
|
+
readonly rightMargin: 60;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 计算 Grid 布局
|
|
27
|
+
*/
|
|
28
|
+
export declare function calculateGridLayout(panes: PaneConfig[], containerHeight: number): {
|
|
29
|
+
id: string;
|
|
30
|
+
left: number;
|
|
31
|
+
right: number;
|
|
32
|
+
top: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}[];
|
|
17
35
|
/**
|
|
18
36
|
* 构建 ECharts Option
|
|
19
37
|
*/
|
|
@@ -24,6 +42,7 @@ export declare function buildOption(params: {
|
|
|
24
42
|
panes?: PaneConfig[];
|
|
25
43
|
visibleCount?: number;
|
|
26
44
|
containerHeight?: number;
|
|
45
|
+
indicatorOptions?: IndicatorOptions;
|
|
27
46
|
}): EChartsOption;
|
|
28
47
|
/**
|
|
29
48
|
* 合并 ECharts Option
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kline-charts-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Professional stock K-line chart React component with built-in data source, powered by ECharts and stock-sdk",
|
|
5
5
|
"author": "chengzuopeng",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
|
-
"README.md"
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
22
23
|
],
|
|
23
24
|
"sideEffects": [
|
|
24
25
|
"*.css"
|
|
@@ -34,7 +35,8 @@
|
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
37
|
"react": ">=17.0.0",
|
|
37
|
-
"react-dom": ">=17.0.0"
|
|
38
|
+
"react-dom": ">=17.0.0",
|
|
39
|
+
"echarts": ">=5.4.0"
|
|
38
40
|
},
|
|
39
41
|
"peerDependenciesMeta": {
|
|
40
42
|
"react": {
|
|
@@ -42,10 +44,12 @@
|
|
|
42
44
|
},
|
|
43
45
|
"react-dom": {
|
|
44
46
|
"optional": false
|
|
47
|
+
},
|
|
48
|
+
"echarts": {
|
|
49
|
+
"optional": false
|
|
45
50
|
}
|
|
46
51
|
},
|
|
47
52
|
"dependencies": {
|
|
48
|
-
"echarts": "^5.5.0",
|
|
49
53
|
"stock-sdk": "^1.6.1"
|
|
50
54
|
},
|
|
51
55
|
"devDependencies": {
|