@abdullahjaswal/tickyr-charts-solid 0.1.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 (217) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +43 -0
  3. package/dist/animation/animator.d.ts +52 -0
  4. package/dist/animation/bar-entry.d.ts +44 -0
  5. package/dist/animation/bar-update.d.ts +38 -0
  6. package/dist/animation/easings.d.ts +22 -0
  7. package/dist/animation/index.d.ts +4 -0
  8. package/dist/charts/bar-chart-controller.d.ts +98 -0
  9. package/dist/charts/bar-chart-helpers.d.ts +334 -0
  10. package/dist/charts/candle-chart-controller.d.ts +353 -0
  11. package/dist/charts/candle-chart-helpers.d.ts +781 -0
  12. package/dist/charts/depth-chart-controller.d.ts +84 -0
  13. package/dist/charts/depth-chart-helpers.d.ts +185 -0
  14. package/dist/charts/depth-series.d.ts +41 -0
  15. package/dist/charts/heatmap-chart-controller.d.ts +78 -0
  16. package/dist/charts/heatmap-chart-helpers.d.ts +174 -0
  17. package/dist/charts/heatmap-color-compute.d.ts +11 -0
  18. package/dist/charts/hierarchy.d.ts +49 -0
  19. package/dist/charts/histogram-binning.d.ts +33 -0
  20. package/dist/charts/histogram-chart-controller.d.ts +82 -0
  21. package/dist/charts/histogram-chart-helpers.d.ts +199 -0
  22. package/dist/charts/kagi-chart-controller.d.ts +154 -0
  23. package/dist/charts/line-chart-controller.d.ts +209 -0
  24. package/dist/charts/line-chart-helpers.d.ts +606 -0
  25. package/dist/charts/mark-buffers.d.ts +105 -0
  26. package/dist/charts/pie-chart-controller.d.ts +83 -0
  27. package/dist/charts/pie-chart-helpers.d.ts +155 -0
  28. package/dist/charts/pie-slice-compute.d.ts +44 -0
  29. package/dist/charts/pnf-chart-controller.d.ts +153 -0
  30. package/dist/charts/renko-chart-controller.d.ts +151 -0
  31. package/dist/charts/sankey-chart-controller.d.ts +176 -0
  32. package/dist/charts/sankey-layout.d.ts +64 -0
  33. package/dist/charts/scatter-chart-controller.d.ts +90 -0
  34. package/dist/charts/scatter-chart-helpers.d.ts +257 -0
  35. package/dist/charts/scatter-density.d.ts +5 -0
  36. package/dist/charts/scatter-regression.d.ts +27 -0
  37. package/dist/charts/sunburst-chart-controller.d.ts +107 -0
  38. package/dist/charts/sunburst-chart-helpers.d.ts +143 -0
  39. package/dist/charts/sunburst-layout.d.ts +40 -0
  40. package/dist/charts/time-off-algorithms.d.ts +53 -0
  41. package/dist/charts/treemap-chart-controller.d.ts +103 -0
  42. package/dist/charts/treemap-chart-helpers.d.ts +163 -0
  43. package/dist/charts/treemap-layout.d.ts +29 -0
  44. package/dist/charts/types.d.ts +38 -0
  45. package/dist/clock/clock.d.ts +10 -0
  46. package/dist/composition/chart-group-state.d.ts +46 -0
  47. package/dist/composition/index.d.ts +1 -0
  48. package/dist/composition/pane.d.ts +33 -0
  49. package/dist/domain/concat.d.ts +18 -0
  50. package/dist/domain/drawings.d.ts +44 -0
  51. package/dist/domain/heikin-ashi.d.ts +9 -0
  52. package/dist/domain/index.d.ts +7 -0
  53. package/dist/domain/ingestion.d.ts +7 -0
  54. package/dist/domain/live-state.d.ts +12 -0
  55. package/dist/domain/markers.d.ts +38 -0
  56. package/dist/domain/series.d.ts +22 -0
  57. package/dist/domain/values.d.ts +32 -0
  58. package/dist/engine/aggregation.d.ts +15 -0
  59. package/dist/engine/downsampling.d.ts +3 -0
  60. package/dist/engine/events.d.ts +14 -0
  61. package/dist/engine/index.d.ts +13 -0
  62. package/dist/engine/indicators.d.ts +37 -0
  63. package/dist/engine/markets.d.ts +8 -0
  64. package/dist/engine/module.d.ts +8 -0
  65. package/dist/engine/quadtree.d.ts +18 -0
  66. package/dist/engine/session.d.ts +11 -0
  67. package/dist/engine/signals.d.ts +52 -0
  68. package/dist/engine/streaming.d.ts +20 -0
  69. package/dist/engine/time-axis.d.ts +16 -0
  70. package/dist/engine/version.d.ts +16 -0
  71. package/dist/engine/views.d.ts +3 -0
  72. package/dist/index.js +17026 -0
  73. package/dist/interaction/keyboard.d.ts +16 -0
  74. package/dist/interaction/touch.d.ts +27 -0
  75. package/dist/perf/adaptive-complexity.d.ts +45 -0
  76. package/dist/perf/memory-pressure.d.ts +16 -0
  77. package/dist/perf/offscreen-canvas-host.d.ts +32 -0
  78. package/dist/perf/offscreen-canvas.d.ts +50 -0
  79. package/dist/perf/offscreen-canvas.worker.d.ts +1 -0
  80. package/dist/perf/shared-array-buffer.d.ts +10 -0
  81. package/dist/perf/visibility.d.ts +39 -0
  82. package/dist/perf/webgl-renderer.d.ts +24 -0
  83. package/dist/perf/wire-memory-pressure.d.ts +2 -0
  84. package/dist/personalization/accessibility.d.ts +16 -0
  85. package/dist/personalization/axes/animation.d.ts +33 -0
  86. package/dist/personalization/axes/area-baseline.d.ts +8 -0
  87. package/dist/personalization/axes/axis-labels.d.ts +3 -0
  88. package/dist/personalization/axes/bin-algorithm.d.ts +3 -0
  89. package/dist/personalization/axes/box-sizing.d.ts +22 -0
  90. package/dist/personalization/axes/cell-shape.d.ts +3 -0
  91. package/dist/personalization/axes/curve-type.d.ts +11 -0
  92. package/dist/personalization/axes/density.d.ts +4 -0
  93. package/dist/personalization/axes/depth-fill-type.d.ts +3 -0
  94. package/dist/personalization/axes/depth-limit.d.ts +2 -0
  95. package/dist/personalization/axes/glow.d.ts +21 -0
  96. package/dist/personalization/axes/heatmap-color-scale.d.ts +31 -0
  97. package/dist/personalization/axes/histogram-overlay.d.ts +18 -0
  98. package/dist/personalization/axes/indicator-pane-spec.d.ts +85 -0
  99. package/dist/personalization/axes/label-behavior.d.ts +3 -0
  100. package/dist/personalization/axes/label-content.d.ts +17 -0
  101. package/dist/personalization/axes/label-placement.d.ts +3 -0
  102. package/dist/personalization/axes/label-rotation.d.ts +3 -0
  103. package/dist/personalization/axes/level-highlight.d.ts +14 -0
  104. package/dist/personalization/axes/line-dash.d.ts +2 -0
  105. package/dist/personalization/axes/mid-line.d.ts +14 -0
  106. package/dist/personalization/axes/node-alignment.d.ts +3 -0
  107. package/dist/personalization/axes/null-behavior.d.ts +3 -0
  108. package/dist/personalization/axes/number-format.d.ts +18 -0
  109. package/dist/personalization/axes/pan-zoom.d.ts +42 -0
  110. package/dist/personalization/axes/pattern.d.ts +26 -0
  111. package/dist/personalization/axes/point-markers.d.ts +55 -0
  112. package/dist/personalization/axes/point-opacity.d.ts +6 -0
  113. package/dist/personalization/axes/point-size.d.ts +23 -0
  114. package/dist/personalization/axes/price-range.d.ts +9 -0
  115. package/dist/personalization/axes/radius-proportion.d.ts +3 -0
  116. package/dist/personalization/axes/regression-line.d.ts +36 -0
  117. package/dist/personalization/axes/sankey-link-color.d.ts +10 -0
  118. package/dist/personalization/axes/sankey-value-display.d.ts +4 -0
  119. package/dist/personalization/axes/small-slice-threshold.d.ts +15 -0
  120. package/dist/personalization/axes/sort-order.d.ts +3 -0
  121. package/dist/personalization/axes/spread-display.d.ts +4 -0
  122. package/dist/personalization/axes/stacking.d.ts +17 -0
  123. package/dist/personalization/axes/tile-layout.d.ts +3 -0
  124. package/dist/personalization/axes/time-off-axes.d.ts +19 -0
  125. package/dist/personalization/axes/treemap-color-scale.d.ts +3 -0
  126. package/dist/personalization/axes/value-labels.d.ts +21 -0
  127. package/dist/personalization/axes/view-mode.d.ts +3 -0
  128. package/dist/personalization/axes/volume-coloring.d.ts +24 -0
  129. package/dist/personalization/axes/y-axis-mode.d.ts +3 -0
  130. package/dist/personalization/index.d.ts +38 -0
  131. package/dist/personalization/locale/formatter.d.ts +45 -0
  132. package/dist/personalization/locale/resolver.d.ts +22 -0
  133. package/dist/personalization/palette/built-ins.d.ts +10 -0
  134. package/dist/personalization/palette/derive.d.ts +35 -0
  135. package/dist/personalization/palette/index.d.ts +6 -0
  136. package/dist/personalization/palette/oklch.d.ts +19 -0
  137. package/dist/personalization/palette/registry.d.ts +7 -0
  138. package/dist/personalization/palette/tonal-symmetry.d.ts +32 -0
  139. package/dist/personalization/palette/types.d.ts +63 -0
  140. package/dist/personalization/personalization.d.ts +137 -0
  141. package/dist/personalization/tooltip-props.d.ts +40 -0
  142. package/dist/rendering/canvas.d.ts +6 -0
  143. package/dist/rendering/color-tables.d.ts +52 -0
  144. package/dist/rendering/dirty-rect-tracker.d.ts +49 -0
  145. package/dist/rendering/dirty-rect.d.ts +17 -0
  146. package/dist/rendering/draw/area-fill-threshold.d.ts +19 -0
  147. package/dist/rendering/draw/area-fill.d.ts +47 -0
  148. package/dist/rendering/draw/area-gradient.d.ts +35 -0
  149. package/dist/rendering/draw/axis.d.ts +65 -0
  150. package/dist/rendering/draw/bar.d.ts +31 -0
  151. package/dist/rendering/draw/candle-live-treatment.d.ts +43 -0
  152. package/dist/rendering/draw/candle.d.ts +101 -0
  153. package/dist/rendering/draw/connection-indicator.d.ts +30 -0
  154. package/dist/rendering/draw/crosshair.d.ts +27 -0
  155. package/dist/rendering/draw/drawings.d.ts +64 -0
  156. package/dist/rendering/draw/grid.d.ts +20 -0
  157. package/dist/rendering/draw/indicator-band.d.ts +17 -0
  158. package/dist/rendering/draw/indicator-line.d.ts +15 -0
  159. package/dist/rendering/draw/last-price.d.ts +36 -0
  160. package/dist/rendering/draw/line.d.ts +16 -0
  161. package/dist/rendering/draw/live-bar.d.ts +31 -0
  162. package/dist/rendering/draw/markers.d.ts +53 -0
  163. package/dist/rendering/draw/pane-divider.d.ts +22 -0
  164. package/dist/rendering/draw/point-markers.d.ts +23 -0
  165. package/dist/rendering/glow/glow.d.ts +40 -0
  166. package/dist/rendering/index.d.ts +9 -0
  167. package/dist/rendering/layers/should-split.d.ts +12 -0
  168. package/dist/rendering/patterns/cross-hatch.d.ts +4 -0
  169. package/dist/rendering/patterns/pattern-tiles.d.ts +25 -0
  170. package/dist/rendering/pipeline.d.ts +21 -0
  171. package/dist/rendering/stacked-layout.d.ts +23 -0
  172. package/dist/rendering/standardization-tokens.d.ts +26 -0
  173. package/dist/rendering/static-layer-cache.d.ts +34 -0
  174. package/dist/rendering/threshold-split.d.ts +14 -0
  175. package/dist/shared/binary-search.d.ts +2 -0
  176. package/dist/shared/typed.d.ts +8 -0
  177. package/dist/solid/chart-group.d.ts +16 -0
  178. package/dist/solid/charts-provider.d.ts +38 -0
  179. package/dist/solid/components/area-chart.d.ts +21 -0
  180. package/dist/solid/components/bar-chart.d.ts +84 -0
  181. package/dist/solid/components/candle-chart.d.ts +142 -0
  182. package/dist/solid/components/chart-group-brush.d.ts +13 -0
  183. package/dist/solid/components/chart-group-navigator.d.ts +12 -0
  184. package/dist/solid/components/depth-chart.d.ts +8 -0
  185. package/dist/solid/components/heatmap-chart.d.ts +8 -0
  186. package/dist/solid/components/histogram-chart.d.ts +8 -0
  187. package/dist/solid/components/kagi-chart.d.ts +8 -0
  188. package/dist/solid/components/line-chart.d.ts +110 -0
  189. package/dist/solid/components/pie-chart.d.ts +20 -0
  190. package/dist/solid/components/point-figure-chart.d.ts +8 -0
  191. package/dist/solid/components/renko-chart.d.ts +8 -0
  192. package/dist/solid/components/sankey-chart.d.ts +8 -0
  193. package/dist/solid/components/scatter-chart.d.ts +8 -0
  194. package/dist/solid/components/sunburst-chart.d.ts +8 -0
  195. package/dist/solid/components/treemap-chart.d.ts +8 -0
  196. package/dist/solid/hooks/use-chart-theme.d.ts +2 -0
  197. package/dist/solid/hooks/use-streaming-candles.d.ts +33 -0
  198. package/dist/solid/index.d.ts +73 -0
  199. package/dist/solid/tooltips/default-candle-tooltip.d.ts +4 -0
  200. package/dist/solid/tooltips/default-extreme-tooltip.d.ts +6 -0
  201. package/dist/solid/tooltips/default-tooltip.d.ts +4 -0
  202. package/dist/solid/tooltips/default-volume-bar-tooltip.d.ts +4 -0
  203. package/dist/solid/tooltips/index.d.ts +4 -0
  204. package/dist/tickyr_charts_wasm-C-sFYtmv.js +828 -0
  205. package/dist/viewport/category-axis.d.ts +32 -0
  206. package/dist/viewport/clip-ticks.d.ts +8 -0
  207. package/dist/viewport/index.d.ts +6 -0
  208. package/dist/viewport/nice-ticks.d.ts +9 -0
  209. package/dist/viewport/nice-time-ticks.d.ts +7 -0
  210. package/dist/viewport/orientation.d.ts +56 -0
  211. package/dist/viewport/padded-domain.d.ts +16 -0
  212. package/dist/viewport/scales/linear.d.ts +9 -0
  213. package/dist/viewport/scales/log.d.ts +9 -0
  214. package/dist/viewport/scales/time.d.ts +7 -0
  215. package/dist/viewport/viewport-sizer.d.ts +15 -0
  216. package/dist/viewport/visible-window.d.ts +5 -0
  217. package/package.json +41 -0
package/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ Copyright (c) 2026 Abdullah Jaswal. All rights reserved.
2
+
3
+ This source code is made publicly available for reference and evaluation
4
+ only. No license or permission is granted to use, copy, modify, merge,
5
+ publish, distribute, sublicense, or sell copies of the software, or to create
6
+ derivative works from it, in whole or in part, without the prior written
7
+ consent of the copyright holder.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
13
+ IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN
14
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/AbdullahJaswal/tickyr-charts/main/assets/brand/logo-light.png" alt="Tickyr Charts" width="84" height="84">
3
+ </p>
4
+
5
+ <h1 align="center">Tickyr Charts for SolidJS</h1>
6
+
7
+ <p align="center">
8
+ Opinionated, canvas-rendered charts for trading and financial-data visualization.<br />
9
+ Powered by a Rust engine compiled to WASM. Self-contained - no other Tickyr package required.
10
+ </p>
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ bun add @abdullahjaswal/tickyr-charts-solid solid-js
16
+ # or: npm install @abdullahjaswal/tickyr-charts-solid solid-js
17
+ ```
18
+
19
+ `solid-js` is a peer dependency.
20
+
21
+ ## Quick start
22
+
23
+ ```tsx
24
+ import { ChartsProvider, CandleChart } from "@abdullahjaswal/tickyr-charts-solid"
25
+
26
+ function App() {
27
+ return (
28
+ <ChartsProvider theme="dark" palette="Monochrome">
29
+ <CandleChart
30
+ data={{ candles: ohlcBars }}
31
+ width={900}
32
+ height={400}
33
+ indicators={[{ type: "rsi", period: 14 }]}
34
+ vwap={{ visible: true }}
35
+ />
36
+ </ChartsProvider>
37
+ )
38
+ }
39
+ ```
40
+
41
+ Full prop tables, the chart gallery, and the React build (`@abdullahjaswal/tickyr-charts-react`) live in the main repo:
42
+
43
+ **https://github.com/AbdullahJaswal/tickyr-charts**
@@ -0,0 +1,52 @@
1
+ export interface AnimationField {
2
+ /** Pool slot index. -1 means "released". */
3
+ readonly slot: number;
4
+ }
5
+ export interface AnimationProgress {
6
+ /** Eased progress in [0, 1]. */
7
+ readonly progress: number;
8
+ /** Linear progress in [0, 1]. */
9
+ readonly linear: number;
10
+ /** True once `linear === 1` (animation complete). */
11
+ readonly done: boolean;
12
+ }
13
+ export type EaseId = 0 | 1 | 2 | 3 | 4 | 5 | 6;
14
+ export declare const Ease: {
15
+ readonly Linear: EaseId;
16
+ readonly OutCubic: EaseId;
17
+ readonly InCubic: EaseId;
18
+ readonly InOutCubic: EaseId;
19
+ readonly OutQuad: EaseId;
20
+ readonly OutBack: EaseId;
21
+ readonly OutElastic: EaseId;
22
+ };
23
+ export declare class AnimationPool {
24
+ private readonly startAt;
25
+ private readonly endsAt;
26
+ private readonly easeIds;
27
+ private readonly free;
28
+ private freeTop;
29
+ /** Logical length - high-water mark of slot indices ever used. */
30
+ private highWater;
31
+ readonly capacity: number;
32
+ constructor(capacity: number);
33
+ /** Reserve a slot. Returns the index. Caller-owned until `release()`.
34
+ * Throws if the pool is full (capacity exceeded). */
35
+ acquire(now: number, durationMs: number, ease?: EaseId): number;
36
+ release(i: number): void;
37
+ /** Read the eased + linear progress of slot `i` at `now`. Pure
38
+ * function of pool state. Does not allocate. */
39
+ read(i: number, now: number, out: ProgressView): void;
40
+ /** Whether slot `i` has finished (linear progress >= 1). Cheap O(1)
41
+ * read for the rAF loop's "should I keep going" check. */
42
+ isDone(i: number, now: number): boolean;
43
+ }
44
+ /** Mutable view returned by `pool.read(slot, now, view)`. The render
45
+ * path keeps one of these on the stack and re-uses it across all
46
+ * active animations to avoid per-frame allocations. */
47
+ export interface ProgressView {
48
+ linear: number;
49
+ progress: number;
50
+ done: boolean;
51
+ }
52
+ export declare function createProgressView(): ProgressView;
@@ -0,0 +1,44 @@
1
+ import { BarEntryAnimation } from '../personalization/axes/animation';
2
+ export interface EntryEffect {
3
+ /** Multiplier for the bar's vertical extent. 1 = fully grown.
4
+ * `'grow-from-baseline'` and `'rise-from-low'` use this to shrink
5
+ * the body-and-wick towards a fixed pivot. */
6
+ scaleY: number;
7
+ /** Pivot for `scaleY` in CSS px (within the bar's local frame).
8
+ * `'grow-from-baseline'` → innerBottom; `'rise-from-low'` → bar.l;
9
+ * `'scale'` → bar center. */
10
+ pivotY: number;
11
+ /** X offset in CSS px applied additively to the bar's center x. */
12
+ offsetX: number;
13
+ /** Y offset in CSS px applied additively (positive = down). */
14
+ offsetY: number;
15
+ /** Multiplier for body-width. `'expand-x'` ramps this 0→1. */
16
+ widthScale: number;
17
+ /** Alpha 0–1 applied to the entire bar's draw. */
18
+ alpha: number;
19
+ /** When true, the bar is fully clipped out (used by `'wipe'`). */
20
+ clipped: boolean;
21
+ }
22
+ declare const _scratch: EntryEffect;
23
+ /** Reset the effect view to identity. The render path always calls
24
+ * this before dispatching so partially-mutated state never leaks. */
25
+ export declare function resetEntryEffect(out: EntryEffect): void;
26
+ export interface EntryGeom {
27
+ innerLeft: number;
28
+ innerRight: number;
29
+ innerTop: number;
30
+ innerBottom: number;
31
+ /** Linear progress in [0, 1] for the chart-wide entry animation. */
32
+ globalProgress: number;
33
+ /** Bar's own y for "rise-from-low". */
34
+ barLowY: number;
35
+ /** Bar's center x. */
36
+ barCenterX: number;
37
+ /** Bar index + total bar count for staggered presets. */
38
+ barIndex: number;
39
+ barCount: number;
40
+ }
41
+ /** Compute per-bar effect for `preset` at the given progress. Mutates
42
+ * `out` in place and returns it. `'none'` is the identity case. */
43
+ export declare function applyBarEntryEffect(preset: BarEntryAnimation, geom: EntryGeom, out: EntryEffect): EntryEffect;
44
+ export { _scratch as ENTRY_EFFECT_SCRATCH };
@@ -0,0 +1,38 @@
1
+ import { BarUpdateAnimation } from '../personalization/axes/animation';
2
+ export interface UpdateEffect {
3
+ /** Multiplier on the bar's vertical extent - `'pulse'` ramps 1→1.08→1.
4
+ * `'rise'` is encoded via `offsetY` instead. */
5
+ scaleY: number;
6
+ /** Vertical offset in CSS px - `'rise'` lifts up to 6px and settles. */
7
+ offsetY: number;
8
+ /** Tint blend (0–1) applied to the bar fill towards `tintColor`. */
9
+ tintBlend: number;
10
+ /** Tint color in CSS rgba string (resolved by the chart). */
11
+ tintColor: string;
12
+ /** Halo radius in CSS px for `'glow'` (0 = no halo). */
13
+ glowRadius: number;
14
+ /** When > 0, draws a horizontal line at `tickLineY` with this alpha. */
15
+ tickLineAlpha: number;
16
+ /** y-coordinate of the tick line in CSS px. */
17
+ tickLineY: number;
18
+ /** Alpha multiplier for the bar (used by `'flicker'`). */
19
+ alpha: number;
20
+ /** Should the OHLC values be lerped from the previous frame's values? */
21
+ morph: boolean;
22
+ }
23
+ declare const _scratch: UpdateEffect;
24
+ export declare function resetUpdateEffect(out: UpdateEffect): void;
25
+ export interface UpdateInputs {
26
+ /** Linear progress in [0, 1]. */
27
+ progress: number;
28
+ /** New close - prev close. Sign drives `'flash-direction'` color. */
29
+ directionSign: 1 | -1 | 0;
30
+ /** Pre-resolved colors for direction / neutral flash. */
31
+ upColor: string;
32
+ downColor: string;
33
+ neutralColor: string;
34
+ /** Last bar's close in CSS px (for tick-line). */
35
+ lastCloseY: number;
36
+ }
37
+ export declare function applyBarUpdateEffect(preset: BarUpdateAnimation, inp: UpdateInputs, out: UpdateEffect): UpdateEffect;
38
+ export { _scratch as UPDATE_EFFECT_SCRATCH };
@@ -0,0 +1,22 @@
1
+ export type EaseFn = (t: number) => number;
2
+ /** Classic CSS ease shapes - `t` clamped to [0, 1]. */
3
+ export declare const easeLinear: EaseFn;
4
+ export declare const easeOutCubic: EaseFn;
5
+ export declare const easeInCubic: EaseFn;
6
+ export declare const easeInOutCubic: EaseFn;
7
+ export declare const easeOutQuad: EaseFn;
8
+ /** Standard CSS easeOutBack - overshoots ~10% mid-curve. Used by the
9
+ * `'wave'` entry preset where pronounced overshoot is intentional.
10
+ * Pure function, no allocations. */
11
+ export declare const easeOutBack: EaseFn;
12
+ /** Subtle spring used by the `'spring'` entry preset on candle bodies.
13
+ * Same closed-form shape as easeOutBack but with a much smaller
14
+ * overshoot coefficient - peaks at ~1.025 instead of ~1.10. This
15
+ * delivers the spec's "bounce into place" feel without making bars
16
+ * visibly larger than their final size on a financial chart (where
17
+ * even a few-percent flash reads as a sizing stutter). */
18
+ export declare const easeOutSpringSubtle: EaseFn;
19
+ /** Damped sine - used by `glow` / `flicker` update presets. */
20
+ export declare const easeOutElastic: EaseFn;
21
+ /** Triangle wave - used for `pulse` (peak at 0.5, returns to 0). */
22
+ export declare const easeTriangle: EaseFn;
@@ -0,0 +1,4 @@
1
+ export { AnimationPool, Ease, type EaseId, type ProgressView, createProgressView, type AnimationProgress, } from './animator';
2
+ export { easeLinear, easeOutCubic, easeInCubic, easeInOutCubic, easeOutQuad, easeOutBack, easeOutSpringSubtle, easeOutElastic, easeTriangle, type EaseFn, } from './easings';
3
+ export { applyBarEntryEffect, resetEntryEffect, ENTRY_EFFECT_SCRATCH, type EntryEffect, type EntryGeom, } from './bar-entry';
4
+ export { applyBarUpdateEffect, resetUpdateEffect, UPDATE_EFFECT_SCRATCH, type UpdateEffect, type UpdateInputs, } from './bar-update';
@@ -0,0 +1,98 @@
1
+ import { LineSeries } from '../domain';
2
+ import { Personalization, ChartFormatter } from '../personalization';
3
+ import { Orientation } from '../viewport/orientation';
4
+ import { StackingLayout } from '../rendering/stacked-layout';
5
+ import { ResolvedLabelConfig } from '../personalization/axes/value-labels';
6
+ import { HoverState, SecondaryBarSeriesDraw, BarChartBaseProps, BarChartTooltipProps } from './bar-chart-helpers';
7
+ /** Provider snapshot - same shape as LineChart's. Kept structural so
8
+ * this file stays framework-agnostic. */
9
+ export interface BarChartProviderSnapshot {
10
+ theme: import('../personalization').ThemeInput;
11
+ palette: string;
12
+ locale: string;
13
+ timeZone: string | undefined;
14
+ visualStyle: import('../personalization').VisualStyle;
15
+ outlineFillColor: "auto" | string;
16
+ outlineFillOpacity: number;
17
+ cornerRadius: number;
18
+ borderWidth: number;
19
+ accents: boolean;
20
+ osTheme: import('../personalization').Theme;
21
+ appTheme: import('../personalization').Theme;
22
+ }
23
+ /** Snapshot of derived state the adapter renders into JSX. */
24
+ export interface BarChartRenderContext {
25
+ personalization: Personalization;
26
+ formatter: ChartFormatter;
27
+ resolvedLocaleBase: string;
28
+ resolvedTimeZone: string | undefined;
29
+ series: LineSeries;
30
+ secondarySeriesList: readonly SecondaryBarSeriesDraw[];
31
+ stackedLayout: StackingLayout | null;
32
+ primaryColor: string | undefined;
33
+ resolvedValueLabels: ResolvedLabelConfig | null;
34
+ ariaLabel: string;
35
+ isSparkline: boolean;
36
+ cssWidth: number;
37
+ cssHeight: number;
38
+ orientation: Orientation;
39
+ }
40
+ export interface BarChartControllerCallbacks {
41
+ onContextChange(ctx: BarChartRenderContext): void;
42
+ onHoverChange(hover: HoverState | null): void;
43
+ }
44
+ /** Controller-specific prop type. Extends the framework-agnostic
45
+ * `BarChartBaseProps` (in `bar-chart-helpers.ts`) with the `tooltip`
46
+ * field whose return type is widened to `unknown` so both the React
47
+ * adapter (returns `React.ReactNode`) and the Solid adapter (returns
48
+ * `JSX.Element`) pass type-check via covariance. */
49
+ export interface BarChartControllerProps extends BarChartBaseProps {
50
+ tooltip?: undefined | false | ((p: BarChartTooltipProps) => unknown);
51
+ }
52
+ export interface BarChartControllerMountOptions extends BarChartControllerCallbacks {
53
+ /** Outer container - used by the visibility source to pause draws
54
+ * when the chart is off-screen. */
55
+ container?: HTMLElement | null;
56
+ staticCanvas: HTMLCanvasElement;
57
+ dynamicCanvas: HTMLCanvasElement | null;
58
+ initialProps: BarChartControllerProps;
59
+ initialProvider: BarChartProviderSnapshot;
60
+ }
61
+ export declare class BarChartController {
62
+ private staticCanvas;
63
+ private dynamicCanvas;
64
+ private callbacks;
65
+ private props;
66
+ private providerCtx;
67
+ private handle;
68
+ private hoverState;
69
+ private dynCfg;
70
+ private series;
71
+ private personalization;
72
+ private resolvedLocale;
73
+ private formatter;
74
+ private secondarySeriesList;
75
+ private stackedLayout;
76
+ private primaryColor;
77
+ private resolvedValueLabels;
78
+ private isSparkline;
79
+ private orientation;
80
+ private staticDrawAbort;
81
+ private disposed;
82
+ private visGate;
83
+ /** Stored container reference for `getBoundingClientRect()` inside
84
+ * pointer handlers. We can't rely on `e.currentTarget` - happy-dom
85
+ * (and some real browsers in non-React dispatch paths) clear it
86
+ * after event dispatch, so reading it later returns null. */
87
+ private container;
88
+ constructor(opts: BarChartControllerMountOptions);
89
+ update(props: BarChartControllerProps, providerCtx: BarChartProviderSnapshot): void;
90
+ handlePointerMove(e: PointerEvent): void;
91
+ handlePointerLeave(): void;
92
+ dispose(): void;
93
+ private setHover;
94
+ private resolveDerived;
95
+ private applyDynamicCfgFromProps;
96
+ private runStaticDraw;
97
+ }
98
+ export type { HoverState, ChartHandle, DynamicCfg, SecondaryBarSeriesDraw, BarChartBaseProps, } from './bar-chart-helpers';
@@ -0,0 +1,334 @@
1
+ import { LineSeries, LineSeriesInput } from '../domain';
2
+ import { Personalization, ThemeInput, DigitGrouping, NumberAbbreviation, DecimalPlaces, CurrencyDisplay, PercentPrecision, DateFormat, TimeFormat, LegendPosition, LegendVisibility, ChartFormatter } from '../personalization';
3
+ import { Viewport } from '../viewport/viewport-sizer';
4
+ import { LinearScale } from '../viewport/scales/linear';
5
+ import { NiceTick } from '../viewport/nice-ticks';
6
+ import { YAxisPosition, XAxisPosition, XAxisTick } from '../rendering/draw/axis';
7
+ import { GridStyle } from '../rendering/draw/grid';
8
+ import { CrosshairMarker } from '../rendering/draw/crosshair';
9
+ import { Orientation } from '../viewport/orientation';
10
+ import { StackingLayout } from '../rendering/stacked-layout';
11
+ import { ResolvedLabelConfig } from '../personalization/axes/value-labels';
12
+ /** Public input shape - same SoA + AoS pair as LineChart so hosts can
13
+ * share data pipelines between line / area / bar without re-shaping. */
14
+ export type BarChartSeriesInput = LineSeriesInput;
15
+ /** Multi-series config - one entry per side-by-side bar at each x-slot.
16
+ * Without per-series `color`, the lib auto-
17
+ * cycles `palette.categorical[i]`. All series MUST share the same `times`
18
+ * view (validated at the public API boundary). */
19
+ export interface BarSeriesConfig {
20
+ readonly id: string;
21
+ readonly data: BarChartSeriesInput;
22
+ readonly label?: string;
23
+ readonly color?: string;
24
+ }
25
+ /** Multi-series rendering mode. */
26
+ export type BarGrouping = "clustered" | "stacked" | "normalized" | "overlapping";
27
+ /** Per-series value at the hover slot - every visible series at that x. */
28
+ export interface BarTooltipSeriesValue {
29
+ readonly id: string;
30
+ readonly label: string;
31
+ readonly color: string;
32
+ readonly value: number;
33
+ }
34
+ /** Props passed to a custom tooltip render function. Mirrors
35
+ * `LineChartTooltipProps` but tailored to bar geometry (no
36
+ * threshold-fill semantics; bar-snap uses the slot index). */
37
+ export interface BarChartTooltipProps {
38
+ /** Time at the hovered bar (unix-ms). */
39
+ readonly t: number;
40
+ /** Bar index (0-based). */
41
+ readonly idx: number;
42
+ /** Per-series values at this x. */
43
+ readonly seriesValues: readonly BarTooltipSeriesValue[];
44
+ readonly pointerX: number;
45
+ readonly pointerY: number;
46
+ readonly containerWidth: number;
47
+ readonly containerHeight: number;
48
+ readonly theme: import('../personalization').Theme;
49
+ readonly palette: import('../personalization').Palette;
50
+ readonly locale: string;
51
+ readonly timeZone: string | undefined;
52
+ readonly formatter: ChartFormatter;
53
+ }
54
+ /** Framework-agnostic BarChart prop shape. Excludes the `tooltip` render-
55
+ * prop field that each framework adapter retypes against its native JSX
56
+ * element type. The controller's `BarChartControllerProps` extends this
57
+ * with an `unknown`-returning tooltip so both adapters' shapes are
58
+ * structurally assignable via covariance. */
59
+ export interface BarChartBaseProps {
60
+ /** Bar data - single series (categories + values). Mutually
61
+ * exclusive with `series` for multi-series. */
62
+ data?: BarChartSeriesInput;
63
+ /** Multi-series mode: multiple parallel series. Layout follows
64
+ * `grouping` (grouped / stacked / normalized). */
65
+ series?: readonly BarSeriesConfig[];
66
+ /** Multi-series layout: `"grouped"` (side-by-side bars per
67
+ * category), `"stacked"` (vertically stacked), `"normalized"`
68
+ * (stacked to 100%). */
69
+ grouping?: BarGrouping;
70
+ /** Padding between bar groups (0–1 fraction of slot width). */
71
+ groupPadding?: number;
72
+ /** Chart orientation: `"vertical"` (default, value on y) or
73
+ * `"horizontal"` (value on x). */
74
+ orientation?: import('../viewport/orientation').Orientation;
75
+ /** Render the bar value as a text label on/near the bar. */
76
+ valueLabels?: import('../personalization/axes/value-labels').ValueLabels;
77
+ /** Legend visibility. */
78
+ legend?: LegendVisibility;
79
+ /** Legend anchor corner. */
80
+ legendPosition?: LegendPosition;
81
+ /** Toggle crosshair on hover. */
82
+ crosshairVisible?: boolean;
83
+ /** Crosshair line style. */
84
+ crosshairLineStyle?: GridStyle;
85
+ /** Snap-marker shape. */
86
+ crosshairMarker?: CrosshairMarker;
87
+ /** Chart width in CSS px. Default 800. */
88
+ width?: number;
89
+ /** Chart height in CSS px. Default 300. */
90
+ height?: number;
91
+ /** Color theme. */
92
+ theme?: ThemeInput;
93
+ /** Palette name. */
94
+ palette?: string;
95
+ /** `"Fill"` (default) or `"Outline"`. */
96
+ visualStyle?: "Fill" | "Outline";
97
+ /** Outline-mode fill color. */
98
+ outlineFillColor?: "auto" | string;
99
+ /** Outline-mode fill opacity (0–100). */
100
+ outlineFillOpacity?: number;
101
+ /** Cap the DPR. */
102
+ pixelDensityCap?: number;
103
+ /** Skip cosmetic features for low-end devices. */
104
+ fastMode?: boolean;
105
+ /** Direction-colored aura behind marks. */
106
+ glow?: import('../personalization/axes/glow').GlowInput;
107
+ /** Glow color rule. `"auto"` = direction-derived. */
108
+ glowColor?: import('../personalization/axes/glow').GlowColorInput;
109
+ /** Pattern fills (hatch, dots, etc.). */
110
+ pattern?: import('../personalization/axes/pattern').PatternInput;
111
+ /** Pattern scale multiplier. */
112
+ patternScale?: number;
113
+ /** Pattern color rule. `"auto"` = derived from bar color. */
114
+ patternColor?: import('../personalization/axes/pattern').PatternColorInput;
115
+ /** Force sparkline mode. */
116
+ sparkline?: boolean;
117
+ /** Override the auto-generated `aria-label`. */
118
+ ariaLabel?: string;
119
+ /** Toggle axis labels + spine. */
120
+ axisVisible?: boolean;
121
+ /** Value-axis position (depends on `orientation`). */
122
+ yAxisPosition?: YAxisPosition;
123
+ /** Category-axis position. */
124
+ xAxisPosition?: XAxisPosition;
125
+ /** Padding above/below the value-axis data range (fraction). */
126
+ yAxisPadding?: number;
127
+ /** Toggle gridlines. */
128
+ gridVisible?: boolean;
129
+ /** Gridline style. */
130
+ gridStyle?: GridStyle;
131
+ /** Gridline density. */
132
+ gridDensity?: "sparse" | "normal" | "dense";
133
+ /** Use accent tint for axis + grid. */
134
+ accents?: boolean;
135
+ /** Locale code. */
136
+ locale?: string;
137
+ /** IANA time zone. */
138
+ timeZone?: string;
139
+ /** Fraction of slot width consumed by the bar body (0–1).
140
+ * Default 0.7. */
141
+ barWidthRatio?: number;
142
+ /** Bar corner radius in CSS px. Default 3. */
143
+ cornerRadius?: number;
144
+ /** Bar border width in CSS px. */
145
+ borderWidth?: number;
146
+ /** Digit-grouping rule (`"thousands"` / `"lakh-crore"` / `"none"`). */
147
+ digitGrouping?: DigitGrouping;
148
+ /** Compact number abbreviation rule. */
149
+ numberAbbreviation?: NumberAbbreviation;
150
+ /** Decimal-place rule for value labels. */
151
+ decimalPlaces?: DecimalPlaces;
152
+ /** ISO currency code. */
153
+ currency?: string;
154
+ /** Currency display style. */
155
+ currencyDisplay?: CurrencyDisplay;
156
+ /** Percentage precision. */
157
+ percentPrecision?: PercentPrecision;
158
+ /** Date format rule for time-axis category labels. */
159
+ dateFormat?: DateFormat;
160
+ /** Time format rule. */
161
+ timeFormat?: TimeFormat;
162
+ }
163
+ export declare const DEFAULT_FONT = "12px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";
164
+ export declare const DEFAULT_AXIS_FONT_SIZE = 11;
165
+ export declare const LABEL_GAP_PX = 6;
166
+ export declare const TICK_LENGTH_PX = 4;
167
+ export declare const Y_AXIS_RESERVE_PX = 80;
168
+ export declare const X_AXIS_RESERVE_PX = 28;
169
+ export declare const GRID_TARGET: {
170
+ readonly sparse: 4;
171
+ readonly normal: 8;
172
+ readonly dense: 12;
173
+ };
174
+ export declare const DEFAULT_BAR_WIDTH_RATIO = 0.7;
175
+ export declare const DEFAULT_GROUP_PADDING = 0.2;
176
+ /** Container width below which sparkline mode auto-engages. Matches
177
+ * LineChart's `SPARKLINE_THRESHOLD_PX`. */
178
+ export declare const SPARKLINE_THRESHOLD_PX = 150;
179
+ /** Constant shrink-ratio per subsequent band in `grouping: 'overlapping'`.
180
+ * Each band is `OVERLAP_SHRINK_RATIO` × the previous band's width, so
181
+ * progressively narrower bars layer on top of the wider band 0.
182
+ * Internal token (not a user axis) - calibrated for visual rhythm
183
+ * matching CandleChart's `bodyWidthRatio: 0.7`. */
184
+ export declare const OVERLAP_SHRINK_RATIO = 0.7;
185
+ /** A non-primary series rendered alongside the primary in multi-series
186
+ * mode. Carries the ingested data + the resolved per-series color so
187
+ * the draw loop is configuration-free. */
188
+ export interface SecondaryBarSeriesDraw {
189
+ readonly ingested: LineSeries;
190
+ readonly color: string;
191
+ }
192
+ /** Pointer-driven hover state. `idx` is the bar's index in the primary
193
+ * series; `t` is its time, `value` is its value. snapX/snapY are the
194
+ * bar's center pixel (where the crosshair marker pins). */
195
+ export interface HoverState {
196
+ readonly pointerX: number;
197
+ readonly pointerY: number;
198
+ readonly snapX: number;
199
+ readonly snapY: number;
200
+ readonly idx: number;
201
+ readonly t: number;
202
+ readonly value: number;
203
+ }
204
+ export interface DynamicCfg {
205
+ readonly crosshairVisible: boolean;
206
+ readonly crosshairLineStyle: GridStyle;
207
+ readonly crosshairMarker: CrosshairMarker;
208
+ }
209
+ /** Pre-resolved per-frame draw inputs for the dynamic layer (crosshair
210
+ * + snap markers). Captured at static-layer-paint time so the
211
+ * pointer-event handlers don't recompute personalization-derived
212
+ * colors per frame. */
213
+ export interface ChartHandle {
214
+ readonly dynamicCtx: CanvasRenderingContext2D | null;
215
+ readonly layout: ChartLayout;
216
+ readonly crosshairLineColor: string;
217
+ readonly crosshairMarkerFill: string;
218
+ readonly crosshairMarkerStroke: string;
219
+ /** Per-secondary lookup: snap marker drops a small dot at each
220
+ * series' value at the cursor x. */
221
+ readonly secondaryLookups: ReadonlyArray<{
222
+ times: Float64Array;
223
+ values: Float64Array;
224
+ color: string;
225
+ }>;
226
+ }
227
+ export interface ChartLayout {
228
+ innerLeft: number;
229
+ innerRight: number;
230
+ innerTop: number;
231
+ innerBottom: number;
232
+ /** Vertical (default): bars rise from x-axis baseline. Horizontal:
233
+ * bars extend from y-axis baseline. */
234
+ orientation: Orientation;
235
+ /** Maps a numeric VALUE (the data) to a pixel along the value axis.
236
+ * - vertical: y-pixel; rangeStart=innerBottom, rangeEnd=innerTop
237
+ * (inverted so larger values render higher).
238
+ * - horizontal: x-pixel; rangeStart=innerLeft, rangeEnd=innerRight
239
+ * (larger values render farther right). */
240
+ valueScale: LinearScale;
241
+ /** Maps a CATEGORY time (`series.times[i]`, in unix-ms) to a pixel
242
+ * along the category axis.
243
+ * - vertical: x-pixel; rangeStart=innerLeft+halfSlot,
244
+ * rangeEnd=innerRight-halfSlot.
245
+ * - horizontal: y-pixel; rangeStart=innerTop+halfSlot,
246
+ * rangeEnd=innerBottom-halfSlot. */
247
+ categoryScale: LinearScale;
248
+ /** Numeric ticks for the value axis (from `niceTicks` over the data
249
+ * domain). Same regardless of orientation. */
250
+ valueTicks: readonly NiceTick[];
251
+ /** Bar-position ticks for the category axis (from
252
+ * `buildBarPositionTicks`). Same regardless of orientation. */
253
+ categoryTicks: readonly XAxisTick[];
254
+ startMs: number;
255
+ endMs: number;
256
+ /** Half the slot extent (in slot-axis pixels) PLUS AXIS_BAR_GAP_PX.
257
+ * Used to inset bar centers from the category-axis spine so first/
258
+ * last bars sit visibly inside the chart. */
259
+ halfSlot: number;
260
+ viewport: Viewport;
261
+ }
262
+ export declare function computeYDomain(series: LineSeries, padding: number, secondarySeries?: readonly SecondaryBarSeriesDraw[], stackedLayout?: StackingLayout | null): {
263
+ min: number;
264
+ max: number;
265
+ };
266
+ export declare function computeLayout(opts: {
267
+ series: LineSeries;
268
+ viewport: Viewport;
269
+ orientation: Orientation;
270
+ yAxisPosition: YAxisPosition;
271
+ xAxisPosition: XAxisPosition;
272
+ yAxisPadding: number;
273
+ gridDensity: "sparse" | "normal" | "dense";
274
+ axisVisible: boolean;
275
+ formatter: ChartFormatter;
276
+ secondarySeries: readonly SecondaryBarSeriesDraw[];
277
+ stackedLayout: StackingLayout | null;
278
+ }): ChartLayout;
279
+ /** Orientation-aware grid drawing. In horizontal mode, the role of
280
+ * horizontal/vertical grid lines swaps: horizontal lines align with
281
+ * category (slot) ticks, vertical lines align with value (numeric)
282
+ * ticks. Both `drawGrid` axes now accept polymorphic tick shapes
283
+ * - no per-draw `.map()` allocation. */
284
+ export declare function drawBarChartGrid(args: {
285
+ ctx: CanvasRenderingContext2D;
286
+ layout: ChartLayout;
287
+ color: string;
288
+ width: number;
289
+ style: GridStyle;
290
+ }): void;
291
+ /** Orientation-aware axis drawing. The PHYSICAL axis sides
292
+ * (`yAxisPosition` left/right, `xAxisPosition` top/bottom) stay the
293
+ * same; what swaps is the CONTENT - which axis is value (numeric) and
294
+ * which is category (time/slot). */
295
+ export declare function drawBarChartAxes(args: {
296
+ ctx: CanvasRenderingContext2D;
297
+ layout: ChartLayout;
298
+ yAxisPosition: YAxisPosition;
299
+ xAxisPosition: XAxisPosition;
300
+ spineColor: string;
301
+ textColor: string;
302
+ }): void;
303
+ /** Static-layer draw: grid + axes + bars. The bar layer is the static
304
+ * layer - repaints only on data / viewport / theme change, not per
305
+ * pointer event. */
306
+ export declare function drawFullBarChart(args: {
307
+ ctx: CanvasRenderingContext2D;
308
+ series: LineSeries;
309
+ layout: ChartLayout;
310
+ personalization: Personalization;
311
+ primaryColor: string | undefined;
312
+ secondarySeries: readonly SecondaryBarSeriesDraw[];
313
+ grouping: BarGrouping;
314
+ /** Pre-built layout for `'stacked'` grouping. Null = clustered. */
315
+ stackedLayout: StackingLayout | null;
316
+ yAxisPosition: YAxisPosition;
317
+ xAxisPosition: XAxisPosition;
318
+ gridVisible: boolean;
319
+ gridStyle: GridStyle;
320
+ axisVisible: boolean;
321
+ accents: boolean;
322
+ barWidthRatio: number;
323
+ groupPadding: number;
324
+ cornerRadius: number;
325
+ borderWidth: number;
326
+ valueLabels: ResolvedLabelConfig | null;
327
+ formatter: ChartFormatter;
328
+ }): void;
329
+ /** Dynamic-layer draw - crosshair + per-series snap markers. Cleared
330
+ * and redrawn each pointer move (dynamic layer is the "high-frequency
331
+ * repaint" surface, separate from the static layer that holds bars +
332
+ * axes). */
333
+ export declare function drawBarChartDynamicLayer(h: ChartHandle, hover: HoverState | null, cfg: DynamicCfg): void;
334
+ export declare function defaultAriaLabel(series: LineSeries): string;