@363045841yyt/klinechart 0.7.4 → 0.7.5-alpha.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 CHANGED
@@ -1,153 +1,149 @@
1
- High-performance financial chart library with a single-frame generation time of just 2ms, stable scrolling at 190�?00fps in a 200Hz environment, native support for AI Agent control, full-link ResizeObserver-driven crisp rendering, and a pluggable architecture.
2
- <div align="center">
3
-
4
- English | [简体中文](README_CN.md)
5
-
6
- # 📈 KLineChartQuant
7
-
8
- **Crisp Rendering · High Performance · Optimized Interaction**
9
-
10
- [![npm version](https://img.shields.io/npm/v/@363045841yyt/klinechart.svg?style=flat&color=blue)](https://www.npmjs.com/package/@363045841yyt/klinechart) [![npm downloads](https://img.shields.io/npm/dm/@363045841yyt/klinechart.svg?style=flat&color=green)](https://www.npmjs.com/package/@363045841yyt/klinechart) [![license](https://img.shields.io/npm/l/@363045841yyt/klinechart.svg?style=flat&color=orange)](https://github.com/363045841/klinechart/blob/main/LICENSE) [![demo](https://img.shields.io/badge/Demo-Online-purple?style=flat)](https://363045841.github.io/KLineChartQuant/)
11
-
12
- [![qq](https://img.shields.io/badge/QQ-672011965-blue?style=flat)](https://qm.qq.com/q/672011965) [![tg](https://img.shields.io/badge/Telegram-Join-26A5E4?style=flat&logo=telegram)](https://t.me/+1o-6B-wVRTU2MjQ9)
13
-
14
- </div>
15
-
16
- ---
17
-
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
-
20
- <div align="center">
21
- <img src="https://files.seeusercontent.com/2026/05/18/7Zjf/pasted-image-1779120668142.webp" width="400" style="border-radius: 12px; margin: 8px;" />
22
- <img src="https://files.seeusercontent.com/2026/05/18/cAw4/pasted-image-1779120665492.webp" width="400" style="border-radius: 12px; margin: 8px;" />
23
- <br/>
24
- <img src="https://files.seeusercontent.com/2026/05/18/Xwq2/pasted-image-1779120662730.webp" width="400" style="border-radius: 12px; margin: 8px;" />
25
- <img src="https://files.seeusercontent.com/2026/05/18/Lb5p/7MNQT2E_2X1UL3626R.png" width="400" style="border-radius: 12px; margin: 8px;" />
26
- </div>
27
-
28
- ## �?Core Features
29
-
30
- - **Agent First** - Supports AI Agent direct control of charts, zoom, pan, and draw operations can all be called programmatically
31
- - **Crisp Rendering** - Full-chain ResizeObserver driven, physical pixel alignment, K-lines, wicks, and lines are sharp and clear on all DPR screens
32
- - **Plugin Architecture** - Renderer plugin-based design, supporting dynamic registration, configuration, and lifecycle management
33
- - **Custom Markers** - Supports semantic configuration of custom markers and custom information
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
- - **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
- - **Optimized Interaction** - Stable zoom anchor, precise crosshair cursor, smooth drag
37
-
38
- ## 🚀 Quick Start
39
-
40
- ### Prerequisites
41
-
42
- KLineChart requires a stock data backend. Please ensure `kmap` and `stockbao` are in the same directory:
43
-
44
- ```
45
- workspace/
46
- ├── KLineChartQuant/ # This repository
47
- └── stockbao/ # Data backend repository
48
- ```
49
-
50
- ### 1. Clone Repositories
51
-
52
- ```bash
53
- git clone https://github.com/363045841/KLineChartQuant.git
54
- git clone https://github.com/363045841/stockbao.git
55
- ```
56
-
57
- ### 2. Start Data Backend
58
-
59
- ```bash
60
- cd KLineChartQuant
61
- npm run stockbao
62
- ```
63
-
64
- After startup, the API is available at `http://localhost:8000`
65
-
66
- ### 3. Install and Use
67
-
68
- ```bash
69
- npm install @363045841yyt/klinechart
70
- ```
71
-
72
- ```vue
73
- <script setup lang="ts">
74
- import KLineChart from '@363045841yyt/klinechart';
75
- import type { SemanticChartConfig } from '@363045841yyt/klinechart';
76
-
77
- const config: SemanticChartConfig = {
78
- version: '1.0.0',
79
- data: {
80
- source: 'baostock',
81
- code: 'sh.000001',
82
- startDate: '2024-01-01',
83
- endDate: '2024-12-31',
84
- frequency: 'day'
85
- },
86
- indicators: {
87
- main: [{ type: 'MA', params: [5, 10, 20] }],
88
- sub: [{ type: 'MACD' }]
89
- }
90
- };
91
- </script>
92
-
93
- <template>
94
- <KLineChart
95
- :semanticConfig="config"
96
- :yPaddingPx="24"
97
- />
98
- </template>
99
- ```
100
-
101
- ## 📖 More Documentation
102
-
103
- - [Rendering Engine Architecture](./docs/rendering-engine-architecture.md) - Core rendering pipeline and physical pixel alignment mechanism
104
- - [Plugin System](./docs/PLUGIN_SYSTEM.md) - Extension mechanism and custom development
105
- - [Renderer Development Guide](./docs/renderer-development-guide.md) - Custom renderer development
106
-
107
- ## 📋 Component Props
108
-
109
- | Prop | Type | Default | Description |
110
- |------|------|---------|-------------|
111
- | semanticConfig | `SemanticChartConfig` | **required** | Semantic configuration, the only control source for chart data and indicators |
112
- | yPaddingPx | `number` | 0 | Y-axis padding in pixels |
113
- | minKWidth | `number` | 2 | Minimum K-line width (logical pixels) |
114
- | maxKWidth | `number` | 50 | Maximum K-line width (logical pixels) |
115
- | rightAxisWidth | `number` | 0 | Right price axis width |
116
- | bottomAxisHeight | `number` | 24 | Bottom time axis height |
117
- | priceLabelWidth | `number` | 60 | Price label extra width for showing change percentage |
118
- | zoomLevels | `number` | 20 | Total number of zoom levels |
119
- | initialZoomLevel | `number` | 3 | Initial zoom level (1 ~ zoomLevels) |
120
-
121
- ## 🗺�?Roadmap
122
-
123
- - [x] K-line zoom anchor stability, improved zoom feel
124
- - [x] Right axis detached from scroll container, completely solving clipping issues
125
- - [x] Blank area drawing support
126
- - [x] Limit vertical pan range to prevent viewport from leaving data
127
- - [x] Drawing system
128
- - [x] Right axis zoom
129
- - [x] Latest price line and right axis label style optimization
130
- - [x] Area primitive tools and rendering
131
- - [x] **Monorepo + Multi-Framework Support** �?Split into `@363045841yyt/klinechart-core`, `@363045841yyt/klinechart`, `@363045841yyt/klinechart-react`, `@363045841yyt/klinechart-angular`
132
- - [ ] React bindings package (`@363045841yyt/klinechart-react`)
133
- - [ ] Angular bindings package (`@363045841yyt/klinechart-angular`)
134
- - [ ] More advanced drawing tools
135
- - [ ] Support for minute, multi-day, monthly, and yearly K-line display
136
- - [ ] Support convert the drawing to quant code
137
-
138
- ## 🚀 What's New
139
-
140
- - **v0.7.0** **Monorepo Refactor + Multi-Framework Support** �?Core engine extracted into `@363045841yyt/klinechart-core`; Vue bindings moved to `@363045841yyt/klinechart`; React and Angular packages scaffolded. Framework-agnostic design with injectable data fetcher (`__setDataFetcher`) and semantic configuration support
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
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**
143
- - **v0.6.3** WebGL rendering for K-lines, volume bars, and MACD bars; significant performance boost across the board
144
- - **v0.6.1** Dual-layer canvas architecture: Main + Overlay separation with UpdateLevel filtering, achieves stable **180fps with low jitter on 200Hz displays**
145
- - **v0.6.0** Stateless indicator pipeline: MA/BOLL/EXPMA/ENE/RSI/CCI/STOCH/MOM/WMSR/KST/FASTK now use unified Calculator �?Scheduler �?StateStore �?Renderer architecture for better performance and maintainability
146
- - **v0.5.6** Logarithmic price axis with evenly distributed grid lines at pixel level
147
- - **v0.5.2** Advanced drawing tools: parallel channel, regression channel, smooth top/bottom, and non-intersecting channel
148
- - **v0.5.0** Complete drawing tool system, supporting line, rectangle, text drawing and style editing
149
- - **v0.4** Modern UI, left toolbar, right axis optimization, TradingView-style zoom feel
150
-
151
- ## 📄 License
152
-
153
- [MIT](LICENSE)
1
+ High-performance financial chart library with a single-frame generation time of just 2ms, stable scrolling at 190–200fps in a 200Hz environment, native support for AI Agent control, full-link ResizeObserver-driven crisp rendering, and a pluggable architecture.
2
+ <div align="center">
3
+
4
+ English | [简体中文](README_CN.md)
5
+
6
+ # 📈 KLineChartQuant
7
+
8
+ **Crisp Rendering · High Performance · Optimized Interaction**
9
+
10
+ [![npm version](https://img.shields.io/npm/v/@363045841yyt/klinechart.svg?style=flat&color=blue)](https://www.npmjs.com/package/@363045841yyt/klinechart) [![npm downloads](https://img.shields.io/npm/dm/@363045841yyt/klinechart.svg?style=flat&color=green)](https://www.npmjs.com/package/@363045841yyt/klinechart) [![license](https://img.shields.io/npm/l/@363045841yyt/klinechart.svg?style=flat&color=orange)](https://github.com/363045841/klinechart/blob/main/LICENSE) [![demo](https://img.shields.io/badge/Demo-Online-purple?style=flat)](https://363045841.github.io/KLineChartQuant/)
11
+
12
+ [![qq](https://img.shields.io/badge/QQ-672011965-blue?style=flat)](https://qm.qq.com/q/672011965) [![tg](https://img.shields.io/badge/Telegram-Join-26A5E4?style=flat&logo=telegram)](https://t.me/+1o-6B-wVRTU2MjQ9)
13
+
14
+ </div>
15
+
16
+ ---
17
+
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
+
20
+ <div align="center">
21
+ <img src="https://files.seeusercontent.com/2026/05/18/7Zjf/pasted-image-1779120668142.webp" width="400" style="border-radius: 12px; margin: 8px;" />
22
+ <img src="https://files.seeusercontent.com/2026/05/18/cAw4/pasted-image-1779120665492.webp" width="400" style="border-radius: 12px; margin: 8px;" />
23
+ <br/>
24
+ <img src="https://files.seeusercontent.com/2026/05/18/Xwq2/pasted-image-1779120662730.webp" width="400" style="border-radius: 12px; margin: 8px;" />
25
+ <img src="https://files.seeusercontent.com/2026/05/18/Lb5p/7MNQT2E_2X1UL3626R.png" width="400" style="border-radius: 12px; margin: 8px;" />
26
+ </div>
27
+
28
+ ## Core Features
29
+
30
+ - **Agent First** - Supports AI Agent direct control of charts, zoom, pan, and draw operations can all be called programmatically
31
+ - **Crisp Rendering** - Full-chain ResizeObserver driven, physical pixel alignment, K-lines, wicks, and lines are sharp and clear on all DPR screens
32
+ - **Plugin Architecture** - Renderer plugin-based design, supporting dynamic registration, configuration, and lifecycle management
33
+ - **Custom Markers** - Supports semantic configuration of custom markers and custom information
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
+ - **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
+ - **Optimized Interaction** - Stable zoom anchor, precise crosshair cursor, smooth drag
37
+
38
+ ## 🚀 Quick Start
39
+
40
+ ### Prerequisites
41
+
42
+ KLineChart requires a stock data backend. Please ensure `kmap` and `stockbao` are in the same directory:
43
+
44
+ ```
45
+ workspace/
46
+ ├── KLineChartQuant/ # This repository
47
+ └── stockbao/ # Data backend repository
48
+ ```
49
+
50
+ ### 1. Clone Repositories
51
+
52
+ ```bash
53
+ git clone https://github.com/363045841/KLineChartQuant.git
54
+ git clone https://github.com/363045841/stockbao.git
55
+ ```
56
+
57
+ ### 2. Start Data Backend
58
+
59
+ ```bash
60
+ cd KLineChartQuant
61
+ npm run stockbao
62
+ ```
63
+
64
+ After startup, the API is available at `http://localhost:8000`
65
+
66
+ ### 3. Install and Use
67
+
68
+ ```bash
69
+ npm install @363045841yyt/klinechart
70
+ ```
71
+
72
+ ```vue
73
+ <script setup lang="ts">
74
+ import KLineChart from '@363045841yyt/klinechart';
75
+ import type { SemanticChartConfig } from '@363045841yyt/klinechart';
76
+
77
+ const config: SemanticChartConfig = {
78
+ version: '1.0.0',
79
+ data: {
80
+ source: 'baostock',
81
+ code: 'sh.000001',
82
+ startDate: '2024-01-01',
83
+ endDate: '2024-12-31',
84
+ frequency: 'day'
85
+ },
86
+ indicators: {
87
+ main: [{ type: 'MA', params: [5, 10, 20] }],
88
+ sub: [{ type: 'MACD' }]
89
+ }
90
+ };
91
+ </script>
92
+
93
+ <template>
94
+ <KLineChart
95
+ :semanticConfig="config"
96
+ :yPaddingPx="24"
97
+ />
98
+ </template>
99
+ ```
100
+
101
+ ## 📖 More Documentation
102
+
103
+ - [Rendering Engine Architecture](./docs/rendering-engine-architecture.md) - Core rendering pipeline and physical pixel alignment mechanism
104
+ - [Plugin System](./docs/PLUGIN_SYSTEM.md) - Extension mechanism and custom development
105
+ - [Renderer Development Guide](./docs/renderer-development-guide.md) - Custom renderer development
106
+
107
+ ## 📋 Component Props
108
+
109
+ | Prop | Type | Default | Description |
110
+ |------|------|---------|-------------|
111
+ | semanticConfig | `SemanticChartConfig` | **required** | Semantic configuration, the only control source for chart data and indicators |
112
+ | yPaddingPx | `number` | 0 | Y-axis padding in pixels |
113
+ | minKWidth | `number` | 2 | Minimum K-line width (logical pixels) |
114
+ | maxKWidth | `number` | 50 | Maximum K-line width (logical pixels) |
115
+ | rightAxisWidth | `number` | 0 | Right price axis width |
116
+ | bottomAxisHeight | `number` | 24 | Bottom time axis height |
117
+ | priceLabelWidth | `number` | 60 | Price label extra width for showing change percentage |
118
+ | zoomLevels | `number` | 20 | Total number of zoom levels |
119
+ | initialZoomLevel | `number` | 3 | Initial zoom level (1 ~ zoomLevels) |
120
+
121
+ ## 🗺️ Roadmap
122
+
123
+ - [x] K-line zoom anchor stability, improved zoom feel
124
+ - [x] Right axis detached from scroll container, completely solving clipping issues
125
+ - [x] Blank area drawing support
126
+ - [x] Limit vertical pan range to prevent viewport from leaving data
127
+ - [x] Drawing system
128
+ - [x] Right axis zoom
129
+ - [x] Latest price line and right axis label style optimization
130
+ - [x] Area primitive tools and rendering
131
+ - [ ] More advanced drawing tools
132
+ - [ ] Support for minute, multi-day, monthly, and yearly K-line display
133
+ - [ ] Support convert the drawing to quant code
134
+
135
+ ## 🚀 What's New
136
+
137
+ - **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
+ - **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
+ - **v0.6.3** WebGL rendering for K-lines, volume bars, and MACD bars; significant performance boost across the board
140
+ - **v0.6.1** Dual-layer canvas architecture: Main + Overlay separation with UpdateLevel filtering, achieves stable **180fps with low jitter on 200Hz displays**
141
+ - **v0.6.0** Stateless indicator pipeline: MA/BOLL/EXPMA/ENE/RSI/CCI/STOCH/MOM/WMSR/KST/FASTK now use unified Calculator Scheduler StateStore Renderer architecture for better performance and maintainability
142
+ - **v0.5.6** Logarithmic price axis with evenly distributed grid lines at pixel level
143
+ - **v0.5.2** Advanced drawing tools: parallel channel, regression channel, smooth top/bottom, and non-intersecting channel
144
+ - **v0.5.0** Complete drawing tool system, supporting line, rectangle, text drawing and style editing
145
+ - **v0.4** Modern UI, left toolbar, right axis optimization, TradingView-style zoom feel
146
+
147
+ ## 📄 License
148
+
149
+ [MIT](LICENSE)