@tradecanvas/core 1.11.0 → 1.12.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 (65) hide show
  1. package/README.md +2 -4
  2. package/dist/{WebGLSeriesRenderer-DVJBHdfm.js → WebGLSeriesRenderer-CLVnGxIS.js} +174 -134
  3. package/dist/{WebGLSeriesRenderer-DVJBHdfm.js.map → WebGLSeriesRenderer-CLVnGxIS.js.map} +1 -1
  4. package/dist/{WebGLSeriesRenderer-DjkYvHPQ.cjs → WebGLSeriesRenderer-rB3-CqXS.cjs} +12 -12
  5. package/dist/{WebGLSeriesRenderer-DjkYvHPQ.cjs.map → WebGLSeriesRenderer-rB3-CqXS.cjs.map} +1 -1
  6. package/dist/charts/BaselineRenderer.d.ts.map +1 -1
  7. package/dist/charts/KagiRenderer.d.ts.map +1 -1
  8. package/dist/charts/PointAndFigureRenderer.d.ts.map +1 -1
  9. package/dist/engine/RenderEngine.d.ts +5 -0
  10. package/dist/engine/RenderEngine.d.ts.map +1 -1
  11. package/dist/engine/gpu.d.ts +3 -1
  12. package/dist/engine/gpu.d.ts.map +1 -1
  13. package/dist/engine/gpuContexts.d.ts +23 -0
  14. package/dist/engine/gpuContexts.d.ts.map +1 -0
  15. package/dist/engine/index.d.ts +3 -1
  16. package/dist/engine/index.d.ts.map +1 -1
  17. package/dist/engine/loadWebGL.d.ts +15 -2
  18. package/dist/engine/loadWebGL.d.ts.map +1 -1
  19. package/dist/{gridLines-CBmfrSCE.cjs → gridLines-CVQJ3gzb.cjs} +2 -2
  20. package/dist/gridLines-CVQJ3gzb.cjs.map +1 -0
  21. package/dist/{gridLines-BJLaM2d7.js → gridLines-ovHZBvAe.js} +38 -5
  22. package/dist/gridLines-ovHZBvAe.js.map +1 -0
  23. package/dist/index.cjs +6 -6
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.js +3242 -2484
  26. package/dist/index.js.map +1 -1
  27. package/dist/indicators/index.d.ts +13 -1
  28. package/dist/indicators/index.d.ts.map +1 -1
  29. package/dist/indicators/math.d.ts +2 -0
  30. package/dist/indicators/math.d.ts.map +1 -1
  31. package/dist/indicators/overlay/HammingMA.d.ts +19 -0
  32. package/dist/indicators/overlay/HammingMA.d.ts.map +1 -0
  33. package/dist/indicators/overlay/MAChannel.d.ts +13 -0
  34. package/dist/indicators/overlay/MAChannel.d.ts.map +1 -0
  35. package/dist/indicators/overlay/MACross.d.ts.map +1 -1
  36. package/dist/indicators/overlay/MovingAverageSets.d.ts +20 -0
  37. package/dist/indicators/overlay/MovingAverageSets.d.ts.map +1 -0
  38. package/dist/indicators/overlay/PivotPoints.d.ts +5 -0
  39. package/dist/indicators/overlay/PivotPoints.d.ts.map +1 -1
  40. package/dist/indicators/overlay/PriceAverages.d.ts +25 -0
  41. package/dist/indicators/overlay/PriceAverages.d.ts.map +1 -0
  42. package/dist/indicators/overlay/VolatilityIndex.d.ts +13 -0
  43. package/dist/indicators/overlay/VolatilityIndex.d.ts.map +1 -0
  44. package/dist/indicators/panel/AccumulativeSwingIndex.d.ts +13 -0
  45. package/dist/indicators/panel/AccumulativeSwingIndex.d.ts.map +1 -0
  46. package/dist/indicators/panel/AdvanceDecline.d.ts +18 -0
  47. package/dist/indicators/panel/AdvanceDecline.d.ts.map +1 -0
  48. package/dist/indicators/panel/ChopZone.d.ts +17 -0
  49. package/dist/indicators/panel/ChopZone.d.ts.map +1 -0
  50. package/dist/indicators/panel/MajorityRule.d.ts +15 -0
  51. package/dist/indicators/panel/MajorityRule.d.ts.map +1 -0
  52. package/dist/indicators/panel/PriceOscillator.d.ts +8 -0
  53. package/dist/indicators/panel/PriceOscillator.d.ts.map +1 -0
  54. package/dist/indicators/panel/SMIErgodic.d.ts +12 -0
  55. package/dist/indicators/panel/SMIErgodic.d.ts.map +1 -0
  56. package/dist/indicators/panel/VolatilityEstimators.d.ts +29 -0
  57. package/dist/indicators/panel/VolatilityEstimators.d.ts.map +1 -0
  58. package/dist/indicators/registry.d.ts.map +1 -1
  59. package/dist/indicators/symbols/symbolIndicators.d.ts +27 -0
  60. package/dist/indicators/symbols/symbolIndicators.d.ts.map +1 -1
  61. package/dist/webgl/WebGLSeriesRenderer.d.ts +30 -12
  62. package/dist/webgl/WebGLSeriesRenderer.d.ts.map +1 -1
  63. package/package.json +2 -2
  64. package/dist/gridLines-BJLaM2d7.js.map +0 -1
  65. package/dist/gridLines-CBmfrSCE.cjs.map +0 -1
@@ -107,6 +107,18 @@ export { NetVolumeIndicator } from './panel/NetVolume.js';
107
107
  export { StandardErrorBandsIndicator } from './overlay/StandardErrorBands.js';
108
108
  export { GuppyMMAIndicator } from './overlay/GuppyMMA.js';
109
109
  export { MARibbonIndicator } from './overlay/MARibbon.js';
110
+ export { AveragePriceIndicator, MedianPriceIndicator, TypicalPriceIndicator } from './overlay/PriceAverages.js';
111
+ export { MAChannelIndicator } from './overlay/MAChannel.js';
112
+ export { HammingMAIndicator } from './overlay/HammingMA.js';
113
+ export { MADoubleIndicator, MATripleIndicator } from './overlay/MovingAverageSets.js';
114
+ export { VolatilityIndexIndicator } from './overlay/VolatilityIndex.js';
115
+ export { AccumulativeSwingIndexIndicator } from './panel/AccumulativeSwingIndex.js';
116
+ export { AdvanceDeclineIndicator } from './panel/AdvanceDecline.js';
117
+ export { MajorityRuleIndicator } from './panel/MajorityRule.js';
118
+ export { ChopZoneIndicator } from './panel/ChopZone.js';
119
+ export { SMIErgodicIndicator } from './panel/SMIErgodic.js';
120
+ export { PriceOscillatorIndicator } from './panel/PriceOscillator.js';
121
+ export { VolatilityOHLCIndicator, VolatilityZeroTrendIndicator } from './panel/VolatilityEstimators.js';
110
122
  export { SymbolSeriesStore } from './symbols/SymbolSeriesStore.js';
111
- export { CompareSymbolIndicator, SpreadIndicator } from './symbols/symbolIndicators.js';
123
+ export { CompareSymbolIndicator, SpreadIndicator, CorrelationCoefficientIndicator, CorrelationLogIndicator } from './symbols/symbolIndicators.js';
112
124
  //# sourceMappingURL=index.d.ts.map
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AAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -9,6 +9,8 @@ export declare function closes(data: DataSeries): number[];
9
9
  export declare function smaOf(src: readonly Num[], period: number): Num[];
10
10
  /** Exponential moving average, seeded with the simple average of its first `period` values. */
11
11
  export declare function emaOf(src: readonly Num[], period: number): Num[];
12
+ /** Linearly weighted moving average: the newest of `period` values weighs `period`, the oldest 1 (none across a gap). */
13
+ export declare function wmaOf(src: readonly Num[], period: number): Num[];
12
14
  /** Wilder's smoothing (RMA, SMMA): an EMA with alpha 1 / period. */
13
15
  export declare function rmaOf(src: readonly Num[], period: number): Num[];
14
16
  /** Population standard deviation over the last `period` values (none across a gap). */
@@ -1 +1 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/indicators/math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGxF,2DAA2D;AAC3D,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;AAErC,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,IAAI,EAAE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CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAWlH;AAED,uDAAuD;AACvD,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKtF;AAED,qDAAqD;AACrD,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKrF;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK3F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA8BvE"}
@@ -0,0 +1,19 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorValue } from '@tradecanvas/commons';
2
+ import { PointwiseIndicator } from '../PointwiseIndicator.js';
3
+ interface HammingParams {
4
+ weights: number[];
5
+ total: number;
6
+ }
7
+ /**
8
+ * Hamming Moving Average: the closes of the last `period` bars weighted by a
9
+ * Hamming window (0.54 − 0.46·cos(2πk / (period − 1))), most in the middle of
10
+ * the window and evenly either side, then divided by the weights' sum. Smoother
11
+ * than a simple average, with a lag of half the window.
12
+ */
13
+ export declare class HammingMAIndicator extends PointwiseIndicator<HammingParams> {
14
+ descriptor: IndicatorDescriptor;
15
+ protected read(config: IndicatorConfig): HammingParams;
16
+ protected pointAt(data: DataSeries, i: number, { weights, total }: HammingParams): IndicatorValue | null;
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=HammingMA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HammingMA.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/HammingMA.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAM9D,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,kBAAkB,CAAC,aAAa,CAAC;IACvE,UAAU,EAAE,mBAAmB,CAQ7B;IAEF,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa;IAMtD,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,aAAa,GAAG,cAAc,GAAG,IAAI;CAOzG"}
@@ -0,0 +1,13 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput, ResolvedIndicatorStyle, ViewportState } from '@tradecanvas/commons';
2
+ import { IndicatorBase } from '../IndicatorBase.js';
3
+ /**
4
+ * Moving Average Channel: the average of the highs over `upperLength` bars
5
+ * and of the lows over `lowerLength`, each shifted by its own offset (later
6
+ * by a positive one, earlier by a negative one), with the channel shaded.
7
+ */
8
+ export declare class MAChannelIndicator extends IndicatorBase {
9
+ descriptor: IndicatorDescriptor;
10
+ calculate(data: DataSeries, config: IndicatorConfig): IndicatorOutput;
11
+ render(ctx: CanvasRenderingContext2D, output: IndicatorOutput, viewport: ViewportState, style: ResolvedIndicatorStyle): void;
12
+ }
13
+ //# sourceMappingURL=MAChannel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MAChannel.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/MAChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,sBAAsB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErK,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,UAAU,EAAE,mBAAmB,CAgB7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;IAWrE,MAAM,CAAC,GAAG,EAAE,wBAAwB,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,sBAAsB,GAAG,IAAI;CA0B7H"}
@@ -1 +1 @@
1
- {"version":3,"file":"MACross.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/MACross.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,gGAAgG;AAChG,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,UAAU,EAAE,mBAAmB,CAQ7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;IAYrE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI;CAoB/G"}
1
+ {"version":3,"file":"MACross.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/MACross.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAapD,gGAAgG;AAChG,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,UAAU,EAAE,mBAAmB,CAQ7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;IASrE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI;CAiB/G"}
@@ -0,0 +1,20 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput } from '@tradecanvas/commons';
2
+ import { IndicatorBase } from '../IndicatorBase.js';
3
+ /** Two or three moving averages of one kind (simple, exponential or weighted), each of its own length. */
4
+ declare abstract class MovingAverageSet extends IndicatorBase {
5
+ /** The length parameters, in order, with their defaults. */
6
+ protected abstract readonly lengths: readonly (readonly [string, number])[];
7
+ calculate(data: DataSeries, config: IndicatorConfig): IndicatorOutput;
8
+ }
9
+ /** Moving Average Double: a shorter and a longer average. */
10
+ export declare class MADoubleIndicator extends MovingAverageSet {
11
+ protected readonly lengths: readonly [readonly ["first", 20], readonly ["second", 50]];
12
+ descriptor: IndicatorDescriptor;
13
+ }
14
+ /** Moving Average Triple: three averages, short to long. */
15
+ export declare class MATripleIndicator extends MovingAverageSet {
16
+ protected readonly lengths: readonly [readonly ["first", 10], readonly ["second", 20], readonly ["third", 50]];
17
+ descriptor: IndicatorDescriptor;
18
+ }
19
+ export {};
20
+ //# sourceMappingURL=MovingAverageSets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MovingAverageSets.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/MovingAverageSets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAapD,0GAA0G;AAC1G,uBAAe,gBAAiB,SAAQ,aAAa;IACnD,4DAA4D;IAC5D,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAE5E,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;CActE;AAED,6DAA6D;AAC7D,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,SAAS,CAAC,QAAQ,CAAC,OAAO,6DAA4C;IACtE,UAAU,EAAE,mBAAmB,CAW7B;CACH;AAED,4DAA4D;AAC5D,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,SAAS,CAAC,QAAQ,CAAC,OAAO,qFAA2D;IACrF,UAAU,EAAE,mBAAmB,CAY7B;CACH"}
@@ -1,5 +1,10 @@
1
1
  import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput, ResolvedIndicatorStyle, ViewportState } from '@tradecanvas/commons';
2
2
  import { IndicatorBase } from '../IndicatorBase.js';
3
+ /**
4
+ * Pivot points from the high, low and close of the last `lookback` bars
5
+ * (and their first open, for DeMark's), by kind: traditional, Fibonacci,
6
+ * Woodie, classic, Camarilla or DeMark (one level either side).
7
+ */
3
8
  export declare class PivotPointsIndicator extends IndicatorBase {
4
9
  descriptor: IndicatorDescriptor;
5
10
  calculate(data: DataSeries, config: IndicatorConfig): IndicatorOutput;
@@ -1 +1 @@
1
- {"version":3,"file":"PivotPoints.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/PivotPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,sBAAsB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrK,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,UAAU,EAAE,mBAAmB,CAe7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;IAgCrE,MAAM,CACJ,GAAG,EAAE,wBAAwB,EAC7B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,sBAAsB,GAC5B,IAAI;CAuCR"}
1
+ {"version":3,"file":"PivotPoints.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/PivotPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,sBAAsB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrK,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWpD;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,UAAU,EAAE,mBAAmB,CAgB7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;IAsBrE,MAAM,CACJ,GAAG,EAAE,wBAAwB,EAC7B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,sBAAsB,GAC5B,IAAI;CAuCR"}
@@ -0,0 +1,25 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorValue, OHLCBar } from '@tradecanvas/commons';
2
+ import { PointwiseIndicator } from '../PointwiseIndicator.js';
3
+ /** One price worked out of each bar, drawn as a line over the bars. */
4
+ declare abstract class BarPriceIndicator extends PointwiseIndicator<null> {
5
+ protected abstract price(bar: OHLCBar): number;
6
+ protected read(_config: IndicatorConfig): null;
7
+ protected pointAt(data: DataSeries, i: number): IndicatorValue | null;
8
+ }
9
+ /** Average Price: (open + high + low + close) / 4. */
10
+ export declare class AveragePriceIndicator extends BarPriceIndicator {
11
+ descriptor: IndicatorDescriptor;
12
+ protected price(b: OHLCBar): number;
13
+ }
14
+ /** Median Price: (high + low) / 2. */
15
+ export declare class MedianPriceIndicator extends BarPriceIndicator {
16
+ descriptor: IndicatorDescriptor;
17
+ protected price(b: OHLCBar): number;
18
+ }
19
+ /** Typical Price: (high + low + close) / 3. */
20
+ export declare class TypicalPriceIndicator extends BarPriceIndicator {
21
+ descriptor: IndicatorDescriptor;
22
+ protected price(b: OHLCBar): number;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=PriceAverages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceAverages.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/PriceAverages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,uEAAuE;AACvE,uBAAe,iBAAkB,SAAQ,kBAAkB,CAAC,IAAI,CAAC;IAC/D,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAE9C,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAI9C,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;CAGtE;AAED,sDAAsD;AACtD,qBAAa,qBAAsB,SAAQ,iBAAiB;IAC1D,UAAU,EAAE,mBAAmB,CAO7B;IAEF,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM;CAGpC;AAED,sCAAsC;AACtC,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,UAAU,EAAE,mBAAmB,CAO7B;IAEF,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM;CAGpC;AAED,+CAA+C;AAC/C,qBAAa,qBAAsB,SAAQ,iBAAiB;IAC1D,UAAU,EAAE,mBAAmB,CAO7B;IAEF,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM;CAGpC"}
@@ -0,0 +1,13 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput } from '@tradecanvas/commons';
2
+ import { IndicatorBase } from '../IndicatorBase.js';
3
+ /**
4
+ * Volatility Index (Wilder's volatility system): a stop and reverse that
5
+ * trails the most extreme close since the last turn by `mult` times the
6
+ * average true range (Wilder's smoothing over `period` bars): under the
7
+ * closes while long, over them while short, turning when a close crosses it.
8
+ */
9
+ export declare class VolatilityIndexIndicator extends IndicatorBase {
10
+ descriptor: IndicatorDescriptor;
11
+ calculate(data: DataSeries, config: IndicatorConfig): IndicatorOutput;
12
+ }
13
+ //# sourceMappingURL=VolatilityIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VolatilityIndex.d.ts","sourceRoot":"","sources":["../../../src/indicators/overlay/VolatilityIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,UAAU,EAAE,mBAAmB,CAQ7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;CAkCtE"}
@@ -0,0 +1,13 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput } from '@tradecanvas/commons';
2
+ import { IndicatorBase } from '../IndicatorBase.js';
3
+ /**
4
+ * Accumulative Swing Index (Wilder): the running sum of each bar's swing
5
+ * index, which weighs the move from the previous close (and the bar's own
6
+ * body, and the previous bar's) against the bar's true range, scaled by the
7
+ * limit move: the most a price may move in a bar. It runs with the trend.
8
+ */
9
+ export declare class AccumulativeSwingIndexIndicator extends IndicatorBase {
10
+ descriptor: IndicatorDescriptor;
11
+ calculate(data: DataSeries, config: IndicatorConfig): IndicatorOutput;
12
+ }
13
+ //# sourceMappingURL=AccumulativeSwingIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccumulativeSwingIndex.d.ts","sourceRoot":"","sources":["../../../src/indicators/panel/AccumulativeSwingIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAA2B,MAAM,sBAAsB,CAAC;AACvI,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD;;;;;GAKG;AACH,qBAAa,+BAAgC,SAAQ,aAAa;IAChE,UAAU,EAAE,mBAAmB,CAS7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;CAUtE"}
@@ -0,0 +1,18 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorValue } from '@tradecanvas/commons';
2
+ import { PointwiseIndicator } from '../PointwiseIndicator.js';
3
+ /**
4
+ * Advance/Decline: of the last `length` bars, those closing above their open
5
+ * over those closing below it (their count when none closed below).
6
+ */
7
+ export declare class AdvanceDeclineIndicator extends PointwiseIndicator<{
8
+ length: number;
9
+ }> {
10
+ descriptor: IndicatorDescriptor;
11
+ protected read(config: IndicatorConfig): {
12
+ length: number;
13
+ };
14
+ protected pointAt(data: DataSeries, i: number, { length }: {
15
+ length: number;
16
+ }): IndicatorValue | null;
17
+ }
18
+ //# sourceMappingURL=AdvanceDecline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdvanceDecline.d.ts","sourceRoot":"","sources":["../../../src/indicators/panel/AdvanceDecline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;IACjF,UAAU,EAAE,mBAAmB,CAS7B;IAEF,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe;;;IAItC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc,GAAG,IAAI;CAUtG"}
@@ -0,0 +1,17 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput, ResolvedIndicatorStyle, ViewportState } from '@tradecanvas/commons';
2
+ import { IndicatorBase } from '../IndicatorBase.js';
3
+ /**
4
+ * Chop Zone: the angle, in degrees, of the 34-bar EMA's slope, its rise per
5
+ * bar scaled by the range of the last 30 bars. Each bar is coloured by its
6
+ * zone, from turquoise (rising steeply) through yellow (flat, choppy) to
7
+ * dark red (falling steeply); the zones are the indicator, so it keeps its
8
+ * own colours whatever the style.
9
+ */
10
+ export declare class ChopZoneIndicator extends IndicatorBase {
11
+ descriptor: IndicatorDescriptor;
12
+ calculate(data: DataSeries, _config: IndicatorConfig): IndicatorOutput;
13
+ render(ctx: CanvasRenderingContext2D, output: IndicatorOutput, viewport: ViewportState, _style: ResolvedIndicatorStyle): void;
14
+ }
15
+ /** The colour of the zone an angle (degrees) falls in. */
16
+ export declare function chopZoneColor(angle: number): string;
17
+ //# sourceMappingURL=ChopZone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChopZone.d.ts","sourceRoot":"","sources":["../../../src/indicators/panel/ChopZone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,sBAAsB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrK,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IAClD,UAAU,EAAE,mBAAmB,CAQ7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe;IAmBtE,MAAM,CAAC,GAAG,EAAE,wBAAwB,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,sBAAsB,GAAG,IAAI;CAa9H;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUnD"}
@@ -0,0 +1,15 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorValue } from '@tradecanvas/commons';
2
+ import { PointwiseIndicator } from '../PointwiseIndicator.js';
3
+ /** Majority Rule: the share of the last `period` closes above the close before, in percent. */
4
+ export declare class MajorityRuleIndicator extends PointwiseIndicator<{
5
+ period: number;
6
+ }> {
7
+ descriptor: IndicatorDescriptor;
8
+ protected read(config: IndicatorConfig): {
9
+ period: number;
10
+ };
11
+ protected pointAt(data: DataSeries, i: number, { period }: {
12
+ period: number;
13
+ }): IndicatorValue | null;
14
+ }
15
+ //# sourceMappingURL=MajorityRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MajorityRule.d.ts","sourceRoot":"","sources":["../../../src/indicators/panel/MajorityRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,+FAA+F;AAC/F,qBAAa,qBAAsB,SAAQ,kBAAkB,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;IAC/E,UAAU,EAAE,mBAAmB,CAU7B;IAEF,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe;;;IAItC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc,GAAG,IAAI;CAMtG"}
@@ -0,0 +1,8 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput } from '@tradecanvas/commons';
2
+ import { IndicatorBase } from '../IndicatorBase.js';
3
+ /** Price Oscillator: the short simple average less the long one, in price (the percentage one is PPO). */
4
+ export declare class PriceOscillatorIndicator extends IndicatorBase {
5
+ descriptor: IndicatorDescriptor;
6
+ calculate(data: DataSeries, config: IndicatorConfig): IndicatorOutput;
7
+ }
8
+ //# sourceMappingURL=PriceOscillator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceOscillator.d.ts","sourceRoot":"","sources":["../../../src/indicators/panel/PriceOscillator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,0GAA0G;AAC1G,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,UAAU,EAAE,mBAAmB,CAS7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;CAMtE"}
@@ -0,0 +1,12 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorOutput } from '@tradecanvas/commons';
2
+ import { IndicatorBase } from '../IndicatorBase.js';
3
+ /**
4
+ * SMI Ergodic (Blau): the bar-to-bar change of the close, smoothed twice by
5
+ * EMAs (`long`, then `short`), over its absolute value smoothed the same way:
6
+ * between −1 and 1. A `signal` EMA of it, and their gap as the oscillator.
7
+ */
8
+ export declare class SMIErgodicIndicator extends IndicatorBase {
9
+ descriptor: IndicatorDescriptor;
10
+ calculate(data: DataSeries, config: IndicatorConfig): IndicatorOutput;
11
+ }
12
+ //# sourceMappingURL=SMIErgodic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SMIErgodic.d.ts","sourceRoot":"","sources":["../../../src/indicators/panel/SMIErgodic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,aAAa;IACpD,UAAU,EAAE,mBAAmB,CAa7B;IAEF,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe;CAetE"}
@@ -0,0 +1,29 @@
1
+ import { IndicatorDescriptor, DataSeries, IndicatorConfig, IndicatorValue } from '@tradecanvas/commons';
2
+ import { PointwiseIndicator } from '../PointwiseIndicator.js';
3
+ interface VolatilityParams {
4
+ period: number;
5
+ annual: number;
6
+ }
7
+ /**
8
+ * Volatility O-H-L-C (Garman–Klass): each bar's variance read from its range
9
+ * and body, 0.5·ln(H/L)² − (2·ln2 − 1)·ln(C/O)², averaged over `period`
10
+ * bars and annualised by `annual` bars a year, in percent. It uses more of
11
+ * each bar than the close-to-close estimate, so it settles sooner.
12
+ */
13
+ export declare class VolatilityOHLCIndicator extends PointwiseIndicator<VolatilityParams> {
14
+ descriptor: IndicatorDescriptor;
15
+ protected read(config: IndicatorConfig): VolatilityParams;
16
+ protected pointAt(data: DataSeries, i: number, { period, annual }: VolatilityParams): IndicatorValue | null;
17
+ }
18
+ /**
19
+ * Volatility Zero Trend Close-to-Close: the root mean square of the log
20
+ * returns over `period` bars, taken about zero rather than their own mean
21
+ * (a steady trend counts as volatility), annualised, in percent.
22
+ */
23
+ export declare class VolatilityZeroTrendIndicator extends PointwiseIndicator<VolatilityParams> {
24
+ descriptor: IndicatorDescriptor;
25
+ protected read(config: IndicatorConfig): VolatilityParams;
26
+ protected pointAt(data: DataSeries, i: number, { period, annual }: VolatilityParams): IndicatorValue | null;
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=VolatilityEstimators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VolatilityEstimators.d.ts","sourceRoot":"","sources":["../../../src/indicators/panel/VolatilityEstimators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AASD;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB,CAAC,gBAAgB,CAAC;IAC/E,UAAU,EAAE,mBAAmB,CAS7B;IAEF,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe;IAItC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,gBAAgB,GAAG,cAAc,GAAG,IAAI;CAU5G;AAED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,kBAAkB,CAAC,gBAAgB,CAAC;IACpF,UAAU,EAAE,mBAAmB,CAS7B;IAEF,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe;IAItC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,gBAAgB,GAAG,cAAc,GAAG,IAAI;CAW5G"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/indicators/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAoG5D,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAkGvE"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/indicators/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAgH5D,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAkHvE"}
@@ -30,5 +30,32 @@ export declare class SpreadIndicator extends PointwiseIndicator<SpreadParams> {
30
30
  protected read(config: IndicatorConfig): SpreadParams;
31
31
  protected pointAt(data: DataSeries, i: number, { symbol, ratio }: SpreadParams): IndicatorValue | null;
32
32
  }
33
+ interface CorrelationParams extends SymbolParams {
34
+ length: number;
35
+ }
36
+ /**
37
+ * Correlation Coefficient: how closely the chart's closes and another
38
+ * symbol's (its bar at or before each one) move together over the last
39
+ * `length` bars, from −1 (opposite) to 1 (in step).
40
+ */
41
+ export declare class CorrelationCoefficientIndicator extends PointwiseIndicator<CorrelationParams> {
42
+ private readonly store;
43
+ descriptor: IndicatorDescriptor;
44
+ constructor(store: SymbolSeriesStore);
45
+ protected read(config: IndicatorConfig): CorrelationParams;
46
+ protected pointAt(data: DataSeries, i: number, { symbol, length }: CorrelationParams): IndicatorValue | null;
47
+ }
48
+ /**
49
+ * Correlation Log: the correlation of the two symbols' bar-to-bar log returns
50
+ * over the last `length` bars. Prices that trend together correlate whatever
51
+ * their day-to-day moves; returns tell whether they move together bar by bar.
52
+ */
53
+ export declare class CorrelationLogIndicator extends PointwiseIndicator<CorrelationParams> {
54
+ private readonly store;
55
+ descriptor: IndicatorDescriptor;
56
+ constructor(store: SymbolSeriesStore);
57
+ protected read(config: IndicatorConfig): CorrelationParams;
58
+ protected pointAt(data: DataSeries, i: number, { symbol, length }: CorrelationParams): IndicatorValue | null;
59
+ }
33
60
  export {};
34
61
  //# sourceMappingURL=symbolIndicators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"symbolIndicators.d.ts","sourceRoot":"","sources":["../../../src/indicators/symbols/symbolIndicators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,YAAa,SAAQ,YAAY;IACzC,KAAK,EAAE,OAAO,CAAC;CAChB;AAKD;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IAU9D,OAAO,CAAC,QAAQ,CAAC,KAAK;IATlC,UAAU,EAAE,mBAAmB,CAO7B;gBAE2B,KAAK,EAAE,iBAAiB;IAIrD,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY;IAIrD,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,YAAY,GAAG,cAAc,GAAG,IAAI;CAKhG;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IAWvD,OAAO,CAAC,QAAQ,CAAC,KAAK;IAVlC,UAAU,EAAE,mBAAmB,CAQ7B;gBAE2B,KAAK,EAAE,iBAAiB;IAIrD,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY;IAIrD,SAAS,CAAC,OAAO,CAA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EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,YAAY,GAAG,cAAc,GAAG,IAAI;CAOvG;AAED,UAAU,iBAAkB,SAAQ,YAAY;IAC9C,MAAM,EAAE,MAAM,CAAC;CAChB;AA2CD;;;;GAIG;AACH,qBAAa,+BAAgC,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IAG5E,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,UAAU,EAAE,mBAAmB,CAA+G;gBAEjH,KAAK,EAAE,iBAAiB;IAIrD,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;IAI1D,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAG,cAAc,GAAG,IAAI;CAa7G;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IAGpE,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,UAAU,EAAE,mBAAmB,CAA8G;gBAEhH,KAAK,EAAE,iBAAiB;IAIrD,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;IAI1D,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAG,cAAc,GAAG,IAAI;CAiB7G"}
@@ -12,16 +12,16 @@ export declare class WebGLSeriesRenderer implements GpuRenderer {
12
12
  readonly label: string;
13
13
  private readonly gl;
14
14
  private readonly kit;
15
- private readonly drawer;
16
- private readonly candleBars;
17
- private readonly volumeBars;
18
- private readonly candleColumns;
19
- private readonly volumeColumns;
20
- private readonly rects;
21
- private readonly seriesBuffer;
22
- private readonly columnBuffer;
23
- private readonly rectBuffer;
24
- private readonly uploads;
15
+ private drawer;
16
+ private candleBars;
17
+ private volumeBars;
18
+ private candleColumns;
19
+ private volumeColumns;
20
+ private rects;
21
+ private seriesBuffer;
22
+ private columnBuffer;
23
+ private rectBuffer;
24
+ private uploads;
25
25
  private gpuFloats;
26
26
  private columns;
27
27
  private rectValues;
@@ -29,12 +29,29 @@ export declare class WebGLSeriesRenderer implements GpuRenderer {
29
29
  private clip;
30
30
  private lost;
31
31
  private lostCallback;
32
- /** A renderer on a new canvas, or null where WebGL 2 isn't there (or, asked for, only a software one). */
32
+ private restoredCallback;
33
+ /** Lets go of the context it holds of those the charts may have (`gpuContexts`), while its own is live. */
34
+ private release;
35
+ /**
36
+ * A renderer on a new canvas, or null where WebGL 2 isn't there (or, asked
37
+ * for, only a software one). `release` lets go of the share of the charts'
38
+ * contexts it was made with (see `loadWebGL`): it calls it once its context
39
+ * is lost or it is destroyed, and claims another if the context comes back.
40
+ */
33
41
  static create(options?: {
34
42
  failIfMajorPerformanceCaveat?: boolean;
43
+ release?: () => void;
35
44
  }): WebGLSeriesRenderer | null;
36
45
  private constructor();
37
- /** `callback` once the context is lost; soon (in a microtask) if it already is. */
46
+ /**
47
+ * Programs and buffers, and the series to upload whole: a lost context took
48
+ * the old ones with it. All are made before any is kept, so a throw half-way
49
+ * leaves the renderer as it was.
50
+ */
51
+ private build;
52
+ /** `callback` each time the context comes back after a loss, ready to draw. */
53
+ onRestored(callback: () => void): void;
54
+ /** `callback` each time the context is lost; soon (in a microtask) if it already is. */
38
55
  onLost(callback: () => void): void;
39
56
  recorder(dpr: number, measure: CanvasRenderingContext2D | null): GpuRecorder;
40
57
  render(frame: GpuFrame): GpuDrawn;
@@ -45,6 +62,7 @@ export declare class WebGLSeriesRenderer implements GpuRenderer {
45
62
  private drawRecordedRects;
46
63
  destroy(): void;
47
64
  private readonly handleLost;
65
+ private readonly handleRestored;
48
66
  private syncSeries;
49
67
  /** Zoomed out: the bars merged per pixel column, as the 2D dense renderers merge them. */
50
68
  private buildColumns;
@@ -1 +1 @@
1
- {"version":3,"file":"WebGLSe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AEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAoB7B;IAEF,OAAO,CAAC,UAAU;IAalB,0FAA0F;IAC1F,OAAO,CAAC,YAAY;IA0BpB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAoDtB,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,UAAU;IAsBlB,wFAAwF;IACxF,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,GAAG;IAoBX,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,GAAG;CAGZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradecanvas/core",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "description": "Canvas rendering engine for @tradecanvas/chart",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "README.md"
35
35
  ],
36
36
  "dependencies": {
37
- "@tradecanvas/commons": "1.11.0"
37
+ "@tradecanvas/commons": "1.12.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "jsdom": "^25.0.1",
@@ -1 +0,0 @@
1
- {"version":3,"file":"gridLines-BJLaM2d7.js","names":[],"sources":["../src/viewport/ScaleMapping.ts","../src/charts/pixelGrid.ts","../src/charts/denseBars.ts","../src/axis/gridLines.ts"],"sourcesContent":["import type { ViewportState } from '@tradecanvas/commons';\n\nexport function barIndexToX(index: number, viewport: ViewportState): number {\n const barUnit = viewport.barWidth + viewport.barSpacing;\n return index * barUnit - viewport.offset + viewport.chartRect.x + viewport.barWidth / 2;\n}\n\nexport function priceToY(price: number, viewport: ViewportState): number {\n const { min, max } = viewport.priceRange;\n const { y: top, height } = viewport.chartRect;\n let ratio: number;\n if (viewport.logScale && min > 0 && max > 0) {\n const logMin = Math.log(min);\n const logRange = Math.log(max) - logMin;\n if (logRange === 0) return top + height / 2;\n ratio = (Math.log(Math.max(price, Number.EPSILON)) - logMin) / logRange;\n } else {\n const range = max - min;\n if (range === 0) return top + height / 2;\n ratio = (price - min) / range;\n }\n return top + height * (viewport.invertScale ? ratio : 1 - ratio);\n}\n\n/**\n * `priceToY` for one frame, with the per-call work hoisted out: for renderers\n * that map every visible bar. Follows the log scale and the inverted scale.\n */\nexport function priceToYMapper(viewport: ViewportState): (price: number) => number {\n const { min, max } = viewport.priceRange;\n const { y: top, height } = viewport.chartRect;\n const invert = viewport.invertScale === true;\n if (viewport.logScale && min > 0 && max > 0) {\n const logMin = Math.log(min);\n const logRange = Math.log(max) - logMin;\n if (logRange === 0) return () => top + height / 2;\n const k = height / logRange;\n const bottom = top + height;\n return invert\n ? (price) => top + (Math.log(Math.max(price, Number.EPSILON)) - logMin) * k\n : (price) => bottom - (Math.log(Math.max(price, Number.EPSILON)) - logMin) * k;\n }\n const range = max - min;\n if (range === 0) return () => top + height / 2;\n const k = height / range;\n return invert ? (price) => top + (price - min) * k : (price) => top + (max - price) * k;\n}\n\n/**\n * Where bucket `b` of `count` equal price buckets across the price range sits\n * on screen (bucket 0 holds the lowest prices), on any scale. `toY` is the\n * frame's `priceToYMapper`.\n */\nexport function priceBucketRow(\n b: number,\n count: number,\n viewport: ViewportState,\n toY: (price: number) => number,\n): { top: number; height: number; mid: number } {\n const { min, max } = viewport.priceRange;\n const step = (max - min) / count;\n const yLow = toY(min + b * step);\n const yHigh = toY(min + (b + 1) * step);\n return { top: Math.min(yLow, yHigh), height: Math.abs(yLow - yHigh), mid: (yLow + yHigh) / 2 };\n}\n\nexport function xToBarIndex(x: number, viewport: ViewportState): number {\n const barUnit = viewport.barWidth + viewport.barSpacing;\n return Math.round((x - viewport.chartRect.x - viewport.barWidth / 2 + viewport.offset) / barUnit);\n}\n\nexport function yToPrice(y: number, viewport: ViewportState): number {\n const { min, max } = viewport.priceRange;\n const fromTop = (y - viewport.chartRect.y) / viewport.chartRect.height;\n const ratio = viewport.invertScale ? fromTop : 1 - fromTop;\n if (viewport.logScale && min > 0 && max > 0) {\n const logMin = Math.log(min);\n const logMax = Math.log(max);\n return Math.exp(logMin + (logMax - logMin) * ratio);\n }\n return min + (max - min) * ratio;\n}\n\ntype TimedSeries = ReadonlyArray<{ time: number }>;\n\nconst stepCache = new WeakMap<TimedSeries, { length: number; step: number }>();\n\n/**\n * Typical spacing between bar times — the median of the last ~20 intervals,\n * so a weekend or halt gap doesn't skew it. Used to place times beyond either\n * end of the data (the empty future the chart can be panned into). Cached per\n * series and length; 0 when there are fewer than two bars.\n */\nexport function barTimeStep(data: TimedSeries): number {\n const n = data.length;\n if (n < 2) return 0;\n const cached = stepCache.get(data);\n if (cached && cached.length === n) return cached.step;\n const diffs: number[] = [];\n for (let i = Math.max(1, n - 20); i < n; i++) diffs.push(data[i].time - data[i - 1].time);\n diffs.sort((a, b) => a - b);\n const step = Math.max(0, diffs[diffs.length >> 1]);\n stepCache.set(data, { length: n, step });\n return step;\n}\n\n/**\n * `barTimeStep` in milliseconds whatever unit the series uses: bar times\n * below 1e12 are seconds (the same rule as `normalizeBarTime`).\n */\nexport function barTimeStepMs(data: TimedSeries): number {\n const step = barTimeStep(data);\n const last = data.length > 0 ? data[data.length - 1].time : 0;\n return last > 1e12 ? step : step * 1000;\n}\n\n/**\n * Time at bar index `index`, extrapolated by `barTimeStep` past either end of\n * the data — e.g. the future area right of the newest bar.\n */\nexport function barIndexToTime(index: number, data: TimedSeries): number {\n const n = data.length;\n if (n === 0) return index;\n const last = n - 1;\n if (index > last) return data[last].time + (index - last) * barTimeStep(data);\n if (index < 0) return data[0].time + index * barTimeStep(data);\n const lo = Math.floor(index);\n if (lo === index || lo >= last) return data[lo].time;\n return data[lo].time + (index - lo) * (data[lo + 1].time - data[lo].time);\n}\n\n/**\n * Convert a bar timestamp to its data-array index via binary search.\n * Falls back to fractional interpolation when the timestamp falls between bars,\n * and extrapolates (by `barTimeStep`) for times beyond either end — so a drawing\n * anchored in the future keeps its place instead of collapsing onto the last bar.\n * Returns -1 if data is empty.\n */\nexport function timestampToBarIndex(timestamp: number, data: TimedSeries): number {\n if (data.length === 0) return -1;\n const first = data[0].time;\n const lastIdx = data.length - 1;\n const lastTime = data[lastIdx].time;\n if (timestamp <= first || timestamp >= lastTime) {\n if (timestamp === first) return 0;\n if (timestamp === lastTime) return lastIdx;\n const step = barTimeStep(data);\n if (step <= 0) return timestamp < first ? 0 : lastIdx;\n return timestamp < first ? (timestamp - first) / step : lastIdx + (timestamp - lastTime) / step;\n }\n // Binary search\n let lo = 0, hi = data.length - 1;\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n if (data[mid].time === timestamp) return mid;\n if (data[mid].time < timestamp) lo = mid + 1;\n else hi = mid - 1;\n }\n // lo is the insertion point; interpolate between hi and lo\n if (lo >= data.length) return data.length - 1;\n if (hi < 0) return 0;\n const tLo = data[hi].time, tHi = data[lo].time;\n const frac = tHi !== tLo ? (timestamp - tLo) / (tHi - tLo) : 0;\n return hi + frac;\n}\n\n/**\n * Resolve an anchor `time` value to a (possibly fractional) bar index in the\n * current series. When `viewport.data` is set, `time` is interpreted as a real\n * timestamp and converted via `timestampToBarIndex`. Otherwise `time` is\n * already a bar index and is returned unchanged.\n */\nexport function resolveBarIndex(time: number, viewport: ViewportState): number {\n const data = viewport.data;\n if (data && data.length > 0) {\n return timestampToBarIndex(time, data);\n }\n return time;\n}\n\n/**\n * Map an anchor `time` value to its pixel x. Works whether `time` is a\n * timestamp (when `viewport.data` is set) or a bar index (legacy callers).\n */\nexport function timeToX(time: number, viewport: ViewportState): number {\n return barIndexToX(resolveBarIndex(time, viewport), viewport);\n}\n\n/**\n * Map a pixel x back to an anchor `time` value. Returns a real timestamp when\n * `viewport.data` is set (so the value survives timeframe switches), otherwise\n * returns a bar index for legacy callers.\n */\nexport function xToTime(x: number, viewport: ViewportState): number {\n const idx = xToBarIndex(x, viewport);\n const data = viewport.data;\n if (data && data.length > 0) {\n // Past either end (the empty future, or before the oldest bar) the time\n // is extrapolated, so drawings can be placed there.\n return barIndexToTime(idx, data);\n }\n return idx;\n}\n","/**\n * Drawing on whole device pixels. The chart draws in CSS pixels under the\n * device-pixel-ratio transform, so a 1 px line at a fractional position\n * spreads over two device pixels at half strength and looks soft and thick.\n * Bars drawn here go back to the canvas's own pixels and round to them: a\n * wick is one sharp column, a body has hard edges, at any ratio (1, 1.25, 2…).\n */\n\n/**\n * Rounding to a device pixel turns up from a hair under the half. Bar steps\n * are often round numbers (5.1 px, say) that put bars exactly on half a\n * pixel, where 64-bit arithmetic here and 32-bit on the GPU would round some\n * of them apart; a hair under, both land on the same side. The shaders use\n * the same constant.\n */\nexport const PIXEL_ROUNDING = 0.5037;\n\n/** The device pixel a device-pixel position rounds to. */\nexport function toPixel(v: number): number {\n return Math.floor(v + PIXEL_ROUNDING);\n}\n\nfunction transformOf(ctx: CanvasRenderingContext2D): { a: number; d: number; e: number; f: number } {\n const m = typeof ctx.getTransform === 'function' ? ctx.getTransform() : undefined;\n return {\n a: m && Number.isFinite(m.a) && m.a > 0 ? m.a : 1,\n d: m && Number.isFinite(m.d) && m.d > 0 ? m.d : 1,\n e: m && Number.isFinite(m.e) ? m.e : 0,\n f: m && Number.isFinite(m.f) ? m.f : 0,\n };\n}\n\n/** CSS to device-pixel mapping, rounded to whole pixels. */\nexport interface PixelGrid {\n /** Device pixels per CSS pixel. */\n ratio: number;\n /** The device pixel a CSS x falls on. */\n x(cssX: number): number;\n /** The device pixel a CSS y falls on. */\n y(cssY: number): number;\n /**\n * Left edge (device px) of a column `width` device pixels wide centred on\n * CSS x `cssCenter`: the same column `crispX` strokes for a line there.\n */\n left(cssCenter: number, width: number): number;\n}\n\n/**\n * Run `draw` with the transform reset to device pixels, then put it back.\n * A context without a readable transform (a test stand-in) is taken as 1:1.\n */\nexport function inDevicePixels<T>(ctx: CanvasRenderingContext2D, draw: (grid: PixelGrid) => T): T {\n const { a, d, e, f } = transformOf(ctx);\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n try {\n return draw({\n ratio: a,\n x: (v) => toPixel(v * a + e),\n y: (v) => toPixel(v * d + f),\n left: (v, width) => toPixel(v * a + e - width / 2),\n });\n } finally {\n ctx.restore();\n }\n}\n\n/**\n * A bar's columns in device pixels: the wick one CSS pixel wide (at least one\n * device pixel), the body about the bar's width, with an even difference so\n * the wick sits exactly in the middle.\n */\nexport function barColumns(barWidth: number, ratio: number): { body: number; wick: number } {\n const wick = Math.max(1, Math.floor(ratio));\n let body = Math.max(wick, Math.round(barWidth * ratio));\n if ((body - wick) % 2 !== 0) body -= 1;\n return { body: Math.max(body, wick), wick };\n}\n\n/** Snap a line's centre (in CSS px) so a `width`-wide stroke covers whole device pixels. */\nfunction snap(v: number, width: number, scale: number, shift: number): { at: number; width: number } {\n const w = Math.max(1, Math.round(width * scale));\n const half = w % 2 ? 0.5 : 0;\n return { at: (toPixel(v * scale + shift - half) + half - shift) / scale, width: w / scale };\n}\n\n/**\n * A horizontal line's y and width, snapped so the stroke covers whole device\n * pixels: one sharp row instead of a soft two-pixel smear.\n */\nexport function crispY(ctx: CanvasRenderingContext2D, y: number, width: number): { y: number; width: number } {\n const t = transformOf(ctx);\n const s = snap(y, width, t.d, t.f);\n return { y: s.at, width: s.width };\n}\n\n/** A vertical line's x and width, snapped like `crispY`. */\nexport function crispX(ctx: CanvasRenderingContext2D, x: number, width: number): { x: number; width: number } {\n const t = transformOf(ctx);\n const s = snap(x, width, t.a, t.e);\n return { x: s.at, width: s.width };\n}\n","import type { DataSeries, ViewportState } from '@tradecanvas/commons';\nimport { priceToYMapper } from '../viewport/ScaleMapping.js';\nimport { inDevicePixels } from './pixelGrid.js';\n\n/**\n * Below this bar width (CSS px) bar-shaped charts draw one column per pixel\n * instead of one shape per bar: thousands of sub-pixel candles would blur\n * into each other and cost a path segment each.\n */\nexport const DENSE_BAR_WIDTH = 1;\n\nexport function isDense(viewport: Pick<ViewportState, 'barWidth'>): boolean {\n return viewport.barWidth < DENSE_BAR_WIDTH;\n}\n\n/** The bars on one pixel column merged into one: first open, last close, extremes, largest volume. */\nexport interface PixelColumn {\n x: number;\n open: number;\n high: number;\n low: number;\n close: number;\n volume: number;\n}\n\n/**\n * Walk bars `from`..`to` merged per pixel column (`Math.floor` of their x).\n * The column object is reused between calls: copy it to keep it.\n */\nexport function forEachPixelColumn(\n data: DataSeries,\n from: number,\n to: number,\n toX: (index: number) => number,\n visit: (column: Readonly<PixelColumn>) => void,\n): void {\n const last = Math.min(to, data.length - 1);\n if (from > last) return;\n const col: PixelColumn = { x: 0, open: 0, high: 0, low: 0, close: 0, volume: 0 };\n let open = false;\n for (let i = Math.max(0, from); i <= last; i++) {\n const bar = data[i];\n const x = Math.floor(toX(i));\n if (open && x !== col.x) {\n visit(col);\n open = false;\n }\n if (!open) {\n col.x = x;\n col.open = bar.open;\n col.high = bar.high;\n col.low = bar.low;\n col.volume = bar.volume;\n open = true;\n } else {\n if (bar.high > col.high) col.high = bar.high;\n if (bar.low < col.low) col.low = bar.low;\n if (bar.volume > col.volume) col.volume = bar.volume;\n }\n col.close = bar.close;\n }\n if (open) visit(col);\n}\n\n/**\n * Draw a dense price series as one high–low line per pixel column, coloured by\n * the column's direction (its last close against its first open).\n */\nexport function renderDenseBars(\n ctx: CanvasRenderingContext2D,\n data: DataSeries,\n viewport: ViewportState,\n upColor: string,\n downColor: string,\n): void {\n const { from, to } = viewport.visibleRange;\n const barUnit = viewport.barWidth + viewport.barSpacing;\n const offsetX = -viewport.offset + viewport.chartRect.x + viewport.barWidth / 2;\n const toY = priceToYMapper(viewport);\n inDevicePixels(ctx, (px) => {\n const up = new Path2D();\n const down = new Path2D();\n forEachPixelColumn(data, from, to, (i) => i * barUnit + offsetX, (c) => {\n const top = px.y(toY(c.high));\n const bottom = px.y(toY(c.low));\n // A flat column still gets a pixel, like a doji's body.\n // Each column reaches the next with no gap: at 125% a CSS pixel is 1 or 2 device pixels.\n const left = px.x(c.x);\n const width = Math.max(1, px.x(c.x + 1) - left);\n (c.close >= c.open ? up : down).rect(left, Math.min(top, bottom), width, Math.max(Math.abs(bottom - top), 1));\n });\n ctx.fillStyle = upColor;\n ctx.fill(up);\n ctx.fillStyle = downColor;\n ctx.fill(down);\n });\n}\n","import type { ViewportState } from '@tradecanvas/commons';\nimport { computeTickStep } from '@tradecanvas/commons';\nimport { priceToYMapper } from '../viewport/ScaleMapping.js';\n\n/** The grid's lines as CSS-pixel centres: one across per price step, one down every few slots. */\nexport interface GridLines {\n horizontal: number[];\n vertical: number[];\n}\n\n/** Bars between vertical lines: at least this many pixels apart. */\nconst MIN_COLUMN_SPACING = 80;\n\n/** Where the grid lines go, for the 2D grid and the GPU alike. */\nexport function gridLines(viewport: ViewportState): GridLines {\n const { chartRect, priceRange } = viewport;\n if (priceRange.max - priceRange.min <= 0) return { horizontal: [], vertical: [] };\n const toY = priceToYMapper(viewport);\n\n const horizontal: number[] = [];\n const priceStep = computeTickStep(priceRange.min, priceRange.max, 8);\n const firstPrice = Math.ceil(priceRange.min / priceStep) * priceStep;\n for (let price = firstPrice; price <= priceRange.max; price += priceStep) {\n horizontal.push(Math.round(toY(price)) + 0.5);\n }\n\n const vertical: number[] = [];\n const barUnit = viewport.barWidth + viewport.barSpacing;\n const barsPerGrid = Math.max(1, Math.ceil(MIN_COLUMN_SPACING / barUnit));\n const offsetX = -viewport.offset + chartRect.x + viewport.barWidth / 2;\n // Every slot on screen — the empty space past either end of the data\n // (where the chart can be panned) keeps its grid too.\n const from = Math.floor(viewport.offset / barUnit);\n const to = Math.ceil((viewport.offset + chartRect.width) / barUnit);\n for (let i = from; i <= to; i++) {\n if (i % barsPerGrid !== 0) continue;\n vertical.push(Math.round(i * barUnit + offsetX) + 0.5);\n }\n return { horizontal, vertical };\n}\n"],"mappings":";;AAEA,SAAgB,EAAY,GAAe,GAAiC;AAE1E,QAAO,KADS,EAAS,WAAW,EAAS,cACpB,EAAS,SAAS,EAAS,UAAU,IAAI,EAAS,WAAW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