@tradecanvas/core 1.83.1 → 1.84.1
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 +6 -6
- package/dist/{WebGLSeriesRenderer-CNjcz7gD.js → WebGLSeriesRenderer-DguvFCTx.js} +1 -1
- package/dist/{WebGLSeriesRenderer-CNjcz7gD.js.map → WebGLSeriesRenderer-DguvFCTx.js.map} +1 -1
- package/dist/{WebGLSeriesRenderer-CcD5VtQE.cjs → WebGLSeriesRenderer-lwJz1WAg.cjs} +1 -1
- package/dist/{WebGLSeriesRenderer-CcD5VtQE.cjs.map → WebGLSeriesRenderer-lwJz1WAg.cjs.map} +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3241 -2505
- package/dist/index.js.map +1 -1
- package/dist/indicator.worker-1I8WNx4q.js +18 -0
- package/dist/indicator.worker-1I8WNx4q.js.map +1 -0
- package/dist/indicator.worker-g0us81yM.cjs +2 -0
- package/dist/indicator.worker-g0us81yM.cjs.map +1 -0
- package/dist/indicators/IndicatorEngine.d.ts +33 -40
- package/dist/indicators/IndicatorEngine.d.ts.map +1 -1
- package/dist/indicators/IndicatorValueMap.d.ts +6 -0
- package/dist/indicators/IndicatorValueMap.d.ts.map +1 -1
- package/dist/indicators/PointwiseIndicator.d.ts +7 -5
- package/dist/indicators/PointwiseIndicator.d.ts.map +1 -1
- package/dist/indicators/builtInFactories.d.ts +8 -0
- package/dist/indicators/builtInFactories.d.ts.map +1 -0
- package/dist/indicators/index.d.ts +7 -0
- package/dist/indicators/index.d.ts.map +1 -1
- package/dist/indicators/indicatorInstance.d.ts +59 -0
- package/dist/indicators/indicatorInstance.d.ts.map +1 -0
- package/dist/indicators/instanceReads.d.ts +40 -0
- package/dist/indicators/instanceReads.d.ts.map +1 -0
- package/dist/indicators/overlay/ChandeKrollStop.d.ts +4 -0
- package/dist/indicators/overlay/ChandeKrollStop.d.ts.map +1 -1
- package/dist/indicators/overlay/DEMA.d.ts +4 -0
- package/dist/indicators/overlay/DEMA.d.ts.map +1 -1
- package/dist/indicators/overlay/VWAP.d.ts +4 -0
- package/dist/indicators/overlay/VWAP.d.ts.map +1 -1
- package/dist/indicators/panel/MACD.d.ts +4 -0
- package/dist/indicators/panel/MACD.d.ts.map +1 -1
- package/dist/indicators/panel/RSI.d.ts +4 -0
- package/dist/indicators/panel/RSI.d.ts.map +1 -1
- package/dist/indicators/panel/UlcerIndex.d.ts +4 -0
- package/dist/indicators/panel/UlcerIndex.d.ts.map +1 -1
- package/dist/indicators/panel/VolumeOscillator.d.ts +4 -0
- package/dist/indicators/panel/VolumeOscillator.d.ts.map +1 -1
- package/dist/indicators/recompute.bench.d.ts +2 -0
- package/dist/indicators/recompute.bench.d.ts.map +1 -0
- package/dist/indicators/registry.d.ts.map +1 -1
- package/dist/indicators/worker/IndicatorWorkerBridge.d.ts +81 -0
- package/dist/indicators/worker/IndicatorWorkerBridge.d.ts.map +1 -0
- package/dist/indicators/worker/IndicatorWorkerHost.d.ts +2 -1
- package/dist/indicators/worker/IndicatorWorkerHost.d.ts.map +1 -1
- package/dist/indicators/worker/IndicatorWorkerPool.d.ts +99 -0
- package/dist/indicators/worker/IndicatorWorkerPool.d.ts.map +1 -0
- package/dist/indicators/worker/columns.d.ts +78 -0
- package/dist/indicators/worker/columns.d.ts.map +1 -0
- package/dist/indicators/worker/messages.d.ts +26 -13
- package/dist/indicators/worker/messages.d.ts.map +1 -1
- package/dist/indicators/worker/spawnWorker.d.ts +17 -0
- package/dist/indicators/worker/spawnWorker.d.ts.map +1 -0
- package/dist/indicators/worker/workerHandler.d.ts +16 -0
- package/dist/indicators/worker/workerHandler.d.ts.map +1 -0
- package/dist/indicators/worker/workerJobs.d.ts +56 -0
- package/dist/indicators/worker/workerJobs.d.ts.map +1 -0
- package/dist/indicators/worker/workerState.d.ts +28 -0
- package/dist/indicators/worker/workerState.d.ts.map +1 -0
- package/dist/interaction/InteractionManager.d.ts +2 -0
- package/dist/interaction/InteractionManager.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -44,18 +44,18 @@ Extensible via `IndicatorBase` for custom indicators.
|
|
|
44
44
|
|
|
45
45
|
### Indicator math in a worker
|
|
46
46
|
|
|
47
|
-
`
|
|
47
|
+
The chart computes its indicators in a Web Worker with `indicatorWorker: 'auto'` (a `ChartOptions` field of `@tradecanvas/chart`): full recomputes over 50,000 bars or more go there, and the results come back as columns of numbers. The worker ships inside the package, inlined in a chunk that loads the first time it is needed and starts from a Blob URL, so there is nothing to serve.
|
|
48
|
+
|
|
49
|
+
To compute an indicator off the main thread yourself, hand the same worker to `IndicatorWorkerHost`, which has a Promise-based `calculate()`, a per-request timeout and a `ping()` health check:
|
|
48
50
|
|
|
49
51
|
```ts
|
|
50
|
-
import { IndicatorWorkerHost } from '@tradecanvas/core'
|
|
52
|
+
import { IndicatorWorkerHost, createIndicatorWorker } from '@tradecanvas/core'
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
const worker = new Worker(new URL('./indicator.worker.ts', import.meta.url), { type: 'module' })
|
|
54
|
-
const host = new IndicatorWorkerHost(worker)
|
|
54
|
+
const host = new IndicatorWorkerHost(await createIndicatorWorker())
|
|
55
55
|
const output = await host.calculate('rsi', config, bars)
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
Pass `null` instead of a worker to calculate synchronously (SSR, tests).
|
|
58
|
+
Pass `null` instead of a worker to calculate synchronously (SSR, tests). `createIndicatorWorker()` rejects where there are no workers, or where a Content Security Policy refuses `blob:` and `data:` workers.
|
|
59
59
|
|
|
60
60
|
### Drawing Tools (24)
|
|
61
61
|
|