@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
@@ -0,0 +1,3 @@
1
+ export type NullBehavior = "empty" | "cross-hatch" | "background";
2
+ export declare const DEFAULT_NULL_BEHAVIOR: NullBehavior;
3
+ export declare function resolveNullBehavior(input: NullBehavior | undefined): NullBehavior;
@@ -0,0 +1,18 @@
1
+ import { DigitGrouping, NumberAbbreviation } from '../locale/formatter';
2
+ export type NumberFormatPreset = "standard" | "compact" | "pk-grouping" | "pk-compact" | "percent" | "currency";
3
+ /** Allow a user-supplied function to bypass all built-in behavior. */
4
+ export type NumberFormatInput = NumberFormatPreset | ((n: number) => string);
5
+ export interface ResolvedNumberFormat {
6
+ readonly preset: NumberFormatPreset | null;
7
+ /** Non-null when the host passed a literal function. */
8
+ readonly custom: ((n: number) => string) | null;
9
+ /** Derived `digitGrouping` for the underlying formatter. */
10
+ readonly digitGrouping: DigitGrouping;
11
+ /** Derived `numberAbbreviation`. */
12
+ readonly numberAbbreviation: NumberAbbreviation;
13
+ /** When the preset is `'percent'` or `'currency'`, the formatter
14
+ * routes through a percent / currency code path. */
15
+ readonly mode: "number" | "percent" | "currency";
16
+ }
17
+ export declare const DEFAULT_NUMBER_FORMAT: NumberFormatPreset;
18
+ export declare function resolveNumberFormat(input: NumberFormatInput | undefined): ResolvedNumberFormat;
@@ -0,0 +1,42 @@
1
+ export type PanEdgeBehavior =
2
+ /** Hard stop at the data extents. */
3
+ "stop"
4
+ /** Allow over-pan with a small empty band. */
5
+ | "overshoot"
6
+ /** Wrap around (rarely useful for finance - left for completeness). */
7
+ | "wrap";
8
+ export type WheelBehavior =
9
+ /** Mouse-wheel zooms (default). Hosts may flip to scroll-only. */
10
+ "zoom"
11
+ /** Wheel scrolls the page; charts ignore wheel. */
12
+ | "scroll"
13
+ /** Wheel zooms only with the modifier key held. */
14
+ | "ctrl-zoom";
15
+ export type PanAxis = "x" | "y" | "both";
16
+ export type ZoomAnchor =
17
+ /** Anchor at the mouse / touch position (default). */
18
+ "pointer"
19
+ /** Anchor at the chart center. */
20
+ | "center";
21
+ export interface PanZoomOptions {
22
+ readonly panEnabled: boolean;
23
+ readonly zoomEnabled: boolean;
24
+ readonly zoomAnchor: ZoomAnchor;
25
+ readonly panEdgeBehavior: PanEdgeBehavior;
26
+ readonly panInertia: boolean;
27
+ readonly wheelBehavior: WheelBehavior;
28
+ readonly panAxis: PanAxis;
29
+ readonly doubleClickReset: boolean;
30
+ readonly yAxisManualRescale: boolean;
31
+ }
32
+ export declare const DEFAULT_PAN_ZOOM_OPTIONS: PanZoomOptions;
33
+ export type PanZoomOptionsInput = {
34
+ readonly [K in keyof PanZoomOptions]?: PanZoomOptions[K] | undefined;
35
+ };
36
+ export declare function resolvePanZoomOptions(input: PanZoomOptionsInput | undefined): PanZoomOptions;
37
+ /** Decay velocity by friction `f` over `dtMs`. `f` defaults to 0.95 /
38
+ * 16ms (≈ ~6% per frame). Returns the new velocity. Below `eps`, the
39
+ * caller should stop the animation. */
40
+ export declare function applyInertiaDecay(velocity: number, dtMs: number, friction?: number): number;
41
+ /** Sentinel - when |velocity| drops below this, stop the loop. */
42
+ export declare const INERTIA_EPSILON = 0.01;
@@ -0,0 +1,26 @@
1
+ export type PatternPreset = "solid" | "diagonal-lines" | "diagonal-lines-reverse" | "cross-hatch" | "dots" | "circles" | "grid" | "horizontal-lines" | "vertical-lines" | "plus" | "chevron" | "zigzag" | "waves" | "checkerboard" | "hexagons" | "bricks";
2
+ /** Host-supplied input - string preset, config form, or a literal
3
+ * `CanvasPattern` (full dev control). */
4
+ export type PatternInput = PatternPreset | {
5
+ readonly type: PatternPreset;
6
+ readonly scale?: number;
7
+ readonly lineWidth?: number;
8
+ readonly color?: string;
9
+ } | CanvasPattern;
10
+ export type PatternColorInput = "auto" | string;
11
+ export interface ResolvedPattern {
12
+ readonly type: PatternPreset;
13
+ readonly scale: number;
14
+ readonly lineWidth: number;
15
+ /** `'auto'` triggers per-mark color derivation at draw time (uses the
16
+ * mark's own fill color with OKLCH L-shift); a literal string forces
17
+ * uniform pattern color. */
18
+ readonly color: "auto" | string;
19
+ /** Literal `CanvasPattern` (custom dev pattern). When non-null, the
20
+ * rendering primitive uses it directly and ignores `type`. */
21
+ readonly customPattern: CanvasPattern | null;
22
+ }
23
+ export declare const DEFAULT_PATTERN: PatternInput;
24
+ export declare const DEFAULT_PATTERN_SCALE = 1;
25
+ export declare const DEFAULT_PATTERN_COLOR: PatternColorInput;
26
+ export declare function resolvePattern(input: PatternInput | undefined, scale: number | undefined, color: PatternColorInput | undefined): ResolvedPattern;
@@ -0,0 +1,55 @@
1
+ export type MarkerStyle = "circle" | "square" | "diamond" | "triangle" | "triangle-down" | "cross" | "plus" | "star" | "direction" | "custom";
2
+ /** Custom-icon shapes accepted by `MarkerConfig.icon` / `upIcon` / `downIcon`.
3
+ * Evaluated synchronously per draw - no async resolution, no React-component
4
+ * offscreen rendering (that's a future sweep when we add
5
+ * bitmap-cache infra). */
6
+ export type MarkerIcon =
7
+ /** SVG path-data string (e.g. `"M-1,-1 L1,1 ..."`). Parsed to a cached
8
+ * `Path2D` once per unique string at first use. */
9
+ string
10
+ /** Pre-built `Path2D` - used directly. */
11
+ | Path2D
12
+ /** Direct-draw function - called per point with translated origin.
13
+ * Receives a context whose origin is at (x, y) and scaled to half-size,
14
+ * so the function should draw the shape in [-1, 1] coordinates. */
15
+ | ((ctx: CanvasRenderingContext2D) => void);
16
+ export interface MarkerConfig {
17
+ style?: MarkerStyle;
18
+ /** Diameter / longest side, in CSS px. Floored to `MIN_MARKER_SIZE` (1.5)
19
+ * internally so markers don't disappear at extreme zoom-out. Default 5. */
20
+ size?: number;
21
+ /** Fill color. `'auto'` = the line's resolved color. `'none'` = no fill. */
22
+ fill?: "auto" | "none" | string;
23
+ /** Stroke color. `'auto'` matches `fill`. `'none'` = no stroke. */
24
+ stroke?: "auto" | "none" | string;
25
+ /** Stroke width in CSS px. `0` (default) = no border. */
26
+ strokeWidth?: number;
27
+ /** Up-arrow color when `style: 'direction'`. `'auto'` = `palette.up`. */
28
+ upColor?: "auto" | string;
29
+ /** Down-arrow color when `style: 'direction'`. `'auto'` = `palette.down`. */
30
+ downColor?: "auto" | string;
31
+ /** Custom up/down icons for `style: 'direction'`. Defaults to the built-in
32
+ * chevron when `undefined`. */
33
+ upIcon?: MarkerIcon;
34
+ downIcon?: MarkerIcon;
35
+ /** Required when `style: 'custom'`. Used for every data point. */
36
+ icon?: MarkerIcon;
37
+ }
38
+ export type PointMarkers = boolean | MarkerConfig;
39
+ export interface ResolvedMarkerConfig {
40
+ readonly style: MarkerStyle;
41
+ readonly size: number;
42
+ readonly fill: "auto" | "none" | string;
43
+ readonly stroke: "auto" | "none" | string;
44
+ readonly strokeWidth: number;
45
+ readonly upColor: "auto" | string;
46
+ readonly downColor: "auto" | string;
47
+ readonly upIcon: MarkerIcon | undefined;
48
+ readonly downIcon: MarkerIcon | undefined;
49
+ readonly icon: MarkerIcon | undefined;
50
+ }
51
+ /** `null` = no markers (false / undefined). */
52
+ export declare function resolvePointMarkers(input: PointMarkers | undefined): ResolvedMarkerConfig | null;
53
+ /** Internal floor - markers never render smaller than this. Mirrors the
54
+ * cross-chart `minMarkSize` token (~1.5px). */
55
+ export declare const MIN_MARKER_SIZE = 1.5;
@@ -0,0 +1,6 @@
1
+ export type PointOpacityInput = number | "auto";
2
+ export declare const AUTO_OPACITY_THRESHOLDS: ReadonlyArray<{
3
+ readonly count: number;
4
+ readonly opacity: number;
5
+ }>;
6
+ export declare function resolvePointOpacity(input: PointOpacityInput | undefined, pointCount: number): number;
@@ -0,0 +1,23 @@
1
+ export type BubbleScale = "linear" | "sqrt";
2
+ export interface PointSizeConfig {
3
+ /** `'linear'` (radius linear in value) or `'sqrt'` (area linear in value).
4
+ * Default `'sqrt'` - perceptually correct for area-encoded bubbles. */
5
+ readonly scale?: BubbleScale;
6
+ /** `[minPx, maxPx]` - the rendered diameter range. Default [4, 32]. */
7
+ readonly range?: readonly [number, number];
8
+ }
9
+ export type PointSizeInput = number | "data-driven" | PointSizeConfig;
10
+ export type ResolvedPointSize = {
11
+ readonly kind: "fixed";
12
+ readonly size: number;
13
+ } | {
14
+ readonly kind: "data-driven";
15
+ readonly scale: BubbleScale;
16
+ readonly range: readonly [number, number];
17
+ };
18
+ export declare const DEFAULT_POINT_SIZE_PX = 9;
19
+ export declare const DEFAULT_BUBBLE_RANGE_PX: readonly [number, number];
20
+ export declare function resolvePointSize(input: PointSizeInput | undefined): ResolvedPointSize;
21
+ /** Compute per-point bubble diameters into the caller-owned `out` buffer.
22
+ * `out.length` must equal `sizes.length`. Zero-allocation on this path. */
23
+ export declare function computeBubbleRadii(sizes: Float64Array, scale: BubbleScale, range: readonly [number, number], out: Float64Array): void;
@@ -0,0 +1,9 @@
1
+ export interface PriceRangeWindow {
2
+ /** Lower bound as fraction off mid (typically negative). */
3
+ readonly minPct: number;
4
+ /** Upper bound as fraction off mid (typically positive). */
5
+ readonly maxPct: number;
6
+ }
7
+ export type PriceRangeInput = "auto" | number | PriceRangeWindow;
8
+ export declare const DEFAULT_PRICE_RANGE_PCT = 0.05;
9
+ export declare function resolvePriceRange(input: PriceRangeInput | undefined): PriceRangeWindow;
@@ -0,0 +1,3 @@
1
+ export type RadiusProportion = "uniform" | "value-weighted" | "sqrt-weighted";
2
+ export declare const DEFAULT_RADIUS_PROPORTION: RadiusProportion;
3
+ export declare function resolveRadiusProportion(input: RadiusProportion | undefined): RadiusProportion;
@@ -0,0 +1,36 @@
1
+ export type RegressionType = "linear" | "polynomial" | "exponential" | "lowess";
2
+ interface RegressionStyle {
3
+ /** `'auto'` resolves to `palette.neutral` at draw time. */
4
+ readonly color?: "auto" | string;
5
+ readonly lineWidth?: number;
6
+ readonly lineDash?: readonly number[];
7
+ }
8
+ export type RegressionLineInput = false | true | (RegressionStyle & {
9
+ readonly type: "linear";
10
+ }) | (RegressionStyle & {
11
+ readonly type: "polynomial";
12
+ readonly degree?: number;
13
+ }) | (RegressionStyle & {
14
+ readonly type: "exponential";
15
+ }) | (RegressionStyle & {
16
+ readonly type: "lowess";
17
+ readonly bandwidth?: number;
18
+ });
19
+ interface ResolvedBase {
20
+ readonly color: "auto" | string;
21
+ readonly lineWidth: number;
22
+ readonly lineDash: readonly number[] | null;
23
+ }
24
+ export type ResolvedRegressionLine = (ResolvedBase & {
25
+ readonly type: "linear";
26
+ }) | (ResolvedBase & {
27
+ readonly type: "polynomial";
28
+ readonly degree: number;
29
+ }) | (ResolvedBase & {
30
+ readonly type: "exponential";
31
+ }) | (ResolvedBase & {
32
+ readonly type: "lowess";
33
+ readonly bandwidth: number;
34
+ });
35
+ export declare function resolveRegressionLine(input: RegressionLineInput | undefined): ResolvedRegressionLine | null;
36
+ export {};
@@ -0,0 +1,10 @@
1
+ export type SankeyLinkColorPreset = "source" | "target" | "gradient" | "neutral";
2
+ export type SankeyLinkColorInput = SankeyLinkColorPreset | string;
3
+ export type ResolvedSankeyLinkColor = {
4
+ readonly kind: SankeyLinkColorPreset;
5
+ } | {
6
+ readonly kind: "literal";
7
+ readonly color: string;
8
+ };
9
+ export declare const DEFAULT_SANKEY_LINK_COLOR: SankeyLinkColorPreset;
10
+ export declare function resolveSankeyLinkColor(input: SankeyLinkColorInput | undefined): ResolvedSankeyLinkColor;
@@ -0,0 +1,4 @@
1
+ export type SankeyValueDisplayInput = false | true | "on-link-hover";
2
+ export type SankeyValueDisplayMode = "off" | "always" | "on-link-hover";
3
+ export declare const DEFAULT_SANKEY_VALUE_DISPLAY: SankeyValueDisplayMode;
4
+ export declare function resolveSankeyValueDisplay(input: SankeyValueDisplayInput | undefined): SankeyValueDisplayMode;
@@ -0,0 +1,15 @@
1
+ interface SmallSliceConfig {
2
+ /** 0-1 fraction of total. */
3
+ readonly threshold: number;
4
+ readonly label?: string;
5
+ /** `'auto'` resolves to a darker neutral at draw time. */
6
+ readonly color?: "auto" | string;
7
+ }
8
+ export type SmallSliceThresholdInput = false | number | SmallSliceConfig;
9
+ export interface ResolvedSmallSliceThreshold {
10
+ readonly threshold: number;
11
+ readonly label: string;
12
+ readonly color: "auto" | string;
13
+ }
14
+ export declare function resolveSmallSliceThreshold(input: SmallSliceThresholdInput | undefined): ResolvedSmallSliceThreshold | null;
15
+ export {};
@@ -0,0 +1,3 @@
1
+ export type SortOrder = "value-desc" | "value-asc" | "data-order" | "alphabetical";
2
+ export declare const DEFAULT_SORT_ORDER: SortOrder;
3
+ export declare function resolveSortOrder(input: SortOrder | undefined): SortOrder;
@@ -0,0 +1,4 @@
1
+ export type SpreadDisplayMode = "off" | "pill" | "inline";
2
+ export type SpreadDisplayInput = false | true | "pill" | "inline";
3
+ export declare const DEFAULT_SPREAD_DISPLAY: SpreadDisplayMode;
4
+ export declare function resolveSpreadDisplay(input: SpreadDisplayInput | undefined): SpreadDisplayMode;
@@ -0,0 +1,17 @@
1
+ export type StackingMode = false | true | "normalized";
2
+ export declare const DEFAULT_STACKING: StackingMode;
3
+ /** Result of `validateStackingAlignment`. */
4
+ export interface StackingAlignmentError {
5
+ readonly kind: "length-mismatch" | "time-mismatch";
6
+ /** 0-based index of the offending series (the one that diverges from
7
+ * series[0]); always > 0 when this returns non-null. */
8
+ readonly seriesIdx: number;
9
+ /** Bar index where the divergence occurs ('time-mismatch' only). */
10
+ readonly barIdx?: number;
11
+ }
12
+ /** Boundary check: every entry shares the same length and the same `times`
13
+ * values as the first entry. Returns null when aligned. */
14
+ export declare function validateStackingAlignment(series: readonly {
15
+ readonly times: Float64Array;
16
+ readonly length: number;
17
+ }[]): StackingAlignmentError | null;
@@ -0,0 +1,3 @@
1
+ export type TileLayout = "squarify" | "slice-and-dice" | "strip" | "slice" | "dice" | "binary";
2
+ export declare const DEFAULT_TILE_LAYOUT: TileLayout;
3
+ export declare function resolveTileLayout(input: TileLayout | undefined): TileLayout;
@@ -0,0 +1,19 @@
1
+ export type TimeOffSource = "close" | "high-low";
2
+ export declare const DEFAULT_TIME_OFF_SOURCE: TimeOffSource;
3
+ export declare function resolveTimeOffSource(input: TimeOffSource | undefined): TimeOffSource;
4
+ export declare const DEFAULT_RENKO_REVERSAL = 2;
5
+ export declare function resolveRenkoReversal(input: number | undefined): number;
6
+ export declare const DEFAULT_BRICK_GAP = 0;
7
+ export declare function resolveBrickGap(input: number | undefined): number;
8
+ export type KagiThicknessRule = "shoulder-waist" | "previous-high-low";
9
+ export declare const DEFAULT_KAGI_THICKNESS_RULE: KagiThicknessRule;
10
+ export declare function resolveKagiThicknessRule(input: KagiThicknessRule | undefined): KagiThicknessRule;
11
+ export declare const DEFAULT_KAGI_THICK_LINE_WIDTH = 3;
12
+ export declare const DEFAULT_KAGI_THIN_LINE_WIDTH = 1.5;
13
+ export declare const DEFAULT_PNF_REVERSAL_COUNT = 3;
14
+ export declare function resolvePnFReversalCount(input: number | undefined): number;
15
+ export type PnFSymbolStyle = "classic" | "filled";
16
+ export declare const DEFAULT_PNF_SYMBOL_STYLE: PnFSymbolStyle;
17
+ export declare function resolvePnFSymbolStyle(input: PnFSymbolStyle | undefined): PnFSymbolStyle;
18
+ export declare const DEFAULT_PNF_SYMBOL_PADDING = 0.15;
19
+ export declare function resolvePnFSymbolPadding(input: number | undefined): number;
@@ -0,0 +1,3 @@
1
+ export type TreemapColorScale = "flat-categorical" | "depth-gradient" | "value-heat" | "directional";
2
+ export declare const DEFAULT_TREEMAP_COLOR_SCALE: TreemapColorScale;
3
+ export declare function resolveTreemapColorScale(input: TreemapColorScale | undefined): TreemapColorScale;
@@ -0,0 +1,21 @@
1
+ export type ValueLabelPosition = "auto" | "inside" | "outside" | "top" | "bottom";
2
+ export interface LabelConfig {
3
+ position?: ValueLabelPosition;
4
+ format?: "auto" | ((value: number) => string);
5
+ /** `'auto'` picks high-contrast based on fill (white on Fill mode,
6
+ * theme primary text on Outline mode). Hex / rgba string overrides. */
7
+ color?: "auto" | string;
8
+ fontSize?: number;
9
+ fontWeight?: number | "normal" | "bold";
10
+ }
11
+ export type ValueLabels = false | true | LabelConfig;
12
+ export interface ResolvedLabelConfig {
13
+ readonly position: ValueLabelPosition;
14
+ /** When 'auto', caller routes the value through the chart's
15
+ * locale-aware formatter; when a function, that function is called. */
16
+ readonly format: "auto" | ((value: number) => string);
17
+ readonly color: "auto" | string;
18
+ readonly fontSize: number;
19
+ readonly fontWeight: number | "normal" | "bold";
20
+ }
21
+ export declare function resolveValueLabels(input: ValueLabels | undefined): ResolvedLabelConfig | null;
@@ -0,0 +1,3 @@
1
+ export type ViewMode = "nested" | "drill-down";
2
+ export declare const DEFAULT_VIEW_MODE: ViewMode;
3
+ export declare function resolveViewMode(input: ViewMode | undefined): ViewMode;
@@ -0,0 +1,24 @@
1
+ import { Palette, Theme } from '../palette/types';
2
+ export type VolumeColoring = "by-direction" | "single" | "by-magnitude";
3
+ export interface VolumeColorResolveArgs {
4
+ readonly mode: VolumeColoring;
5
+ /** Used only when mode='single'. `'auto'` derives from palette. */
6
+ readonly singleColor: "auto" | string;
7
+ readonly palette: Palette;
8
+ readonly theme: Theme;
9
+ /** Visible-window volumes (the same Float64Array CandleSeries owns;
10
+ * zero-copy). */
11
+ readonly volumes: Float64Array;
12
+ /** Inclusive start index in `volumes`. */
13
+ readonly startIdx: number;
14
+ /** Inclusive end index in `volumes`. */
15
+ readonly endIdx: number;
16
+ }
17
+ export interface VolumeColorResolver {
18
+ /** Returns the CSS color (rgba / hex) for the bar at `idx`. `isUp`
19
+ * indicates the candle direction; only `'by-direction'` mode uses
20
+ * it. The returned string is interned for the resolver lifetime;
21
+ * callers can compare references for equality (zero-alloc draw). */
22
+ resolveAt(idx: number, isUp: boolean): string;
23
+ }
24
+ export declare function resolveVolumeColoring(args: VolumeColorResolveArgs): VolumeColorResolver;
@@ -0,0 +1,3 @@
1
+ export type YAxisMode = "frequency" | "density" | "cumulative";
2
+ export declare const DEFAULT_Y_AXIS_MODE: YAxisMode;
3
+ export declare function resolveYAxisMode(input: YAxisMode | undefined): YAxisMode;
@@ -0,0 +1,38 @@
1
+ export { type Personalization, type PersonalizationInput, type LiveBarIndicator, type ConnectionIndicator, type LegendPosition, type StaleVisualization, type LegendVisibility, resolvePersonalization, resolveTheme, effectiveOutlineAlpha, } from './personalization';
2
+ export { type BarEntryAnimation, type BarUpdateAnimation, type ThemeSwitchTransition, type AnimationAxes, type AnimationInputs, resolveAnimation, ANIMATION_DEFAULTS, } from './axes/animation';
3
+ export { type PointSizeInput, type ResolvedPointSize, type BubbleScale, resolvePointSize, computeBubbleRadii, DEFAULT_POINT_SIZE_PX, DEFAULT_BUBBLE_RANGE_PX, } from './axes/point-size';
4
+ export { type PointOpacityInput, resolvePointOpacity, AUTO_OPACITY_THRESHOLDS, } from './axes/point-opacity';
5
+ export { type DensityInput, type DensityRenderMode, resolveDensityMode, DENSITY_AUTO_THRESHOLD, } from './axes/density';
6
+ export { type RegressionLineInput, type ResolvedRegressionLine, type RegressionType, resolveRegressionLine, } from './axes/regression-line';
7
+ export { type BinAlgorithm, resolveBinAlgorithm, DEFAULT_BIN_ALGORITHM, } from './axes/bin-algorithm';
8
+ export { type YAxisMode, resolveYAxisMode, DEFAULT_Y_AXIS_MODE, } from './axes/y-axis-mode';
9
+ export { type HistogramOverlayInput, type HistogramOverlayType, type ResolvedHistogramOverlay, resolveHistogramOverlay, } from './axes/histogram-overlay';
10
+ export { type HeatmapColorScaleInput, type HeatmapColorScaleType, type ResolvedHeatmapColorScale, resolveHeatmapColorScale, DEFAULT_HEATMAP_COLOR_SCALE, } from './axes/heatmap-color-scale';
11
+ export { type CellShape, resolveCellShape, DEFAULT_CELL_SHAPE, } from './axes/cell-shape';
12
+ export { type NullBehavior, resolveNullBehavior, DEFAULT_NULL_BEHAVIOR, } from './axes/null-behavior';
13
+ export { type AxisLabelsMode, resolveAxisLabels, DEFAULT_AXIS_LABELS, } from './axes/axis-labels';
14
+ export { type PriceRangeInput, type PriceRangeWindow, resolvePriceRange, DEFAULT_PRICE_RANGE_PCT, } from './axes/price-range';
15
+ export { type MidLineInput, type MidLineStyle, type ResolvedMidLine, resolveMidLine, } from './axes/mid-line';
16
+ export { type SpreadDisplayInput, type SpreadDisplayMode, resolveSpreadDisplay, DEFAULT_SPREAD_DISPLAY, } from './axes/spread-display';
17
+ export { type DepthFillType, resolveDepthFillType, DEFAULT_DEPTH_FILL_TYPE, } from './axes/depth-fill-type';
18
+ export { type LevelHighlightInput, type ResolvedLevelHighlight, resolveLevelHighlight, } from './axes/level-highlight';
19
+ export { type LabelPlacement, resolveLabelPlacement, DEFAULT_LABEL_PLACEMENT, } from './axes/label-placement';
20
+ export { type LabelContentInput, type LabelContentPreset, type ResolvedLabelContent, type SliceLabelData, resolveLabelContent, DEFAULT_LABEL_CONTENT, } from './axes/label-content';
21
+ export { type SortOrder, resolveSortOrder, DEFAULT_SORT_ORDER, } from './axes/sort-order';
22
+ export { type SmallSliceThresholdInput, type ResolvedSmallSliceThreshold, resolveSmallSliceThreshold, } from './axes/small-slice-threshold';
23
+ export { type TileLayout, resolveTileLayout, DEFAULT_TILE_LAYOUT, } from './axes/tile-layout';
24
+ export { type LabelBehavior, resolveLabelBehavior, DEFAULT_LABEL_BEHAVIOR, } from './axes/label-behavior';
25
+ export { type DepthLimitInput, resolveDepthLimit, } from './axes/depth-limit';
26
+ export { type TreemapColorScale, resolveTreemapColorScale, DEFAULT_TREEMAP_COLOR_SCALE, } from './axes/treemap-color-scale';
27
+ export { type ViewMode, resolveViewMode, DEFAULT_VIEW_MODE, } from './axes/view-mode';
28
+ export { type RadiusProportion, resolveRadiusProportion, DEFAULT_RADIUS_PROPORTION, } from './axes/radius-proportion';
29
+ export { type LabelRotation, resolveLabelRotation, DEFAULT_LABEL_ROTATION, } from './axes/label-rotation';
30
+ export { type BoxSizingInput, type ResolvedBoxSizing, resolveBoxSizing, DEFAULT_BOX_SIZING, } from './axes/box-sizing';
31
+ export { type TimeOffSource, type KagiThicknessRule, type PnFSymbolStyle, resolveTimeOffSource, resolveRenkoReversal, resolveBrickGap, resolveKagiThicknessRule, resolvePnFReversalCount, resolvePnFSymbolStyle, resolvePnFSymbolPadding, DEFAULT_TIME_OFF_SOURCE, DEFAULT_RENKO_REVERSAL, DEFAULT_BRICK_GAP, DEFAULT_KAGI_THICKNESS_RULE, DEFAULT_KAGI_THICK_LINE_WIDTH, DEFAULT_KAGI_THIN_LINE_WIDTH, DEFAULT_PNF_REVERSAL_COUNT, } from './axes/time-off-axes';
32
+ export { type NodeAlignment, resolveNodeAlignment, DEFAULT_NODE_ALIGNMENT, } from './axes/node-alignment';
33
+ export { type SankeyLinkColorInput, type SankeyLinkColorPreset, type ResolvedSankeyLinkColor, resolveSankeyLinkColor, DEFAULT_SANKEY_LINK_COLOR, } from './axes/sankey-link-color';
34
+ export { type SankeyValueDisplayInput, type SankeyValueDisplayMode, resolveSankeyValueDisplay, DEFAULT_SANKEY_VALUE_DISPLAY, } from './axes/sankey-value-display';
35
+ export { DEFAULT_PNF_SYMBOL_STYLE, DEFAULT_PNF_SYMBOL_PADDING, } from './axes/time-off-axes';
36
+ export { type ResolvedLocale, resolveLocale, registerLocale, isLocaleRegistered, listLocales, LocaleNotSupportedError, } from './locale/resolver';
37
+ export { ChartFormatter, acquireChartFormatter, clearChartFormatterCache, chartFormatterCacheSize, type ChartFormatterOptions, type DigitGrouping, type NumberAbbreviation, type DecimalPlaces, type CurrencyDisplay, type PercentPrecision, type DateFormat, type TimeFormat, } from './locale/formatter';
38
+ export { type Palette, type PaletteVariant, type Theme, type ThemeInput, type VisualStyle, type Oklch, type BuiltInPaletteName, type TonalSymmetrySide, type ResolvedTonalSymmetry, PaletteValidationError, validatePaletteOrThrow, registerPalette, getPalette, getPaletteOrThrow, listPalettes, isBuiltInPalette, resolveTonalSymmetry, isTonallyChosen, resolveDirectionalLineOklch, oklchToHex, oklchToPackedRgba, oklchToRgbF, BUILT_IN_PALETTES, MONOCHROME, CLASSIC, ACCESSIBLE, } from './palette';
@@ -0,0 +1,45 @@
1
+ import { ResolvedLocale } from './resolver';
2
+ export type DigitGrouping = "international" | "lakh-crore" | "none";
3
+ export type NumberAbbreviation = "off" | "compact" | "lakh-crore" | "auto";
4
+ export type DecimalPlaces = "auto" | number;
5
+ export type CurrencyDisplay = "none" | "symbol" | "code";
6
+ export type PercentPrecision = "auto" | number;
7
+ export type DateFormat = "auto" | "short" | "medium" | "iso";
8
+ export type TimeFormat = "auto" | "24h" | "12h";
9
+ export interface ChartFormatterOptions {
10
+ readonly locale: ResolvedLocale;
11
+ readonly digitGrouping: DigitGrouping;
12
+ readonly numberAbbreviation: NumberAbbreviation;
13
+ readonly decimalPlaces: DecimalPlaces;
14
+ readonly currency: string;
15
+ readonly currencyDisplay: CurrencyDisplay;
16
+ readonly percentPrecision: PercentPrecision;
17
+ readonly dateFormat: DateFormat;
18
+ readonly timeFormat: TimeFormat;
19
+ readonly timeZone?: string | undefined;
20
+ }
21
+ export declare class ChartFormatter {
22
+ private readonly opt;
23
+ private readonly resolvedAbbrev;
24
+ private readonly intlCache;
25
+ private readonly dateFmt;
26
+ private readonly timeFmt;
27
+ constructor(opt: ChartFormatterOptions);
28
+ private intlFor;
29
+ formatNumber(n: number, decimalsOverride?: number): string;
30
+ formatPrice(n: number, decimalsOverride?: number): string;
31
+ formatPercent(fraction: number, precisionOverride?: number): string;
32
+ formatDate(t: number): string;
33
+ formatTime(t: number): string;
34
+ private buildDateFmt;
35
+ private buildTimeFmt;
36
+ }
37
+ /** Acquire a ChartFormatter for the given options. Cached app-wide
38
+ * using a 32-entry LRU. Move-to-front on hit so frequently-used
39
+ * configs survive longest. Returns the same instance for identical
40
+ * option tuples. */
41
+ export declare function acquireChartFormatter(opt: ChartFormatterOptions): ChartFormatter;
42
+ /** Empty the cache. Used by memory-pressure handlers + tests. */
43
+ export declare function clearChartFormatterCache(): void;
44
+ /** Test-only - current cache size. */
45
+ export declare function chartFormatterCacheSize(): number;
@@ -0,0 +1,22 @@
1
+ export interface ResolvedLocale {
2
+ /** Uppercase ISO 3166-1 alpha-3 code. */
3
+ readonly country: string;
4
+ /** Platform-formatter locale for international grouping. */
5
+ readonly baseLocale: string;
6
+ /** Locale for lakh-crore (lakh/crore) grouping with Latin digits forced.
7
+ * When undefined, the country has no native lakh-crore-grouping
8
+ * locale; ChartFormatter falls back to its custom 5-line formatter
9
+ * when the host opts into lakh-crore grouping. */
10
+ readonly lakhCroreLocale: string | undefined;
11
+ /** ISO 4217 currency code paired with this locale by default. */
12
+ readonly defaultCurrency: string;
13
+ }
14
+ export declare class LocaleNotSupportedError extends Error {
15
+ readonly name = "LocaleNotSupportedError";
16
+ }
17
+ type LocaleEntry = Omit<ResolvedLocale, "country">;
18
+ export declare function resolveLocale(country: string): ResolvedLocale;
19
+ export declare function registerLocale(country: string, entry: LocaleEntry): void;
20
+ export declare function isLocaleRegistered(country: string): boolean;
21
+ export declare function listLocales(): readonly string[];
22
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Palette } from './types';
2
+ export declare const MONOCHROME: Palette;
3
+ export declare const CLASSIC: Palette;
4
+ export declare const ACCESSIBLE: Palette;
5
+ export declare const BUILT_IN_PALETTES: {
6
+ readonly Monochrome: Palette;
7
+ readonly Classic: Palette;
8
+ readonly Accessible: Palette;
9
+ };
10
+ export type BuiltInPaletteName = keyof typeof BUILT_IN_PALETTES;
@@ -0,0 +1,35 @@
1
+ import { Oklch } from './oklch';
2
+ import { PaletteVariant, Palette, TonalSymmetrySide } from './types';
3
+ /** Convert a sRGB hex string (`#rrggbb` or `#rgb`) to OKLCH. */
4
+ export declare function hexToOklch(hex: string): Oklch;
5
+ /** Accept brand input as OKLCH or hex string. */
6
+ export type BrandInput = Oklch | string;
7
+ /** Generate `n` categorical colors by rotating hue around the brand.
8
+ * The brand color sits at slot 0; subsequent slots step `360 / n`
9
+ * degrees around the OKLCH hue wheel while preserving the brand's L
10
+ * and C. Palettes are expected to define a usable
11
+ * categorical array (used by multi-series, pie/donut, treemap, etc.).
12
+ *
13
+ * Tunable count - defaults to 8 which matches the built-in palettes. */
14
+ export declare function deriveCategoricalSet(brand: BrandInput, count?: number): readonly Oklch[];
15
+ /** Generate the chart-chrome accent tint. Per the built-ins, the accent
16
+ * is a desaturated version of the brand pulled toward neutral so it
17
+ * reads as "muted ink" against the chart background while still
18
+ * carrying the brand hue. */
19
+ export declare function deriveAccentTint(brand: BrandInput): Oklch;
20
+ /** Build a `PaletteVariant` (one of `light` or `dark`) from a brand
21
+ * color. Uses opinionated L/C tuning matching the built-in
22
+ * Monochrome / Classic / Accessible variants:
23
+ * - Light theme - up/down at L ≈ 0.70, C ≈ 0.18.
24
+ * - Dark theme - brightened L ≈ 0.78, C ≈ 0.20 for AA contrast.
25
+ * Hue derives from the brand. Categorical = 8-step hue rotation. */
26
+ export declare function deriveVariant(brand: BrandInput, theme: "light" | "dark"): PaletteVariant;
27
+ /** Build a complete `Palette` from a brand color. Generates both
28
+ * `light` and `dark` variants by calling `deriveVariant` twice with
29
+ * theme-tuned L/C. */
30
+ export interface DeriveDefaultPaletteOptions {
31
+ readonly name: string;
32
+ readonly tonalSymmetrySide?: TonalSymmetrySide;
33
+ readonly tonalSymmetryFlipInDarkMode?: boolean;
34
+ }
35
+ export declare function deriveDefaultPalette(brand: BrandInput, opts: DeriveDefaultPaletteOptions): Palette;
@@ -0,0 +1,6 @@
1
+ export { type Oklch, type RgbF, oklchToHex, oklchToPackedRgba, oklchToRgbF, } from './oklch';
2
+ export { type Theme, type ThemeInput, type VisualStyle, type Palette, type PaletteVariant, type TonalSymmetrySide, PaletteValidationError, validatePaletteOrThrow, } from './types';
3
+ export { type ResolvedTonalSymmetry, resolveTonalSymmetry, isTonallyChosen, resolveDirectionalLineOklch, } from './tonal-symmetry';
4
+ export { BUILT_IN_PALETTES, MONOCHROME, CLASSIC, ACCESSIBLE, type BuiltInPaletteName, } from './built-ins';
5
+ export { registerPalette, getPalette, getPaletteOrThrow, listPalettes, isBuiltInPalette, } from './registry';
6
+ export { type BrandInput, type DeriveDefaultPaletteOptions, deriveAccentTint, deriveCategoricalSet, deriveDefaultPalette, deriveVariant, hexToOklch, } from './derive';
@@ -0,0 +1,19 @@
1
+ export interface Oklch {
2
+ L: number;
3
+ C: number;
4
+ h: number;
5
+ }
6
+ export interface RgbF {
7
+ r: number;
8
+ g: number;
9
+ b: number;
10
+ }
11
+ export declare function oklchToOklab({ L, C, h }: Oklch): {
12
+ L: number;
13
+ a: number;
14
+ b: number;
15
+ };
16
+ export declare function oklabToLinearRgb(L: number, a: number, b: number): RgbF;
17
+ export declare function oklchToRgbF(o: Oklch): RgbF;
18
+ export declare function oklchToHex({ L, C, h }: Oklch, alpha?: number): string;
19
+ export declare function oklchToPackedRgba(o: Oklch, alpha?: number): number;
@@ -0,0 +1,7 @@
1
+ import { Palette } from './types';
2
+ import { BuiltInPaletteName } from './built-ins';
3
+ export declare function registerPalette(palette: Palette): void;
4
+ export declare function getPalette(name: string): Palette | undefined;
5
+ export declare function getPaletteOrThrow(name: string): Palette;
6
+ export declare function listPalettes(): readonly string[];
7
+ export declare function isBuiltInPalette(name: string): name is BuiltInPaletteName;
@@ -0,0 +1,32 @@
1
+ import { Palette, Theme, TonalSymmetrySide } from './types';
2
+ export interface ResolvedTonalSymmetry {
3
+ /** The effective chosen side for the active theme (after the
4
+ * dark-mode flip). `'none'` → palette has no symmetry rule; bars
5
+ * render normally per `visualStyle`. */
6
+ readonly chosen: TonalSymmetrySide;
7
+ }
8
+ export declare function resolveTonalSymmetry(palette: Palette, theme: Theme): ResolvedTonalSymmetry;
9
+ /** True if the bar's direction (`positive`) matches the resolved
10
+ * chosen side and should therefore render with the symmetric "hollow
11
+ * w/ opposite-color stroke" treatment. False (and for `'none'`
12
+ * palettes always false) means the bar renders normally per
13
+ * `visualStyle`. */
14
+ export declare function isTonallyChosen(symmetry: ResolvedTonalSymmetry, positive: boolean): boolean;
15
+ /** Resolves the directional-line/area color for a non-threshold,
16
+ * non-multi-series chart (LineChart standalone, AreaChart standalone,
17
+ * Sparkline, etc.).
18
+ *
19
+ * - `chosen === 'none'`: returns trend-aware color (`palette.up` if
20
+ * `trendingUp`, else `palette.down`). Preserves the legacy
21
+ * "color carries direction cue" behavior on Classic / Accessible.
22
+ * - `chosen ≠ 'none'`: returns the OPPOSITE-of-chosen direction color
23
+ * regardless of trend. Net effect on Monochrome: both trending-up
24
+ * and trending-down lines use the contrasty shade against the chart
25
+ * background (the chosen-side shade is the one that "blends" with
26
+ * bg by palette design - using it consistently would make the line
27
+ * invisible). The chart's shape (line going up vs. down) carries
28
+ * the direction cue instead. */
29
+ export declare function resolveDirectionalLineOklch<T>(symmetry: ResolvedTonalSymmetry, variant: {
30
+ up: T;
31
+ down: T;
32
+ }, trendingUp: boolean): T;