@tony01/astroneum 0.4.1-beta.2 → 0.4.1-beta.24
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/CHANGELOG.md +280 -237
- package/LICENSE +21 -21
- package/README.md +250 -198
- package/dist/{Indicator-BBI3L_lx.d.ts → Indicator-BQQcVGGT.d.ts} +51 -227
- package/dist/astroneum.css +1 -1
- package/dist/chunk-47YGQEL5.js +399 -0
- package/dist/chunk-67XM5LOK.js +2 -0
- package/dist/{chunk-2YYGUSVX.js → chunk-DFJMDDL5.js} +1 -1
- package/dist/chunk-EFAS6F4C.js +59 -0
- package/dist/chunk-EHZN52CY.js +2 -0
- package/dist/chunk-HKLWNPMP.js +35 -0
- package/dist/chunk-ONPPQW65.js +2 -0
- package/dist/chunk-SCTHEM27.js +3 -0
- package/dist/chunk-UQXYMB6X.js +2 -0
- package/dist/chunk-WSIR5T2M.js +3 -0
- package/dist/entries/alerts.d.ts +36 -10
- package/dist/entries/alerts.js +1 -1
- package/dist/entries/datafeeds/crypto.d.ts +5 -1
- package/dist/entries/datafeeds/crypto.js +1 -1
- package/dist/entries/datafeeds/polygon.d.ts +3 -1
- package/dist/entries/datafeeds/polygon.js +1 -1
- package/dist/entries/headless.d.ts +78 -0
- package/dist/entries/headless.js +2 -0
- package/dist/entries/multichart.d.ts +12 -1
- package/dist/entries/multichart.js +1 -1
- package/dist/entries/replay.d.ts +3 -1
- package/dist/entries/script.d.ts +2 -68
- package/dist/entries/script.js +1 -1
- package/dist/entries/watchlist.d.ts +32 -2
- package/dist/entries/watchlist.js +1 -1
- package/dist/entries/workspace.d.ts +61 -0
- package/dist/entries/workspace.js +2 -0
- package/dist/index-BiXdqLA4.d.ts +45 -0
- package/dist/index-_JgHTy8X.d.ts +19 -0
- package/dist/index.d.ts +188 -27
- package/dist/index.js +1 -1
- package/dist/script-BU9StbN-.d.ts +120 -0
- package/dist/types-W6SIYQ9m.d.ts +232 -0
- package/dist/types-yETgeYsE.d.ts +28 -0
- package/dist/zh-CN-NDTUDZGZ.js +3 -0
- package/docs/MIRROR-PLAN-SYMBOL-SEARCH-WATCHLIST.md +255 -0
- package/docs/STRUCTURE.md +51 -37
- package/docs/TODO-DESIGN.md +111 -37
- package/docs/TODO.md +26 -16
- package/docs/WORKSTREAMS.md +55 -0
- package/docs/api.md +655 -528
- package/docs/datafeed-guide.md +329 -311
- package/docs/design-astroneum.md +204 -65
- package/docs/plugin-development.md +569 -565
- package/docs/tv-functions-skill.md +88 -64
- package/package.json +158 -147
- package/dist/chunk-4YOLQ5DC.js +0 -2
- package/dist/chunk-I4YQBP2M.js +0 -3
- package/dist/chunk-OOMZRONH.js +0 -35
- package/dist/chunk-PV2GAINM.js +0 -2
- package/dist/chunk-YW3STIPY.js +0 -653
- package/dist/zh-CN-Y2C6RSOI.js +0 -3
package/README.md
CHANGED
|
@@ -1,198 +1,250 @@
|
|
|
1
|
-
# Astroneum
|
|
2
|
-
|
|
3
|
-
Professional financial charting library for React applications — now with
|
|
4
|
-
TradingView-class features, zero licensing fees, and MIT license.
|
|
5
|
-
|
|
6
|
-
[](https://react.dev/)
|
|
9
|
-
[](https://www.typescriptlang.org/)
|
|
10
|
-
[](https://nodejs.org/)
|
|
11
|
-
[](LICENSE)
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-

|
|
16
|
-
|
|
17
|
-
## Features
|
|
18
|
-
|
|
19
|
-
### Chart Types
|
|
20
|
-
- **Candlestick, OHLC, bar, area, line, Heikin-Ashi** — rendered via Canvas2D / WebGL2 with GPU acceleration
|
|
21
|
-
- **Non-time-based bars** — Renko, Kagi, Tick, Range, and Point & Figure generators
|
|
22
|
-
- **Multi-chart grid** (2/4/8/16 panes) and **multi-period stacked layout** (e.g. 4H + 1H + 15m)
|
|
23
|
-
|
|
24
|
-
### Indicators & Analysis
|
|
25
|
-
- **
|
|
26
|
-
- **Volume Profile** — horizontal histogram with POC, Value Area, and price-level bucketing
|
|
27
|
-
- **ZigZag + auto pattern detection** — swing highs/lows, support/resistance clustering
|
|
28
|
-
- **Depth of Market** — bid/ask volume ladder visualization
|
|
29
|
-
- **Compare/Overlay** — second symbol normalized to percentage on same pane
|
|
30
|
-
- **Multi-timeframe indicators** — resample any TF, forward-fill to lower TF bars
|
|
31
|
-
- **Custom indicator plugins** via `registerIndicatorPlugin()` with Canvas2D or WebGL2 render path
|
|
32
|
-
- **Script editor** — sandboxed Pine-Script–inspired JS environment for custom indicators
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- **
|
|
54
|
-
- **
|
|
55
|
-
- **
|
|
56
|
-
- **
|
|
57
|
-
- **
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
63
|
-
- **
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
70
|
-
- **
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
import {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
type
|
|
92
|
-
type
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
const [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import {
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
import {
|
|
149
|
-
import {
|
|
150
|
-
import {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
import {
|
|
160
|
-
import {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
import {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1
|
+
# Astroneum
|
|
2
|
+
|
|
3
|
+
Professional financial charting library for React applications — now with
|
|
4
|
+
TradingView-class features, zero licensing fees, and MIT license.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@tony01/astroneum)
|
|
7
|
+
[](https://www.npmjs.com/package/@tony01/astroneum)
|
|
8
|
+
[](https://react.dev/)
|
|
9
|
+
[](https://www.typescriptlang.org/)
|
|
10
|
+
[](https://nodejs.org/)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
### Chart Types
|
|
20
|
+
- **Candlestick, OHLC, bar, area, line, Heikin-Ashi** — rendered via Canvas2D / WebGL2 with GPU acceleration
|
|
21
|
+
- **Non-time-based bars** — Renko, Kagi, Tick, Range, and Point & Figure generators
|
|
22
|
+
- **Multi-chart grid** (2/4/8/16 panes) and **multi-period stacked layout** (e.g. 4H + 1H + 15m)
|
|
23
|
+
|
|
24
|
+
### Indicators & Analysis
|
|
25
|
+
- **50 built-in indicators** — SMA, EMA, MACD, RSI, KDJ, Bollinger Bands, TRIX, SAR, and more
|
|
26
|
+
- **Volume Profile** — horizontal histogram with POC, Value Area, and price-level bucketing
|
|
27
|
+
- **ZigZag + auto pattern detection** — swing highs/lows, support/resistance clustering
|
|
28
|
+
- **Depth of Market** — bid/ask volume ladder visualization
|
|
29
|
+
- **Compare/Overlay** — second symbol normalized to percentage on same pane
|
|
30
|
+
- **Multi-timeframe indicators** — resample any TF, forward-fill to lower TF bars
|
|
31
|
+
- **Custom indicator plugins** via `registerIndicatorPlugin()` with Canvas2D or WebGL2 render path
|
|
32
|
+
- **Script editor** — sandboxed Pine-Script–inspired JS environment for custom indicators
|
|
33
|
+
- **Deterministic strategy backtesting** — bounded script signal contract, trade/equity/drawdown result types, and a demo report surface; not broker execution
|
|
34
|
+
|
|
35
|
+
### Drawing Tools
|
|
36
|
+
- **20 drawing tools** ? trend lines, Fibonacci (circle, spiral, extension, segment, fan), Gann boxes, pitchforks, Elliott waves, harmonic patterns (ABCD, XABCD), cursor modes, zoom, and **measure/ruler tool**
|
|
37
|
+
- **Magnet/Snap** — snap to bar OHLC within 8px, angle snap to 0°/30°/45°/60°/90°
|
|
38
|
+
- **Drawing style presets** (7 built-in + custom) with live preview and per-drawing color
|
|
39
|
+
- **Undo/Redo** — `UndoManager` with 50-entry depth via Ctrl+Z / Ctrl+Y
|
|
40
|
+
- **Copy/Paste drawings** — Ctrl+C/V across charts via clipboard
|
|
41
|
+
- **Lock all drawings** toggle
|
|
42
|
+
- **Session visualizer** — auto session high/low/open/close lines
|
|
43
|
+
|
|
44
|
+
### Navigation & UX
|
|
45
|
+
- **Keyboard shortcuts** — arrows pan, Page/Home/End scroll/jump, mouse wheel zoom at cursor
|
|
46
|
+
- **Crosshair sync** across multi-chart and multi-period layouts
|
|
47
|
+
- **Price axis scaling** — linear, log, percentage, indexed-to-100
|
|
48
|
+
- **Chart templates** — save/load named configurations to localStorage
|
|
49
|
+
- **Accessibility** — `accessible` prop with aria-live OHLCV announcement
|
|
50
|
+
- **State serialization** — full chart state persistence & recovery via `serializeState()`/`loadState()`
|
|
51
|
+
|
|
52
|
+
### Data & Performance
|
|
53
|
+
- **Off-main-thread indicator pool** — Web Workers + TypedArray column store
|
|
54
|
+
- **OPFS historical cache** — binary bar data persisted to Origin Private File System
|
|
55
|
+
- **FlatBuffers binary codec** (`BarsCodec`) — 40 bytes per bar, efficient storage & transfer
|
|
56
|
+
- **TickAnimator** — smooth close/high/low interpolation at 60fps
|
|
57
|
+
- **TaskScheduler** with priority queue (data > indicator > overlay)
|
|
58
|
+
- **SharedArrayBuffer** ring buffer when `crossOriginIsolated`
|
|
59
|
+
|
|
60
|
+
### Datafeeds
|
|
61
|
+
- **StandardCryptoDatafeed** — 100+ symbols, Binance/Bitget/OKX futures, real-time WebSocket
|
|
62
|
+
- **DefaultDatafeed & WebSocketDatafeed** — Polygon.io REST + WebSocket
|
|
63
|
+
- **WebTransportDatafeed** — experimental HTTP/3 QUIC support
|
|
64
|
+
- **BYO datafeed** — 4-method interface (`searchSymbols`, `getHistoryData`, `subscribe`, `unsubscribe`)
|
|
65
|
+
|
|
66
|
+
### Developer Experience
|
|
67
|
+
- **Fully typed TypeScript** — branded financial types (`Price`, `Volume`, `Timestamp`)
|
|
68
|
+
- **10 tree-shakeable subpath exports** — import only what you need
|
|
69
|
+
- **18 locale JSON files** ? lazy-loaded on demand, dark/light/high-contrast themes
|
|
70
|
+
- **SSR-safe** — `'use client'` on every entry, Next.js App Router compatible
|
|
71
|
+
- **MIT license** — no usage limits, no watermark, no "Powered by" branding
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Install
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm install @tony01/astroneum
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`react` and `react-dom` ≥ 18 are peer dependencies.
|
|
82
|
+
|
|
83
|
+
## Quick Start
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import { useMemo, useRef, useState } from 'react'
|
|
87
|
+
import {
|
|
88
|
+
AstroneumChart,
|
|
89
|
+
createStandardCryptoDatafeed,
|
|
90
|
+
STANDARD_CRYPTO_SYMBOLS,
|
|
91
|
+
type AstroneumHandle,
|
|
92
|
+
type Period,
|
|
93
|
+
type SymbolInfo,
|
|
94
|
+
} from '@tony01/astroneum'
|
|
95
|
+
import '@tony01/astroneum/style.css'
|
|
96
|
+
|
|
97
|
+
export default function App() {
|
|
98
|
+
const chartRef = useRef<AstroneumHandle>(null)
|
|
99
|
+
const datafeed = useMemo(() => createStandardCryptoDatafeed(), [])
|
|
100
|
+
const [symbol] = useState<SymbolInfo>(STANDARD_CRYPTO_SYMBOLS[0])
|
|
101
|
+
const [period] = useState<Period>({ multiplier: 1, timespan: 'hour', text: '1H' })
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<AstroneumChart
|
|
105
|
+
ref={chartRef}
|
|
106
|
+
symbol={symbol}
|
|
107
|
+
period={period}
|
|
108
|
+
datafeed={datafeed}
|
|
109
|
+
theme="dark"
|
|
110
|
+
subIndicators={['VOL']}
|
|
111
|
+
style={{ width: '100%', height: 560 }}
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Key Props
|
|
118
|
+
|
|
119
|
+
| Prop | Type | Description |
|
|
120
|
+
|------|------|-------------|
|
|
121
|
+
| `symbol` | `SymbolInfo` | Symbol to display |
|
|
122
|
+
| `period` | `Period` | Timeframe (1m, 5m, 1H, 4H, D, etc.) |
|
|
123
|
+
| `datafeed` | `Datafeed` | Data source (crypto, Polygon, or custom); may implement optional batched `getQuotes` for watchlists |
|
|
124
|
+
| `theme` | `string` | `'dark'`, `'light'`, or `'high-contrast'` |
|
|
125
|
+
| `barStyle` | `'candle' \| 'heikin_ashi'` | Candle rendering style |
|
|
126
|
+
| `priceScale` | `'linear' \| 'log' \| 'percent' \| 'indexed'` | Price axis scale |
|
|
127
|
+
| `locale` | `string` | BCP-47 locale (e.g. `'ja-JP'`) |
|
|
128
|
+
| `drawingBarVisible` | `boolean` | Show drawing toolbar |
|
|
129
|
+
| `mainIndicators` | `IndicatorDef[]` | Main pane indicators |
|
|
130
|
+
| `subIndicators` | `string[]` | Sub-pane indicators (`['VOL', 'MACD', 'RSI']`) |
|
|
131
|
+
| `plugins` | `ChartPlugin[]` | Custom plugins with lifecycle hooks |
|
|
132
|
+
| `accessible` | `boolean` | Screen-reader support |
|
|
133
|
+
| `style` / `className` | | Container styling |
|
|
134
|
+
|
|
135
|
+
## Subpath Exports
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
// Main entry
|
|
139
|
+
import { AstroneumChart, DefaultDatafeed } from '@tony01/astroneum'
|
|
140
|
+
|
|
141
|
+
// Tree-shakeable subpaths
|
|
142
|
+
import { createChart } from '@tony01/astroneum/headless'
|
|
143
|
+
import { BarReplay } from '@tony01/astroneum/replay'
|
|
144
|
+
import { MultiChartLayout } from '@tony01/astroneum/multichart'
|
|
145
|
+
import { MultiPeriodLayout } from '@tony01/astroneum' // same symbol, stacked periods
|
|
146
|
+
import { WatchlistManager } from '@tony01/astroneum/watchlist' // persisted lists, sort, columns, colors, live snapshots
|
|
147
|
+
import { PortfolioTracker } from '@tony01/astroneum/portfolio'
|
|
148
|
+
import { AlertManager } from '@tony01/astroneum/alerts'
|
|
149
|
+
import { ScriptEngine } from '@tony01/astroneum/script'
|
|
150
|
+
import { UndoManager } from '@tony01/astroneum'
|
|
151
|
+
import { ChartTemplateManager } from '@tony01/astroneum'
|
|
152
|
+
import { SessionVisualizer } from '@tony01/astroneum'
|
|
153
|
+
|
|
154
|
+
// Datafeeds
|
|
155
|
+
import { createStandardCryptoDatafeed, STANDARD_CRYPTO_SYMBOLS } from '@tony01/astroneum/datafeeds/crypto'
|
|
156
|
+
import { DefaultDatafeed, WebSocketDatafeed } from '@tony01/astroneum/datafeeds/polygon'
|
|
157
|
+
|
|
158
|
+
// Utilities
|
|
159
|
+
import { heikinAshi } from '@tony01/astroneum' // OHLC → Heikin-Ashi transform
|
|
160
|
+
import { zigzag, detectSupportResistance } from '@tony01/astroneum' // pattern detection
|
|
161
|
+
import { resampleBars, forwardFill } from '@tony01/astroneum' // multi-TF resampling
|
|
162
|
+
import { generateRenko, generateKagi,
|
|
163
|
+
generateTickBars, generateRangeBars,
|
|
164
|
+
generatePointAndFigure } from '@tony01/astroneum' // non-time-based bars
|
|
165
|
+
import { transformCandles, untransformPrice } from '@tony01/astroneum' // price scale transforms
|
|
166
|
+
|
|
167
|
+
// Plugins
|
|
168
|
+
import { volumeProfilePlugin, domPlugin, zigzagPlugin,
|
|
169
|
+
pointAndFigurePlugin } from '@tony01/astroneum' // registerIndicatorPlugin(...)
|
|
170
|
+
import { createCompareIndicator } from '@tony01/astroneum' // compare symbols overlay
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Headless Engine
|
|
174
|
+
|
|
175
|
+
`@tony01/astroneum/headless` exposes the rendering engine without React,
|
|
176
|
+
Astroneum UI, stylesheets, datafeeds, keyboard shortcuts, or network behavior.
|
|
177
|
+
The host supplies the container, bars, controls, persistence, and lifecycle.
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
import {
|
|
181
|
+
asPrice,
|
|
182
|
+
asTimestamp,
|
|
183
|
+
createChart,
|
|
184
|
+
destroyChart,
|
|
185
|
+
registerBuiltInExtensions,
|
|
186
|
+
} from '@tony01/astroneum/headless'
|
|
187
|
+
|
|
188
|
+
registerBuiltInExtensions()
|
|
189
|
+
|
|
190
|
+
const chart = createChart(document.getElementById('chart')!)
|
|
191
|
+
chart.replaceBars([{
|
|
192
|
+
timestamp: asTimestamp(Date.UTC(2026, 7, 29)),
|
|
193
|
+
open: asPrice(100),
|
|
194
|
+
high: asPrice(105),
|
|
195
|
+
low: asPrice(98),
|
|
196
|
+
close: asPrice(103),
|
|
197
|
+
}])
|
|
198
|
+
|
|
199
|
+
destroyChart(chart)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Calling `createChart()` twice with the same container returns the same instance.
|
|
203
|
+
`destroyChart()` is idempotent and releases the container for a later mount.
|
|
204
|
+
`replaceBars()` requires strictly ascending, finite UTC-millisecond OHLCV data;
|
|
205
|
+
`updateBar()` may replace the current last bar or append a newer bar. Invalid data
|
|
206
|
+
throws without mutating current bars. Calling either method switches that chart to
|
|
207
|
+
host-owned data and detaches any explicitly configured engine data loader.
|
|
208
|
+
|
|
209
|
+
Built-in indicator and drawing registration is explicit and process-wide. Call
|
|
210
|
+
`registerBuiltInExtensions()` once before creating studies or drawings. The
|
|
211
|
+
headless entry does not require `style.css`.
|
|
212
|
+
|
|
213
|
+
Typed `registerIndicatorPlugin()` helpers and raw `registerIndicator()` /
|
|
214
|
+
`registerOverlay()` primitives let the host supply study and drawing behavior.
|
|
215
|
+
`getViewportState()` returns only versioned bar spacing and right-offset bar count;
|
|
216
|
+
`setViewportState()` validates and clamps those fields against current bars and
|
|
217
|
+
container geometry. Restore it after bars load. Screenshot export composites the
|
|
218
|
+
ordered Canvas2D, WebGL, WebGPU, worker-canvas, and GPU-text layers.
|
|
219
|
+
|
|
220
|
+
`createStandardCryptoDatafeed()` implements batched watchlist snapshots for Binance, Bitget, and OKX. Custom datafeeds can opt in with `getQuotes(symbols)`; consumers without it continue to work and display unavailable quote values.
|
|
221
|
+
|
|
222
|
+
## Browser Support
|
|
223
|
+
|
|
224
|
+
| Browser | Minimum | Notes |
|
|
225
|
+
|---------|---------|-------|
|
|
226
|
+
| Chrome / Edge | 110+ | Full WebGL2 + OPFS |
|
|
227
|
+
| Firefox | 115+ | Full WebGL2 |
|
|
228
|
+
| Safari | 16.4+ | Full WebGL2, OPFS on 17+ |
|
|
229
|
+
| iOS Safari | 16.4+ | Touch + pinch |
|
|
230
|
+
|
|
231
|
+
Graceful fallback: no WebGL2 → Canvas2D, no OPFS → in-memory cache, no OffscreenCanvas → main-thread calc.
|
|
232
|
+
|
|
233
|
+
## Next.js Usage
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
// next.config.ts
|
|
237
|
+
const nextConfig = { transpilePackages: ['@tony01/astroneum'] }
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
// app/layout.tsx
|
|
242
|
+
import '@tony01/astroneum/style.css'
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The library ships with `'use client'` built in — no extra directive needed.
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
MIT — use it anywhere, no fees, no limits, no branding requirement. The package
|
|
250
|
+
retains the upstream copyright notice for Kowit Charoenratchatabhan.
|