candleview 2.4.0 → 2.4.5
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 +66 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +23 -23
- package/dist/index.mjs +3001 -2956
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,6 +48,72 @@ const App = () => {
|
|
|
48
48
|
};
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
# Implement custom timeframe logic.
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { CandleView } from "./CandleView";
|
|
55
|
+
|
|
56
|
+
const App = () => {
|
|
57
|
+
return (
|
|
58
|
+
<CandleView
|
|
59
|
+
data={candleData}
|
|
60
|
+
title="Test"
|
|
61
|
+
theme={theme}
|
|
62
|
+
i18n={i18n}
|
|
63
|
+
markData={a}
|
|
64
|
+
height={800}
|
|
65
|
+
leftpanel={true}
|
|
66
|
+
toppanel={true}
|
|
67
|
+
terminal={true}
|
|
68
|
+
ai={true}
|
|
69
|
+
timezone="America/New_York"
|
|
70
|
+
timeframe="1m"
|
|
71
|
+
isCloseInternalTimeFrameCalculation={false} // the internal timeframe calculation logic has been disabled.
|
|
72
|
+
timeframeCallbacks={{
|
|
73
|
+
"1m": () => {
|
|
74
|
+
// Implement a custom data source switching mechanism for a 1m timeframe.
|
|
75
|
+
},
|
|
76
|
+
"5m": () => {
|
|
77
|
+
// Implement a custom data source switching mechanism for a 5m timeframe.
|
|
78
|
+
},
|
|
79
|
+
"1D": () => {
|
|
80
|
+
// Implement a custom data source switching mechanism for a 1D timeframe.
|
|
81
|
+
},
|
|
82
|
+
"1H": () => {
|
|
83
|
+
// Implement a custom data source switching mechanism for a 1H timeframe.
|
|
84
|
+
},
|
|
85
|
+
"15m": () => {
|
|
86
|
+
// Implement a custom data source switching mechanism for a 15m timeframe.
|
|
87
|
+
},
|
|
88
|
+
"30m": () => {
|
|
89
|
+
// Implement a custom data source switching mechanism for a 30m timeframe.
|
|
90
|
+
},
|
|
91
|
+
"4H": () => {
|
|
92
|
+
// Implement a custom data source switching mechanism for a 4H timeframe.
|
|
93
|
+
},
|
|
94
|
+
}}
|
|
95
|
+
aiconfigs={[
|
|
96
|
+
{
|
|
97
|
+
proxyUrl: "http://localhost:3000/api",
|
|
98
|
+
brand: "aliyun",
|
|
99
|
+
model: "qwen-turbo",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
proxyUrl: "http://localhost:3000/api",
|
|
103
|
+
brand: "deepseek",
|
|
104
|
+
model: "deepseek-chat",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
proxyUrl: "http://localhost:3000/api",
|
|
108
|
+
brand: "deepseek",
|
|
109
|
+
model: "deepseek-chat-lite",
|
|
110
|
+
},
|
|
111
|
+
]}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
```
|
|
116
|
+
|
|
51
117
|
# AI Features
|
|
52
118
|
|
|
53
119
|
<img src="./assets/ai/ai-data-analysis-2.png" alt="CandleView AI" width="100%">
|
package/dist/index.d.ts
CHANGED
|
@@ -152,6 +152,8 @@ declare interface CandleViewProps {
|
|
|
152
152
|
ai?: boolean;
|
|
153
153
|
aiconfigs?: AIConfig[];
|
|
154
154
|
terminal?: boolean;
|
|
155
|
+
isCloseInternalTimeFrameCalculation?: boolean;
|
|
156
|
+
timeframeCallbacks?: Partial<Record<TimeframeEnum, () => void>>;
|
|
155
157
|
handleScreenshotCapture?: (imageData: {
|
|
156
158
|
dataUrl: string;
|
|
157
159
|
blob: Blob;
|