@363045841yyt/klinechart 0.8.1 → 0.8.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 +6 -2
- package/dist/components/KLineAdjustmentDropdown.vue.d.ts +13 -0
- package/dist/components/KLineAdjustmentDropdown.vue.d.ts.map +1 -0
- package/dist/components/KLineChart.vue.d.ts +7 -2
- package/dist/components/KLineChart.vue.d.ts.map +1 -1
- package/dist/components/KLineLevelDropdown.vue.d.ts +1 -1
- package/dist/components/KLineLevelDropdown.vue.d.ts.map +1 -1
- package/dist/components/KLineTooltip.vue.d.ts +6 -0
- package/dist/components/KLineTooltip.vue.d.ts.map +1 -1
- package/dist/components/SymbolSelector.vue.d.ts.map +1 -1
- package/dist/components/TopToolbar.vue.d.ts +3 -0
- package/dist/components/TopToolbar.vue.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +699 -653
- package/dist/web-component.d.ts +2 -1
- package/dist/web-component.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/KLineAdjustmentDropdown.vue +32 -0
- package/src/components/KLineChart.vue +23 -7
- package/src/components/KLineLevelDropdown.vue +2 -0
- package/src/components/KLineTooltip.vue +16 -9
- package/src/components/SymbolSelector.vue +2 -0
- package/src/components/TopToolbar.vue +22 -17
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ English | [简体中文](README_CN.md)
|
|
|
18
18
|
A lightweight financial K-line charting library focused on quantitative trading scenarios. **Agent is a first-class citizen** — supports AI Agent direct control of chart operations, providing TradingView-level interaction experience.
|
|
19
19
|
|
|
20
20
|
<div align="center">
|
|
21
|
-
<img src="https://files.seeusercontent.com/2026/06/
|
|
22
|
-
<img src="https://files.seeusercontent.com/2026/06/
|
|
21
|
+
<img src="https://files.seeusercontent.com/2026/06/14/4Oky/pasted-image-1781448962268.webp" width="400" style="border-radius: 12px; margin: 8px;" />
|
|
22
|
+
<img src="https://files.seeusercontent.com/2026/06/14/7xPd/pasted-image-1781448960220.webp" width="400" style="border-radius: 12px; margin: 8px;" />
|
|
23
23
|
<br/>
|
|
24
24
|
<img src="https://files.seeusercontent.com/2026/06/05/Udw3/white1.png" width="400" style="border-radius: 12px; margin: 8px;" />
|
|
25
25
|
<img src="https://files.seeusercontent.com/2026/06/05/vQg8/white2.png" width="400" style="border-radius: 12px; margin: 8px;" />
|
|
@@ -34,6 +34,8 @@ A lightweight financial K-line charting library focused on quantitative trading
|
|
|
34
34
|
- **High Performance** - Smoothly handles tens of thousands of data points, no lag during zoom or pan; supports **190-200fps on 200Hz displays** with single-frame generation time as low as **2ms**
|
|
35
35
|
- **WebGL Rendering** - K-lines, volume bars, and MACD bars rendered via WebGL for GPU-accelerated performance, reaching **190fps on 200Hz displays** with per-frame GPU time under **1ms**
|
|
36
36
|
- **Optimized Interaction** - Stable zoom anchor, precise crosshair cursor, smooth drag
|
|
37
|
+
- **Multi-Symbol Comparison** - Supports unlimited number of instruments for trend comparison
|
|
38
|
+
- **Multi-Source Aggregation** - Supports aggregation and unification of multiple data sources
|
|
37
39
|
|
|
38
40
|
## 🚀 Quick Start
|
|
39
41
|
|
|
@@ -134,6 +136,8 @@ const config: SemanticChartConfig = {
|
|
|
134
136
|
|
|
135
137
|
## 🚀 What's New
|
|
136
138
|
|
|
139
|
+
- **v0.8** Symbol comparison, multi-source data aggregation
|
|
140
|
+
- **v0.7** Renderer registration chain AOP refactoring with decorator syntax, monorepo split, Vue/React bindings (experimental), standalone core package, tokenized color system
|
|
137
141
|
- **v0.6.10** Unified WebGL rendering context sharing for all panes, plus sub-pane lifecycle refactoring — centralized pane instance management via SubPaneManager with first-class paneId identity
|
|
138
142
|
- **v0.6.6** Comprehensive rendering optimizations: batched price-to-Y calculations, cached tick positions and geometry, optimized month-key operations; achieves stable **190-200fps on 200Hz displays** with frame generation time down to **2ms**
|
|
139
143
|
- **v0.6.3** WebGL rendering for K-lines, volume bars, and MACD bars; significant performance boost across the board
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AdjustType } from '@363045841yyt/klinechart-core/semantic';
|
|
2
|
+
export type KLineAdjustment = AdjustType;
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
modelValue?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
7
|
+
"update:modelValue": (adjust: AdjustType) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((adjust: AdjustType) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=KLineAdjustmentDropdown.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KLineAdjustmentDropdown.vue.d.ts","sourceRoot":"","sources":["../../src/components/KLineAdjustmentDropdown.vue"],"names":[],"mappings":"AAUA;AAoCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AAExE,MAAM,MAAM,eAAe,GAAG,UAAU,CAAA;AASxC,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;AA6DF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SemanticChartConfig, DataFetcher } from '@363045841yyt/klinechart-core/semantic';
|
|
2
2
|
import { SubIndicatorType } from '@363045841yyt/klinechart-core/controllers';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
/**
|
|
5
|
-
semanticConfig
|
|
4
|
+
/** 语义化配置(可选,唯一控制源) */
|
|
5
|
+
semanticConfig?: SemanticChartConfig;
|
|
6
6
|
/** 数据获取函数(必需)。框架不绑定数据源,由使用者注入。 */
|
|
7
7
|
dataFetcher: DataFetcher;
|
|
8
8
|
yPaddingPx?: number;
|
|
@@ -20,6 +20,8 @@ type __VLS_Props = {
|
|
|
20
20
|
initialZoomLevel?: number;
|
|
21
21
|
/** 是否全屏 */
|
|
22
22
|
isFullscreen?: boolean;
|
|
23
|
+
/** 时区,默认 Asia/Shanghai */
|
|
24
|
+
timezone?: string;
|
|
23
25
|
};
|
|
24
26
|
declare function scheduleRender(): void;
|
|
25
27
|
declare function addSubPane(indicatorId?: SubIndicatorType, params?: Record<string, number | boolean | string>): boolean;
|
|
@@ -41,14 +43,17 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
|
41
43
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
42
44
|
toggleFullscreen: () => any;
|
|
43
45
|
kLineLevelChange: (level: string) => any;
|
|
46
|
+
kLineAdjustChange: (adjust: "none" | "qfq" | "hfq" | "splits") => any;
|
|
44
47
|
zoomLevelChange: (level: number, kWidth: number) => any;
|
|
45
48
|
themeChange: (theme: "light" | "dark") => any;
|
|
46
49
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
47
50
|
onToggleFullscreen?: (() => any) | undefined;
|
|
48
51
|
onKLineLevelChange?: ((level: string) => any) | undefined;
|
|
52
|
+
onKLineAdjustChange?: ((adjust: "none" | "qfq" | "hfq" | "splits") => any) | undefined;
|
|
49
53
|
onZoomLevelChange?: ((level: number, kWidth: number) => any) | undefined;
|
|
50
54
|
onThemeChange?: ((theme: "light" | "dark") => any) | undefined;
|
|
51
55
|
}>, {
|
|
56
|
+
timezone: string;
|
|
52
57
|
isFullscreen: boolean;
|
|
53
58
|
yPaddingPx: number;
|
|
54
59
|
minKWidth: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KLineChart.vue.d.ts","sourceRoot":"","sources":["../../src/components/KLineChart.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KLineChart.vue.d.ts","sourceRoot":"","sources":["../../src/components/KLineChart.vue"],"names":[],"mappings":"AAgIA;AAo1CA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,wCAAwC,CAAA;AAM/C,OAAO,EAKL,KAAK,gBAAgB,EAQtB,MAAM,2CAA2C,CAAA;AAkBlD,KAAK,WAAW,GAAG;IACf,sBAAsB;IACtB,cAAc,CAAC,EAAE,mBAAmB,CAAA;IAEpC,kCAAkC;IAClC,WAAW,EAAE,WAAW,CAAA;IAExB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc;IACd,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW;IACX,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;AA4LJ,iBAAS,cAAc,SAEtB;AAuTD,iBAAS,UAAU,CACjB,WAAW,GAAE,gBAA2B,EACxC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,GACjD,OAAO,CAUT;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,iBAAS,gBAAgB,IAAI,IAAI,CAIhC;AAqBD,iBAAS,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAGlF;AA4GD,iBAAS,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,QAE9D;AAywBD,QAAA,MAAM,YAAY;;;;;;;uBAhwBG,MAAM;wBACL,MAAM;;;;;;;;;;;;;;;;cA7pBb,MAAM;kBAFF,OAAO;gBAfT,MAAM;eACP,MAAM;eACN,MAAM;oBAED,MAAM;sBAEJ,MAAM;qBAEP,MAAM;gBAGX,MAAM;sBAEA,MAAM;6EAq6C3B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type KLineLevel = '1min' | '5min' | '15min' | '30min' | '60min' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
|
|
1
|
+
export type KLineLevel = '1min' | '5min' | '15min' | '30min' | '60min' | 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
modelValue?: string;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KLineLevelDropdown.vue.d.ts","sourceRoot":"","sources":["../../src/components/KLineLevelDropdown.vue"],"names":[],"mappings":"AAUA;
|
|
1
|
+
{"version":3,"file":"KLineLevelDropdown.vue.d.ts","sourceRoot":"","sources":["../../src/components/KLineLevelDropdown.vue"],"names":[],"mappings":"AAUA;AAoDA,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,CAAA;AAeZ,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;AA6DF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -27,10 +27,16 @@ type __VLS_Props = {
|
|
|
27
27
|
upColor?: string;
|
|
28
28
|
/** 跌的颜色(默认绿跌) */
|
|
29
29
|
downColor?: string;
|
|
30
|
+
/** 时区,默认 Asia/Shanghai */
|
|
31
|
+
timezone?: string;
|
|
32
|
+
/** 是否显示时分,默认 false */
|
|
33
|
+
showTime?: boolean;
|
|
30
34
|
};
|
|
31
35
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
32
36
|
upColor: string;
|
|
33
37
|
downColor: string;
|
|
38
|
+
timezone: string;
|
|
39
|
+
showTime: boolean;
|
|
34
40
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
35
41
|
declare const _default: typeof __VLS_export;
|
|
36
42
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KLineTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/KLineTooltip.vue"],"names":[],"mappings":"AAiDA;
|
|
1
|
+
{"version":3,"file":"KLineTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/KLineTooltip.vue"],"names":[],"mappings":"AAiDA;AA4NA,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAA;IAC9B,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,eAAe,CAAC,EAAE,cAAc,GAAG,aAAa,CAAA;IAChD,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAA;IAC3C,iBAAiB;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA0PF,QAAA,MAAM,YAAY;aAjQN,MAAM;eAEJ,MAAM;cAEP,MAAM;cAEN,OAAO;6EA8PlB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SymbolSelector.vue.d.ts","sourceRoot":"","sources":["../../src/components/SymbolSelector.vue"],"names":[],"mappings":"AAqGA;
|
|
1
|
+
{"version":3,"file":"SymbolSelector.vue.d.ts","sourceRoot":"","sources":["../../src/components/SymbolSelector.vue"],"names":[],"mappings":"AAqGA;AA+eA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAC;AA0WF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -4,6 +4,7 @@ export type { SymbolItem };
|
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
symbol?: string;
|
|
6
6
|
kLineLevel?: string;
|
|
7
|
+
kLineAdjust?: string;
|
|
7
8
|
symbols?: SymbolItem[];
|
|
8
9
|
symbolLoading?: boolean;
|
|
9
10
|
symbolError?: boolean;
|
|
@@ -15,12 +16,14 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
15
16
|
addOverlaySymbol: (item: SymbolItem) => any;
|
|
16
17
|
removeOverlaySymbol: (code: string) => any;
|
|
17
18
|
kLineLevelChange: (level: KLineLevel) => any;
|
|
19
|
+
kLineAdjustChange: (adjust: import('@363045841yyt/klinechart-core/semantic').AdjustType) => any;
|
|
18
20
|
toggleIndicator: () => any;
|
|
19
21
|
symbolChange: (symbol: SymbolItem) => any;
|
|
20
22
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
23
|
onAddOverlaySymbol?: ((item: SymbolItem) => any) | undefined;
|
|
22
24
|
onRemoveOverlaySymbol?: ((code: string) => any) | undefined;
|
|
23
25
|
onKLineLevelChange?: ((level: KLineLevel) => any) | undefined;
|
|
26
|
+
onKLineAdjustChange?: ((adjust: import('@363045841yyt/klinechart-core/semantic').AdjustType) => any) | undefined;
|
|
24
27
|
onToggleIndicator?: (() => any) | undefined;
|
|
25
28
|
onSymbolChange?: ((symbol: SymbolItem) => any) | undefined;
|
|
26
29
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/TopToolbar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/TopToolbar.vue"],"names":[],"mappings":"AAsCA;AAgLA,OAA2B,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAI9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAC;AAwMF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|