@tradecanvas/core 1.23.0 → 1.24.0

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 CHANGED
@@ -42,19 +42,20 @@ Indicator parameters are read through `getNumberParam` / `getIntParam` helpers,
42
42
 
43
43
  Extensible via `IndicatorBase` for custom indicators.
44
44
 
45
- ### Web Worker offload
45
+ ### Indicator math in a worker
46
46
 
47
- `IndicatorWorkerHost` wraps a `Worker` and exposes a Promise-based `calculate()` so heavy charts can run indicator math off the main thread:
47
+ `IndicatorWorkerHost` wraps a `Worker` you create and exposes a Promise-based `calculate()`, with a per-request timeout and a `ping()` health check:
48
48
 
49
49
  ```ts
50
50
  import { IndicatorWorkerHost } from '@tradecanvas/core'
51
51
 
52
- const worker = new Worker(new URL('./dist/indicator.worker.js', import.meta.url), { type: 'module' })
52
+ // Your own worker, built from src/indicators/worker/indicator.worker.ts in the repository
53
+ const worker = new Worker(new URL('./indicator.worker.ts', import.meta.url), { type: 'module' })
53
54
  const host = new IndicatorWorkerHost(worker)
54
55
  const output = await host.calculate('rsi', config, bars)
55
56
  ```
56
57
 
57
- Pass `null` instead of a worker for synchronous fallback (SSR, tests). The shipped `indicator.worker.js` registers all 33 built-in indicators and supports `calculate` and `ping` requests.
58
+ Pass `null` instead of a worker to calculate synchronously (SSR, tests). The package does not ship a built worker script, and the chart computes its own indicators on the main thread; it does not route them through this host yet.
58
59
 
59
60
  ### Drawing Tools (24)
60
61