@363045841yyt/klinechart 0.2.11 → 0.2.12

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.
@@ -9,7 +9,7 @@ export interface Indicator {
9
9
  }
10
10
  type __VLS_Props = {
11
11
  activeIndicators?: string[];
12
- indicatorParams?: Record<string, Record<string, number>>;
12
+ indicatorParams?: Record<string, Record<string, unknown>>;
13
13
  };
14
14
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
15
  toggle: (indicatorId: string, active: boolean) => any;
@@ -178,6 +178,12 @@ export declare class Chart {
178
178
  * 获取当前所有副图指标类型
179
179
  */
180
180
  getSubPaneIndicators(): SubIndicatorType[];
181
+ /**
182
+ * 平移价格轴(用于上下拖动)
183
+ * @param paneId 目标 pane ID
184
+ * @param deltaY Y轴像素偏移(正数向下拖动)
185
+ */
186
+ translatePrice(paneId: string, deltaY: number): void;
181
187
  /**
182
188
  * 更新数据并请求重绘
183
189
  * @param data K 线数据数组
@@ -13,6 +13,9 @@ export declare class InteractionController {
13
13
  private isDragging;
14
14
  private dragStartX;
15
15
  private scrollStartX;
16
+ /** 垂直拖动相关 */
17
+ private dragStartY;
18
+ private activePaneIdOnDrag;
16
19
  /** [触屏]:触摸会话标记,避免触摸触发的模拟 mouse 事件干扰 */
17
20
  private isTouchSession;
18
21
  /** 十字线位置 */
@@ -0,0 +1,20 @@
1
+ import { RendererPlugin } from '../../../plugin';
2
+ import { KLineData } from '../../../types/price';
3
+ export interface ENEConfig {
4
+ /** 周期(默认10) */
5
+ period?: number;
6
+ /** 偏离率百分比(默认11) */
7
+ deviation?: number;
8
+ }
9
+ /**
10
+ * 计算指定索引处的 ENE 值(供图例使用)
11
+ */
12
+ export declare function calcENEAtIndex(data: KLineData[], index: number, period?: number, deviation?: number): {
13
+ upper: number;
14
+ middle: number;
15
+ lower: number;
16
+ } | null;
17
+ /**
18
+ * 创建 ENE(轨道线)渲染器插件
19
+ */
20
+ export declare function createENERendererPlugin(initialConfig?: ENEConfig): RendererPlugin;
@@ -0,0 +1,19 @@
1
+ import { RendererPlugin } from '../../../plugin';
2
+ import { KLineData } from '../../../types/price';
3
+ export interface EXPMAConfig {
4
+ /** 快线周期(默认12) */
5
+ fastPeriod?: number;
6
+ /** 慢线周期(默认50) */
7
+ slowPeriod?: number;
8
+ }
9
+ /**
10
+ * 计算指定索引处的 EXPMA 值(供图例使用)
11
+ */
12
+ export declare function calcEXPMAAtIndex(data: KLineData[], index: number, fastPeriod?: number, slowPeriod?: number): {
13
+ fast: number;
14
+ slow: number;
15
+ } | null;
16
+ /**
17
+ * 创建 EXPMA(指数平滑移动平均线)渲染器插件
18
+ */
19
+ export declare function createEXPMARendererPlugin(initialConfig?: EXPMAConfig): RendererPlugin;
@@ -1,8 +1,9 @@
1
1
  import { RendererPlugin } from '../../../plugin';
2
2
  export { createMARendererPlugin, type MAFlags } from './ma';
3
- export { createMALegendRendererPlugin } from './maLegend';
4
3
  export { createBOLLRendererPlugin, calcBOLLAtIndex, type BOLLConfig } from './boll';
5
- export { createBOLLLegendRendererPlugin, type BOLLLegendConfig } from './bollLegend';
4
+ export { createEXPMARendererPlugin, calcEXPMAAtIndex, type EXPMAConfig } from './expma';
5
+ export { createENERendererPlugin, calcENEAtIndex, type ENEConfig } from './ene';
6
+ export { createMainIndicatorLegendRendererPlugin } from './mainIndicatorLegend';
6
7
  export { createMACDRendererPlugin, calcMACDAtIndex, type MACDConfig, type MACDRendererOptions, getMACDTitleInfo } from './macd';
7
8
  export { createMACDLegendRendererPlugin, type MACDLegendOptions } from './macdLegend';
8
9
  export { createRSIRendererPlugin, calcRSIAtIndex, type RSIConfig, type RSIRendererOptions, getRSITitleInfo } from './rsi';
@@ -0,0 +1,10 @@
1
+ import { RendererPlugin } from '../../../plugin';
2
+ /**
3
+ * 创建主图指标图例渲染器插件
4
+ *
5
+ * 统一管理 MA、BOLL 等主图指标的图例显示,支持多行排列
6
+ * 通过 setConfig 更新指标状态,不依赖事件系统
7
+ */
8
+ export declare function createMainIndicatorLegendRendererPlugin(options: {
9
+ yPaddingPx: number;
10
+ }): RendererPlugin;
@@ -8,12 +8,33 @@ export declare class PriceScale {
8
8
  private height;
9
9
  private paddingTop;
10
10
  private paddingBottom;
11
+ /** 价格偏移量(用于上下拖动平移价格轴) */
12
+ private priceOffset;
11
13
  setRange(r: PriceRange): void;
12
14
  setHeight(h: number): void;
13
15
  setPadding(top: number, bottom: number): void;
14
16
  getRange(): PriceRange;
15
17
  getPaddingTop(): number;
16
18
  getPaddingBottom(): number;
19
+ /**
20
+ * 设置价格偏移量
21
+ * @param offset 价格偏移(正数向上平移,负数向下平移)
22
+ */
23
+ setPriceOffset(offset: number): void;
24
+ /**
25
+ * 获取当前价格偏移量
26
+ */
27
+ getPriceOffset(): number;
28
+ /**
29
+ * 重置价格偏移量
30
+ */
31
+ resetPriceOffset(): void;
17
32
  priceToY(price: number): number;
18
33
  yToPrice(y: number): number;
34
+ /**
35
+ * 根据像素偏移计算价格偏移
36
+ * @param deltaY Y轴像素偏移(正数向下拖动)
37
+ * @returns 对应的价格偏移量
38
+ */
39
+ deltaYToPriceOffset(deltaY: number): number;
19
40
  }
@@ -179,6 +179,28 @@ export declare const KST_COLORS: {
179
179
  readonly KST: "rgba(69, 112, 249, 1)";
180
180
  readonly SIGNAL: "rgba(255, 152, 0, 1)";
181
181
  };
182
+ /**
183
+ * EXPMA 颜色
184
+ */
185
+ export declare const EXPMA_COLORS: {
186
+ /** 快线颜色(黄色) */
187
+ readonly FAST: "#FFD700";
188
+ /** 慢线颜色(蓝色) */
189
+ readonly SLOW: "rgba(69, 112, 249, 1)";
190
+ };
191
+ /**
192
+ * ENE 轨道线颜色
193
+ */
194
+ export declare const ENE_COLORS: {
195
+ /** 上轨颜色(红色) */
196
+ readonly UPPER: "rgba(214, 10, 34, 1)";
197
+ /** 中轨颜色(蓝色) */
198
+ readonly MIDDLE: "rgba(69, 112, 249, 1)";
199
+ /** 下轨颜色(绿色) */
200
+ readonly LOWER: "rgba(3, 123, 102, 1)";
201
+ /** 带状区域填充 */
202
+ readonly BAND_FILL: "rgba(69, 112, 249, 0.08)";
203
+ };
182
204
  /**
183
205
  * 十字线颜色
184
206
  */