@tradecanvas/core 1.83.0 → 1.84.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.
Files changed (63) hide show
  1. package/README.md +6 -6
  2. package/dist/{WebGLSeriesRenderer-CNjcz7gD.js → WebGLSeriesRenderer-DguvFCTx.js} +1 -1
  3. package/dist/{WebGLSeriesRenderer-CNjcz7gD.js.map → WebGLSeriesRenderer-DguvFCTx.js.map} +1 -1
  4. package/dist/{WebGLSeriesRenderer-CcD5VtQE.cjs → WebGLSeriesRenderer-lwJz1WAg.cjs} +1 -1
  5. package/dist/{WebGLSeriesRenderer-CcD5VtQE.cjs.map → WebGLSeriesRenderer-lwJz1WAg.cjs.map} +1 -1
  6. package/dist/index.cjs +8 -8
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +3232 -2503
  9. package/dist/index.js.map +1 -1
  10. package/dist/indicator.worker-1I8WNx4q.js +18 -0
  11. package/dist/indicator.worker-1I8WNx4q.js.map +1 -0
  12. package/dist/indicator.worker-g0us81yM.cjs +2 -0
  13. package/dist/indicator.worker-g0us81yM.cjs.map +1 -0
  14. package/dist/indicators/IndicatorEngine.d.ts +33 -40
  15. package/dist/indicators/IndicatorEngine.d.ts.map +1 -1
  16. package/dist/indicators/IndicatorValueMap.d.ts +6 -0
  17. package/dist/indicators/IndicatorValueMap.d.ts.map +1 -1
  18. package/dist/indicators/PointwiseIndicator.d.ts +7 -5
  19. package/dist/indicators/PointwiseIndicator.d.ts.map +1 -1
  20. package/dist/indicators/builtInFactories.d.ts +8 -0
  21. package/dist/indicators/builtInFactories.d.ts.map +1 -0
  22. package/dist/indicators/index.d.ts +7 -0
  23. package/dist/indicators/index.d.ts.map +1 -1
  24. package/dist/indicators/indicatorInstance.d.ts +59 -0
  25. package/dist/indicators/indicatorInstance.d.ts.map +1 -0
  26. package/dist/indicators/instanceReads.d.ts +40 -0
  27. package/dist/indicators/instanceReads.d.ts.map +1 -0
  28. package/dist/indicators/overlay/ChandeKrollStop.d.ts +4 -0
  29. package/dist/indicators/overlay/ChandeKrollStop.d.ts.map +1 -1
  30. package/dist/indicators/overlay/DEMA.d.ts +4 -0
  31. package/dist/indicators/overlay/DEMA.d.ts.map +1 -1
  32. package/dist/indicators/overlay/VWAP.d.ts +4 -0
  33. package/dist/indicators/overlay/VWAP.d.ts.map +1 -1
  34. package/dist/indicators/panel/MACD.d.ts +4 -0
  35. package/dist/indicators/panel/MACD.d.ts.map +1 -1
  36. package/dist/indicators/panel/RSI.d.ts +4 -0
  37. package/dist/indicators/panel/RSI.d.ts.map +1 -1
  38. package/dist/indicators/panel/UlcerIndex.d.ts +4 -0
  39. package/dist/indicators/panel/UlcerIndex.d.ts.map +1 -1
  40. package/dist/indicators/panel/VolumeOscillator.d.ts +4 -0
  41. package/dist/indicators/panel/VolumeOscillator.d.ts.map +1 -1
  42. package/dist/indicators/recompute.bench.d.ts +2 -0
  43. package/dist/indicators/recompute.bench.d.ts.map +1 -0
  44. package/dist/indicators/registry.d.ts.map +1 -1
  45. package/dist/indicators/worker/IndicatorWorkerBridge.d.ts +81 -0
  46. package/dist/indicators/worker/IndicatorWorkerBridge.d.ts.map +1 -0
  47. package/dist/indicators/worker/IndicatorWorkerHost.d.ts +2 -1
  48. package/dist/indicators/worker/IndicatorWorkerHost.d.ts.map +1 -1
  49. package/dist/indicators/worker/IndicatorWorkerPool.d.ts +99 -0
  50. package/dist/indicators/worker/IndicatorWorkerPool.d.ts.map +1 -0
  51. package/dist/indicators/worker/columns.d.ts +78 -0
  52. package/dist/indicators/worker/columns.d.ts.map +1 -0
  53. package/dist/indicators/worker/messages.d.ts +26 -13
  54. package/dist/indicators/worker/messages.d.ts.map +1 -1
  55. package/dist/indicators/worker/spawnWorker.d.ts +17 -0
  56. package/dist/indicators/worker/spawnWorker.d.ts.map +1 -0
  57. package/dist/indicators/worker/workerHandler.d.ts +16 -0
  58. package/dist/indicators/worker/workerHandler.d.ts.map +1 -0
  59. package/dist/indicators/worker/workerJobs.d.ts +56 -0
  60. package/dist/indicators/worker/workerJobs.d.ts.map +1 -0
  61. package/dist/indicators/worker/workerState.d.ts +28 -0
  62. package/dist/indicators/worker/workerState.d.ts.map +1 -0
  63. 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
- `IndicatorWorkerHost` wraps a `Worker` you create and exposes a Promise-based `calculate()`, with a per-request timeout and a `ping()` health check:
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
- // 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' })
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). 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
+ 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
 
@@ -1781,4 +1781,4 @@ function $(e) {
1781
1781
  //#endregion
1782
1782
  export { Ee as WebGLSeriesRenderer };
1783
1783
 
1784
- //# sourceMappingURL=WebGLSeriesRenderer-CNjcz7gD.js.map
1784
+ //# sourceMappingURL=WebGLSeriesRenderer-DguvFCTx.js.map