@super-chart/chart-react 0.2.1 → 0.2.2
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 +46 -0
- package/package.json +14 -5
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# `@super-chart/chart-react`
|
|
2
|
+
|
|
3
|
+
React adapter for `@super-chart/chart-advanced`.
|
|
4
|
+
|
|
5
|
+
商业闭源,仅供授权集成方使用。
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @super-chart/chart-react @super-chart/chart-advanced
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer dependency: `react` ^18 or ^19.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { useRef } from 'react'
|
|
19
|
+
import { FinancialChart, type FinancialChartRef } from '@super-chart/chart-react'
|
|
20
|
+
|
|
21
|
+
export function DemoChart() {
|
|
22
|
+
const chartRef = useRef<FinancialChartRef>(null)
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<FinancialChart
|
|
26
|
+
ref={chartRef}
|
|
27
|
+
style={{ width: '100%', height: 400 }}
|
|
28
|
+
options={{ symbol: 'DEMO', preset: 'trading' }}
|
|
29
|
+
initialData={[
|
|
30
|
+
{ time: Date.parse('2026-07-27T09:30:00.000+08:00'), open: 100, high: 103, low: 99, close: 102 },
|
|
31
|
+
{ time: Date.parse('2026-07-27T09:31:00.000+08:00'), open: 102, high: 105, low: 101, close: 104 },
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
After mount, use the ref for `setData`, `appendData`, `fitContent`, and other chart APIs.
|
|
39
|
+
|
|
40
|
+
## Docs
|
|
41
|
+
|
|
42
|
+
See [`@super-chart/chart-advanced`](https://www.npmjs.com/package/@super-chart/chart-advanced).
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
UNLICENSED — authorized use only.
|
package/package.json
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@super-chart/chart-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"description": "React adapter for Super Chart",
|
|
7
|
+
"description": "React adapter for Super Chart financial charts",
|
|
8
|
+
"homepage": "https://www.npmjs.com/package/@super-chart/chart-advanced",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"react",
|
|
11
|
+
"candlestick",
|
|
12
|
+
"financial-chart",
|
|
13
|
+
"trading",
|
|
14
|
+
"super-chart"
|
|
15
|
+
],
|
|
8
16
|
"files": [
|
|
9
17
|
"dist",
|
|
18
|
+
"README.md",
|
|
10
19
|
"!dist/**/*.tsbuildinfo"
|
|
11
20
|
],
|
|
12
21
|
"main": "./dist/index.js",
|
|
@@ -26,9 +35,9 @@
|
|
|
26
35
|
"react": "^18.0.0 || ^19.0.0"
|
|
27
36
|
},
|
|
28
37
|
"dependencies": {
|
|
29
|
-
"@super-chart/chart-base": "0.2.
|
|
30
|
-
"@super-chart/chart-renderer-canvas": "0.2.
|
|
31
|
-
"@super-chart/chart-advanced": "0.2.
|
|
38
|
+
"@super-chart/chart-base": "0.2.2",
|
|
39
|
+
"@super-chart/chart-renderer-canvas": "0.2.2",
|
|
40
|
+
"@super-chart/chart-advanced": "0.2.2"
|
|
32
41
|
},
|
|
33
42
|
"devDependencies": {
|
|
34
43
|
"@testing-library/react": "^16.3.2",
|