@chartgpu/chartgpu 0.2.5

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 (273) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +208 -0
  3. package/dist/ChartGPU.d.ts +146 -0
  4. package/dist/ChartGPU.d.ts.map +1 -0
  5. package/dist/components/createAnnotationConfigDialog.d.ts +24 -0
  6. package/dist/components/createAnnotationConfigDialog.d.ts.map +1 -0
  7. package/dist/components/createDataZoomSlider.d.ts +14 -0
  8. package/dist/components/createDataZoomSlider.d.ts.map +1 -0
  9. package/dist/components/createLegend.d.ts +9 -0
  10. package/dist/components/createLegend.d.ts.map +1 -0
  11. package/dist/components/createTextOverlay.d.ts +17 -0
  12. package/dist/components/createTextOverlay.d.ts.map +1 -0
  13. package/dist/components/createTooltip.d.ts +12 -0
  14. package/dist/components/createTooltip.d.ts.map +1 -0
  15. package/dist/components/formatTooltip.d.ts +19 -0
  16. package/dist/components/formatTooltip.d.ts.map +1 -0
  17. package/dist/config/OptionResolver.d.ts +137 -0
  18. package/dist/config/OptionResolver.d.ts.map +1 -0
  19. package/dist/config/defaults.d.ts +56 -0
  20. package/dist/config/defaults.d.ts.map +1 -0
  21. package/dist/config/types.d.ts +553 -0
  22. package/dist/config/types.d.ts.map +1 -0
  23. package/dist/core/GPUContext.d.ts +242 -0
  24. package/dist/core/GPUContext.d.ts.map +1 -0
  25. package/dist/core/RenderScheduler.d.ts +174 -0
  26. package/dist/core/RenderScheduler.d.ts.map +1 -0
  27. package/dist/core/createAnimationController.d.ts +15 -0
  28. package/dist/core/createAnimationController.d.ts.map +1 -0
  29. package/dist/core/createRenderCoordinator.d.ts +78 -0
  30. package/dist/core/createRenderCoordinator.d.ts.map +1 -0
  31. package/dist/core/renderCoordinator/animation/animationHelpers.d.ts +183 -0
  32. package/dist/core/renderCoordinator/animation/animationHelpers.d.ts.map +1 -0
  33. package/dist/core/renderCoordinator/annotations/processAnnotations.d.ts +88 -0
  34. package/dist/core/renderCoordinator/annotations/processAnnotations.d.ts.map +1 -0
  35. package/dist/core/renderCoordinator/axis/axisLabelHelpers.d.ts +91 -0
  36. package/dist/core/renderCoordinator/axis/axisLabelHelpers.d.ts.map +1 -0
  37. package/dist/core/renderCoordinator/axis/computeAxisTicks.d.ts +53 -0
  38. package/dist/core/renderCoordinator/axis/computeAxisTicks.d.ts.map +1 -0
  39. package/dist/core/renderCoordinator/data/computeVisibleSlice.d.ts +66 -0
  40. package/dist/core/renderCoordinator/data/computeVisibleSlice.d.ts.map +1 -0
  41. package/dist/core/renderCoordinator/gpu/textureManager.d.ts +69 -0
  42. package/dist/core/renderCoordinator/gpu/textureManager.d.ts.map +1 -0
  43. package/dist/core/renderCoordinator/interaction/interactionHelpers.d.ts +160 -0
  44. package/dist/core/renderCoordinator/interaction/interactionHelpers.d.ts.map +1 -0
  45. package/dist/core/renderCoordinator/render/renderAnnotationLabels.d.ts +36 -0
  46. package/dist/core/renderCoordinator/render/renderAnnotationLabels.d.ts.map +1 -0
  47. package/dist/core/renderCoordinator/render/renderAxisLabels.d.ts +40 -0
  48. package/dist/core/renderCoordinator/render/renderAxisLabels.d.ts.map +1 -0
  49. package/dist/core/renderCoordinator/render/renderOverlays.d.ts +70 -0
  50. package/dist/core/renderCoordinator/render/renderOverlays.d.ts.map +1 -0
  51. package/dist/core/renderCoordinator/render/renderSeries.d.ts +146 -0
  52. package/dist/core/renderCoordinator/render/renderSeries.d.ts.map +1 -0
  53. package/dist/core/renderCoordinator/renderers/rendererPool.d.ts +112 -0
  54. package/dist/core/renderCoordinator/renderers/rendererPool.d.ts.map +1 -0
  55. package/dist/core/renderCoordinator/types.d.ts +19 -0
  56. package/dist/core/renderCoordinator/types.d.ts.map +1 -0
  57. package/dist/core/renderCoordinator/ui/tooltipLegendHelpers.d.ts +104 -0
  58. package/dist/core/renderCoordinator/ui/tooltipLegendHelpers.d.ts.map +1 -0
  59. package/dist/core/renderCoordinator/utils/axisUtils.d.ts +122 -0
  60. package/dist/core/renderCoordinator/utils/axisUtils.d.ts.map +1 -0
  61. package/dist/core/renderCoordinator/utils/boundsComputation.d.ts +69 -0
  62. package/dist/core/renderCoordinator/utils/boundsComputation.d.ts.map +1 -0
  63. package/dist/core/renderCoordinator/utils/canvasUtils.d.ts +52 -0
  64. package/dist/core/renderCoordinator/utils/canvasUtils.d.ts.map +1 -0
  65. package/dist/core/renderCoordinator/utils/dataPointUtils.d.ts +71 -0
  66. package/dist/core/renderCoordinator/utils/dataPointUtils.d.ts.map +1 -0
  67. package/dist/core/renderCoordinator/utils/index.d.ts +12 -0
  68. package/dist/core/renderCoordinator/utils/index.d.ts.map +1 -0
  69. package/dist/core/renderCoordinator/utils/timeAxisUtils.d.ts +149 -0
  70. package/dist/core/renderCoordinator/utils/timeAxisUtils.d.ts.map +1 -0
  71. package/dist/core/renderCoordinator/zoom/zoomHelpers.d.ts +129 -0
  72. package/dist/core/renderCoordinator/zoom/zoomHelpers.d.ts.map +1 -0
  73. package/dist/data/cartesianData.d.ts +72 -0
  74. package/dist/data/cartesianData.d.ts.map +1 -0
  75. package/dist/data/createDataStore.d.ts +27 -0
  76. package/dist/data/createDataStore.d.ts.map +1 -0
  77. package/dist/data/createStreamBuffer.d.ts +20 -0
  78. package/dist/data/createStreamBuffer.d.ts.map +1 -0
  79. package/dist/data/lttbSample.d.ts +5 -0
  80. package/dist/data/lttbSample.d.ts.map +1 -0
  81. package/dist/data/ohlcSample.d.ts +21 -0
  82. package/dist/data/ohlcSample.d.ts.map +1 -0
  83. package/dist/data/packDataPoints.d.ts +65 -0
  84. package/dist/data/packDataPoints.d.ts.map +1 -0
  85. package/dist/data/sampleSeries.d.ts +20 -0
  86. package/dist/data/sampleSeries.d.ts.map +1 -0
  87. package/dist/esm/ChartGPUWorkerController-B50J-8sx.js +772 -0
  88. package/dist/esm/ChartGPUWorkerController-B50J-8sx.js.map +1 -0
  89. package/dist/esm/OptionResolver-R_gJDRSD.js +7150 -0
  90. package/dist/esm/OptionResolver-R_gJDRSD.js.map +1 -0
  91. package/dist/esm/assets/worker-entry-Wg897auv.js +779 -0
  92. package/dist/esm/assets/worker-entry-Wg897auv.js.map +1 -0
  93. package/dist/esm/createChartInWorker-C4fEeJL8.js +1224 -0
  94. package/dist/esm/createChartInWorker-C4fEeJL8.js.map +1 -0
  95. package/dist/esm/index.js +795 -0
  96. package/dist/esm/index.js.map +1 -0
  97. package/dist/index.cjs +1270 -0
  98. package/dist/index.cjs.map +1 -0
  99. package/dist/index.d.ts +30 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +10504 -0
  102. package/dist/index.js.map +1 -0
  103. package/dist/interaction/createAnnotationAuthoring.d.ts +115 -0
  104. package/dist/interaction/createAnnotationAuthoring.d.ts.map +1 -0
  105. package/dist/interaction/createAnnotationDragHandler.d.ts +28 -0
  106. package/dist/interaction/createAnnotationDragHandler.d.ts.map +1 -0
  107. package/dist/interaction/createAnnotationHitTester.d.ts +32 -0
  108. package/dist/interaction/createAnnotationHitTester.d.ts.map +1 -0
  109. package/dist/interaction/createChartSync.d.ts +27 -0
  110. package/dist/interaction/createChartSync.d.ts.map +1 -0
  111. package/dist/interaction/createEventManager.d.ts +24 -0
  112. package/dist/interaction/createEventManager.d.ts.map +1 -0
  113. package/dist/interaction/createHoverState.d.ts +20 -0
  114. package/dist/interaction/createHoverState.d.ts.map +1 -0
  115. package/dist/interaction/createInsideZoom.d.ts +14 -0
  116. package/dist/interaction/createInsideZoom.d.ts.map +1 -0
  117. package/dist/interaction/createZoomState.d.ts +63 -0
  118. package/dist/interaction/createZoomState.d.ts.map +1 -0
  119. package/dist/interaction/findCandlestick.d.ts +41 -0
  120. package/dist/interaction/findCandlestick.d.ts.map +1 -0
  121. package/dist/interaction/findNearestPoint.d.ts +61 -0
  122. package/dist/interaction/findNearestPoint.d.ts.map +1 -0
  123. package/dist/interaction/findPieSlice.d.ts +36 -0
  124. package/dist/interaction/findPieSlice.d.ts.map +1 -0
  125. package/dist/interaction/findPointsAtX.d.ts +37 -0
  126. package/dist/interaction/findPointsAtX.d.ts.map +1 -0
  127. package/dist/renderers/createAnnotationMarkerRenderer.d.ts +58 -0
  128. package/dist/renderers/createAnnotationMarkerRenderer.d.ts.map +1 -0
  129. package/dist/renderers/createAreaRenderer.d.ts +19 -0
  130. package/dist/renderers/createAreaRenderer.d.ts.map +1 -0
  131. package/dist/renderers/createAxisRenderer.d.ts +19 -0
  132. package/dist/renderers/createAxisRenderer.d.ts.map +1 -0
  133. package/dist/renderers/createBarRenderer.d.ts +20 -0
  134. package/dist/renderers/createBarRenderer.d.ts.map +1 -0
  135. package/dist/renderers/createCandlestickRenderer.d.ts +19 -0
  136. package/dist/renderers/createCandlestickRenderer.d.ts.map +1 -0
  137. package/dist/renderers/createCrosshairRenderer.d.ts +43 -0
  138. package/dist/renderers/createCrosshairRenderer.d.ts.map +1 -0
  139. package/dist/renderers/createGridRenderer.d.ts +45 -0
  140. package/dist/renderers/createGridRenderer.d.ts.map +1 -0
  141. package/dist/renderers/createHighlightRenderer.d.ts +41 -0
  142. package/dist/renderers/createHighlightRenderer.d.ts.map +1 -0
  143. package/dist/renderers/createLineRenderer.d.ts +18 -0
  144. package/dist/renderers/createLineRenderer.d.ts.map +1 -0
  145. package/dist/renderers/createPieRenderer.d.ts +18 -0
  146. package/dist/renderers/createPieRenderer.d.ts.map +1 -0
  147. package/dist/renderers/createReferenceLineRenderer.d.ts +81 -0
  148. package/dist/renderers/createReferenceLineRenderer.d.ts.map +1 -0
  149. package/dist/renderers/createScatterDensityRenderer.d.ts +14 -0
  150. package/dist/renderers/createScatterDensityRenderer.d.ts.map +1 -0
  151. package/dist/renderers/createScatterRenderer.d.ts +20 -0
  152. package/dist/renderers/createScatterRenderer.d.ts.map +1 -0
  153. package/dist/renderers/rendererUtils.d.ts +100 -0
  154. package/dist/renderers/rendererUtils.d.ts.map +1 -0
  155. package/dist/themes/darkTheme.d.ts +11 -0
  156. package/dist/themes/darkTheme.d.ts.map +1 -0
  157. package/dist/themes/index.d.ts +8 -0
  158. package/dist/themes/index.d.ts.map +1 -0
  159. package/dist/themes/lightTheme.d.ts +11 -0
  160. package/dist/themes/lightTheme.d.ts.map +1 -0
  161. package/dist/themes/types.d.ts +14 -0
  162. package/dist/themes/types.d.ts.map +1 -0
  163. package/dist/types/ChartGPU.d.ts +99 -0
  164. package/dist/types/ChartGPU.d.ts.map +1 -0
  165. package/dist/types/components/createDataZoomSlider.d.ts +14 -0
  166. package/dist/types/components/createDataZoomSlider.d.ts.map +1 -0
  167. package/dist/types/components/createLegend.d.ts +9 -0
  168. package/dist/types/components/createLegend.d.ts.map +1 -0
  169. package/dist/types/components/createTextOverlay.d.ts +17 -0
  170. package/dist/types/components/createTextOverlay.d.ts.map +1 -0
  171. package/dist/types/components/createTooltip.d.ts +12 -0
  172. package/dist/types/components/createTooltip.d.ts.map +1 -0
  173. package/dist/types/components/formatTooltip.d.ts +19 -0
  174. package/dist/types/components/formatTooltip.d.ts.map +1 -0
  175. package/dist/types/config/OptionResolver.d.ts +134 -0
  176. package/dist/types/config/OptionResolver.d.ts.map +1 -0
  177. package/dist/types/config/defaults.d.ts +55 -0
  178. package/dist/types/config/defaults.d.ts.map +1 -0
  179. package/dist/types/config/types.d.ts +485 -0
  180. package/dist/types/config/types.d.ts.map +1 -0
  181. package/dist/types/core/GPUContext.d.ts +242 -0
  182. package/dist/types/core/GPUContext.d.ts.map +1 -0
  183. package/dist/types/core/RenderScheduler.d.ts +174 -0
  184. package/dist/types/core/RenderScheduler.d.ts.map +1 -0
  185. package/dist/types/core/createAnimationController.d.ts +15 -0
  186. package/dist/types/core/createAnimationController.d.ts.map +1 -0
  187. package/dist/types/core/createRenderCoordinator.d.ts +129 -0
  188. package/dist/types/core/createRenderCoordinator.d.ts.map +1 -0
  189. package/dist/types/data/createDataStore.d.ts +33 -0
  190. package/dist/types/data/createDataStore.d.ts.map +1 -0
  191. package/dist/types/data/createStreamBuffer.d.ts +20 -0
  192. package/dist/types/data/createStreamBuffer.d.ts.map +1 -0
  193. package/dist/types/data/lttbSample.d.ts +5 -0
  194. package/dist/types/data/lttbSample.d.ts.map +1 -0
  195. package/dist/types/data/ohlcSample.d.ts +21 -0
  196. package/dist/types/data/ohlcSample.d.ts.map +1 -0
  197. package/dist/types/data/packDataPoints.d.ts +79 -0
  198. package/dist/types/data/packDataPoints.d.ts.map +1 -0
  199. package/dist/types/data/sampleSeries.d.ts +3 -0
  200. package/dist/types/data/sampleSeries.d.ts.map +1 -0
  201. package/dist/types/index.d.ts +35 -0
  202. package/dist/types/index.d.ts.map +1 -0
  203. package/dist/types/interaction/createChartSync.d.ts +12 -0
  204. package/dist/types/interaction/createChartSync.d.ts.map +1 -0
  205. package/dist/types/interaction/createEventManager.d.ts +24 -0
  206. package/dist/types/interaction/createEventManager.d.ts.map +1 -0
  207. package/dist/types/interaction/createHoverState.d.ts +20 -0
  208. package/dist/types/interaction/createHoverState.d.ts.map +1 -0
  209. package/dist/types/interaction/createInsideZoom.d.ts +14 -0
  210. package/dist/types/interaction/createInsideZoom.d.ts.map +1 -0
  211. package/dist/types/interaction/createZoomState.d.ts +63 -0
  212. package/dist/types/interaction/createZoomState.d.ts.map +1 -0
  213. package/dist/types/interaction/findCandlestick.d.ts +41 -0
  214. package/dist/types/interaction/findCandlestick.d.ts.map +1 -0
  215. package/dist/types/interaction/findNearestPoint.d.ts +61 -0
  216. package/dist/types/interaction/findNearestPoint.d.ts.map +1 -0
  217. package/dist/types/interaction/findPieSlice.d.ts +36 -0
  218. package/dist/types/interaction/findPieSlice.d.ts.map +1 -0
  219. package/dist/types/interaction/findPointsAtX.d.ts +37 -0
  220. package/dist/types/interaction/findPointsAtX.d.ts.map +1 -0
  221. package/dist/types/renderers/createAreaRenderer.d.ts +18 -0
  222. package/dist/types/renderers/createAreaRenderer.d.ts.map +1 -0
  223. package/dist/types/renderers/createAxisRenderer.d.ts +19 -0
  224. package/dist/types/renderers/createAxisRenderer.d.ts.map +1 -0
  225. package/dist/types/renderers/createBarRenderer.d.ts +20 -0
  226. package/dist/types/renderers/createBarRenderer.d.ts.map +1 -0
  227. package/dist/types/renderers/createCandlestickRenderer.d.ts +19 -0
  228. package/dist/types/renderers/createCandlestickRenderer.d.ts.map +1 -0
  229. package/dist/types/renderers/createCrosshairRenderer.d.ts +43 -0
  230. package/dist/types/renderers/createCrosshairRenderer.d.ts.map +1 -0
  231. package/dist/types/renderers/createGridRenderer.d.ts +45 -0
  232. package/dist/types/renderers/createGridRenderer.d.ts.map +1 -0
  233. package/dist/types/renderers/createHighlightRenderer.d.ts +41 -0
  234. package/dist/types/renderers/createHighlightRenderer.d.ts.map +1 -0
  235. package/dist/types/renderers/createLineRenderer.d.ts +18 -0
  236. package/dist/types/renderers/createLineRenderer.d.ts.map +1 -0
  237. package/dist/types/renderers/createPieRenderer.d.ts +18 -0
  238. package/dist/types/renderers/createPieRenderer.d.ts.map +1 -0
  239. package/dist/types/renderers/createScatterDensityRenderer.d.ts +14 -0
  240. package/dist/types/renderers/createScatterDensityRenderer.d.ts.map +1 -0
  241. package/dist/types/renderers/createScatterRenderer.d.ts +19 -0
  242. package/dist/types/renderers/createScatterRenderer.d.ts.map +1 -0
  243. package/dist/types/renderers/rendererUtils.d.ts +100 -0
  244. package/dist/types/renderers/rendererUtils.d.ts.map +1 -0
  245. package/dist/types/themes/darkTheme.d.ts +11 -0
  246. package/dist/types/themes/darkTheme.d.ts.map +1 -0
  247. package/dist/types/themes/index.d.ts +8 -0
  248. package/dist/types/themes/index.d.ts.map +1 -0
  249. package/dist/types/themes/lightTheme.d.ts +11 -0
  250. package/dist/types/themes/lightTheme.d.ts.map +1 -0
  251. package/dist/types/themes/types.d.ts +14 -0
  252. package/dist/types/themes/types.d.ts.map +1 -0
  253. package/dist/types/utils/axisLabelStyling.d.ts +27 -0
  254. package/dist/types/utils/axisLabelStyling.d.ts.map +1 -0
  255. package/dist/types/utils/checkWebGPU.d.ts +39 -0
  256. package/dist/types/utils/checkWebGPU.d.ts.map +1 -0
  257. package/dist/types/utils/colors.d.ts +14 -0
  258. package/dist/types/utils/colors.d.ts.map +1 -0
  259. package/dist/types/utils/easing.d.ts +9 -0
  260. package/dist/types/utils/easing.d.ts.map +1 -0
  261. package/dist/types/utils/scales.d.ts +79 -0
  262. package/dist/types/utils/scales.d.ts.map +1 -0
  263. package/dist/utils/axisLabelStyling.d.ts +20 -0
  264. package/dist/utils/axisLabelStyling.d.ts.map +1 -0
  265. package/dist/utils/checkWebGPU.d.ts +39 -0
  266. package/dist/utils/checkWebGPU.d.ts.map +1 -0
  267. package/dist/utils/colors.d.ts +14 -0
  268. package/dist/utils/colors.d.ts.map +1 -0
  269. package/dist/utils/easing.d.ts +9 -0
  270. package/dist/utils/easing.d.ts.map +1 -0
  271. package/dist/utils/scales.d.ts +79 -0
  272. package/dist/utils/scales.d.ts.map +1 -0
  273. package/package.json +64 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ChartGPU
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,208 @@
1
+ <p align="center" style="margin-bottom:0; margin-top:20px;">
2
+ <img src="docs/assets/chartgpu.png" alt="ChartGPU" width="400">
3
+ </p>
4
+
5
+ <p align="center" style="margin-top:-18px;">
6
+ The fastest open-source charting library — 50M points at 60 FPS.
7
+ </p>
8
+
9
+ <div align="center">
10
+
11
+
12
+ [<img src="docs/assets/powered-by-webgpu.svg" alt="Powered by WebGPU" height="28" />](https://forthebadge.com)
13
+ [![GitHub Stars](https://img.shields.io/github/stars/ChartGPU/chartgpu?style=for-the-badge&color=yellow)](https://github.com/chartgpu/chartgpu)
14
+ [![CI Status](https://img.shields.io/github/actions/workflow/status/chartgpu/chartgpu/tests.yml?branch=main&style=for-the-badge&label=Tests)](https://github.com/chartgpu/chartgpu/actions/workflows/tests.yml)
15
+ [![npm version](https://img.shields.io/npm/v/chartgpu?style=for-the-badge&color=blue)](https://www.npmjs.com/package/chartgpu)
16
+ [![NPM Downloads](https://img.shields.io/npm/dm/chartgpu?style=for-the-badge&color=%2368cc49)](https://www.npmjs.com/package/chartgpu)
17
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://github.com/chartgpu/chartgpu/blob/main/LICENSE)
18
+ [![Live Demo](https://img.shields.io/badge/demo-live-brightgreen?style=for-the-badge)](https://chartgpu.github.io/ChartGPU/examples/)
19
+ [![Examples](https://img.shields.io/badge/Examples-Code%20Samples-blue?style=for-the-badge)](https://github.com/chartgpu/chartgpu/tree/main/examples)
20
+ [![Documentation](https://img.shields.io/badge/Documentation-Getting%20Started-blue?style=for-the-badge)](https://github.com/chartgpu/chartgpu/blob/main/docs/GETTING_STARTED.md)
21
+
22
+ [<img src="https://hackerbadge.now.sh/api?id=46706528" alt="Featured on Hacker News" height="30" />](https://news.ycombinator.com/item?id=46706528)
23
+
24
+ [<img src="https://awesome.re/mentioned-badge.svg" alt="Featured in Awesome WebGPU" style="height: 30px;" />](https://github.com/mikbry/awesome-webgpu)
25
+
26
+
27
+ </div>
28
+
29
+ ChartGPU is a TypeScript charting library built on WebGPU for smooth, interactive rendering—especially when you have lots of data.
30
+
31
+ ## Demo
32
+
33
+ ![ChartGPU demo](https://raw.githubusercontent.com/chartgpu/chartgpu/main/docs/assets/chart-gpu-demo.gif)
34
+
35
+ ### 35M points (benchmark)
36
+
37
+ 35,000,000 points rendered at ~72 FPS (benchmark mode).
38
+
39
+ ![35 million point benchmark at 72 FPS](docs/assets/35-million-ultimate-benchmark-example.png)
40
+
41
+ ## Quick Start
42
+
43
+ ```ts
44
+ import { ChartGPU } from 'chartgpu';
45
+ const container = document.getElementById('chart')!;
46
+ await ChartGPU.create(container, {
47
+ series: [{ type: 'line', data: [[0, 1], [1, 3], [2, 2]] }],
48
+ });
49
+ ```
50
+
51
+ ### Annotations
52
+
53
+ Add reference lines, point markers, and text overlays to highlight important data features:
54
+
55
+ ```ts
56
+ await ChartGPU.create(container, {
57
+ series: [{ type: 'line', data: [[0, 1], [1, 3], [2, 2]] }],
58
+ annotations: [
59
+ // Horizontal reference line
60
+ {
61
+ id: 'ref-y',
62
+ type: 'lineY',
63
+ y: 2.5,
64
+ layer: 'belowSeries',
65
+ style: { color: '#ffd166', lineWidth: 2, lineDash: [8, 6], opacity: 0.95 },
66
+ label: { text: 'threshold' },
67
+ },
68
+ // Point marker at peak
69
+ {
70
+ id: 'peak',
71
+ type: 'point',
72
+ x: 1,
73
+ y: 3,
74
+ layer: 'aboveSeries',
75
+ marker: { symbol: 'circle', size: 8, style: { color: '#ff4ab0' } },
76
+ label: { template: 'peak={y}', decimals: 2 },
77
+ },
78
+ ],
79
+ });
80
+ ```
81
+
82
+ See [Annotations Documentation](https://github.com/chartgpu/chartgpu/blob/main/docs/api/options.md#annotations) and the [annotations example](https://github.com/chartgpu/chartgpu/tree/main/examples/annotation-authoring).
83
+
84
+ ## Highlights
85
+
86
+ - 🚀 WebGPU-accelerated rendering for high FPS with large datasets
87
+ - 📈 Multiple series types: line, area, bar, scatter, pie, candlestick
88
+ - 🌡️ Scatter density/heatmap mode (`mode: 'density'`) for large point clouds — see [`docs/api/options.md#scatterseriesconfig`](docs/api/options.md#scatterseriesconfig) and [`examples/scatter-density-1m/`](examples/scatter-density-1m/)
89
+ - 📍 Annotation overlays: reference lines (horizontal/vertical), point markers, and text labels — see [`docs/api/options.md#annotations`](docs/api/options.md#annotations) and [`examples/annotations/`](examples/annotations/)
90
+ - 🧭 Built-in interaction: hover highlight, tooltip, crosshair
91
+ - 🔁 Streaming updates via `appendData(...)` with typed-array support (`XYArraysData`, `InterleavedXYData`, `DataPoint[]`) — see [`examples/cartesian-data-formats/`](examples/cartesian-data-formats/)
92
+ - 🔍 X-axis zoom (inside gestures + optional slider UI)
93
+ - 🎛️ Theme presets (`'dark' | 'light'`) and custom theme support
94
+
95
+
96
+ ### Candlestick Charts
97
+
98
+ Financial OHLC (open-high-low-close) candlestick rendering with classic/hollow style toggle and color customization. The live streaming demo renders **5 million candlesticks at over 100 FPS** with real-time updates.
99
+
100
+ ![Candlestick chart example](docs/assets/candle-stick-example.png)
101
+
102
+ ### Scatter Density (1M points)
103
+
104
+ GPU-binned density/heatmap mode for scatter plots (`mode: 'density'`) to reveal structure in overplotted point clouds. See [`docs/api/options.md#scatterseriesconfig`](docs/api/options.md#scatterseriesconfig) and the demo in [`examples/scatter-density-1m/`](examples/scatter-density-1m/).
105
+
106
+ ![Scatter density chart example (1M points)](docs/assets/scatter-plot-density-chart-1million-points-example.png)
107
+
108
+ ### Interactive Annotation Authoring
109
+
110
+ Full-featured annotation authoring system with interactive editing capabilities. Create, edit, drag, and delete annotations with an intuitive UI. Supports all annotation types: reference lines (horizontal/vertical), point markers, text annotations (plot-space + data-space tracking), labels, and styling options.
111
+
112
+ ![Annotations comprehensive demo](docs/assets/annotations.png)
113
+
114
+ **Key features:**
115
+ - **Right-click empty space** → Add vertical/horizontal line or text note with custom color, style & label
116
+ - **Click & drag annotations** → Reposition them (lines constrained to their axis)
117
+ - **Right-click on annotation** → Edit properties or delete
118
+ - **Full styling control** → Color picker, line style (solid/dashed), line width, and label customization
119
+ - **Undo/Redo support** → All annotations are reversible
120
+ - **Scroll to zoom, Drag to pan** → Standard chart interactions work seamlessly
121
+
122
+ ![Annotation configuration dialog](docs/assets/annontations-add-indicator.png)
123
+
124
+ The annotation authoring system is demonstrated in the [`examples/annotation-authoring/`](examples/annotation-authoring/) example.
125
+
126
+ ## Installation
127
+
128
+ ```bash
129
+ npm install chartgpu
130
+ ```
131
+
132
+ **GitHub Packages:**
133
+
134
+ ```bash
135
+ npm install @chartgpu/chartgpu
136
+ ```
137
+
138
+ For GitHub Packages, configure your `.npmrc`:
139
+
140
+ ```
141
+ @chartgpu:registry=https://npm.pkg.github.com
142
+ ```
143
+
144
+ ## React Integration
145
+
146
+ React bindings are available via [`chartgpu-react`](https://github.com/ChartGPU/chartgpu-react):
147
+
148
+ ```bash
149
+ npm install chartgpu-react
150
+ ```
151
+
152
+ ```tsx
153
+ import { ChartGPUChart } from 'chartgpu-react';
154
+
155
+ function MyChart() {
156
+ return (
157
+ <ChartGPUChart
158
+ options={{
159
+ series: [{ type: 'line', data: [[0, 1], [1, 3], [2, 2]] }],
160
+ }}
161
+ />
162
+ );
163
+ }
164
+ ```
165
+
166
+ See the [chartgpu-react repository](https://github.com/ChartGPU/chartgpu-react) for full documentation and examples.
167
+
168
+ ## Browser support (WebGPU required)
169
+
170
+ - Chrome 113+ or Edge 113+ (WebGPU enabled by default)
171
+ - Safari 18+ (WebGPU enabled by default)
172
+ - Firefox: Windows 114+, Mac 145+, Linux nightly
173
+
174
+ See the [gpuweb repository](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status) for full Implementation Status
175
+
176
+ ## Who's Using ChartGPU
177
+
178
+ ChartGPU is a young project and we'd love to hear how you're using it! If your team or project uses ChartGPU, [open a pull request](https://github.com/chartgpu/chartgpu/pulls) to add your name here.
179
+
180
+ <!-- Add your project/company below:
181
+ - [Your Project](https://link) — short description
182
+ -->
183
+
184
+ ## Documentation
185
+
186
+ - Full documentation: [Getting Started](https://github.com/chartgpu/chartgpu/blob/main/docs/GETTING_STARTED.md)
187
+ - API reference: [`docs/api/README.md`](https://github.com/chartgpu/chartgpu/blob/main/docs/api/README.md)
188
+
189
+ ## Examples
190
+
191
+ - Browse examples: [`examples/`](https://github.com/chartgpu/chartgpu/tree/main/examples)
192
+ - Run locally:
193
+ - `npm install`
194
+ - `npm run dev` (opens `http://localhost:5173/examples/`)
195
+
196
+ ## Contributing
197
+
198
+ See [`CONTRIBUTING.md`](https://github.com/chartgpu/chartgpu/blob/main/CONTRIBUTING.md).
199
+
200
+ ## License
201
+
202
+ MIT — see [`LICENSE`](https://github.com/chartgpu/chartgpu/blob/main/LICENSE).
203
+
204
+ ## Architecture
205
+
206
+ ChartGPU follows a functional-first architecture. `ChartGPU.create(...)` owns the canvas and WebGPU lifecycle, delegating render orchestration to a modular render coordinator with 11 specialized modules.
207
+
208
+ For the full architecture diagram, see [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md). For deep internal notes, see [`docs/api/INTERNALS.md`](docs/api/INTERNALS.md).
@@ -0,0 +1,146 @@
1
+ import type { CartesianSeriesData, ChartGPUOptions, OHLCDataPoint } from './config/types';
2
+ import type { PerformanceMetrics, PerformanceCapabilities } from './config/types';
3
+ /**
4
+ * Hit-test match for a chart element.
5
+ */
6
+ export type ChartGPUHitTestMatch = Readonly<{
7
+ readonly kind: 'cartesian' | 'candlestick' | 'pie';
8
+ readonly seriesIndex: number;
9
+ readonly dataIndex: number;
10
+ readonly value: readonly [number, number];
11
+ }>;
12
+ /**
13
+ * Result of a hit-test operation on a chart.
14
+ */
15
+ export type ChartGPUHitTestResult = Readonly<{
16
+ readonly isInGrid: boolean;
17
+ readonly canvasX: number;
18
+ readonly canvasY: number;
19
+ readonly gridX: number;
20
+ readonly gridY: number;
21
+ readonly match: ChartGPUHitTestMatch | null;
22
+ }>;
23
+ export interface ChartGPUInstance {
24
+ readonly options: Readonly<ChartGPUOptions>;
25
+ readonly disposed: boolean;
26
+ setOption(options: ChartGPUOptions): void;
27
+ /**
28
+ * Appends new points to a cartesian series at runtime (streaming).
29
+ *
30
+ * Accepts multiple formats for efficient data append without per-point object allocations:
31
+ * - `DataPoint[]`: Traditional array of point objects/tuples (existing behavior)
32
+ * - `XYArraysData`: Separate x/y/size arrays (`{x: ArrayLike<number>, y: ArrayLike<number>, size?: ArrayLike<number>}`)
33
+ * - `InterleavedXYData`: Typed array with [x0,y0,x1,y1,...] layout (e.g. `Float32Array`)
34
+ * - `OHLCDataPoint[]`: For candlestick series only
35
+ *
36
+ * Point count is derived via `getPointCount()` from `cartesianData.ts`:
37
+ * - `XYArraysData`: min(x.length, y.length)
38
+ * - `InterleavedXYData`: floor(length / 2), ignoring trailing odd element
39
+ * - `DataView` is unsupported and throws an error
40
+ *
41
+ * Pie series are non-cartesian and are not supported by streaming append.
42
+ */
43
+ appendData(seriesIndex: number, newPoints: CartesianSeriesData | OHLCDataPoint[]): void;
44
+ resize(): void;
45
+ dispose(): void;
46
+ on(eventName: 'crosshairMove', callback: ChartGPUCrosshairMoveCallback): void;
47
+ on(eventName: 'zoomRangeChange', callback: ChartGPUZoomRangeChangeCallback): void;
48
+ on(eventName: ChartGPUEventName, callback: ChartGPUEventCallback): void;
49
+ off(eventName: 'crosshairMove', callback: ChartGPUCrosshairMoveCallback): void;
50
+ off(eventName: 'zoomRangeChange', callback: ChartGPUZoomRangeChangeCallback): void;
51
+ off(eventName: ChartGPUEventName, callback: ChartGPUEventCallback): void;
52
+ /**
53
+ * Gets the current “interaction x” in domain units (or `null` when inactive).
54
+ *
55
+ * This is derived from pointer movement inside the plot grid and can also be driven
56
+ * externally via `setInteractionX(...)` (e.g. chart sync).
57
+ */
58
+ getInteractionX(): number | null;
59
+ /**
60
+ * Drives the chart’s crosshair + tooltip from a domain-space x value.
61
+ *
62
+ * Passing `null` clears the interaction (hides crosshair/tooltip).
63
+ */
64
+ setInteractionX(x: number | null, source?: unknown): void;
65
+ /**
66
+ * Alias for `setInteractionX(...)` for chart sync semantics.
67
+ */
68
+ setCrosshairX(x: number | null, source?: unknown): void;
69
+ /**
70
+ * Subscribes to interaction x changes (domain units).
71
+ *
72
+ * Returns an unsubscribe function.
73
+ */
74
+ onInteractionXChange(callback: (x: number | null, source?: unknown) => void): () => void;
75
+ /**
76
+ * Returns the current percent-space zoom window (or `null` when zoom is disabled).
77
+ */
78
+ getZoomRange(): Readonly<{
79
+ start: number;
80
+ end: number;
81
+ }> | null;
82
+ /**
83
+ * Sets the percent-space zoom window.
84
+ *
85
+ * No-op when zoom is disabled.
86
+ */
87
+ setZoomRange(start: number, end: number, source?: unknown): void;
88
+ /**
89
+ * Gets the latest performance metrics.
90
+ * Returns exact FPS and detailed frame statistics.
91
+ *
92
+ * @returns Current performance metrics, or null if not available
93
+ */
94
+ getPerformanceMetrics(): Readonly<PerformanceMetrics> | null;
95
+ /**
96
+ * Gets the performance capabilities of the current environment.
97
+ * Indicates which performance features are supported.
98
+ *
99
+ * @returns Performance capabilities, or null if not initialized
100
+ */
101
+ getPerformanceCapabilities(): Readonly<PerformanceCapabilities> | null;
102
+ /**
103
+ * Registers a callback to be notified of performance metric updates.
104
+ * Callback is invoked every frame with the latest metrics.
105
+ *
106
+ * @param callback - Function to call with updated metrics
107
+ * @returns Unsubscribe function to remove the callback
108
+ */
109
+ onPerformanceUpdate(callback: (metrics: Readonly<PerformanceMetrics>) => void): () => void;
110
+ /**
111
+ * Performs hit-testing on a pointer or mouse event.
112
+ *
113
+ * Returns coordinates and matched chart element (if any).
114
+ * Accepts both `PointerEvent` (for hover/click) and `MouseEvent` (for contextmenu/right-click).
115
+ *
116
+ * @param e - Pointer or mouse event to test
117
+ * @returns Hit-test result with coordinates and optional match
118
+ */
119
+ hitTest(e: PointerEvent | MouseEvent): ChartGPUHitTestResult;
120
+ }
121
+ export type ChartGPU = ChartGPUInstance;
122
+ export type ChartGPUEventName = 'click' | 'mouseover' | 'mouseout' | 'crosshairMove' | 'zoomRangeChange';
123
+ export type ChartGPUEventPayload = Readonly<{
124
+ readonly seriesIndex: number | null;
125
+ readonly dataIndex: number | null;
126
+ readonly value: readonly [number, number] | null;
127
+ readonly seriesName: string | null;
128
+ readonly event: PointerEvent;
129
+ }>;
130
+ export type ChartGPUCrosshairMovePayload = Readonly<{
131
+ readonly x: number | null;
132
+ readonly source?: unknown;
133
+ }>;
134
+ export type ChartGPUZoomRangeChangePayload = Readonly<{
135
+ readonly start: number;
136
+ readonly end: number;
137
+ readonly source?: unknown;
138
+ }>;
139
+ export type ChartGPUEventCallback = (payload: ChartGPUEventPayload) => void;
140
+ export type ChartGPUCrosshairMoveCallback = (payload: ChartGPUCrosshairMovePayload) => void;
141
+ export type ChartGPUZoomRangeChangeCallback = (payload: ChartGPUZoomRangeChangePayload) => void;
142
+ export declare function createChartGPU(container: HTMLElement, options: ChartGPUOptions): Promise<ChartGPUInstance>;
143
+ export declare const ChartGPU: {
144
+ create: typeof createChartGPU;
145
+ };
146
+ //# sourceMappingURL=ChartGPU.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartGPU.d.ts","sourceRoot":"","sources":["../src/ChartGPU.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EAGf,aAAa,EAId,MAAM,gBAAgB,CAAC;AAWxB,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EAQxB,MAAM,gBAAgB,CAAC;AAwBxB;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,GAAG,KAAK,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,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for setting annotation properties:
5
+ * - Label, color, line style, line width (for lines)
6
+ * - Text content, color, font size (for text annotations)
7
+ * - Label, color, marker size (for point annotations)
8
+ */
9
+ import type { AnnotationConfig } from '../config/types.js';
10
+ export interface AnnotationConfigDialogOptions {
11
+ readonly palette?: readonly string[];
12
+ readonly zIndex?: number;
13
+ }
14
+ export interface AnnotationConfigDialog {
15
+ showCreate(annotationType: 'lineX' | 'lineY' | 'text' | 'point', defaults: Partial<AnnotationConfig>, onSave: (config: AnnotationConfig) => void, onCancel: () => void): void;
16
+ showEdit(annotation: AnnotationConfig, onSave: (updates: Partial<AnnotationConfig>) => void, onCancel: () => void): void;
17
+ hide(): void;
18
+ dispose(): void;
19
+ }
20
+ /**
21
+ * Creates a configuration dialog for annotations
22
+ */
23
+ export declare function createAnnotationConfigDialog(container: HTMLElement, options?: AnnotationConfigDialogOptions): AnnotationConfigDialog;
24
+ //# sourceMappingURL=createAnnotationConfigDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createAnnotationConfigDialog.d.ts","sourceRoot":"","sources":["../../src/components/createAnnotationConfigDialog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,CACR,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,EACpD,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACnC,MAAM,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,EAC1C,QAAQ,EAAE,MAAM,IAAI,GACnB,IAAI,CAAC;IAER,QAAQ,CACN,UAAU,EAAE,gBAAgB,EAC5B,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,EACpD,QAAQ,EAAE,MAAM,IAAI,GACnB,IAAI,CAAC;IAER,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,IAAI,CAAC;CACjB;AAiBD;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,WAAW,EACtB,OAAO,GAAE,6BAAkC,GAC1C,sBAAsB,CA2rBxB"}
@@ -0,0 +1,14 @@
1
+ import type { ZoomState } from '../interaction/createZoomState';
2
+ import type { ThemeConfig } from '../themes/types';
3
+ export interface DataZoomSlider {
4
+ update(theme: ThemeConfig): void;
5
+ dispose(): void;
6
+ }
7
+ export interface DataZoomSliderOptions {
8
+ readonly height?: number;
9
+ readonly marginTop?: number;
10
+ readonly zIndex?: number;
11
+ readonly showPreview?: boolean;
12
+ }
13
+ export declare function createDataZoomSlider(container: HTMLElement, zoomState: ZoomState, options?: DataZoomSliderOptions): DataZoomSlider;
14
+ //# sourceMappingURL=createDataZoomSlider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDataZoomSlider.d.ts","sourceRoot":"","sources":["../../src/components/createDataZoomSlider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAgBD,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,cAAc,CA+RhB"}
@@ -0,0 +1,9 @@
1
+ import type { SeriesConfig } from '../config/types';
2
+ import type { ThemeConfig } from '../themes/types';
3
+ export type LegendPosition = 'top' | 'bottom' | 'left' | 'right';
4
+ export interface Legend {
5
+ update(series: ReadonlyArray<SeriesConfig>, theme: ThemeConfig): void;
6
+ dispose(): void;
7
+ }
8
+ export declare function createLegend(container: HTMLElement, position?: LegendPosition, onSeriesToggle?: (seriesIndex: number, sliceIndex?: number) => void): Legend;
9
+ //# sourceMappingURL=createLegend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createLegend.d.ts","sourceRoot":"","sources":["../../src/components/createLegend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjE,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACtE,OAAO,IAAI,IAAI,CAAC;CACjB;AAwCD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,WAAW,EACtB,QAAQ,GAAE,cAAwB,EAClC,cAAc,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,GAClE,MAAM,CAyPR"}
@@ -0,0 +1,17 @@
1
+ export type TextOverlayAnchor = 'start' | 'middle' | 'end';
2
+ export interface TextOverlayLabelOptions {
3
+ readonly fontSize?: number;
4
+ readonly color?: string;
5
+ readonly anchor?: TextOverlayAnchor;
6
+ /**
7
+ * Rotation in degrees (CSS `rotate(<deg>deg)`).
8
+ */
9
+ readonly rotation?: number;
10
+ }
11
+ export interface TextOverlay {
12
+ clear(): void;
13
+ addLabel(text: string, x: number, y: number, options?: TextOverlayLabelOptions): HTMLSpanElement;
14
+ dispose(): void;
15
+ }
16
+ export declare function createTextOverlay(container: HTMLElement): TextOverlay;
17
+ //# sourceMappingURL=createTextOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTextOverlay.d.ts","sourceRoot":"","sources":["../../src/components/createTextOverlay.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE3D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,CACN,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,OAAO,CAAC,EAAE,uBAAuB,GAChC,eAAe,CAAC;IACnB,OAAO,IAAI,IAAI,CAAC;CACjB;AAeD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,WAAW,GAAG,WAAW,CAiFrE"}
@@ -0,0 +1,12 @@
1
+ export interface Tooltip {
2
+ /**
3
+ * Show tooltip at container-local CSS pixel coordinates.
4
+ *
5
+ * `content` is treated as HTML (assigned via `innerHTML`).
6
+ */
7
+ show(x: number, y: number, content: string): void;
8
+ hide(): void;
9
+ dispose(): void;
10
+ }
11
+ export declare function createTooltip(container: HTMLElement): Tooltip;
12
+ //# sourceMappingURL=createTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTooltip.d.ts","sourceRoot":"","sources":["../../src/components/createTooltip.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,IAAI,CAAC;CACjB;AASD,wBAAgB,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAsL7D"}
@@ -0,0 +1,19 @@
1
+ import type { TooltipParams } from '../config/types';
2
+ /**
3
+ * Default tooltip formatter for candlestick series in item mode.
4
+ * Renders O/H/L/C values with colored arrow and percentage change.
5
+ */
6
+ export declare function formatCandlestickTooltip(params: TooltipParams): string;
7
+ /**
8
+ * Default tooltip formatter for item mode.
9
+ * Returns a compact single-row HTML snippet: dot + series name + y value.
10
+ * For candlestick series, returns O/H/L/C with arrow and percentage change.
11
+ */
12
+ export declare function formatTooltipItem(params: TooltipParams): string;
13
+ /**
14
+ * Default tooltip formatter for axis mode.
15
+ * Renders an x header line then one row per series with the y value.
16
+ * Candlestick series show O/H/L/C values with arrow and percentage change.
17
+ */
18
+ export declare function formatTooltipAxis(params: TooltipParams[]): string;
19
+ //# sourceMappingURL=formatTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatTooltip.d.ts","sourceRoot":"","sources":["../../src/components/formatTooltip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAqIrD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAK/D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAkBjE"}
@@ -0,0 +1,137 @@
1
+ import type { AreaStyleConfig, AnnotationConfig, AxisConfig, CandlestickItemStyleConfig, CandlestickSeriesConfig, CandlestickStyle, ChartGPUOptions, GridConfig, LineStyleConfig, AreaSeriesConfig, BarSeriesConfig, LineSeriesConfig, PieDataItem, PieSeriesConfig, ScatterSeriesConfig, SeriesSampling } from './types';
2
+ import type { ThemeConfig } from '../themes/types';
3
+ export type ResolvedGridConfig = Readonly<Required<GridConfig>>;
4
+ export type ResolvedLineStyleConfig = Readonly<Required<Omit<LineStyleConfig, 'color'>> & {
5
+ readonly color: string;
6
+ }>;
7
+ export type ResolvedAreaStyleConfig = Readonly<Required<Omit<AreaStyleConfig, 'color'>> & {
8
+ readonly color: string;
9
+ }>;
10
+ export type RawBounds = Readonly<{
11
+ xMin: number;
12
+ xMax: number;
13
+ yMin: number;
14
+ yMax: number;
15
+ }>;
16
+ export type ResolvedLineSeriesConfig = Readonly<Omit<LineSeriesConfig, 'color' | 'lineStyle' | 'areaStyle' | 'sampling' | 'samplingThreshold' | 'data'> & {
17
+ readonly color: string;
18
+ readonly lineStyle: ResolvedLineStyleConfig;
19
+ readonly areaStyle?: ResolvedAreaStyleConfig;
20
+ readonly sampling: SeriesSampling;
21
+ readonly samplingThreshold: number;
22
+ /**
23
+ * Original (unsampled) series data.
24
+ *
25
+ * Used at runtime for zoom-aware re-sampling so we can increase detail when zoomed-in without
26
+ * losing outliers or permanently discarding points.
27
+ */
28
+ readonly rawData: Readonly<LineSeriesConfig['data']>;
29
+ readonly data: Readonly<LineSeriesConfig['data']>;
30
+ /**
31
+ * Bounds computed from the original (unsampled) data. Used for axis auto-bounds so sampling
32
+ * cannot clip outliers.
33
+ */
34
+ readonly rawBounds?: RawBounds;
35
+ }>;
36
+ export type ResolvedAreaSeriesConfig = Readonly<Omit<AreaSeriesConfig, 'color' | 'areaStyle' | 'sampling' | 'samplingThreshold' | 'data'> & {
37
+ readonly color: string;
38
+ readonly areaStyle: ResolvedAreaStyleConfig;
39
+ readonly sampling: SeriesSampling;
40
+ readonly samplingThreshold: number;
41
+ /** Original (unsampled) series data (see `ResolvedLineSeriesConfig.rawData`). */
42
+ readonly rawData: Readonly<AreaSeriesConfig['data']>;
43
+ readonly data: Readonly<AreaSeriesConfig['data']>;
44
+ /**
45
+ * Bounds computed from the original (unsampled) data. Used for axis auto-bounds so sampling
46
+ * cannot clip outliers.
47
+ */
48
+ readonly rawBounds?: RawBounds;
49
+ }>;
50
+ export type ResolvedBarSeriesConfig = Readonly<Omit<BarSeriesConfig, 'color' | 'sampling' | 'samplingThreshold' | 'data'> & {
51
+ readonly color: string;
52
+ readonly sampling: SeriesSampling;
53
+ readonly samplingThreshold: number;
54
+ /** Original (unsampled) series data (see `ResolvedLineSeriesConfig.rawData`). */
55
+ readonly rawData: Readonly<BarSeriesConfig['data']>;
56
+ readonly data: Readonly<BarSeriesConfig['data']>;
57
+ /**
58
+ * Bounds computed from the original (unsampled) data. Used for axis auto-bounds so sampling
59
+ * cannot clip outliers.
60
+ */
61
+ readonly rawBounds?: RawBounds;
62
+ }>;
63
+ export type ResolvedScatterSeriesConfig = Readonly<Omit<ScatterSeriesConfig, 'color' | 'sampling' | 'samplingThreshold' | 'data' | 'mode' | 'binSize' | 'densityColormap' | 'densityNormalization'> & {
64
+ readonly color: string;
65
+ readonly sampling: SeriesSampling;
66
+ readonly samplingThreshold: number;
67
+ readonly mode: NonNullable<ScatterSeriesConfig['mode']>;
68
+ readonly binSize: number;
69
+ readonly densityColormap: NonNullable<ScatterSeriesConfig['densityColormap']>;
70
+ readonly densityNormalization: NonNullable<ScatterSeriesConfig['densityNormalization']>;
71
+ /** Original (unsampled) series data (see `ResolvedLineSeriesConfig.rawData`). */
72
+ readonly rawData: Readonly<ScatterSeriesConfig['data']>;
73
+ readonly data: Readonly<ScatterSeriesConfig['data']>;
74
+ /**
75
+ * Bounds computed from the original (unsampled) data. Used for axis auto-bounds so sampling
76
+ * cannot clip outliers.
77
+ */
78
+ readonly rawBounds?: RawBounds;
79
+ }>;
80
+ export type ResolvedPieDataItem = Readonly<Omit<PieDataItem, 'color' | 'visible'> & {
81
+ readonly color: string;
82
+ readonly visible: boolean;
83
+ }>;
84
+ export type ResolvedPieSeriesConfig = Readonly<Omit<PieSeriesConfig, 'color' | 'data'> & {
85
+ readonly color: string;
86
+ readonly data: ReadonlyArray<ResolvedPieDataItem>;
87
+ }>;
88
+ export type ResolvedCandlestickItemStyleConfig = Readonly<Required<CandlestickItemStyleConfig>>;
89
+ export type ResolvedCandlestickSeriesConfig = Readonly<Omit<CandlestickSeriesConfig, 'color' | 'style' | 'itemStyle' | 'barWidth' | 'barMinWidth' | 'barMaxWidth' | 'sampling' | 'samplingThreshold' | 'data'> & {
90
+ readonly color: string;
91
+ readonly style: CandlestickStyle;
92
+ readonly itemStyle: ResolvedCandlestickItemStyleConfig;
93
+ readonly barWidth: number | string;
94
+ readonly barMinWidth: number;
95
+ readonly barMaxWidth: number;
96
+ readonly sampling: 'none' | 'ohlc';
97
+ readonly samplingThreshold: number;
98
+ /** Original (unsampled) series data. */
99
+ readonly rawData: Readonly<CandlestickSeriesConfig['data']>;
100
+ readonly data: Readonly<CandlestickSeriesConfig['data']>;
101
+ /**
102
+ * Bounds computed from the original (unsampled) data. Used for axis auto-bounds so sampling
103
+ * cannot clip outliers.
104
+ */
105
+ readonly rawBounds?: RawBounds;
106
+ }>;
107
+ export type ResolvedSeriesConfig = ResolvedLineSeriesConfig | ResolvedAreaSeriesConfig | ResolvedBarSeriesConfig | ResolvedScatterSeriesConfig | ResolvedPieSeriesConfig | ResolvedCandlestickSeriesConfig;
108
+ export interface ResolvedChartGPUOptions extends Omit<ChartGPUOptions, 'grid' | 'xAxis' | 'yAxis' | 'theme' | 'palette' | 'series' | 'legend'> {
109
+ readonly grid: ResolvedGridConfig;
110
+ readonly xAxis: AxisConfig;
111
+ readonly yAxis: AxisConfig;
112
+ readonly autoScroll: boolean;
113
+ readonly theme: ThemeConfig;
114
+ readonly palette: ReadonlyArray<string>;
115
+ readonly series: ReadonlyArray<ResolvedSeriesConfig>;
116
+ readonly annotations?: ReadonlyArray<AnnotationConfig>;
117
+ readonly legend?: import('./types').LegendConfig;
118
+ }
119
+ export declare function resolveOptions(userOptions?: ChartGPUOptions): ResolvedChartGPUOptions;
120
+ /**
121
+ * Resolves chart options with slider bottom-space reservation.
122
+ *
123
+ * This function wraps `resolveOptions()` and applies additional grid bottom spacing
124
+ * when a slider-type dataZoom is configured. The reservation ensures x-axis labels
125
+ * and ticks are visible above the slider overlay.
126
+ *
127
+ * **Usage**: Use this function instead of `resolveOptions()` when creating charts
128
+ * to ensure consistent slider layout.
129
+ *
130
+ * @param userOptions - User-provided chart options
131
+ * @returns Resolved options with slider bottom-space applied if needed
132
+ */
133
+ export declare function resolveOptionsForChart(userOptions?: ChartGPUOptions): ResolvedChartGPUOptions;
134
+ export declare const OptionResolver: {
135
+ readonly resolve: typeof resolveOptions;
136
+ };
137
+ //# sourceMappingURL=OptionResolver.d.ts.map