@363045841yyt/klinechart 0.4.5 → 0.5.0-alpha.0

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
@@ -2,8 +2,8 @@
2
2
 
3
3
  [English](README_EN.md) | 简体中文
4
4
 
5
- 这是一个基于 Canvas 的金融图表绘制库,提供 Vue 组件封装。专注于高性能 K 线图渲染,支持**语义化 JSON 配置**,便于 AI Agent 直接控制图表渲染。特性包括横向滚动、多种技术指标(MA/BOLL/MACD/RSI 等)、自定义标记标注、多数据源支持(BaoStock、东方财富)。
6
-
5
+ 这是一个基于 Canvas 的金融图表绘制库,提供 Vue 组件封装。专注于高性能 K 线图渲染,支持**语义化 JSON 配置**,便于 AI Agent 直接控制图表渲染。特性包括横向滚动、多种技术指标(MA/BOLL/MACD/RSI 等)、自定义标记标注、多数据源支持(BaoStock、东方财富)。
6
+
7
7
  [NPM](https://www.npmjs.com/package/@363045841yyt/klinechart) | [GitHub](https://github.com/363045841/KLineChartQuant)
8
8
 
9
9
  ## 功能特性
@@ -16,10 +16,12 @@
16
16
  - **框架无关**:核心逻辑完全独立,不依赖特定框架
17
17
  - **插件化架构**:渲染器插件支持动态注册、配置和生命周期管理
18
18
  - **量价关系标注**:自动识别并标注量价齐升、量价背离、量增价跌、量缩价跌四种形态
19
+ - **绘图工具**(v0.5 预览):支持基础线条绘制,包括趋势线(线段、射线、延长线)、水平线/垂直线/十字线、信息线、平行通道和线性回归通道。v0.5 版本将完善绘图交互与编辑能力
19
20
 
20
21
  ![pasted-image-1778063749574.webp](https://files.seeusercontent.com/2026/05/06/2Udv/pasted-image-1778063749574.webp)
21
22
  ![pasted-image-1778063691961.webp](https://files.seeusercontent.com/2026/05/06/q1Cq/pasted-image-1778063691961.webp)
22
23
  ![pasted-image-1778063638151.webp](https://files.seeusercontent.com/2026/05/06/uv3R/pasted-image-1778063638151.webp)
24
+ ![pasted-image-1778256491407.webp](https://files.seeusercontent.com/2026/05/08/1Nkp/pasted-image-1778256491407.webp)
23
25
 
24
26
  ### Agent 语义化控制
25
27
 
@@ -46,9 +48,13 @@ src/
46
48
  ├── components/ # Vue 组件
47
49
  │ ├── KLineChart.vue # K 线图主组件
48
50
  │ ├── IndicatorSelector.vue # 指标选择器
49
- └── IndicatorParams.vue # 指标参数编辑
51
+ ├── IndicatorParams.vue # 指标参数编辑
52
+ │ └── LeftToolbar.vue # 左侧绘图工具栏
50
53
  ├── core/ # 核心渲染引擎
51
54
  │ ├── chart.ts # 图表控制器
55
+ │ ├── drawing/ # 绘图系统
56
+ │ │ ├── index.ts # DrawingStore、定义注册、图元渲染器
57
+ │ │ └── plugin.ts # 绘图渲染器插件
52
58
  │ ├── renderers/ # 渲染器插件
53
59
  │ │ ├── candle.ts # K 线渲染器
54
60
  │ │ ├── ma.ts # MA 均线渲染器
@@ -210,14 +216,14 @@ uv run python -m aktools # 启动服务
210
216
  | 属性 | 类型 | 默认值 | 说明 |
211
217
  |------|------|--------|------|
212
218
  | semanticConfig | SemanticChartConfig | - | **必需**。语义化配置(唯一控制源) |
213
- | kWidth | number | 10 | K 线实体宽度 |
214
- | kGap | number | 2 | K 线间距 |
215
219
  | yPaddingPx | number | 0 | Y 轴上下留白像素 |
216
220
  | minKWidth | number | 2 | K 线最小宽度 |
217
221
  | maxKWidth | number | 50 | K 线最大宽度 |
218
222
  | rightAxisWidth | number | 0 | 右侧价格轴宽度 |
219
223
  | bottomAxisHeight | number | 24 | 底部时间轴高度 |
220
224
  | priceLabelWidth | number | 60 | 价格标签额外宽度(用于显示涨跌幅) |
225
+ | zoomLevels | number | 20 | 缩放级别数量 |
226
+ | initialZoomLevel | number | 3 | 初始缩放级别(1 ~ zoomLevels) |
221
227
 
222
228
  ## 环境要求
223
229