@tradecanvas/react 1.0.7 → 1.0.13
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 +48 -48
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# @tradecanvas/react
|
|
2
|
-
|
|
3
|
-
React component for [`@tradecanvas/chart`](https://www.npmjs.com/package/@tradecanvas/chart) — reactive props, ref forwarding, zero boilerplate.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @tradecanvas/react @tradecanvas/chart
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
`react` (>= 18) and `react-dom` are peer dependencies.
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import { TradeCanvas } from '@tradecanvas/react'
|
|
17
|
-
|
|
18
|
-
export function Chart() {
|
|
19
|
-
return (
|
|
20
|
-
<div style={{ height: 500 }}>
|
|
21
|
-
<TradeCanvas symbol="BTCUSDT" timeframe="5m" theme="dark" indicators={['rsi', 'macd']} />
|
|
22
|
-
</div>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Streams live Binance data by default. Pass `data={bars}` for static OHLC, or `adapter={...}` for any feed (`CoinbaseAdapter`, `BybitAdapter`, `KrakenAdapter`, or your own).
|
|
28
|
-
|
|
29
|
-
## Props
|
|
30
|
-
|
|
31
|
-
`symbol`, `timeframe`, `theme` (`'dark'` | `'light'` | `Theme`), `chartType`, `indicators`, `data`, `adapter`, `historyLimit`, `features`, `autoScale`, `signalMarkers`, `signalMarkerStyle`, `tradeZones`, `tradeZoneStyle`, `watermarkText`, `onReady(chart)`, `onCrosshairMove`, `className`, `style`.
|
|
32
|
-
|
|
33
|
-
## Imperative access
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import { useRef } from 'react'
|
|
37
|
-
import { TradeCanvas, type TradeCanvasRef } from '@tradecanvas/react'
|
|
38
|
-
|
|
39
|
-
const ref = useRef<TradeCanvasRef>(null)
|
|
40
|
-
ref.current?.getChart() // the underlying Chart — full API
|
|
41
|
-
ref.current?.screenshot('chart.png')
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Reach the underlying `Chart` (drawings, trading, execution adapters, plugins, drag-to-create orders, resizable panes) via `onReady` or `ref.getChart()`. See the [main docs](https://github.com/bonguynvan/tradecanvas).
|
|
45
|
-
|
|
46
|
-
## License
|
|
47
|
-
|
|
48
|
-
MIT
|
|
1
|
+
# @tradecanvas/react
|
|
2
|
+
|
|
3
|
+
React component for [`@tradecanvas/chart`](https://www.npmjs.com/package/@tradecanvas/chart) — reactive props, ref forwarding, zero boilerplate.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @tradecanvas/react @tradecanvas/chart
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react` (>= 18) and `react-dom` are peer dependencies.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { TradeCanvas } from '@tradecanvas/react'
|
|
17
|
+
|
|
18
|
+
export function Chart() {
|
|
19
|
+
return (
|
|
20
|
+
<div style={{ height: 500 }}>
|
|
21
|
+
<TradeCanvas symbol="BTCUSDT" timeframe="5m" theme="dark" indicators={['rsi', 'macd']} />
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Streams live Binance data by default. Pass `data={bars}` for static OHLC, or `adapter={...}` for any feed (`CoinbaseAdapter`, `BybitAdapter`, `KrakenAdapter`, or your own).
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
`symbol`, `timeframe`, `theme` (`'dark'` | `'light'` | `Theme`), `chartType`, `indicators`, `data`, `adapter`, `historyLimit`, `features`, `autoScale`, `signalMarkers`, `signalMarkerStyle`, `tradeZones`, `tradeZoneStyle`, `watermarkText`, `onReady(chart)`, `onCrosshairMove`, `className`, `style`.
|
|
32
|
+
|
|
33
|
+
## Imperative access
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { useRef } from 'react'
|
|
37
|
+
import { TradeCanvas, type TradeCanvasRef } from '@tradecanvas/react'
|
|
38
|
+
|
|
39
|
+
const ref = useRef<TradeCanvasRef>(null)
|
|
40
|
+
ref.current?.getChart() // the underlying Chart — full API
|
|
41
|
+
ref.current?.screenshot('chart.png')
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Reach the underlying `Chart` (drawings, trading, execution adapters, plugins, drag-to-create orders, resizable panes) via `onReady` or `ref.getChart()`. See the [main docs](https://github.com/bonguynvan/tradecanvas).
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradecanvas/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React component for @tradecanvas/chart — reactive props, ref forwarding, zero boilerplate.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"README.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tradecanvas/chart": "1.
|
|
36
|
+
"@tradecanvas/chart": "1.10.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": ">=18.0.0",
|