katucharts.js 0.2.1

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 (200) hide show
  1. package/LICENSE +106 -0
  2. package/README.md +1100 -0
  3. package/dist/__vite-optional-peer-dep_jspdf_katucharts-BDMct_Gn.js +4 -0
  4. package/dist/accessibility/A11yModule.d.ts +26 -0
  5. package/dist/axis/Axis.d.ts +140 -0
  6. package/dist/axis/AxisCoordinator.d.ts +38 -0
  7. package/dist/bio.d.ts +22 -0
  8. package/dist/components/Credits.d.ts +38 -0
  9. package/dist/components/Crosshair.d.ts +15 -0
  10. package/dist/components/DataLabels.d.ts +7 -0
  11. package/dist/components/ExportButton.d.ts +27 -0
  12. package/dist/components/Legend.d.ts +53 -0
  13. package/dist/components/TitleRenderer.d.ts +19 -0
  14. package/dist/components/Tooltip.d.ts +61 -0
  15. package/dist/core/Chart.d.ts +156 -0
  16. package/dist/core/EventBus.d.ts +14 -0
  17. package/dist/core/InteractionController.d.ts +62 -0
  18. package/dist/core/OptionsParser.d.ts +61 -0
  19. package/dist/core/Registry.d.ts +27 -0
  20. package/dist/core/SVGRenderer.d.ts +48 -0
  21. package/dist/core/ScrollablePlotOverlay.d.ts +31 -0
  22. package/dist/core/StackComputer.d.ts +25 -0
  23. package/dist/core/StateManager.d.ts +21 -0
  24. package/dist/core/UpdateScheduler.d.ts +28 -0
  25. package/dist/core/animationConstants.d.ts +20 -0
  26. package/dist/core/chartTypes.d.ts +46 -0
  27. package/dist/core/registerAll.d.ts +4 -0
  28. package/dist/core/registerBio.d.ts +4 -0
  29. package/dist/core/registerCore.d.ts +4 -0
  30. package/dist/core/registerFinance.d.ts +4 -0
  31. package/dist/core/registerFinancial.d.ts +4 -0
  32. package/dist/core/registerFlow.d.ts +4 -0
  33. package/dist/core/registerGeneral.d.ts +4 -0
  34. package/dist/datatable/DataTable.d.ts +162 -0
  35. package/dist/datatable/DataTableDefaults.d.ts +7 -0
  36. package/dist/datatable/api/TableApi.d.ts +35 -0
  37. package/dist/datatable/columns/ColumnDef.d.ts +16 -0
  38. package/dist/datatable/columns/ColumnManager.d.ts +31 -0
  39. package/dist/datatable/data/DataProcessor.d.ts +46 -0
  40. package/dist/datatable/data/DataSource.d.ts +26 -0
  41. package/dist/datatable/editing/CellEditor.d.ts +29 -0
  42. package/dist/datatable/export/TableExport.d.ts +23 -0
  43. package/dist/datatable/locales/en.d.ts +9 -0
  44. package/dist/datatable/locales/es.d.ts +6 -0
  45. package/dist/datatable/locales/index.d.ts +22 -0
  46. package/dist/datatable/locales/pt-BR.d.ts +6 -0
  47. package/dist/datatable/locales/resolveLocale.d.ts +16 -0
  48. package/dist/datatable/locales/zh.d.ts +6 -0
  49. package/dist/datatable/render/CellRenderer.d.ts +24 -0
  50. package/dist/datatable/render/HeaderRenderer.d.ts +51 -0
  51. package/dist/datatable/render/PaginationRenderer.d.ts +26 -0
  52. package/dist/datatable/render/SearchRenderer.d.ts +21 -0
  53. package/dist/datatable/render/TableRenderer.d.ts +81 -0
  54. package/dist/datatable/render/ToolbarRenderer.d.ts +34 -0
  55. package/dist/datatable/render/icons.d.ts +24 -0
  56. package/dist/datatable/render/popover.d.ts +15 -0
  57. package/dist/datatable/selection/SelectionManager.d.ts +29 -0
  58. package/dist/datatable/themes/TableTheme.d.ts +36 -0
  59. package/dist/datatable/themes/styleSheet.d.ts +16 -0
  60. package/dist/datatable.d.ts +19 -0
  61. package/dist/export/ChartExporter.d.ts +50 -0
  62. package/dist/export/Export.d.ts +76 -0
  63. package/dist/finance.d.ts +49 -0
  64. package/dist/index.d.ts +67 -0
  65. package/dist/indicators/Indicator.d.ts +23 -0
  66. package/dist/indicators/expandIndicators.d.ts +18 -0
  67. package/dist/indicators/moving-averages/DEMA.d.ts +10 -0
  68. package/dist/indicators/moving-averages/EMA.d.ts +12 -0
  69. package/dist/indicators/moving-averages/SMA.d.ts +11 -0
  70. package/dist/indicators/moving-averages/TEMA.d.ts +10 -0
  71. package/dist/indicators/moving-averages/WMA.d.ts +12 -0
  72. package/dist/indicators/oscillators/CCI.d.ts +11 -0
  73. package/dist/indicators/oscillators/MACD.d.ts +20 -0
  74. package/dist/indicators/oscillators/Momentum.d.ts +10 -0
  75. package/dist/indicators/oscillators/ROC.d.ts +10 -0
  76. package/dist/indicators/oscillators/RSI.d.ts +11 -0
  77. package/dist/indicators/oscillators/Stochastic.d.ts +20 -0
  78. package/dist/indicators/registry.d.ts +9 -0
  79. package/dist/indicators/trend/ADX.d.ts +11 -0
  80. package/dist/indicators/trend/IchimokuCloud.d.ts +14 -0
  81. package/dist/indicators/trend/PSAR.d.ts +11 -0
  82. package/dist/indicators/util.d.ts +8 -0
  83. package/dist/indicators/volatility/ATR.d.ts +11 -0
  84. package/dist/indicators/volatility/BollingerBands.d.ts +11 -0
  85. package/dist/indicators/volume/OBV.d.ts +11 -0
  86. package/dist/indicators/volume/VBP.d.ts +12 -0
  87. package/dist/indicators/volume/VWAP.d.ts +12 -0
  88. package/dist/interaction/Drilldown.d.ts +29 -0
  89. package/dist/interaction/HoverManager.d.ts +47 -0
  90. package/dist/interaction/Zoom.d.ts +68 -0
  91. package/dist/katucharts-bio.es.js +5861 -0
  92. package/dist/katucharts-bio.umd.js +1 -0
  93. package/dist/katucharts-datatable.es.js +3363 -0
  94. package/dist/katucharts-datatable.umd.js +296 -0
  95. package/dist/katucharts-finance.es.js +4364 -0
  96. package/dist/katucharts-finance.umd.js +1 -0
  97. package/dist/katucharts-react.es.js +35 -0
  98. package/dist/katucharts-react.umd.js +1 -0
  99. package/dist/katucharts.es.js +20531 -0
  100. package/dist/katucharts.umd.js +9 -0
  101. package/dist/layout/LayoutEngine.d.ts +44 -0
  102. package/dist/license/LicenseManager.d.ts +63 -0
  103. package/dist/options/defaults.d.ts +5 -0
  104. package/dist/react/KatuChartsReact.d.ts +16 -0
  105. package/dist/react.d.ts +2 -0
  106. package/dist/responsive/ResponsiveEngine.d.ts +15 -0
  107. package/dist/series/BaseSeries.d.ts +186 -0
  108. package/dist/series/bioinformatics/CircosChart.d.ts +4 -0
  109. package/dist/series/bioinformatics/ClusteredHeatmapChart.d.ts +22 -0
  110. package/dist/series/bioinformatics/ForestPlotChart.d.ts +21 -0
  111. package/dist/series/bioinformatics/KaplanMeierChart.d.ts +22 -0
  112. package/dist/series/bioinformatics/ManhattanChart.d.ts +34 -0
  113. package/dist/series/bioinformatics/PCoAChart.d.ts +22 -0
  114. package/dist/series/bioinformatics/PhyloTreeChart.d.ts +27 -0
  115. package/dist/series/bioinformatics/SequenceLogoChart.d.ts +21 -0
  116. package/dist/series/bioinformatics/ViolinChart.d.ts +23 -0
  117. package/dist/series/bioinformatics/VolcanoChart.d.ts +28 -0
  118. package/dist/series/bioinformatics/circos/CircosChart.d.ts +20 -0
  119. package/dist/series/bioinformatics/circos/CircosColorScales.d.ts +6 -0
  120. package/dist/series/bioinformatics/circos/CircosComparativeChart.d.ts +41 -0
  121. package/dist/series/bioinformatics/circos/CircosHeatmapChart.d.ts +31 -0
  122. package/dist/series/bioinformatics/circos/CircosLayoutEngine.d.ts +37 -0
  123. package/dist/series/bioinformatics/circos/CircosRules.d.ts +6 -0
  124. package/dist/series/bioinformatics/circos/CircosSpiralChart.d.ts +39 -0
  125. package/dist/series/bioinformatics/circos/CircosTypes.d.ts +131 -0
  126. package/dist/series/bioinformatics/circos/tracks/AreaTrackRenderer.d.ts +7 -0
  127. package/dist/series/bioinformatics/circos/tracks/ConnectorTrackRenderer.d.ts +7 -0
  128. package/dist/series/bioinformatics/circos/tracks/GlyphTrackRenderer.d.ts +7 -0
  129. package/dist/series/bioinformatics/circos/tracks/HeatmapTrackRenderer.d.ts +7 -0
  130. package/dist/series/bioinformatics/circos/tracks/HighlightTrackRenderer.d.ts +6 -0
  131. package/dist/series/bioinformatics/circos/tracks/HistogramTrackRenderer.d.ts +7 -0
  132. package/dist/series/bioinformatics/circos/tracks/LineTrackRenderer.d.ts +7 -0
  133. package/dist/series/bioinformatics/circos/tracks/LinkTrackRenderer.d.ts +8 -0
  134. package/dist/series/bioinformatics/circos/tracks/LollipopTrackRenderer.d.ts +9 -0
  135. package/dist/series/bioinformatics/circos/tracks/RibbonTrackRenderer.d.ts +9 -0
  136. package/dist/series/bioinformatics/circos/tracks/ScatterTrackRenderer.d.ts +7 -0
  137. package/dist/series/bioinformatics/circos/tracks/StackTrackRenderer.d.ts +7 -0
  138. package/dist/series/bioinformatics/circos/tracks/TextTrackRenderer.d.ts +8 -0
  139. package/dist/series/bioinformatics/circos/tracks/TileTrackRenderer.d.ts +7 -0
  140. package/dist/series/bioinformatics/circos/tracks/TrackAxesRenderer.d.ts +6 -0
  141. package/dist/series/bioinformatics/circos/tracks/TrackBackgroundRenderer.d.ts +5 -0
  142. package/dist/series/cartesian/AreaChart.d.ts +33 -0
  143. package/dist/series/cartesian/BoxPlotChart.d.ts +24 -0
  144. package/dist/series/cartesian/BubbleChart.d.ts +34 -0
  145. package/dist/series/cartesian/ColumnChart.d.ts +37 -0
  146. package/dist/series/cartesian/LineChart.d.ts +28 -0
  147. package/dist/series/cartesian/ScatterChart.d.ts +20 -0
  148. package/dist/series/cartesian/SplineChart.d.ts +9 -0
  149. package/dist/series/cartesian/WaterfallChart.d.ts +25 -0
  150. package/dist/series/financial/AreaRangeChart.d.ts +24 -0
  151. package/dist/series/financial/BaselineChart.d.ts +20 -0
  152. package/dist/series/financial/CandlestickChart.d.ts +55 -0
  153. package/dist/series/financial/ColumnRangeChart.d.ts +16 -0
  154. package/dist/series/financial/FlagsChart.d.ts +34 -0
  155. package/dist/series/financial/HeikinAshiChart.d.ts +11 -0
  156. package/dist/series/financial/HollowCandlestickChart.d.ts +17 -0
  157. package/dist/series/financial/KagiChart.d.ts +23 -0
  158. package/dist/series/financial/LineBreakChart.d.ts +23 -0
  159. package/dist/series/financial/PointAndFigureChart.d.ts +24 -0
  160. package/dist/series/financial/RenkoChart.d.ts +22 -0
  161. package/dist/series/financial/VBPChart.d.ts +18 -0
  162. package/dist/series/financial/VolumeChart.d.ts +15 -0
  163. package/dist/series/flow/DependencyWheelChart.d.ts +23 -0
  164. package/dist/series/flow/NetworkGraphChart.d.ts +18 -0
  165. package/dist/series/flow/SankeyChart.d.ts +24 -0
  166. package/dist/series/gauge/GaugeChart.d.ts +40 -0
  167. package/dist/series/heatmap/HeatmapChart.d.ts +18 -0
  168. package/dist/series/hierarchical/SunburstChart.d.ts +44 -0
  169. package/dist/series/hierarchical/TreegraphChart.d.ts +19 -0
  170. package/dist/series/hierarchical/TreemapChart.d.ts +20 -0
  171. package/dist/series/hierarchical/WordcloudChart.d.ts +19 -0
  172. package/dist/series/index.d.ts +45 -0
  173. package/dist/series/map/FlowmapChart.d.ts +33 -0
  174. package/dist/series/map/MapChart.d.ts +53 -0
  175. package/dist/series/map/MapPointChart.d.ts +26 -0
  176. package/dist/series/map/mapProjection.d.ts +46 -0
  177. package/dist/series/pie/PieChart.d.ts +53 -0
  178. package/dist/series/polar/PolarChart.d.ts +18 -0
  179. package/dist/series/race/BarRaceChart.d.ts +44 -0
  180. package/dist/series/timeline/TimelineChart.d.ts +23 -0
  181. package/dist/series/venn/VennChart.d.ts +28 -0
  182. package/dist/stock/DataGrouping.d.ts +21 -0
  183. package/dist/stock/Navigator.d.ts +25 -0
  184. package/dist/stock/RangeSelector.d.ts +9 -0
  185. package/dist/stock/StockController.d.ts +47 -0
  186. package/dist/stockcharts.d.ts +8 -0
  187. package/dist/streaming/StreamAdapter.d.ts +36 -0
  188. package/dist/types/datatable-options.d.ts +633 -0
  189. package/dist/types/options.d.ts +1333 -0
  190. package/dist/utils/CircularBuffer.d.ts +24 -0
  191. package/dist/utils/chartText.d.ts +18 -0
  192. package/dist/utils/color.d.ts +23 -0
  193. package/dist/utils/decimation.d.ts +19 -0
  194. package/dist/utils/deepMerge.d.ts +5 -0
  195. package/dist/utils/dom.d.ts +10 -0
  196. package/dist/utils/format.d.ts +42 -0
  197. package/dist/utils/index.d.ts +7 -0
  198. package/dist/utils/math.d.ts +6 -0
  199. package/dist/utils/throttle.d.ts +2 -0
  200. package/package.json +95 -0
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Owns the chart's export/output concern: image/SVG/PDF/CSV/XLS downloads, the
3
+ * data-table view, print, the external-options snapshot, and full-screen
4
+ * toggling. Extracted from `Chart` so the orchestrator no longer carries this
5
+ * ~250-line subsystem. The exporter reaches back into the chart through a narrow
6
+ * host interface (live getters + a few bound callbacks) so it always sees the
7
+ * chart's current options/series and never captures stale references.
8
+ */
9
+ import type { SVGRenderer } from '../core/SVGRenderer';
10
+ import type { InternalConfig, KatuChartsOptions, ExportingOptions } from '../types/options';
11
+ import type { BaseSeries } from '../series/BaseSeries';
12
+ export interface ExporterHost {
13
+ getRenderer(): SVGRenderer;
14
+ getOptions(): InternalConfig;
15
+ getContainer(): HTMLElement;
16
+ getSeriesInstances(): BaseSeries[];
17
+ setSize(width: number, height: number): void;
18
+ fireEvent(name: string, ...args: any[]): void;
19
+ getDefaultHeightAspectRatio(): number;
20
+ disconnectResizeObserver(): void;
21
+ observeResizeObserver(): void;
22
+ getViewportSize(): {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ fitToViewport(width: number, height: number): void;
27
+ }
28
+ export declare class ChartExporter {
29
+ private host;
30
+ constructor(host: ExporterHost);
31
+ getSVG(): string;
32
+ getInlinedSVG(): string;
33
+ handleExportAction(type: string): void;
34
+ toggleFullScreen(): void;
35
+ getSeriesDataForExport(): {
36
+ name: string;
37
+ data: {
38
+ x?: any;
39
+ y?: any;
40
+ name?: string;
41
+ }[];
42
+ }[];
43
+ exportXLS(filename: string): void;
44
+ getCSV(): string;
45
+ getTable(): string;
46
+ getDataRows(): (string | number | null)[][];
47
+ exportChart(exportingOptions?: Partial<ExportingOptions>): void;
48
+ print(): void;
49
+ optionsToExternal(): KatuChartsOptions;
50
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Export engine: SVG, PNG, JPEG, PDF, CSV, and print support.
3
+ */
4
+ export declare class ExportModule {
5
+ private static readonly INLINE_PROPS;
6
+ /**
7
+ * Clone the SVG node, inline computed styles on every element, strip the
8
+ * export button group, and return a self-contained SVG string.
9
+ */
10
+ static inlineStyles(svgNode: SVGSVGElement): string;
11
+ /** Append a guaranteed, render-safe attribution watermark to an export clone. */
12
+ private static stampWatermark;
13
+ /**
14
+ * Shared helper: render an SVG string to a canvas at a given scale with
15
+ * an optional background colour fill.
16
+ */
17
+ static svgToCanvas(svgString: string, scale: number, bgColor?: string): Promise<HTMLCanvasElement>;
18
+ static exportSVG(svgString: string, filename?: string): void;
19
+ static exportPNG(svgString: string, filename?: string, scale?: number): Promise<void>;
20
+ static exportJPEG(svgString: string, filename?: string, scale?: number, quality?: number): Promise<void>;
21
+ static exportPDF(svgString: string, filename?: string, scale?: number): Promise<void>;
22
+ static print(svgString: string, maxWidth?: number): void;
23
+ static exportCSV(seriesData: {
24
+ name: string;
25
+ data: {
26
+ x?: any;
27
+ y?: any;
28
+ name?: string;
29
+ }[];
30
+ }[], filename?: string, csvOptions?: {
31
+ columnHeaderFormatter?: (item: any, key?: string, keyLength?: number) => string | false;
32
+ dateFormat?: string;
33
+ itemDelimiter?: string;
34
+ lineDelimiter?: string;
35
+ decimalPoint?: string;
36
+ }): void;
37
+ static getCSV(seriesData: {
38
+ name: string;
39
+ data: {
40
+ x?: any;
41
+ y?: any;
42
+ name?: string;
43
+ }[];
44
+ }[], csvOptions?: {
45
+ columnHeaderFormatter?: (item: any, key?: string, keyLength?: number) => string | false;
46
+ dateFormat?: string;
47
+ itemDelimiter?: string;
48
+ lineDelimiter?: string;
49
+ decimalPoint?: string;
50
+ }): string;
51
+ static getDataRows(seriesData: {
52
+ name: string;
53
+ data: {
54
+ x?: any;
55
+ y?: any;
56
+ name?: string;
57
+ }[];
58
+ }[]): (string | number | null)[][];
59
+ static getTable(seriesData: {
60
+ name: string;
61
+ data: {
62
+ x?: any;
63
+ y?: any;
64
+ name?: string;
65
+ }[];
66
+ }[], tableCaption?: string | boolean): string;
67
+ static viewDataTable(seriesData: {
68
+ name: string;
69
+ data: {
70
+ x?: any;
71
+ y?: any;
72
+ name?: string;
73
+ }[];
74
+ }[], container: HTMLElement, tableCaption?: string | boolean): HTMLDivElement;
75
+ static downloadBlob(blob: Blob, filename: string): void;
76
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * KatuCharts — Finance charts plugin.
3
+ *
4
+ * Import this module to register all finance series types:
5
+ * import 'katucharts/finance';
6
+ *
7
+ * Or import named exports for manual control:
8
+ * import { registerFinanceSeriesTypes, HeikinAshiChart, SMA } from 'katucharts/finance';
9
+ */
10
+ export { registerFinanceSeriesTypes } from './core/registerFinance';
11
+ export { CandlestickChart, OHLCChart } from './series/financial/CandlestickChart';
12
+ export { HeikinAshiChart } from './series/financial/HeikinAshiChart';
13
+ export { HollowCandlestickChart } from './series/financial/HollowCandlestickChart';
14
+ export { VolumeChart } from './series/financial/VolumeChart';
15
+ export { AreaRangeChart, AreaSplineRangeChart } from './series/financial/AreaRangeChart';
16
+ export { ColumnRangeChart } from './series/financial/ColumnRangeChart';
17
+ export { VBPChart } from './series/financial/VBPChart';
18
+ export { BaselineChart } from './series/financial/BaselineChart';
19
+ export { FlagsChart } from './series/financial/FlagsChart';
20
+ export { RenkoChart } from './series/financial/RenkoChart';
21
+ export { KagiChart } from './series/financial/KagiChart';
22
+ export { PointAndFigureChart } from './series/financial/PointAndFigureChart';
23
+ export { LineBreakChart } from './series/financial/LineBreakChart';
24
+ export { Indicator } from './indicators/Indicator';
25
+ export type { OHLCVPoint, IndicatorResult } from './indicators/Indicator';
26
+ export { IndicatorRegistry } from './indicators/registry';
27
+ export { SMA, SMAIndicator } from './indicators/moving-averages/SMA';
28
+ export { EMA, EMAIndicator } from './indicators/moving-averages/EMA';
29
+ export { WMA, WMAIndicator } from './indicators/moving-averages/WMA';
30
+ export { DEMA, DEMAIndicator } from './indicators/moving-averages/DEMA';
31
+ export { TEMA, TEMAIndicator } from './indicators/moving-averages/TEMA';
32
+ export { RSI, RSIIndicator } from './indicators/oscillators/RSI';
33
+ export { Stochastic, StochasticIndicator } from './indicators/oscillators/Stochastic';
34
+ export { MACD, MACDIndicator } from './indicators/oscillators/MACD';
35
+ export { CCI, CCIIndicator } from './indicators/oscillators/CCI';
36
+ export { ROC, ROCIndicator } from './indicators/oscillators/ROC';
37
+ export { Momentum, MomentumIndicator } from './indicators/oscillators/Momentum';
38
+ export { BollingerBands, BollingerBandsIndicator } from './indicators/volatility/BollingerBands';
39
+ export { ATR, ATRIndicator } from './indicators/volatility/ATR';
40
+ export { VWAP, VWAPIndicator } from './indicators/volume/VWAP';
41
+ export { OBV, OBVIndicator } from './indicators/volume/OBV';
42
+ export { VBP, VBPIndicator } from './indicators/volume/VBP';
43
+ export { IchimokuCloud, IchimokuCloudIndicator } from './indicators/trend/IchimokuCloud';
44
+ export { ADX, ADXIndicator } from './indicators/trend/ADX';
45
+ export { PSAR, PSARIndicator } from './indicators/trend/PSAR';
46
+ export { StreamAdapter } from './streaming/StreamAdapter';
47
+ export type { StreamSubscription } from './streaming/StreamAdapter';
48
+ export { CircularBuffer } from './utils/CircularBuffer';
49
+ export { UpdateScheduler, UpdateBatch } from './core/UpdateScheduler';
@@ -0,0 +1,67 @@
1
+ /**
2
+ * KatuCharts — D3.js charting library.
3
+ */
4
+ import { Chart } from './core/Chart';
5
+ import { type ModuleDefinition } from './core/Registry';
6
+ import { type LicenseConfig } from './license/LicenseManager';
7
+ import { dateFormat, numberFormat, templateFormat, stripHtmlTags } from './utils/format';
8
+ import type { KatuChartsOptions } from './types/options';
9
+ export declare const KatuCharts: {
10
+ chart(containerOrId: string | HTMLElement, options: KatuChartsOptions): Chart;
11
+ setOptions(options: Partial<KatuChartsOptions>): void;
12
+ getOptions(): Partial<KatuChartsOptions>;
13
+ dateFormat: typeof dateFormat;
14
+ numberFormat: typeof numberFormat;
15
+ templateFormat: typeof templateFormat;
16
+ stripHtmlTags: typeof stripHtmlTags;
17
+ color(input: string): import("./utils").KatuChartsColor;
18
+ palettes: Record<string, string[]>;
19
+ getPalette(name: string): string[];
20
+ themes: Record<string, any>;
21
+ themeNames: string[];
22
+ getTheme(name: string): any;
23
+ setTheme(name: string): void;
24
+ use(module: ModuleDefinition): void;
25
+ setLicenseKey(key: string): boolean;
26
+ isLicensed(): boolean;
27
+ configureLicensing(config: LicenseConfig): void;
28
+ ChartRegistry: {
29
+ types: Map<string, import("./core/Registry").SeriesConstructor>;
30
+ registerType(name: import(".").SeriesType | string, constructor: import("./core/Registry").SeriesConstructor): void;
31
+ getType(name: string): import("./core/Registry").SeriesConstructor | undefined;
32
+ hasType(name: string): boolean;
33
+ getRegisteredTypes(): string[];
34
+ };
35
+ };
36
+ export default KatuCharts;
37
+ export { Chart } from './core/Chart';
38
+ export { EventBus } from './core/EventBus';
39
+ export { SVGRenderer } from './core/SVGRenderer';
40
+ export { OptionsParser, setGlobalOptions, getGlobalOptions } from './core/OptionsParser';
41
+ export { ChartRegistry, ModuleRegistry } from './core/Registry';
42
+ export { BaseSeries } from './series/BaseSeries';
43
+ export { ExportModule } from './export/Export';
44
+ export { ResponsiveEngine } from './responsive/ResponsiveEngine';
45
+ export { A11yModule } from './accessibility/A11yModule';
46
+ export { Drilldown } from './interaction/Drilldown';
47
+ export { Zoom } from './interaction/Zoom';
48
+ export { Tooltip } from './components/Tooltip';
49
+ export { Legend } from './components/Legend';
50
+ export { DataLabels } from './components/DataLabels';
51
+ export { Crosshair } from './components/Crosshair';
52
+ export { ExportButton } from './components/ExportButton';
53
+ export { LicenseManager } from './license/LicenseManager';
54
+ export { Navigator } from './stock/Navigator';
55
+ export { RangeSelector } from './stock/RangeSelector';
56
+ export { DataGrouping } from './stock/DataGrouping';
57
+ export { registerCoreSeriesTypes } from './core/registerCore';
58
+ export { registerGeneralSeriesTypes } from './core/registerGeneral';
59
+ export { registerFinancialSeriesTypes } from './core/registerFinancial';
60
+ export { registerFlowSeriesTypes } from './core/registerFlow';
61
+ export { lttbDecimate, minMaxDecimate } from './utils/decimation';
62
+ export { CircularBuffer } from './utils/CircularBuffer';
63
+ export { UpdateScheduler, UpdateBatch } from './core/UpdateScheduler';
64
+ export { StreamAdapter } from './streaming/StreamAdapter';
65
+ export type { StreamSubscription } from './streaming/StreamAdapter';
66
+ export type { UpdateType, UpdateEntry } from './core/UpdateScheduler';
67
+ export type { KatuChartsOptions, ChartOptions, SeriesOptions, AxisOptions, TooltipOptions, LegendOptions, PlotOptions, PointOptions, MarkerOptions, DataLabelOptions, SeriesType, PlotArea, InternalConfig, ExportingOptions, StreamingOptions, } from './types/options';
@@ -0,0 +1,23 @@
1
+ import type { PointOptions } from '../types/options';
2
+ export interface OHLCVPoint {
3
+ x: number;
4
+ open: number;
5
+ high: number;
6
+ low: number;
7
+ close: number;
8
+ volume?: number;
9
+ }
10
+ export interface IndicatorResult {
11
+ values: PointOptions[];
12
+ bands?: {
13
+ upper: PointOptions[];
14
+ lower: PointOptions[];
15
+ middle?: PointOptions[];
16
+ };
17
+ histogram?: PointOptions[];
18
+ signal?: PointOptions[];
19
+ }
20
+ export declare abstract class Indicator {
21
+ abstract readonly name: string;
22
+ abstract calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
23
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Expands declarative technical-indicator series (the
3
+ * `{ type: 'sma', linkedTo: 'id', params: { period } }`) into concrete
4
+ * line / arearange / column series, computed from the linked series' data.
5
+ *
6
+ * This keeps the indicator math in the existing IndicatorRegistry calculators
7
+ * and reuses the standard renderers, so an indicator is just a derived series.
8
+ * Runs after option normalization, so the linked series' OHLC data is available.
9
+ */
10
+ import type { InternalSeriesConfig } from '../types/options';
11
+ export declare const INDICATOR_TYPES: Set<string>;
12
+ export declare function isIndicatorType(type: string | undefined): boolean;
13
+ /**
14
+ * Replaces indicator series in-place with their computed concrete series.
15
+ * Non-indicator series pass through untouched. Indices are reassigned so the
16
+ * downstream color/clip logic stays consistent after fan-out.
17
+ */
18
+ export declare function expandIndicatorSeries(seriesList: InternalSeriesConfig[]): InternalSeriesConfig[];
@@ -0,0 +1,10 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class DEMAIndicator extends Indicator {
3
+ readonly name = "dema";
4
+ /**
5
+ * Double Exponential Moving Average: 2*EMA - EMA(EMA). Reduces the lag of a
6
+ * single EMA while keeping smoothing.
7
+ */
8
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
9
+ }
10
+ export declare const DEMA: DEMAIndicator;
@@ -0,0 +1,12 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class EMAIndicator extends Indicator {
3
+ readonly name = "ema";
4
+ /**
5
+ * Calculates the Exponential Moving Average over closing prices.
6
+ * Uses multiplier k = 2 / (period + 1). The first EMA value is
7
+ * seeded with the SMA of the first `period` points.
8
+ * Points with insufficient history produce y: null.
9
+ */
10
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
11
+ }
12
+ export declare const EMA: EMAIndicator;
@@ -0,0 +1,11 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class SMAIndicator extends Indicator {
3
+ readonly name = "sma";
4
+ /**
5
+ * Calculates the Simple Moving Average over closing prices.
6
+ * SMA = sum of last `period` closes / period.
7
+ * Points with insufficient history produce y: null.
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const SMA: SMAIndicator;
@@ -0,0 +1,10 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class TEMAIndicator extends Indicator {
3
+ readonly name = "tema";
4
+ /**
5
+ * Triple Exponential Moving Average: 3*EMA - 3*EMA(EMA) + EMA(EMA(EMA)).
6
+ * Lower lag than DEMA for the same period.
7
+ */
8
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
9
+ }
10
+ export declare const TEMA: TEMAIndicator;
@@ -0,0 +1,12 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class WMAIndicator extends Indicator {
3
+ readonly name = "wma";
4
+ /**
5
+ * Calculates the Weighted Moving Average over closing prices.
6
+ * Uses linear weighting where the most recent price in the window
7
+ * receives the highest weight: weight_i = i + 1.
8
+ * Points with insufficient history produce y: null.
9
+ */
10
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
11
+ }
12
+ export declare const WMA: WMAIndicator;
@@ -0,0 +1,11 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class CCIIndicator extends Indicator {
3
+ readonly name = "cci";
4
+ /**
5
+ * Commodity Channel Index. Measures deviation of the typical price
6
+ * ((high+low+close)/3) from its SMA, scaled by mean absolute deviation:
7
+ * CCI = (TP - SMA(TP)) / (0.015 * meanDeviation).
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const CCI: CCIIndicator;
@@ -0,0 +1,20 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class MACDIndicator extends Indicator {
3
+ readonly name = "macd";
4
+ /**
5
+ * Calculates MACD (Moving Average Convergence Divergence).
6
+ * Returns the MACD line (fast EMA - slow EMA), a signal line
7
+ * (EMA of MACD), and a histogram (MACD - signal).
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ /**
11
+ * Calculates Exponential Moving Average.
12
+ * Uses SMA for the seed value, then applies the recursive EMA formula.
13
+ */
14
+ private ema;
15
+ /**
16
+ * Extracts non-null values and their original indices from a sparse array.
17
+ */
18
+ private extractNonNull;
19
+ }
20
+ export declare const MACD: MACDIndicator;
@@ -0,0 +1,10 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class MomentumIndicator extends Indicator {
3
+ readonly name = "momentum";
4
+ /**
5
+ * Momentum: the absolute price change over `period` bars
6
+ * (close - close[i-period]).
7
+ */
8
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
9
+ }
10
+ export declare const Momentum: MomentumIndicator;
@@ -0,0 +1,10 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class ROCIndicator extends Indicator {
3
+ readonly name = "roc";
4
+ /**
5
+ * Rate of Change: percentage change of close versus the close `period` bars
6
+ * ago. ROC = 100 * (close - close[i-period]) / close[i-period].
7
+ */
8
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
9
+ }
10
+ export declare const ROC: ROCIndicator;
@@ -0,0 +1,11 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class RSIIndicator extends Indicator {
3
+ readonly name = "rsi";
4
+ /**
5
+ * Calculates the Relative Strength Index using Wilder's smoothing method.
6
+ * RSI oscillates between 0 and 100; values above 70 suggest overbought,
7
+ * below 30 suggest oversold conditions.
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const RSI: RSIIndicator;
@@ -0,0 +1,20 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class StochasticIndicator extends Indicator {
3
+ readonly name = "stochastic";
4
+ /**
5
+ * Calculates the Stochastic Oscillator (%K and %D lines).
6
+ * %K measures momentum by comparing the close to the high-low range
7
+ * over kPeriod, smoothed by smoothK. %D is the SMA signal of %K.
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ /**
11
+ * Computes raw %K values: 100 * (close - lowestLow) / (highestHigh - lowestLow).
12
+ */
13
+ private computeRawK;
14
+ /**
15
+ * Computes a Simple Moving Average over a nullable numeric array,
16
+ * returning null for positions with insufficient non-null predecessors.
17
+ */
18
+ private sma;
19
+ }
20
+ export declare const Stochastic: StochasticIndicator;
@@ -0,0 +1,9 @@
1
+ import { Indicator } from './Indicator';
2
+ declare class IndicatorRegistryClass {
3
+ private indicators;
4
+ register(indicator: Indicator): void;
5
+ get(name: string): Indicator | undefined;
6
+ getAll(): Map<string, Indicator>;
7
+ }
8
+ export declare const IndicatorRegistry: IndicatorRegistryClass;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class ADXIndicator extends Indicator {
3
+ readonly name = "adx";
4
+ /**
5
+ * Average Directional Index (Wilder). Quantifies trend strength from the
6
+ * smoothed directional movement (+DM/-DM) relative to true range. Returns the
7
+ * ADX line; values below the first valid window are null.
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const ADX: ADXIndicator;
@@ -0,0 +1,14 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class IchimokuCloudIndicator extends Indicator {
3
+ readonly name = "ichimoku";
4
+ /**
5
+ * Calculates the full Ichimoku Cloud system: Tenkan-sen, Kijun-sen,
6
+ * Senkou Span A/B (displaced forward), and Chikou Span (displaced backward).
7
+ */
8
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
9
+ /**
10
+ * Returns (highest high + lowest low) / 2 over a contiguous range of data.
11
+ */
12
+ private midpoint;
13
+ }
14
+ export declare const IchimokuCloud: IchimokuCloudIndicator;
@@ -0,0 +1,11 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class PSARIndicator extends Indicator {
3
+ readonly name = "psar";
4
+ /**
5
+ * Parabolic SAR (stop-and-reverse). Tracks a trailing stop that accelerates
6
+ * toward price as a trend extends. `increment` steps the acceleration factor
7
+ * up to `maximum` each time a new extreme point is made.
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const PSAR: PSARIndicator;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shared helpers for indicator calculators.
3
+ */
4
+ /**
5
+ * Exponential moving average over a numeric source, seeded with the SMA of the
6
+ * first `period` values. Positions with insufficient history are `null`.
7
+ */
8
+ export declare function emaArray(source: (number | null)[], period: number): (number | null)[];
@@ -0,0 +1,11 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class ATRIndicator extends Indicator {
3
+ readonly name = "atr";
4
+ /**
5
+ * Calculates Average True Range using Wilder's smoothing.
6
+ * ATR measures market volatility by decomposing the full range
7
+ * of a bar including gap openings.
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const ATR: ATRIndicator;
@@ -0,0 +1,11 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class BollingerBandsIndicator extends Indicator {
3
+ readonly name = "bollingerbands";
4
+ /**
5
+ * Calculates Bollinger Bands: a middle SMA band with upper and lower bands
6
+ * offset by a configurable number of standard deviations. Useful for
7
+ * identifying volatility and potential price breakouts.
8
+ */
9
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const BollingerBands: BollingerBandsIndicator;
@@ -0,0 +1,11 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class OBVIndicator extends Indicator {
3
+ readonly name = "obv";
4
+ /**
5
+ * Calculates On Balance Volume.
6
+ * Accumulates volume on up-closes and subtracts on down-closes.
7
+ * Unchanged closes carry the previous OBV forward.
8
+ */
9
+ calculate(data: OHLCVPoint[], _params: Record<string, number>): IndicatorResult;
10
+ }
11
+ export declare const OBV: OBVIndicator;
@@ -0,0 +1,12 @@
1
+ import { Indicator, IndicatorResult, OHLCVPoint } from '../Indicator';
2
+ export declare class VBPIndicator extends Indicator {
3
+ readonly name = "vbp";
4
+ /**
5
+ * Volume by Price: splits the price range into `ranges` horizontal bins and
6
+ * sums the volume traded while the close fell in each bin. Each result point
7
+ * carries the bin's price band (low/high) and its total/up volume, consumed
8
+ * by the VBP renderer as horizontal bars.
9
+ */
10
+ calculate(data: OHLCVPoint[], params: Record<string, number>): IndicatorResult;
11
+ }
12
+ export declare const VBP: VBPIndicator;
@@ -0,0 +1,12 @@
1
+ import { Indicator, OHLCVPoint, IndicatorResult } from '../Indicator';
2
+ export declare class VWAPIndicator extends Indicator {
3
+ readonly name = "vwap";
4
+ /**
5
+ * Calculates Volume Weighted Average Price.
6
+ * Accumulates (Typical Price * Volume) / cumulative Volume
7
+ * from the first data point. Points with zero or missing volume
8
+ * carry forward the previous VWAP value.
9
+ */
10
+ calculate(data: OHLCVPoint[], _params: Record<string, number>): IndicatorResult;
11
+ }
12
+ export declare const VWAP: VWAPIndicator;
@@ -0,0 +1,29 @@
1
+ import type { DrilldownOptions, SeriesOptions } from '../types/options';
2
+ import { EventBus } from '../core/EventBus';
3
+ export declare class Drilldown {
4
+ private config;
5
+ private events;
6
+ private stack;
7
+ private drilldownMap;
8
+ private breadcrumbsEl;
9
+ private container;
10
+ private pointClickHandler;
11
+ constructor(config: DrilldownOptions, events: EventBus, container?: HTMLElement);
12
+ addSeriesAsDrilldown(point: any, seriesOptions: SeriesOptions): void;
13
+ private drillDown;
14
+ drillUp(): void;
15
+ drillUpToLevel(targetLevel: number): void;
16
+ hasLevels(): boolean;
17
+ getCurrentLevel(): number;
18
+ private get breadcrumbsConfig();
19
+ private isBreadcrumbsEnabled;
20
+ /**
21
+ * Renders breadcrumb navigation trail for drilldown levels. Shown by default once
22
+ * a drill happens; suppress via `drilldown.breadcrumbs: false` or `{ enabled: false }`.
23
+ * Renders a back arrow and clickable path ("\u25C0 Root / Level"), or a single back button
24
+ * when `showFullPath` is false. Positioned as floating overlay to avoid layout shifts.
25
+ */
26
+ private updateBreadcrumbs;
27
+ private getCrumbLabel;
28
+ destroy(): void;
29
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Event delegation hover manager for cartesian series.
3
+ * Uses a single shared mousemove handler per SVG to coordinate across all series.
4
+ */
5
+ import { Selection } from 'd3-selection';
6
+ import 'd3-transition';
7
+ import type { PointOptions, PlotArea } from '../types/options';
8
+ import type { AxisInstance } from '../axis/Axis';
9
+ import type { EventBus } from '../core/EventBus';
10
+ import type { BaseSeries } from '../series/BaseSeries';
11
+ export interface HoverManagerConfig {
12
+ series: BaseSeries;
13
+ group: Selection<SVGGElement, unknown, null, undefined>;
14
+ data: PointOptions[];
15
+ xAxis: AxisInstance;
16
+ yAxis: AxisInstance;
17
+ plotArea: PlotArea;
18
+ events: EventBus;
19
+ haloSize: number;
20
+ haloOpacity: number;
21
+ markerRadius: number;
22
+ hoverRadius: number;
23
+ hoverLineWidth: number;
24
+ cursor: string;
25
+ pathSelection?: Selection<SVGPathElement, any, any, any> | null;
26
+ lineWidthPlus: number;
27
+ baseLineWidth: number;
28
+ getColor: (d: PointOptions) => string;
29
+ }
30
+ export declare class HoverManager {
31
+ private config;
32
+ private hoverGroup;
33
+ private halo;
34
+ private hoverMarker;
35
+ private xPositions;
36
+ private validData;
37
+ currentIdx: number;
38
+ constructor(config: HoverManagerConfig);
39
+ findCandidate(mx: number, my: number): {
40
+ idx: number;
41
+ dist: number;
42
+ } | null;
43
+ handleClick(event: MouseEvent): void;
44
+ showHover(idx: number, event: MouseEvent): void;
45
+ hideHover(event: MouseEvent): void;
46
+ private findNearest;
47
+ }