@363045841yyt/klinechart 0.3.0 → 0.4.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 +15 -0
- package/dist/index.cjs +9 -9
- package/dist/index.js +1250 -1095
- package/dist/klinechart.css +1 -1
- package/dist/src/core/chart.d.ts +14 -4
- package/dist/src/core/renderers/Indicator/macd.d.ts +12 -2
- package/dist/src/core/renderers/Indicator/scale/macd_scale.d.ts +8 -0
- package/dist/src/core/utils/tickCount.d.ts +3 -2
- package/dist/src/plugin/PluginHost.d.ts +7 -1
- package/dist/src/plugin/StateStore.d.ts +37 -0
- package/dist/src/plugin/stateKeys.d.ts +6 -0
- package/dist/src/plugin/types.d.ts +26 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
这是一个基于 Canvas 的金融图表绘制库,提供 Vue 组件封装。专注于高性能 K 线图渲染,支持**语义化 JSON 配置**,便于 AI Agent 直接控制图表渲染。特性包括横向滚动、多种技术指标(MA/BOLL/MACD/RSI 等)、自定义标记标注、多数据源支持(BaoStock、东方财富)。
|
|
6
6
|
|
|
7
|
+
## 重要更新:渲染链路已重构为 ResizeObserver 单链路
|
|
8
|
+
|
|
9
|
+
当前版本已完成 Canvas 尺寸与 DPR 处理链路重构,核心变化如下:
|
|
10
|
+
|
|
11
|
+
- 尺寸与 DPR 统一由 `Chart` 内部 `ResizeObserver` 维护(单一真源)
|
|
12
|
+
- 优先使用 `devicePixelContentBoxSize` 获取精确 DPR,回退 `window.devicePixelRatio`
|
|
13
|
+
- `canvas.width/height` 始终按 `逻辑尺寸 × 当前 DPR` 设置,绘制前统一 `ctx.scale(dpr, dpr)`
|
|
14
|
+
- 交互命中边界与渲染 viewport 对齐,减少缩放/跨屏后的坐标漂移
|
|
15
|
+
- Vue 组件层移除重复 resize observer,避免双链路竞争
|
|
16
|
+
|
|
17
|
+
这次重构的目标是:在浏览器缩放、跨屏拖动、容器 resize 等场景下保持持续清晰绘制。
|
|
18
|
+
|
|
19
|
+
详细说明见:[架构文档(ResizeObserver 重构版)](./docs/architecture.md)
|
|
20
|
+
|
|
7
21
|

|
|
8
22
|

|
|
9
23
|

|
|
@@ -235,6 +249,7 @@ pnpm preview # 预览生产包
|
|
|
235
249
|
- [Canvas API MDN 文档](https://developer.mozilla.org/zh-CN/docs/Web/API/Canvas_API)
|
|
236
250
|
- [Vitest 官方文档](https://vitest.dev/)
|
|
237
251
|
- [语义化配置文档](./docs/semantic-config.md) - Agent JSON 配置说明
|
|
252
|
+
- [架构文档(ResizeObserver 重构版)](./docs/architecture.md)
|
|
238
253
|
|
|
239
254
|
## 许可证
|
|
240
255
|
|