candleview 2.9.1 → 2.9.3

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,10 +1,9 @@
1
1
  <p align="center">
2
- <table align="center" border="0" cellpadding="0" cellspacing="0" style="border: none !important; border-collapse: collapse !important;">
3
- <tr style="border: none !important;">
4
- <td style="border: none !important; padding: 0;"><img src="./assets/logo/logo_50x50.jpeg" alt="CandleView Logo" width="50" height="50" style="border-radius:5px"></td>
5
- <td style="border: none !important; padding: 0 0 0 10px;"><h1 style="margin: 0; border: none !important;">CandleView</h1></td>
6
- </tr>
7
- </table>
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="./assets/logo/logo_imgtxt_dark_en.png">
4
+ <source media="(prefers-color-scheme: light)" srcset="./assets/logo/logo_imgtxt_light_en.png">
5
+ <img src="./assets/logo/logo_imgtxt_light_en.png" alt="Portal" width="300">
6
+ </picture>
8
7
  </p>
9
8
  <h4 align="center">
10
9
  An AI-driven financial time-series data visualization and rendering engine.
@@ -38,8 +37,8 @@ yarn add candleview
38
37
 
39
38
  # 🌐 Link
40
39
 
41
- | Website | Website(CN) | Emulator | Markets |
42
- | ------------------------------------------------------------ | ---------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------- |
40
+ | Website | Website(CN) | Emulator | Markets |
41
+ | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------- |
43
42
  | <a href="https://candleview.vercel.app/">Website</a> | <a href="https://www.candleview.cn/">Website(CN)</a> | <a href="https://candleview.vercel.app/application">Emulator</a> | <a href="https://candleview.vercel.app/markets">Markets</a> |
44
43
 
45
44
  # 📚 Directory
@@ -52,6 +51,33 @@ yarn add candleview
52
51
  | **docs** | Documents. |
53
52
  | **assets** | Asset Directory. |
54
53
 
54
+ # Props
55
+
56
+ | Parameter | Type | Default | Description | Required |
57
+ | ------------------------------------- | -------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
58
+ | `theme` | `'dark' \| 'light'` | `'dark'` | Theme mode | No |
59
+ | `i18n` | `'en' \| 'zh-cn'` | `'zh-cn'` | Language setting | No |
60
+ | `height` | `number \| string` | `500` | Chart height (px or percentage) | No |
61
+ | `width` | `number \| string` | `'100%'` | Chart width (px or percentage) | No |
62
+ | `title` | `string` | `''` | Chart title displayed on the chart | Yes |
63
+ | `toppanel` | `boolean` | `false` | Show top toolbar | No |
64
+ | `leftpanel` | `boolean` | `false` | Show left drawing tools panel | No |
65
+ | `markData` | `IStaticMarkData[]` | `[]` | Pre-drawn marks data | No |
66
+ | `timeframe` | `string` | `'1d'` | Chart timeframe (e.g., '1m', '1h', '1d') | No |
67
+ | `timezone` | `string` | `'Asia/Shanghai'` | Timezone for data display | No |
68
+ | `data` | `ICandleViewDataPoint[]` | `[]` | K-line data array | No |
69
+ | `ai` | `boolean` | `false` | Enable AI function | No |
70
+ | `aiconfigs` | `AIConfig[]` | `[]` | AI configuration list | No |
71
+ | `terminal` | `boolean` | `false` | Show terminal panel | No |
72
+ | `isMobileMode` | `boolean` | `false` | Enable mobile mode | No |
73
+ | `isOpenViewportSegmentation` | `boolean` | `false` | Enable viewport data segmentation | No |
74
+ | `isCloseInternalTimeFrameCalculation` | `boolean` | `false` | Disable internal timeframe calculation | No |
75
+ | `timeframeCallbacks` | `Partial<Record<TimeframeEnum, () => void>>` | `{}` | Callbacks for custom timeframe switching | No |
76
+ | `mainChartIndicators` | `string[]` | `[]` | Main chart indicator names to initialize (supported: 'ma', 'ema', 'bollinger', 'ichimoku', 'donchian', 'envelope', 'vwap', 'heatmap', 'marketprofile') | No |
77
+ | `subChartIndicators` | `string[]` | `[]` | Sub chart indicator names to initialize (supported: 'rsi', 'macd', 'volume', 'sar', 'kdj', 'atr', 'stochastic', 'cci', 'bbwidth', 'adx', 'obv') | No |
78
+ | `danmakus` | `string[]` | `[]` | Danmaku messages | No |
79
+ | `handleScreenshotCapture` | `(imageData: { dataUrl: string; blob: Blob; width: number; height: number; timestamp: number }) => void` | `undefined` | Callback for screenshot capture | No |
80
+
55
81
  # 🚀 Quick Start
56
82
 
57
83
  ```typescript
@@ -140,6 +166,10 @@ const App = () => {
140
166
  };
141
167
  ```
142
168
 
169
+ # Danmaku System
170
+
171
+ <img src="./assets/danmaku.gif" alt="CandleView Danmaku System" width="100%">
172
+
143
173
  # AI Features
144
174
 
145
175
  <img src="./assets/ai/ai-data-analysis.gif" alt="CandleView AI" width="100%">
@@ -455,25 +485,6 @@ $ history # View recent command history
455
485
 
456
486
  # 🔧 Configuration Options
457
487
 
458
- ## Props
459
-
460
- | Parameter | Type | Default | Description | Required |
461
- | ------------------------- | -------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------- | -------- |
462
- | `theme` | `'dark' \| 'light'` | `'dark'` | Theme mode | No |
463
- | `i18n` | `'en' \| 'zh-cn'` | `'zh-cn'` | Language setting | No |
464
- | `height` | `number \| string` | `500` | Chart height (px or percentage) | No |
465
- | `title` | `string` | `''` | Chart title displayed on the chart | Yes |
466
- | `showToolbar` | `boolean` | `true` | Show top toolbar | No |
467
- | `showLeftPanel` | `boolean` | `true` | Show left drawing tools panel | No |
468
- | `showTopPanel` | `boolean` | `true` | Show top settings panel | No |
469
- | `showIndicators` | `boolean` | `true` | Show indicators panel | No |
470
- | `timeframe` | `string` | `'1d'` | Chart timeframe (e.g., '1m', '1h', '1d') | No |
471
- | `timezone` | `string` | `'Asia/Shanghai'` | Timezone for data display | No |
472
- | `data` | `ICandleViewDataPoint[]` | `[]` | K-line data array | No |
473
- | `url` | `string` | `''` | URL to fetch data from | No |
474
- | `markData` | `IStaticMarkData[]` | `[]` | Pre-drawn marks data | No |
475
- | `handleScreenshotCapture` | `(imageData: { dataUrl: string; blob: Blob; width: number; height: number; timestamp: number }) => void` | `undefined` | Callback for screenshot capture | No |
476
-
477
488
  ## ⏰ Supported Timeframes
478
489
 
479
490
  ### Second-based Timeframes
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ declare enum AIFunctionType {
32
32
  declare class CandleView extends default_2.Component<CandleViewProps, CandleViewState> {
33
33
  candleViewRef: default_2.RefObject<HTMLDivElement | null>;
34
34
  private chartRef;
35
- private chartContainerRef;
35
+ chartContainerRef: default_2.RefObject<HTMLDivElement | null>;
36
36
  private chartLayerRef;
37
37
  private chart;
38
38
  private resizeObserver;
@@ -58,10 +58,16 @@ declare class CandleView extends default_2.Component<CandleViewProps, CandleView
58
58
  private preparedData;
59
59
  private originalData;
60
60
  private aiManager;
61
+ private danmakuManager;
62
+ private danmakuCanvasRef;
63
+ private danmakuContainerRef;
61
64
  constructor(props: CandleViewProps);
62
65
  componentDidMount(): void;
63
66
  componentDidUpdate(prevProps: CandleViewProps, prevState: CandleViewState): void;
64
67
  componentWillUnmount(): void;
68
+ private initializeDanmaku;
69
+ private clearDanmaku;
70
+ private handleDanmakuResize;
65
71
  private initializeMainChartIndicators;
66
72
  private initializeSubChartIndicators;
67
73
  private handleAiMobileMouseMove;
@@ -174,6 +180,7 @@ declare interface CandleViewProps {
174
180
  isThemeSelection?: boolean;
175
181
  mainChartIndicators?: string[];
176
182
  subChartIndicators?: string[];
183
+ danmakus?: string[];
177
184
  handleScreenshotCapture?: (imageData: {
178
185
  dataUrl: string;
179
186
  blob: Blob;