react-candlesticks 0.0.2

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 (267) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +219 -0
  3. package/dist/components/Chart/Chart.d.ts +36 -0
  4. package/dist/components/Chart/ChartWithPropTypes.d.ts +7 -0
  5. package/dist/components/Chart/chartPropTypes.d.ts +21 -0
  6. package/dist/components/Chart/index.d.ts +8 -0
  7. package/dist/components/Chart/parseConfigComponents.d.ts +19 -0
  8. package/dist/components/ChartCanvases/ChartCanvases.d.ts +26 -0
  9. package/dist/components/ChartCanvases/index.d.ts +8 -0
  10. package/dist/components/InteractiveArea/InteractiveArea.d.ts +13 -0
  11. package/dist/components/InteractiveArea/index.d.ts +8 -0
  12. package/dist/components/StatefulChart/StatefulChart.d.ts +26 -0
  13. package/dist/components/StatefulChart/getViewportData.d.ts +6 -0
  14. package/dist/components/StatefulChart/index.d.ts +8 -0
  15. package/dist/components/UIs/PanelUIs/Legend/Legend.d.ts +13 -0
  16. package/dist/components/UIs/PanelUIs/PanelControls/PanelControls.d.ts +13 -0
  17. package/dist/components/UIs/PanelUIs/PanelUIs.d.ts +16 -0
  18. package/dist/components/UIs/UIs.d.ts +23 -0
  19. package/dist/components/index.d.ts +8 -0
  20. package/dist/config/chart/ChartConfig.d.ts +19 -0
  21. package/dist/config/chart/borders/BordersConfig.d.ts +21 -0
  22. package/dist/config/chart/borders/parseBordersConfig.d.ts +3 -0
  23. package/dist/config/chart/crosshairs/CrosshairsConfig.d.ts +14 -0
  24. package/dist/config/chart/crosshairs/parseCrosshairsConfig.d.ts +3 -0
  25. package/dist/config/chart/crosshairs/timeCrosshair/TimeCrosshairConfig.d.ts +14 -0
  26. package/dist/config/chart/crosshairs/timeCrosshair/parseTimeCrosshairConfig.d.ts +3 -0
  27. package/dist/config/chart/crosshairs/timeCrosshair/timeCrosshairLabel/CrosshairTimeFormat.d.ts +7 -0
  28. package/dist/config/chart/crosshairs/timeCrosshair/timeCrosshairLabel/TimeCrosshairLabelConfig.d.ts +10 -0
  29. package/dist/config/chart/crosshairs/timeCrosshair/timeCrosshairLabel/TimeCrosshairLabelFormatter.d.ts +7 -0
  30. package/dist/config/chart/crosshairs/timeCrosshair/timeCrosshairLabel/defaultTimeCrosshairLabelFormatter.d.ts +3 -0
  31. package/dist/config/chart/crosshairs/timeCrosshair/timeCrosshairLabel/parseTimeCrosshairLabelConfig.d.ts +3 -0
  32. package/dist/config/chart/crosshairs/valueCrosshair/ValueCrosshairConfig.d.ts +14 -0
  33. package/dist/config/chart/crosshairs/valueCrosshair/parseValueCrosshairConfig.d.ts +3 -0
  34. package/dist/config/chart/crosshairs/valueCrosshair/valueCrosshairLabel/ValueCrosshairLabelConfig.d.ts +5 -0
  35. package/dist/config/chart/crosshairs/valueCrosshair/valueCrosshairLabel/parseValueCrosshairLabelConfig.d.ts +3 -0
  36. package/dist/config/chart/grid/GridConfig.d.ts +13 -0
  37. package/dist/config/chart/grid/parseGridConfig.d.ts +3 -0
  38. package/dist/config/chart/parseChartConfig.d.ts +4 -0
  39. package/dist/config/chart/xAxis/XAxisConfig.d.ts +23 -0
  40. package/dist/config/chart/xAxis/parseXAxisConfig.d.ts +3 -0
  41. package/dist/config/elements/bar/BarConfig.d.ts +20 -0
  42. package/dist/config/elements/bar/DirectionalBarConfig.d.ts +17 -0
  43. package/dist/config/elements/bar/parseBarConfig.d.ts +3 -0
  44. package/dist/config/elements/bar/parseDirectionalBarConfig.d.ts +3 -0
  45. package/dist/config/elements/boxedTimeLabel/BoxedTimeLabelConfig.d.ts +23 -0
  46. package/dist/config/elements/boxedTimeLabel/parseBoxedTimeLabelConfig.d.ts +3 -0
  47. package/dist/config/elements/boxedValueLabel/BoxedValueLabelConfig.d.ts +23 -0
  48. package/dist/config/elements/boxedValueLabel/parseBoxedValueLabelConfig.d.ts +3 -0
  49. package/dist/config/elements/button/ButtonConfig.d.ts +21 -0
  50. package/dist/config/elements/button/parseButtonConfig.d.ts +3 -0
  51. package/dist/config/elements/label/Font.d.ts +9 -0
  52. package/dist/config/elements/label/LabelConfig.d.ts +27 -0
  53. package/dist/config/elements/label/parseLabelConfig.d.ts +3 -0
  54. package/dist/config/elements/line/DirectionalLineConfig.d.ts +17 -0
  55. package/dist/config/elements/line/LineConfig.d.ts +28 -0
  56. package/dist/config/elements/line/parseDirectionalLineConfig.d.ts +3 -0
  57. package/dist/config/elements/line/parseLineConfig.d.ts +3 -0
  58. package/dist/config/elements/timeLabel/TimeLabelConfig.d.ts +14 -0
  59. package/dist/config/elements/timeLabel/TimeLabelFormatter.d.ts +9 -0
  60. package/dist/config/elements/timeLabel/defaultTimeLabelFormatter.d.ts +3 -0
  61. package/dist/config/elements/timeLabel/parseTimeLabelConfig.d.ts +3 -0
  62. package/dist/config/elements/valueLabel/ValueLabelConfig.d.ts +11 -0
  63. package/dist/config/elements/valueLabel/defaultValueLabelFormatter.d.ts +8 -0
  64. package/dist/config/elements/valueLabel/parseValueLabelConfig.d.ts +3 -0
  65. package/dist/config/index.d.ts +7 -0
  66. package/dist/config/layer/BaseLayerConfig.d.ts +81 -0
  67. package/dist/config/layer/Layer.d.ts +17 -0
  68. package/dist/config/layer/LayerConfig.d.ts +24 -0
  69. package/dist/config/layer/LayerType.d.ts +7 -0
  70. package/dist/config/layer/createLayerTopology.d.ts +9 -0
  71. package/dist/config/layer/inputSourceShorthand.d.ts +4 -0
  72. package/dist/config/layer/layerComponentNameToLayerTypeMap.d.ts +19 -0
  73. package/dist/config/layer/layerComponentTypeKey.d.ts +8 -0
  74. package/dist/config/layer/parseLayerConfig.d.ts +3 -0
  75. package/dist/config/layer/parseLayerConfigs.d.ts +3 -0
  76. package/dist/config/layer/parseLookback.d.ts +8 -0
  77. package/dist/config/layer/validateLayerInputs.d.ts +3 -0
  78. package/dist/config/layer/yAxis/YAxisConfig.d.ts +22 -0
  79. package/dist/config/layer/yAxis/parseYAxisConfig.d.ts +3 -0
  80. package/dist/config/legend/LegendConfig.d.ts +29 -0
  81. package/dist/config/legend/LegendFieldConfig.d.ts +31 -0
  82. package/dist/config/legend/parseLegendConfig.d.ts +4 -0
  83. package/dist/config/legend/parseLegendFieldConfig.d.ts +3 -0
  84. package/dist/config/legend/parseLegendFieldsConfig.d.ts +3 -0
  85. package/dist/config/panel/Panel.d.ts +7 -0
  86. package/dist/config/panel/PanelConfig.d.ts +30 -0
  87. package/dist/config/panel/controls/PanelControlsConfig.d.ts +10 -0
  88. package/dist/config/panel/controls/parsePanelControlsConfig.d.ts +3 -0
  89. package/dist/config/panel/parsePanelConfig.d.ts +4 -0
  90. package/dist/config/panel/parsePanelConfigs.d.ts +4 -0
  91. package/dist/config/panel/setPanelYAxes.d.ts +4 -0
  92. package/dist/config/utils/validateNumber.d.ts +9 -0
  93. package/dist/config/valueMarker/DirectionalValueMarkerConfig.d.ts +25 -0
  94. package/dist/config/valueMarker/ValueMarkerConfig.d.ts +19 -0
  95. package/dist/config/valueMarker/ValueMarkerMode.d.ts +7 -0
  96. package/dist/config/valueMarker/parseDirectionalValueMarkerConfig.d.ts +3 -0
  97. package/dist/config/valueMarker/parseValueMarkerConfig.d.ts +3 -0
  98. package/dist/data/layers/createLayersData.d.ts +4 -0
  99. package/dist/data/layers/createPriceVolumeCalculationContext.d.ts +4 -0
  100. package/dist/data/layers/createPriceVolumeDerivedLayerCalculationContext.d.ts +5 -0
  101. package/dist/data/layers/updateLayersData.d.ts +7 -0
  102. package/dist/data/map/buildDataMap.d.ts +9 -0
  103. package/dist/data/utils/deduceGranulairty.d.ts +4 -0
  104. package/dist/data/utils/granularityToTimeUnit.d.ts +4 -0
  105. package/dist/domain/constants/time/days.d.ts +8 -0
  106. package/dist/domain/constants/time/months.d.ts +8 -0
  107. package/dist/domain/constants/time/timeDurationsAsMs.d.ts +10 -0
  108. package/dist/domain/constants/timeZone/timeZones.d.ts +8 -0
  109. package/dist/domain/types/DataMap.d.ts +18 -0
  110. package/dist/domain/types/DataPoint.d.ts +14 -0
  111. package/dist/domain/types/DataPointInfo.d.ts +9 -0
  112. package/dist/domain/types/DateTimeFormatToken.d.ts +7 -0
  113. package/dist/domain/types/Granularity.d.ts +7 -0
  114. package/dist/domain/types/IndexBlock.d.ts +20 -0
  115. package/dist/domain/types/IndexProvider.d.ts +13 -0
  116. package/dist/domain/types/LayersData.d.ts +20 -0
  117. package/dist/domain/types/Layout.d.ts +19 -0
  118. package/dist/domain/types/LocalDateTime.d.ts +25 -0
  119. package/dist/domain/types/RawSession.d.ts +14 -0
  120. package/dist/domain/types/Theme.d.ts +17 -0
  121. package/dist/domain/types/TimeFormatToken.d.ts +7 -0
  122. package/dist/domain/types/TimeScale.d.ts +21 -0
  123. package/dist/domain/types/TimeUnit.d.ts +7 -0
  124. package/dist/domain/types/ViewportData.d.ts +18 -0
  125. package/dist/domain/types/gridLine/TimeGridLine.d.ts +7 -0
  126. package/dist/domain/types/gridLine/TimeGridStep.d.ts +14 -0
  127. package/dist/domain/types/gridLine/TimeIntervalSpec.d.ts +9 -0
  128. package/dist/domain/types/metrics/ChartMetrics.d.ts +5 -0
  129. package/dist/domain/types/metrics/LayerMetrics.d.ts +11 -0
  130. package/dist/domain/types/metrics/PanelMetrics.d.ts +15 -0
  131. package/dist/drawing/chart/borders/drawBorders.d.ts +4 -0
  132. package/dist/drawing/chart/crosshairs/clearChartCrosshairs.d.ts +8 -0
  133. package/dist/drawing/chart/crosshairs/drawChartCrosshairs.d.ts +13 -0
  134. package/dist/drawing/chart/crosshairs/drawChartValueCrosshairLabel.d.ts +5 -0
  135. package/dist/drawing/chart/drawChart.d.ts +9 -0
  136. package/dist/drawing/chart/grid/time/TimeGridLine.d.ts +11 -0
  137. package/dist/drawing/chart/grid/time/drawTimeGridLabels.d.ts +6 -0
  138. package/dist/drawing/chart/grid/time/drawTimeGridLines.d.ts +6 -0
  139. package/dist/drawing/chart/grid/time/isTimeGridLine.d.ts +3 -0
  140. package/dist/drawing/chart/grid/value/ValueGridLine.d.ts +10 -0
  141. package/dist/drawing/chart/grid/value/calculateValueGridLines.d.ts +3 -0
  142. package/dist/drawing/chart/grid/value/drawValueGridLines.d.ts +7 -0
  143. package/dist/drawing/chart/grid/value/getDefaultValueGridLines.d.ts +8 -0
  144. package/dist/drawing/elements/drawBar.d.ts +3 -0
  145. package/dist/drawing/elements/labels/timeLabel/drawTimeGridLabel.d.ts +4 -0
  146. package/dist/drawing/elements/labels/valueLabel/drawValueGridLabels.d.ts +9 -0
  147. package/dist/drawing/elements/line/drawLine.d.ts +8 -0
  148. package/dist/drawing/elements/line/endDrawLine.d.ts +3 -0
  149. package/dist/drawing/elements/line/startDrawLine.d.ts +3 -0
  150. package/dist/drawing/getCanvasContext.d.ts +12 -0
  151. package/dist/drawing/labels/valueLabel/drawValueGridLabels.d.ts +9 -0
  152. package/dist/drawing/layer/drawLayer.d.ts +10 -0
  153. package/dist/drawing/layer/drawLayers.d.ts +11 -0
  154. package/dist/drawing/panel/drawLayersForScale.d.ts +12 -0
  155. package/dist/drawing/panel/drawPanel.d.ts +14 -0
  156. package/dist/drawing/panel/drawPanelBorder.d.ts +9 -0
  157. package/dist/drawing/panel/drawPanels.d.ts +14 -0
  158. package/dist/drawing/panel/getPanelYAxes.d.ts +21 -0
  159. package/dist/drawing/panel/mapLayersByScale.d.ts +4 -0
  160. package/dist/drawing/valueMarker/drawDirectionalValueMarker.d.ts +12 -0
  161. package/dist/drawing/valueMarker/drawValueMarker.d.ts +12 -0
  162. package/dist/drawing/valueMarker/drawValueMarkerLabel.d.ts +13 -0
  163. package/dist/drawing/valueMarker/drawValueMarkerLine.d.ts +9 -0
  164. package/dist/exampleData/d1.d.ts +3 -0
  165. package/dist/exampleData/d1Short.d.ts +3 -0
  166. package/dist/exampleData/index.d.ts +7 -0
  167. package/dist/hooks/useDevicePixelRatio.d.ts +8 -0
  168. package/dist/hooks/useResizeObserver.d.ts +7 -0
  169. package/dist/index-Bb_QstiX.js +9443 -0
  170. package/dist/index.d.ts +13 -0
  171. package/dist/index.js +21 -0
  172. package/dist/indexProviders/continuous/createContinuousIndexProvider.d.ts +5 -0
  173. package/dist/indexProviders/continuous/findClosestIndex.d.ts +3 -0
  174. package/dist/indexProviders/continuous/getKnownBars.d.ts +6 -0
  175. package/dist/indexProviders/continuous/indexToTimestamp.d.ts +3 -0
  176. package/dist/indexProviders/continuous/lowerBound.d.ts +8 -0
  177. package/dist/indexProviders/continuous/timestampToBarIndex.d.ts +3 -0
  178. package/dist/layers/atr/ATRLayer.d.ts +8 -0
  179. package/dist/layers/atr/AtrLayerConfig.d.ts +44 -0
  180. package/dist/layers/atr/calc.d.ts +4 -0
  181. package/dist/layers/atr/draw.d.ts +10 -0
  182. package/dist/layers/atr/index.d.ts +5 -0
  183. package/dist/layers/atr/parse.d.ts +4 -0
  184. package/dist/layers/bollingerBands/BollingerBandsLayer.d.ts +8 -0
  185. package/dist/layers/bollingerBands/BollingerBandsLayerConfig.d.ts +65 -0
  186. package/dist/layers/bollingerBands/calc.d.ts +4 -0
  187. package/dist/layers/bollingerBands/draw.d.ts +10 -0
  188. package/dist/layers/bollingerBands/index.d.ts +5 -0
  189. package/dist/layers/bollingerBands/parse.d.ts +4 -0
  190. package/dist/layers/candlesticks/CandlestickLayerConfig.d.ts +42 -0
  191. package/dist/layers/candlesticks/CandlesticksLayer.d.ts +8 -0
  192. package/dist/layers/candlesticks/calc.d.ts +5 -0
  193. package/dist/layers/candlesticks/draw/_debugDrawEmptyCandle.d.ts +8 -0
  194. package/dist/layers/candlesticks/draw/draw.d.ts +10 -0
  195. package/dist/layers/candlesticks/draw/drawCandleBody.d.ts +3 -0
  196. package/dist/layers/candlesticks/draw/drawCandleWick.d.ts +3 -0
  197. package/dist/layers/candlesticks/draw/drawCandlestick.d.ts +4 -0
  198. package/dist/layers/candlesticks/index.d.ts +5 -0
  199. package/dist/layers/candlesticks/parse.d.ts +4 -0
  200. package/dist/layers/ema/EMALayer.d.ts +8 -0
  201. package/dist/layers/ema/EmaLayerConfig.d.ts +42 -0
  202. package/dist/layers/ema/calc.d.ts +4 -0
  203. package/dist/layers/ema/draw.d.ts +10 -0
  204. package/dist/layers/ema/index.d.ts +5 -0
  205. package/dist/layers/ema/parse.d.ts +4 -0
  206. package/dist/layers/index.d.ts +11 -0
  207. package/dist/layers/layers.d.ts +4 -0
  208. package/dist/layers/macd/MACDLayer.d.ts +8 -0
  209. package/dist/layers/macd/MacdLayerConfig.d.ts +61 -0
  210. package/dist/layers/macd/calc.d.ts +4 -0
  211. package/dist/layers/macd/draw.d.ts +10 -0
  212. package/dist/layers/macd/index.d.ts +5 -0
  213. package/dist/layers/macd/parse.d.ts +4 -0
  214. package/dist/layers/priceLine/PriceLineLayer.d.ts +8 -0
  215. package/dist/layers/priceLine/PriceLineLayerConfig.d.ts +39 -0
  216. package/dist/layers/priceLine/calc.d.ts +5 -0
  217. package/dist/layers/priceLine/draw.d.ts +10 -0
  218. package/dist/layers/priceLine/index.d.ts +5 -0
  219. package/dist/layers/priceLine/parse.d.ts +4 -0
  220. package/dist/layers/rsi/RSILayer.d.ts +8 -0
  221. package/dist/layers/rsi/RsiLayerConfig.d.ts +40 -0
  222. package/dist/layers/rsi/calc.d.ts +4 -0
  223. package/dist/layers/rsi/draw.d.ts +10 -0
  224. package/dist/layers/rsi/index.d.ts +5 -0
  225. package/dist/layers/rsi/parse.d.ts +4 -0
  226. package/dist/layers/sma/SMALayer.d.ts +8 -0
  227. package/dist/layers/sma/SmaLayerConfig.d.ts +42 -0
  228. package/dist/layers/sma/calc.d.ts +4 -0
  229. package/dist/layers/sma/draw.d.ts +10 -0
  230. package/dist/layers/sma/index.d.ts +5 -0
  231. package/dist/layers/sma/parse.d.ts +4 -0
  232. package/dist/layers/stochastic/StochasticLayer.d.ts +8 -0
  233. package/dist/layers/stochastic/StochasticLayerConfig.d.ts +56 -0
  234. package/dist/layers/stochastic/calc.d.ts +4 -0
  235. package/dist/layers/stochastic/draw.d.ts +10 -0
  236. package/dist/layers/stochastic/index.d.ts +5 -0
  237. package/dist/layers/stochastic/parse.d.ts +4 -0
  238. package/dist/layers/volumeBars/VolumeBarsLayer.d.ts +8 -0
  239. package/dist/layers/volumeBars/VolumeBarsLayerConfig.d.ts +38 -0
  240. package/dist/layers/volumeBars/calc.d.ts +5 -0
  241. package/dist/layers/volumeBars/draw/draw.d.ts +10 -0
  242. package/dist/layers/volumeBars/draw/drawVolumeBar.d.ts +3 -0
  243. package/dist/layers/volumeBars/index.d.ts +5 -0
  244. package/dist/layers/volumeBars/parse.d.ts +4 -0
  245. package/dist/layout/getLayout.d.ts +5 -0
  246. package/dist/metrics/chart/calculateChartMetrics.d.ts +5 -0
  247. package/dist/metrics/layer/calculateLayerMetrics.d.ts +8 -0
  248. package/dist/metrics/layer/getIndicatorScalingValues.d.ts +3 -0
  249. package/dist/metrics/layer/getMinAndMaxValues.d.ts +8 -0
  250. package/dist/propTypes.d.ts +15 -0
  251. package/dist/propTypes.js +77 -0
  252. package/dist/react-candlesticks.css +6 -0
  253. package/dist/themes/defaultDarkTheme.d.ts +3 -0
  254. package/dist/themes/defaultLightTheme.d.ts +3 -0
  255. package/dist/themes/themes.d.ts +4 -0
  256. package/dist/timeScale/continuous/continuousTimeScale.d.ts +5 -0
  257. package/dist/timeScale/core/calculateNewScrollOffset.d.ts +3 -0
  258. package/dist/timeScale/core/createTimeScale.d.ts +15 -0
  259. package/dist/timeScale/gridLines/generateTimeGridLines.d.ts +5 -0
  260. package/dist/timeScale/gridLines/getTimeGridStep.d.ts +5 -0
  261. package/dist/timeScale/gridLines/isTimeGridLine.d.ts +7 -0
  262. package/dist/utils/createSelector.d.ts +8 -0
  263. package/dist/utils/throttle.d.ts +8 -0
  264. package/dist/utils/time/isoTimestampToMs.d.ts +8 -0
  265. package/dist/utils/time/localToUtc.d.ts +14 -0
  266. package/dist/utils/time/utcToLocal.d.ts +3 -0
  267. package/package.json +117 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jason Wilson, trendingcandles.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,219 @@
1
+ # React Candlesticks
2
+
3
+ [![npm version](https://img.shields.io/npm/v/react-candlesticks)](https://www.npmjs.com/package/react-candlesticks)
4
+ [![license](https://img.shields.io/npm/l/react-candlesticks)](./LICENSE)
5
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/react-candlesticks)](https://bundlephobia.com/package/react-candlesticks)
6
+ [![types included](https://img.shields.io/badge/types-included-3178C6?logo=typescript&logoColor=white)](https://www.npmjs.com/package/react-candlesticks)
7
+ [![react 18%2B](https://img.shields.io/badge/react-18%2B-61DAFB?logo=react&logoColor=white)](https://react.dev/)
8
+ [![docs](https://img.shields.io/badge/docs-trendingcandles.com-0A66C2)](https://docs.trendingcandles.com/)
9
+ [![CI](https://github.com/trendingcandles/react-candlesticks/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/trendingcandles/react-candlesticks/actions/workflows/ci.yml)
10
+ ![Coverage total](./badges/coverage-total.svg)
11
+
12
+ Canvas-powered, composable candlestick charts for React — built for serious trading UIs.
13
+
14
+ Build responsive trading charts in React with candlesticks, indicators, crosshairs, zoom, and theming — rendered on Canvas for smooth performance on large datasets.
15
+
16
+ `react-candlesticks` is in an early public release / soft launch phase. Feedback, bug reports, and edge-case reproductions are especially helpful right now.
17
+
18
+ <!-- [![demo](./demo/demo-v3.gif)](https://stackblitz.com/edit/react-candlesticks?file=src%2FApp.tsx) -->
19
+ [![demo](./demo/screenshot.png)](https://stackblitz.com/edit/react-candlesticks?file=src%2FApp.tsx)
20
+
21
+ [![StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/react-candlesticks?file=src%2FApp.tsx)
22
+
23
+ [Website](https://trendingcandles.com/) • [Documentation](https://docs.trendingcandles.com/)
24
+
25
+ For bugs and feature requests, [open an issue](https://github.com/trendingcandles/react-candlesticks/issues). For usage questions, [start a discussion](https://github.com/trendingcandles/react-candlesticks/discussions/new?category=q-a).
26
+
27
+ ---
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ npm install react-candlesticks
33
+ ```
34
+
35
+ ## Quick Start
36
+
37
+ Paste this into your React app for a basic candlestick chart with volume:
38
+
39
+ ```tsx
40
+ import 'react-candlesticks/style.css';
41
+ import { Chart, Panel, Candlesticks, VolumeBars, exampleData }
42
+ from 'react-candlesticks';
43
+
44
+ export default function App() {
45
+ return (
46
+ <Chart
47
+ width={800}
48
+ height={500}
49
+ granularity="d1"
50
+ data={exampleData} // demo data
51
+ >
52
+ <Panel heightRatio={3}>
53
+ <Candlesticks />
54
+ </Panel>
55
+ <Panel>
56
+ <VolumeBars />
57
+ </Panel>
58
+ </Chart>
59
+ );
60
+ }
61
+ ```
62
+
63
+ `granularity` is optional if your dataset uses a consistent interval and you want the library to infer it automatically. For empty/loading states, pass `granularity` explicitly.
64
+
65
+ ## Why React Candlesticks?
66
+
67
+ - **Canvas rendering** — smooth zoom, pan, and hover with predictable performance on large datasets
68
+ - **Composable like React** — build charts using JSX (React components)
69
+ - **Trading-focused** — indicators, crosshairs, multi-panel layouts
70
+ - **Precise interactions** — zoom, scroll, and hover tuned for financial UX
71
+ - **Fully themeable** — light and dark mode, or provide a custom theme
72
+ - **Lightweight & dependency-free** — no bloat, easy to ship
73
+
74
+ ---
75
+
76
+ ## Usage Patterns
77
+
78
+ ### Declarative (JSX) ✅ recommended
79
+
80
+ The recommended approach for most use cases. Compose panels and layers declaratively using JSX.
81
+ ```tsx
82
+ import { Chart, Panel, Candlesticks, VolumeBars, BollingerBands, EMA, MACD, RSI }
83
+ from 'react-candlesticks';
84
+
85
+ <Chart granularity="d1" data={data}>
86
+ <Panel heightRatio={3}>
87
+ <Candlesticks />
88
+ <EMA period={50} />
89
+ <BollingerBands />
90
+ </Panel>
91
+ <Panel>
92
+ <VolumeBars />
93
+ </Panel>
94
+ <Panel>
95
+ <MACD />
96
+ </Panel>
97
+ <Panel>
98
+ <RSI />
99
+ </Panel>
100
+ </Chart>
101
+ ```
102
+
103
+ ### Config-driven (panels prop)
104
+
105
+ ```tsx
106
+ import { Chart } from 'react-candlesticks';
107
+
108
+ <Chart
109
+ granularity="d1"
110
+ data={data}
111
+ panels={[
112
+ {
113
+ heightRatio: 3,
114
+ layers: [
115
+ { type: 'price:candlesticks' },
116
+ { type: 'ema', period: 20 },
117
+ { type: 'bollinger-bands' },
118
+ ]
119
+ },
120
+ {
121
+ layers: [{ type: 'volume:bars' }]
122
+ },
123
+ {
124
+ layers: [{ type: 'macd' }]
125
+ },
126
+ {
127
+ layers: [{ type: 'rsi' }]
128
+ }
129
+ ]}
130
+ />
131
+ ```
132
+
133
+ ### Theming
134
+
135
+ Use the built-in `'light'` or `'dark'` theme, or provide a custom `Theme` object.
136
+ ```tsx
137
+ import type { Theme } from 'react-candlesticks';
138
+
139
+ // Named theme
140
+ <Chart theme="dark" ... />
141
+
142
+ // Custom theme
143
+ <Chart theme={myCustomTheme} ... />
144
+ ```
145
+
146
+ See the [Theme documentation](https://docs.trendingcandles.com/docs/api/theme/theme) for the full theme shape.
147
+
148
+ ---
149
+
150
+ ## Compatibility and Limitations
151
+
152
+ - Supports React 18+ and React 19.
153
+ - Ships ESM only; CommonJS/UMD consumers are not supported.
154
+ - Intended for modern browser-based React apps.
155
+ - Chart rendering and interaction are client-side. In SSR frameworks, render the chart from a client component or client-only boundary.
156
+ - Runtime behavior depends on standard browser APIs including Canvas, `ResizeObserver`, `matchMedia`, `devicePixelRatio`, and Pointer Events for touch and pinch interactions.
157
+ - If you target older browsers or restricted webviews, you may need compatibility checks or polyfills for APIs such as `ResizeObserver`.
158
+ - Current chart time display defaults to `UTC`. A public chart-level timezone configuration API is not exposed yet, so if your UI requires exchange-local or user-local time labels, treat that as a current limitation.
159
+ - Mouse, trackpad, touch, and pinch interactions are covered in modern evergreen browsers. If you rely on embedded webviews, older Safari/WebKit builds, or custom kiosk environments, verify pointer and wheel behavior in your exact target runtime before rollout.
160
+ - Data should use a consistent interval if you want automatic `granularity` inference. For irregular datasets, pass `granularity` explicitly.
161
+
162
+ ---
163
+
164
+ ## Layers
165
+
166
+ | Layer | Type string | Description |
167
+ |---|---|---|
168
+ | `<Candlesticks>` | `'price:candlesticks'` | OHLC candlestick chart |
169
+ | `<PriceLine>` | `'price:line'` | Line chart of a single price field |
170
+ | `<VolumeBars>` | `'volume:bars'` | Volume bar chart |
171
+ | `<ATR>` | `'atr'` | Average True Range |
172
+ | `<BollingerBands>` | `'bollinger-bands'` | Bollinger Bands overlay |
173
+ | `<EMA>` | `'ema'` | Exponential Moving Average |
174
+ | `<MACD>` | `'macd'` | MACD oscillator |
175
+ | `<RSI>` | `'rsi'` | Relative Strength Index |
176
+ | `<SMA>` | `'sma'` | Simple Moving Average |
177
+ | `<Stochastic>` | `'stochastic'` | Stochastic Oscillator |
178
+
179
+ ---
180
+
181
+ ## API Reference
182
+
183
+ - [`API Reference Home`](https://docs.trendingcandles.com/docs/api/)
184
+ - [`ChartProps`](https://docs.trendingcandles.com/docs/api/chart/chart#properties)
185
+ - [`PanelConfig`](https://docs.trendingcandles.com/docs/api/panel/panel-config)
186
+ - [`LayerConfig`](https://docs.trendingcandles.com/docs/api/layer/layer-config)
187
+ - [`Theme`](https://docs.trendingcandles.com/docs/api/theme/theme)
188
+ - [`DataPoint`](https://docs.trendingcandles.com/docs/api/chart/data-point)
189
+ - [`Granularity`](https://docs.trendingcandles.com/docs/api/chart/granularity)
190
+
191
+ ---
192
+
193
+ ## Project Notes
194
+
195
+ - [`CHANGELOG.md`](./CHANGELOG.md)
196
+ - [`SECURITY.md`](./SECURITY.md)
197
+ - [`CONTRIBUTING.md`](./CONTRIBUTING.md)
198
+
199
+ ---
200
+
201
+ ## Prop Types
202
+
203
+ If you want runtime prop validation in a JavaScript app, install the optional peer dependency too:
204
+
205
+ ```bash
206
+ npm install react-candlesticks prop-types
207
+ ```
208
+
209
+ Then import `Chart` from the opt-in `propTypes` entrypoint:
210
+
211
+ ```js
212
+ import { Chart } from 'react-candlesticks/propTypes';
213
+ ```
214
+
215
+ ---
216
+
217
+ ## License
218
+
219
+ [MIT](./LICENSE)
@@ -0,0 +1,36 @@
1
+ import { HTMLAttributes, JSX, ReactNode } from 'react';
2
+ import { DataPoint } from '../../domain/types/DataPoint';
3
+ import { PanelConfig } from '../../config/panel/PanelConfig';
4
+ import { Theme } from '../../domain/types/Theme';
5
+ import { ThemeName } from '../../themes/themes';
6
+ import { Granularity } from '../../domain/types/Granularity';
7
+ import { GridConfig } from '../../config/chart/grid/GridConfig';
8
+ import { CrosshairsConfig } from '../../config/chart/crosshairs/CrosshairsConfig';
9
+ import { XAxisConfig } from '../../config/chart/xAxis/XAxisConfig';
10
+ interface ChartPropsBase extends Omit<HTMLAttributes<HTMLDivElement>, 'onScroll'> {
11
+ width?: number | 'auto';
12
+ height?: number | 'auto';
13
+ intervalWidthPx?: number;
14
+ granularity?: Granularity;
15
+ backgroundColor?: string;
16
+ xAxis?: false | XAxisConfig;
17
+ grid?: false | GridConfig;
18
+ crosshairs?: false | CrosshairsConfig;
19
+ theme?: Theme | ThemeName;
20
+ data: DataPoint[];
21
+ scrollToLatestMargin?: number;
22
+ onScroll?: (newScrollOffset: number) => void;
23
+ onZoom?: (newIntervalWidthPx: number) => void;
24
+ }
25
+ interface PanelsAsPropChartProps extends ChartPropsBase {
26
+ panels?: readonly [PanelConfig, ...PanelConfig[]];
27
+ children?: never;
28
+ }
29
+ interface PanelsAsChildrenChartProps extends ChartPropsBase {
30
+ panels?: never;
31
+ children?: ReactNode;
32
+ }
33
+ type PanelsProps = PanelsAsPropChartProps | PanelsAsChildrenChartProps;
34
+ export type ChartProps = ChartPropsBase & PanelsProps;
35
+ declare const _default: import('react').MemoExoticComponent<({ width, height, intervalWidthPx, granularity, backgroundColor, xAxis, grid, crosshairs, theme, panels, data, scrollToLatestMargin, onScroll, onZoom, children, ...props }: ChartProps) => JSX.Element>;
36
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { NamedExoticComponent } from 'react';
2
+ import { ChartProps } from './Chart';
3
+ type ChartWithPropTypesComponent = NamedExoticComponent<ChartProps> & {
4
+ propTypes?: Record<string, unknown>;
5
+ };
6
+ declare const ChartWithPropTypes: ChartWithPropTypesComponent;
7
+ export default ChartWithPropTypes;
@@ -0,0 +1,21 @@
1
+ import { default as PropTypes } from 'prop-types';
2
+ import { ThemeName } from '../../themes/themes';
3
+ type InternalPropTypeValidator = (props: Record<string, unknown>, propName: string, componentName: string, location: string, propFullName: string, secret?: string) => Error | null;
4
+ declare const chartPropTypes: {
5
+ width: InternalPropTypeValidator;
6
+ height: InternalPropTypeValidator;
7
+ intervalWidthPx: PropTypes.Requireable<number>;
8
+ granularity: PropTypes.Requireable<string>;
9
+ backgroundColor: PropTypes.Requireable<string>;
10
+ xAxis: PropTypes.Requireable<NonNullable<boolean | object | null | undefined>>;
11
+ grid: PropTypes.Requireable<NonNullable<boolean | object | null | undefined>>;
12
+ crosshairs: PropTypes.Requireable<NonNullable<boolean | object | null | undefined>>;
13
+ theme: PropTypes.Requireable<NonNullable<object | ThemeName | null | undefined>>;
14
+ data: PropTypes.Validator<object[]>;
15
+ scrollToLatestMargin: PropTypes.Requireable<number>;
16
+ onScroll: PropTypes.Requireable<(...args: any[]) => any>;
17
+ onZoom: PropTypes.Requireable<(...args: any[]) => any>;
18
+ panels: InternalPropTypeValidator;
19
+ children: InternalPropTypeValidator;
20
+ };
21
+ export default chartPropTypes;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * react-candlesticks, trendingcandles.com
3
+ *
4
+ * Copyright (c) 2026 Jason Wilson
5
+ * Licensed under the MIT License (see LICENSE file in the project root).
6
+ */
7
+ export { default } from './Chart';
8
+ export type { ChartProps } from './Chart';
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { PanelConfig } from '../../config/panel/PanelConfig';
3
+ import { LayerConfig } from '../../config/layer/LayerConfig';
4
+ export interface ConfigNode {
5
+ type: string;
6
+ props: Record<string, any>;
7
+ children?: ConfigNode[];
8
+ }
9
+ export interface LayerConfigNode {
10
+ props: Record<string, any>;
11
+ }
12
+ export interface PanelConfigNode {
13
+ props: Record<string, any>;
14
+ layers?: LayerConfigNode[];
15
+ }
16
+ export declare function mapLayerElementToConfig(element: ReactNode): LayerConfig | null;
17
+ export declare function mapPanelElementsToConfig(element: ReactNode): PanelConfig | null;
18
+ declare const parseConfigComponents: (chartChildElements: ReactNode) => PanelConfig[];
19
+ export default parseConfigComponents;
@@ -0,0 +1,26 @@
1
+ import { ChartConfigComplete } from '../../config/chart/ChartConfig';
2
+ import { Layout } from '../../domain/types/Layout';
3
+ import { PanelConfigComplete } from '../../config/panel/PanelConfig';
4
+ import { LayerMetrics } from '../../domain/types/metrics/LayerMetrics';
5
+ import { PanelMetrics } from '../../domain/types/metrics/PanelMetrics';
6
+ import { LayerScale } from '../../config/layer/BaseLayerConfig';
7
+ import { default as DataPointInfo } from '../../domain/types/DataPointInfo';
8
+ import { default as ViewportData } from '../../domain/types/ViewportData';
9
+ export type ChartCanvasesHandle = {
10
+ requestDraw: (viewportData: ViewportData, layout: Layout, updatePanelMetrics?: (metricsByPanel: Record<string, {
11
+ panelMetrics: PanelMetrics;
12
+ layerMetricsByScale: Record<LayerScale['key'], LayerMetrics>;
13
+ }>) => void) => void;
14
+ requestDrawCrosshairs: (layout: Layout, viewportData: ViewportData, clientX: number, clientY: number, onCrosshairsMove?: (ts: number | null, dataPoint: DataPointInfo | null) => void) => void;
15
+ updateCrosshairsCanvas: (layout: Layout) => void;
16
+ hideCrosshairs: (layout: Layout) => void;
17
+ };
18
+ export interface ChartCanvasesProps {
19
+ width: number;
20
+ height: number;
21
+ layout: Layout;
22
+ config: ChartConfigComplete;
23
+ panels: PanelConfigComplete[];
24
+ }
25
+ declare const ChartCanvases: import('react').ForwardRefExoticComponent<ChartCanvasesProps & import('react').RefAttributes<ChartCanvasesHandle>>;
26
+ export default ChartCanvases;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * react-candlesticks, trendingcandles.com
3
+ *
4
+ * Copyright (c) 2026 Jason Wilson
5
+ * Licensed under the MIT License (see LICENSE file in the project root).
6
+ */
7
+ export { default } from './ChartCanvases';
8
+ export type { ChartCanvasesProps } from './ChartCanvases';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * react-candlesticks, trendingcandles.com
3
+ *
4
+ * Copyright (c) 2026 Jason Wilson
5
+ * Licensed under the MIT License (see LICENSE file in the project root).
6
+ */
7
+ export interface InteractiveAreaProps {
8
+ onScroll: (deltaX: number, deltaY: number, wheel?: boolean) => void;
9
+ onMouseMove: (clientX: number, clientY: number, isOverButton?: boolean) => void;
10
+ onZoom: (delta: number) => void;
11
+ }
12
+ declare const _default: import('react').MemoExoticComponent<({ onScroll, onMouseMove, onZoom, }: InteractiveAreaProps) => import("react/jsx-runtime").JSX.Element>;
13
+ export default _default;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * react-candlesticks, trendingcandles.com
3
+ *
4
+ * Copyright (c) 2026 Jason Wilson
5
+ * Licensed under the MIT License (see LICENSE file in the project root).
6
+ */
7
+ export { default } from './InteractiveArea';
8
+ export type { InteractiveAreaProps } from './InteractiveArea';
@@ -0,0 +1,26 @@
1
+ import { ChartConfigComplete } from '../../config/chart/ChartConfig';
2
+ import { Layout } from '../../domain/types/Layout';
3
+ import { PanelConfigComplete } from '../../config/panel/PanelConfig';
4
+ import { Granularity } from '../../domain/types/Granularity';
5
+ import { LayersData } from '../../domain/types/LayersData';
6
+ import { IndexProvider } from '../../domain/types/IndexProvider';
7
+ import { DataMap } from '../../domain/types/DataMap';
8
+ export interface StatefulChartProps {
9
+ chartWidth: number;
10
+ chartHeight: number;
11
+ intervalSize: number;
12
+ granularity: Granularity;
13
+ config: ChartConfigComplete;
14
+ panels: PanelConfigComplete[];
15
+ layout: Layout;
16
+ indexProvider: IndexProvider;
17
+ dataMap: DataMap;
18
+ initialLayersData: LayersData;
19
+ maxLookback: number;
20
+ maxLookForward: number;
21
+ scrollToLatestMargin: number;
22
+ onScroll?: (newScrollOffset: number) => void;
23
+ onZoom?: (newIntervalSize: number) => void;
24
+ }
25
+ declare const _default: import('react').MemoExoticComponent<({ chartWidth, chartHeight, intervalSize, granularity, config, panels, layout, indexProvider, dataMap, initialLayersData, maxLookback, maxLookForward, scrollToLatestMargin, onScroll, onZoom, }: StatefulChartProps) => import("react/jsx-runtime").JSX.Element>;
26
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { IndexProvider } from '../../domain/types/IndexProvider';
2
+ import { TimeScale } from '../../domain/types/TimeScale';
3
+ import { default as ViewportData } from '../../domain/types/ViewportData';
4
+ import { LayersData } from '../../domain/types/LayersData';
5
+ declare function getViewportData(indexProvider: IndexProvider, timeScale: TimeScale, layersData: LayersData, scrollOffset: number, viewportWidth: number, intervalSize: number): ViewportData;
6
+ export default getViewportData;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * react-candlesticks, trendingcandles.com
3
+ *
4
+ * Copyright (c) 2026 Jason Wilson
5
+ * Licensed under the MIT License (see LICENSE file in the project root).
6
+ */
7
+ export { default } from './StatefulChart';
8
+ export type { StatefulChartProps } from './StatefulChart';
@@ -0,0 +1,13 @@
1
+ import { LegendConfigComplete } from '../../../../config/legend/LegendConfig';
2
+ import { DataPoint } from '../../../../domain/types/DataPoint';
3
+ import { LayerConfigComplete } from '../../../../config/layer/LayerConfig';
4
+ import { default as DataPointInfo } from '../../../../domain/types/DataPointInfo';
5
+ export interface LegendHandle {
6
+ update: (dataPoint: DataPointInfo | null, latestDataPoint?: DataPoint) => void;
7
+ }
8
+ export interface LegendProps {
9
+ layer: LayerConfigComplete;
10
+ legend: LegendConfigComplete;
11
+ }
12
+ declare const _default: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<LegendProps & import('react').RefAttributes<LegendHandle>>>;
13
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { PanelControlsConfigComplete } from '../../../../config/panel/controls/PanelControlsConfig';
2
+ import { PanelMetrics } from '../../../../domain/types/metrics/PanelMetrics';
3
+ export interface PanelControlsHandle {
4
+ updateGoToLatestButton: (show: boolean) => void;
5
+ }
6
+ export interface PanelControlsProps {
7
+ panelMetrics: PanelMetrics;
8
+ panelControls: PanelControlsConfigComplete;
9
+ onGoToLatestButtonClick: () => void;
10
+ onButtonMouseEnterLeave: (enter: boolean) => void;
11
+ }
12
+ declare const _default: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<PanelControlsProps & import('react').RefAttributes<PanelControlsHandle>>>;
13
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { DataPoint } from '../../../domain/types/DataPoint';
2
+ import { PanelConfigComplete } from '../../../config/panel/PanelConfig';
3
+ import { PanelMetrics } from '../../../domain/types/metrics/PanelMetrics';
4
+ import { default as DataPointInfo } from '../../../domain/types/DataPointInfo';
5
+ export interface PanelUIsHandle {
6
+ updateLegends: (dataPoint: DataPointInfo | null, latestDataPoint?: DataPoint) => void;
7
+ updateGoToLatestButton: (show: boolean) => void;
8
+ }
9
+ export interface PanelUIsProps {
10
+ panel: PanelConfigComplete;
11
+ panelMetrics?: PanelMetrics;
12
+ onGoToLatest: () => void;
13
+ onButtonMouseEnterLeave: (enter: boolean) => void;
14
+ }
15
+ declare const _default: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<PanelUIsProps & import('react').RefAttributes<PanelUIsHandle>>>;
16
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import { PanelConfigComplete } from '../../config/panel/PanelConfig';
2
+ import { Layout } from '../../domain/types/Layout';
3
+ import { DataPoint } from '../../domain/types/DataPoint';
4
+ import { PanelMetrics } from '../../domain/types/metrics/PanelMetrics';
5
+ import { LayerMetrics } from '../../domain/types/metrics/LayerMetrics';
6
+ import { LayerScale } from '../../config/layer/BaseLayerConfig';
7
+ import { default as DataPointInfo } from '../../domain/types/DataPointInfo';
8
+ export type UisHandle = {
9
+ updatePanelMetrics?: (metricsByPanel: Record<string, {
10
+ panelMetrics: PanelMetrics;
11
+ layerMetricsByScale: Record<LayerScale['key'], LayerMetrics>;
12
+ }>) => void;
13
+ updateLegends: (dataPoint: DataPointInfo | null, latestDataPoint?: DataPoint) => void;
14
+ updateGoToLatestButton: (show: boolean) => void;
15
+ };
16
+ export interface UIsProps {
17
+ layout: Layout;
18
+ panels: PanelConfigComplete[];
19
+ onGoToLatest: () => void;
20
+ onButtonMouseEnterLeave: (enter: boolean) => void;
21
+ }
22
+ declare const _default: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<UIsProps & import('react').RefAttributes<UisHandle>>>;
23
+ export default _default;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * react-candlesticks, trendingcandles.com
3
+ *
4
+ * Copyright (c) 2026 Jason Wilson
5
+ * Licensed under the MIT License (see LICENSE file in the project root).
6
+ */
7
+ export { default as Chart } from './Chart';
8
+ export { type ChartProps } from './Chart';
@@ -0,0 +1,19 @@
1
+ import { BordersConfig, BordersConfigComplete } from './borders/BordersConfig';
2
+ import { CrosshairsConfig, CrosshairsConfigComplete } from './crosshairs/CrosshairsConfig';
3
+ import { GridConfig, GridConfigComplete } from './grid/GridConfig';
4
+ import { XAxisConfig, XAxisConfigComplete } from './xAxis/XAxisConfig';
5
+ export interface ChartConfigComplete {
6
+ backgroundColor: string;
7
+ borders: null | BordersConfigComplete;
8
+ xAxis: null | XAxisConfigComplete;
9
+ grid: null | GridConfigComplete;
10
+ crosshairs: null | CrosshairsConfigComplete;
11
+ }
12
+ export interface ChartConfig {
13
+ backgroundColor?: string;
14
+ borders?: false | BordersConfig;
15
+ xAxis?: false | XAxisConfig;
16
+ grid?: false | GridConfig;
17
+ crosshairs?: false | CrosshairsConfig;
18
+ }
19
+ export declare const chartDefaults: Pick<ChartConfigComplete, 'backgroundColor'>;
@@ -0,0 +1,21 @@
1
+ import { LineConfig, LineConfigComplete } from '../../elements/line/LineConfig';
2
+ export interface BordersConfigComplete {
3
+ left: null | LineConfigComplete;
4
+ right: null | LineConfigComplete;
5
+ top: null | LineConfigComplete;
6
+ bottom: null | LineConfigComplete;
7
+ }
8
+ export interface BordersConfig {
9
+ left?: false | LineConfig;
10
+ right?: false | LineConfig;
11
+ top?: false | LineConfig;
12
+ bottom?: false | LineConfig;
13
+ }
14
+ export interface BordersTheme {
15
+ left: LineConfigComplete;
16
+ right: LineConfigComplete;
17
+ top: LineConfigComplete;
18
+ bottom: LineConfigComplete;
19
+ }
20
+ export declare const bordersDefaults: BordersConfigComplete;
21
+ export declare const themeDefaultBorders: BordersTheme;
@@ -0,0 +1,3 @@
1
+ import { BordersConfig, BordersConfigComplete, BordersTheme } from './BordersConfig';
2
+ declare const parseBordersConfig: (partialConfig?: false | BordersConfig, defaults?: BordersTheme, color?: string) => null | BordersConfigComplete;
3
+ export default parseBordersConfig;
@@ -0,0 +1,14 @@
1
+ import { TimeCrosshairConfig, TimeCrosshairConfigComplete, TimeCrosshairTheme } from './timeCrosshair/TimeCrosshairConfig';
2
+ import { ValueCrosshairConfig, ValueCrosshairConfigComplete, ValueCrosshairTheme } from './valueCrosshair/ValueCrosshairConfig';
3
+ export interface CrosshairsConfigComplete {
4
+ value: null | ValueCrosshairConfigComplete;
5
+ time: null | TimeCrosshairConfigComplete;
6
+ }
7
+ export interface CrosshairsConfig {
8
+ value?: false | ValueCrosshairConfig;
9
+ time?: false | TimeCrosshairConfig;
10
+ }
11
+ export interface CrosshairsTheme {
12
+ time: TimeCrosshairTheme;
13
+ value: ValueCrosshairTheme;
14
+ }
@@ -0,0 +1,3 @@
1
+ import { CrosshairsConfigComplete, CrosshairsConfig, CrosshairsTheme } from './CrosshairsConfig';
2
+ declare const parseCrosshairsConfig: (partialConfig: (false | CrosshairsConfig) | undefined, crosshairsTheme: CrosshairsTheme) => null | CrosshairsConfigComplete;
3
+ export default parseCrosshairsConfig;
@@ -0,0 +1,14 @@
1
+ import { LineConfig, LineConfigComplete } from '../../../elements/line/LineConfig';
2
+ import { TimeCrosshairLabelConfig, TimeCrosshairLabelConfigComplete } from './timeCrosshairLabel/TimeCrosshairLabelConfig';
3
+ export interface TimeCrosshairConfigComplete {
4
+ line: null | LineConfigComplete;
5
+ label: null | TimeCrosshairLabelConfigComplete;
6
+ }
7
+ export interface TimeCrosshairConfig {
8
+ line?: false | LineConfig;
9
+ label?: false | TimeCrosshairLabelConfig;
10
+ }
11
+ export interface TimeCrosshairTheme {
12
+ line: LineConfigComplete;
13
+ label: Omit<TimeCrosshairLabelConfigComplete, 'formatter'>;
14
+ }
@@ -0,0 +1,3 @@
1
+ import { TimeCrosshairConfig, TimeCrosshairConfigComplete, TimeCrosshairTheme } from './TimeCrosshairConfig';
2
+ declare const parseTimeCrosshairConfig: (partialConfig: (false | TimeCrosshairConfig) | undefined, timeCrosshairTheme: TimeCrosshairTheme) => null | TimeCrosshairConfigComplete;
3
+ export default parseTimeCrosshairConfig;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * react-candlesticks, trendingcandles.com
3
+ *
4
+ * Copyright (c) 2026 Jason Wilson
5
+ * Licensed under the MIT License (see LICENSE file in the project root).
6
+ */
7
+ export type CrosshairTimeFormat = 'ddd DD MMM YY HH:mm' | 'ddd DD MMM YY';
@@ -0,0 +1,10 @@
1
+ import { BoxedTimeLabelConfig, BoxedTimeLabelConfigComplete, BoxedTimeLabelTheme } from '../../../../elements/boxedTimeLabel/BoxedTimeLabelConfig';
2
+ import { TimeCrosshairLabelFormatter } from './TimeCrosshairLabelFormatter';
3
+ export interface TimeCrosshairLabelConfigComplete extends Omit<BoxedTimeLabelConfigComplete, 'formatter'> {
4
+ formatter: TimeCrosshairLabelFormatter;
5
+ }
6
+ export interface TimeCrosshairLabelConfig extends Omit<BoxedTimeLabelConfig, 'formatter'> {
7
+ formatter?: TimeCrosshairLabelFormatter;
8
+ }
9
+ export type TimeCrosshairLabelTheme = BoxedTimeLabelTheme;
10
+ export declare const timeCrosshairLabelDefaults: TimeCrosshairLabelConfigComplete;
@@ -0,0 +1,7 @@
1
+ import { TimeUnit } from '../../../../../domain/types/TimeUnit';
2
+ export interface TimeCrosshairLabelFormatterArgs {
3
+ utcTs: number;
4
+ timeUnit: TimeUnit;
5
+ timeZoneId?: string | null;
6
+ }
7
+ export type TimeCrosshairLabelFormatter = (args: TimeCrosshairLabelFormatterArgs) => string;