react-native-chart-kit 7.0.0-next.0 → 7.0.0-next.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 (428) hide show
  1. package/README.md +17 -0
  2. package/dist/v2/core/data/index.d.ts +3 -0
  3. package/dist/v2/core/data/index.d.ts.map +1 -0
  4. package/dist/v2/core/data/index.js +1 -0
  5. package/dist/v2/core/data/normalize.d.ts +8 -0
  6. package/dist/v2/core/data/normalize.d.ts.map +1 -0
  7. package/dist/v2/core/data/normalize.js +229 -0
  8. package/dist/v2/core/data/normalizeValues.d.ts +16 -0
  9. package/dist/v2/core/data/normalizeValues.d.ts.map +1 -0
  10. package/dist/v2/core/data/normalizeValues.js +96 -0
  11. package/dist/v2/core/data/types.d.ts +161 -0
  12. package/dist/v2/core/data/types.d.ts.map +1 -0
  13. package/dist/v2/core/data/types.js +1 -0
  14. package/dist/v2/core/geometry/areaPath.d.ts +3 -0
  15. package/dist/v2/core/geometry/areaPath.d.ts.map +1 -0
  16. package/dist/v2/core/geometry/areaPath.js +36 -0
  17. package/dist/v2/core/geometry/barRects.d.ts +44 -0
  18. package/dist/v2/core/geometry/barRects.d.ts.map +1 -0
  19. package/dist/v2/core/geometry/barRects.js +201 -0
  20. package/dist/v2/core/geometry/contributionHeatmap.d.ts +49 -0
  21. package/dist/v2/core/geometry/contributionHeatmap.d.ts.map +1 -0
  22. package/dist/v2/core/geometry/contributionHeatmap.js +107 -0
  23. package/dist/v2/core/geometry/horizontalBarRects.d.ts +27 -0
  24. package/dist/v2/core/geometry/horizontalBarRects.d.ts.map +1 -0
  25. package/dist/v2/core/geometry/horizontalBarRects.js +202 -0
  26. package/dist/v2/core/geometry/index.d.ts +12 -0
  27. package/dist/v2/core/geometry/index.d.ts.map +1 -0
  28. package/dist/v2/core/geometry/index.js +11 -0
  29. package/dist/v2/core/geometry/lineDecimation.d.ts +8 -0
  30. package/dist/v2/core/geometry/lineDecimation.d.ts.map +1 -0
  31. package/dist/v2/core/geometry/lineDecimation.js +110 -0
  32. package/dist/v2/core/geometry/linePath.d.ts +5 -0
  33. package/dist/v2/core/geometry/linePath.d.ts.map +1 -0
  34. package/dist/v2/core/geometry/linePath.js +98 -0
  35. package/dist/v2/core/geometry/lineSeries.d.ts +29 -0
  36. package/dist/v2/core/geometry/lineSeries.d.ts.map +1 -0
  37. package/dist/v2/core/geometry/lineSeries.js +51 -0
  38. package/dist/v2/core/geometry/path.d.ts +6 -0
  39. package/dist/v2/core/geometry/path.d.ts.map +1 -0
  40. package/dist/v2/core/geometry/path.js +24 -0
  41. package/dist/v2/core/geometry/pieArcs.d.ts +29 -0
  42. package/dist/v2/core/geometry/pieArcs.d.ts.map +1 -0
  43. package/dist/v2/core/geometry/pieArcs.js +142 -0
  44. package/dist/v2/core/geometry/progressRings.d.ts +30 -0
  45. package/dist/v2/core/geometry/progressRings.d.ts.map +1 -0
  46. package/dist/v2/core/geometry/progressRings.js +104 -0
  47. package/dist/v2/core/geometry/types.d.ts +32 -0
  48. package/dist/v2/core/geometry/types.d.ts.map +1 -0
  49. package/dist/v2/core/geometry/types.js +1 -0
  50. package/dist/v2/core/index.d.ts +6 -0
  51. package/dist/v2/core/index.d.ts.map +1 -0
  52. package/dist/v2/core/index.js +6 -0
  53. package/dist/v2/core/interaction/index.d.ts +5 -0
  54. package/dist/v2/core/interaction/index.d.ts.map +1 -0
  55. package/dist/v2/core/interaction/index.js +2 -0
  56. package/dist/v2/core/interaction/viewport.d.ts +71 -0
  57. package/dist/v2/core/interaction/viewport.d.ts.map +1 -0
  58. package/dist/v2/core/interaction/viewport.js +216 -0
  59. package/dist/v2/core/interaction/viewportTransform.d.ts +17 -0
  60. package/dist/v2/core/interaction/viewportTransform.d.ts.map +1 -0
  61. package/dist/v2/core/interaction/viewportTransform.js +70 -0
  62. package/dist/v2/core/layout/autoPadding.d.ts +3 -0
  63. package/dist/v2/core/layout/autoPadding.d.ts.map +1 -0
  64. package/dist/v2/core/layout/autoPadding.js +33 -0
  65. package/dist/v2/core/layout/chartBox.d.ts +5 -0
  66. package/dist/v2/core/layout/chartBox.d.ts.map +1 -0
  67. package/dist/v2/core/layout/chartBox.js +22 -0
  68. package/dist/v2/core/layout/debugLayout.d.ts +3 -0
  69. package/dist/v2/core/layout/debugLayout.d.ts.map +1 -0
  70. package/dist/v2/core/layout/debugLayout.js +20 -0
  71. package/dist/v2/core/layout/index.d.ts +8 -0
  72. package/dist/v2/core/layout/index.d.ts.map +1 -0
  73. package/dist/v2/core/layout/index.js +6 -0
  74. package/dist/v2/core/layout/labelCollision.d.ts +3 -0
  75. package/dist/v2/core/layout/labelCollision.d.ts.map +1 -0
  76. package/dist/v2/core/layout/labelCollision.js +90 -0
  77. package/dist/v2/core/layout/legendLayout.d.ts +3 -0
  78. package/dist/v2/core/layout/legendLayout.d.ts.map +1 -0
  79. package/dist/v2/core/layout/legendLayout.js +39 -0
  80. package/dist/v2/core/layout/tooltipPlacement.d.ts +3 -0
  81. package/dist/v2/core/layout/tooltipPlacement.d.ts.map +1 -0
  82. package/dist/v2/core/layout/tooltipPlacement.js +76 -0
  83. package/dist/v2/core/layout/types.d.ts +114 -0
  84. package/dist/v2/core/layout/types.d.ts.map +1 -0
  85. package/dist/v2/core/layout/types.js +1 -0
  86. package/dist/v2/core/scales/band.d.ts +15 -0
  87. package/dist/v2/core/scales/band.d.ts.map +1 -0
  88. package/dist/v2/core/scales/band.js +34 -0
  89. package/dist/v2/core/scales/domain.d.ts +6 -0
  90. package/dist/v2/core/scales/domain.d.ts.map +1 -0
  91. package/dist/v2/core/scales/domain.js +109 -0
  92. package/dist/v2/core/scales/index.d.ts +7 -0
  93. package/dist/v2/core/scales/index.d.ts.map +1 -0
  94. package/dist/v2/core/scales/index.js +5 -0
  95. package/dist/v2/core/scales/linear.d.ts +8 -0
  96. package/dist/v2/core/scales/linear.d.ts.map +1 -0
  97. package/dist/v2/core/scales/linear.js +22 -0
  98. package/dist/v2/core/scales/ticks.d.ts +4 -0
  99. package/dist/v2/core/scales/ticks.d.ts.map +1 -0
  100. package/dist/v2/core/scales/ticks.js +111 -0
  101. package/dist/v2/core/scales/time.d.ts +8 -0
  102. package/dist/v2/core/scales/time.d.ts.map +1 -0
  103. package/dist/v2/core/scales/time.js +23 -0
  104. package/dist/v2/core/scales/types.d.ts +46 -0
  105. package/dist/v2/core/scales/types.d.ts.map +1 -0
  106. package/dist/v2/core/scales/types.js +1 -0
  107. package/dist/v2/index.d.ts +1 -0
  108. package/dist/v2/index.js +1 -0
  109. package/dist/v2/react-native/charts/bar/BarChart.d.ts +6 -0
  110. package/dist/v2/react-native/charts/bar/BarChart.d.ts.map +1 -0
  111. package/dist/v2/react-native/charts/bar/BarChart.js +198 -0
  112. package/dist/v2/react-native/charts/bar/BarChartSurface.d.ts +36 -0
  113. package/dist/v2/react-native/charts/bar/BarChartSurface.d.ts.map +1 -0
  114. package/dist/v2/react-native/charts/bar/BarChartSurface.js +126 -0
  115. package/dist/v2/react-native/charts/bar/StackedBarChart.d.ts +4 -0
  116. package/dist/v2/react-native/charts/bar/StackedBarChart.d.ts.map +1 -0
  117. package/dist/v2/react-native/charts/bar/StackedBarChart.js +9 -0
  118. package/dist/v2/react-native/charts/bar/accessibility.d.ts +31 -0
  119. package/dist/v2/react-native/charts/bar/accessibility.d.ts.map +1 -0
  120. package/dist/v2/react-native/charts/bar/accessibility.js +87 -0
  121. package/dist/v2/react-native/charts/bar/interaction.d.ts +18 -0
  122. package/dist/v2/react-native/charts/bar/interaction.d.ts.map +1 -0
  123. package/dist/v2/react-native/charts/bar/interaction.js +62 -0
  124. package/dist/v2/react-native/charts/bar/model.d.ts +3 -0
  125. package/dist/v2/react-native/charts/bar/model.d.ts.map +1 -0
  126. package/dist/v2/react-native/charts/bar/model.js +326 -0
  127. package/dist/v2/react-native/charts/bar/modelUtils.d.ts +27 -0
  128. package/dist/v2/react-native/charts/bar/modelUtils.d.ts.map +1 -0
  129. package/dist/v2/react-native/charts/bar/modelUtils.js +58 -0
  130. package/dist/v2/react-native/charts/bar/options.d.ts +7 -0
  131. package/dist/v2/react-native/charts/bar/options.d.ts.map +1 -0
  132. package/dist/v2/react-native/charts/bar/options.js +49 -0
  133. package/dist/v2/react-native/charts/bar/rendererSafety.d.ts +12 -0
  134. package/dist/v2/react-native/charts/bar/rendererSafety.d.ts.map +1 -0
  135. package/dist/v2/react-native/charts/bar/rendererSafety.js +31 -0
  136. package/dist/v2/react-native/charts/bar/selectionAnimation.d.ts +42 -0
  137. package/dist/v2/react-native/charts/bar/selectionAnimation.d.ts.map +1 -0
  138. package/dist/v2/react-native/charts/bar/selectionAnimation.js +158 -0
  139. package/dist/v2/react-native/charts/bar/stackedCompat.d.ts +55 -0
  140. package/dist/v2/react-native/charts/bar/stackedCompat.d.ts.map +1 -0
  141. package/dist/v2/react-native/charts/bar/stackedCompat.js +105 -0
  142. package/dist/v2/react-native/charts/bar/tooltip.d.ts +11 -0
  143. package/dist/v2/react-native/charts/bar/tooltip.d.ts.map +1 -0
  144. package/dist/v2/react-native/charts/bar/tooltip.js +15 -0
  145. package/dist/v2/react-native/charts/bar/tooltipModel.d.ts +33 -0
  146. package/dist/v2/react-native/charts/bar/tooltipModel.d.ts.map +1 -0
  147. package/dist/v2/react-native/charts/bar/tooltipModel.js +40 -0
  148. package/dist/v2/react-native/charts/bar/tooltipPlacement.d.ts +9 -0
  149. package/dist/v2/react-native/charts/bar/tooltipPlacement.d.ts.map +1 -0
  150. package/dist/v2/react-native/charts/bar/tooltipPlacement.js +9 -0
  151. package/dist/v2/react-native/charts/bar/types.d.ts +211 -0
  152. package/dist/v2/react-native/charts/bar/types.d.ts.map +1 -0
  153. package/dist/v2/react-native/charts/bar/types.js +1 -0
  154. package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.d.ts +10 -0
  155. package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.d.ts.map +1 -0
  156. package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.js +87 -0
  157. package/dist/v2/react-native/charts/bar/viewport.d.ts +20 -0
  158. package/dist/v2/react-native/charts/bar/viewport.d.ts.map +1 -0
  159. package/dist/v2/react-native/charts/bar/viewport.js +47 -0
  160. package/dist/v2/react-native/charts/contribution/ContributionGraph.d.ts +13 -0
  161. package/dist/v2/react-native/charts/contribution/ContributionGraph.d.ts.map +1 -0
  162. package/dist/v2/react-native/charts/contribution/ContributionGraph.js +65 -0
  163. package/dist/v2/react-native/charts/contribution/accessibility.d.ts +25 -0
  164. package/dist/v2/react-native/charts/contribution/accessibility.d.ts.map +1 -0
  165. package/dist/v2/react-native/charts/contribution/accessibility.js +50 -0
  166. package/dist/v2/react-native/charts/contribution/model.d.ts +17 -0
  167. package/dist/v2/react-native/charts/contribution/model.d.ts.map +1 -0
  168. package/dist/v2/react-native/charts/contribution/model.js +102 -0
  169. package/dist/v2/react-native/charts/contribution/types.d.ts +50 -0
  170. package/dist/v2/react-native/charts/contribution/types.d.ts.map +1 -0
  171. package/dist/v2/react-native/charts/contribution/types.js +1 -0
  172. package/dist/v2/react-native/charts/line/AreaChart.d.ts +3 -0
  173. package/dist/v2/react-native/charts/line/AreaChart.d.ts.map +1 -0
  174. package/dist/v2/react-native/charts/line/AreaChart.js +3 -0
  175. package/dist/v2/react-native/charts/line/ChartSurface.d.ts +16 -0
  176. package/dist/v2/react-native/charts/line/ChartSurface.d.ts.map +1 -0
  177. package/dist/v2/react-native/charts/line/ChartSurface.js +151 -0
  178. package/dist/v2/react-native/charts/line/LineChart.d.ts +6 -0
  179. package/dist/v2/react-native/charts/line/LineChart.d.ts.map +1 -0
  180. package/dist/v2/react-native/charts/line/LineChart.js +294 -0
  181. package/dist/v2/react-native/charts/line/StickyYAxis.d.ts +15 -0
  182. package/dist/v2/react-native/charts/line/StickyYAxis.d.ts.map +1 -0
  183. package/dist/v2/react-native/charts/line/StickyYAxis.js +26 -0
  184. package/dist/v2/react-native/charts/line/accessibility.d.ts +34 -0
  185. package/dist/v2/react-native/charts/line/accessibility.d.ts.map +1 -0
  186. package/dist/v2/react-native/charts/line/accessibility.js +103 -0
  187. package/dist/v2/react-native/charts/line/axisLabels.d.ts +37 -0
  188. package/dist/v2/react-native/charts/line/axisLabels.d.ts.map +1 -0
  189. package/dist/v2/react-native/charts/line/axisLabels.js +55 -0
  190. package/dist/v2/react-native/charts/line/debugLayout.d.ts +26 -0
  191. package/dist/v2/react-native/charts/line/debugLayout.d.ts.map +1 -0
  192. package/dist/v2/react-native/charts/line/debugLayout.js +77 -0
  193. package/dist/v2/react-native/charts/line/debugOverlay.d.ts +9 -0
  194. package/dist/v2/react-native/charts/line/debugOverlay.d.ts.map +1 -0
  195. package/dist/v2/react-native/charts/line/debugOverlay.js +30 -0
  196. package/dist/v2/react-native/charts/line/defaultTooltip.d.ts +3 -0
  197. package/dist/v2/react-native/charts/line/defaultTooltip.d.ts.map +1 -0
  198. package/dist/v2/react-native/charts/line/defaultTooltip.js +17 -0
  199. package/dist/v2/react-native/charts/line/interaction.d.ts +82 -0
  200. package/dist/v2/react-native/charts/line/interaction.d.ts.map +1 -0
  201. package/dist/v2/react-native/charts/line/interaction.js +94 -0
  202. package/dist/v2/react-native/charts/line/legend.d.ts +35 -0
  203. package/dist/v2/react-native/charts/line/legend.d.ts.map +1 -0
  204. package/dist/v2/react-native/charts/line/legend.js +95 -0
  205. package/dist/v2/react-native/charts/line/markers.d.ts +11 -0
  206. package/dist/v2/react-native/charts/line/markers.d.ts.map +1 -0
  207. package/dist/v2/react-native/charts/line/markers.js +52 -0
  208. package/dist/v2/react-native/charts/line/options.d.ts +172 -0
  209. package/dist/v2/react-native/charts/line/options.d.ts.map +1 -0
  210. package/dist/v2/react-native/charts/line/options.js +168 -0
  211. package/dist/v2/react-native/charts/line/outsidePressSurfaces.d.ts +15 -0
  212. package/dist/v2/react-native/charts/line/outsidePressSurfaces.d.ts.map +1 -0
  213. package/dist/v2/react-native/charts/line/outsidePressSurfaces.js +37 -0
  214. package/dist/v2/react-native/charts/line/overviewProps.d.ts +45 -0
  215. package/dist/v2/react-native/charts/line/overviewProps.d.ts.map +1 -0
  216. package/dist/v2/react-native/charts/line/overviewProps.js +4 -0
  217. package/dist/v2/react-native/charts/line/rangeSelector.d.ts +19 -0
  218. package/dist/v2/react-native/charts/line/rangeSelector.d.ts.map +1 -0
  219. package/dist/v2/react-native/charts/line/rangeSelector.js +176 -0
  220. package/dist/v2/react-native/charts/line/rangeSelectorConfig.d.ts +38 -0
  221. package/dist/v2/react-native/charts/line/rangeSelectorConfig.d.ts.map +1 -0
  222. package/dist/v2/react-native/charts/line/rangeSelectorConfig.js +41 -0
  223. package/dist/v2/react-native/charts/line/referenceLabelPlacement.d.ts +21 -0
  224. package/dist/v2/react-native/charts/line/referenceLabelPlacement.d.ts.map +1 -0
  225. package/dist/v2/react-native/charts/line/referenceLabelPlacement.js +113 -0
  226. package/dist/v2/react-native/charts/line/references.d.ts +62 -0
  227. package/dist/v2/react-native/charts/line/references.d.ts.map +1 -0
  228. package/dist/v2/react-native/charts/line/references.js +156 -0
  229. package/dist/v2/react-native/charts/line/renderer.d.ts +4 -0
  230. package/dist/v2/react-native/charts/line/renderer.d.ts.map +1 -0
  231. package/dist/v2/react-native/charts/line/renderer.js +23 -0
  232. package/dist/v2/react-native/charts/line/responders.d.ts +13 -0
  233. package/dist/v2/react-native/charts/line/responders.d.ts.map +1 -0
  234. package/dist/v2/react-native/charts/line/responders.js +59 -0
  235. package/dist/v2/react-native/charts/line/selection.d.ts +31 -0
  236. package/dist/v2/react-native/charts/line/selection.d.ts.map +1 -0
  237. package/dist/v2/react-native/charts/line/selection.js +26 -0
  238. package/dist/v2/react-native/charts/line/seriesInput.d.ts +4 -0
  239. package/dist/v2/react-native/charts/line/seriesInput.d.ts.map +1 -0
  240. package/dist/v2/react-native/charts/line/seriesInput.js +13 -0
  241. package/dist/v2/react-native/charts/line/seriesStyles.d.ts +20 -0
  242. package/dist/v2/react-native/charts/line/seriesStyles.d.ts.map +1 -0
  243. package/dist/v2/react-native/charts/line/seriesStyles.js +33 -0
  244. package/dist/v2/react-native/charts/line/stickyYAxisLayout.d.ts +6 -0
  245. package/dist/v2/react-native/charts/line/stickyYAxisLayout.d.ts.map +1 -0
  246. package/dist/v2/react-native/charts/line/stickyYAxisLayout.js +2 -0
  247. package/dist/v2/react-native/charts/line/text.d.ts +7 -0
  248. package/dist/v2/react-native/charts/line/text.d.ts.map +1 -0
  249. package/dist/v2/react-native/charts/line/text.js +7 -0
  250. package/dist/v2/react-native/charts/line/thresholdRendering.d.ts +28 -0
  251. package/dist/v2/react-native/charts/line/thresholdRendering.d.ts.map +1 -0
  252. package/dist/v2/react-native/charts/line/thresholdRendering.js +145 -0
  253. package/dist/v2/react-native/charts/line/tooltip.d.ts +70 -0
  254. package/dist/v2/react-native/charts/line/tooltip.d.ts.map +1 -0
  255. package/dist/v2/react-native/charts/line/tooltip.js +87 -0
  256. package/dist/v2/react-native/charts/line/types.d.ts +371 -0
  257. package/dist/v2/react-native/charts/line/types.d.ts.map +1 -0
  258. package/dist/v2/react-native/charts/line/types.js +1 -0
  259. package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.d.ts +13 -0
  260. package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.d.ts.map +1 -0
  261. package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.js +84 -0
  262. package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.d.ts +5 -0
  263. package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.d.ts.map +1 -0
  264. package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.js +141 -0
  265. package/dist/v2/react-native/charts/line/useChartModel.d.ts +103 -0
  266. package/dist/v2/react-native/charts/line/useChartModel.d.ts.map +1 -0
  267. package/dist/v2/react-native/charts/line/useChartModel.js +367 -0
  268. package/dist/v2/react-native/charts/line/useDebugLayout.d.ts +16 -0
  269. package/dist/v2/react-native/charts/line/useDebugLayout.d.ts.map +1 -0
  270. package/dist/v2/react-native/charts/line/useDebugLayout.js +35 -0
  271. package/dist/v2/react-native/charts/line/utils.d.ts +10 -0
  272. package/dist/v2/react-native/charts/line/utils.d.ts.map +1 -0
  273. package/dist/v2/react-native/charts/line/utils.js +40 -0
  274. package/dist/v2/react-native/charts/line/viewportInteraction.d.ts +3 -0
  275. package/dist/v2/react-native/charts/line/viewportInteraction.d.ts.map +1 -0
  276. package/dist/v2/react-native/charts/line/viewportInteraction.js +1 -0
  277. package/dist/v2/react-native/charts/line/viewportInteractionConfig.d.ts +3 -0
  278. package/dist/v2/react-native/charts/line/viewportInteractionConfig.d.ts.map +1 -0
  279. package/dist/v2/react-native/charts/line/viewportInteractionConfig.js +1 -0
  280. package/dist/v2/react-native/charts/line/viewportPinchZoom.d.ts +2 -0
  281. package/dist/v2/react-native/charts/line/viewportPinchZoom.d.ts.map +1 -0
  282. package/dist/v2/react-native/charts/line/viewportPinchZoom.js +1 -0
  283. package/dist/v2/react-native/charts/line/xLabelCandidates.d.ts +13 -0
  284. package/dist/v2/react-native/charts/line/xLabelCandidates.d.ts.map +1 -0
  285. package/dist/v2/react-native/charts/line/xLabelCandidates.js +23 -0
  286. package/dist/v2/react-native/charts/line/xLabels.d.ts +39 -0
  287. package/dist/v2/react-native/charts/line/xLabels.d.ts.map +1 -0
  288. package/dist/v2/react-native/charts/line/xLabels.js +289 -0
  289. package/dist/v2/react-native/charts/line/xScale.d.ts +6 -0
  290. package/dist/v2/react-native/charts/line/xScale.d.ts.map +1 -0
  291. package/dist/v2/react-native/charts/line/xScale.js +25 -0
  292. package/dist/v2/react-native/charts/line/yAxisModel.d.ts +29 -0
  293. package/dist/v2/react-native/charts/line/yAxisModel.d.ts.map +1 -0
  294. package/dist/v2/react-native/charts/line/yAxisModel.js +39 -0
  295. package/dist/v2/react-native/charts/pie/PieChart.d.ts +7 -0
  296. package/dist/v2/react-native/charts/pie/PieChart.d.ts.map +1 -0
  297. package/dist/v2/react-native/charts/pie/PieChart.js +244 -0
  298. package/dist/v2/react-native/charts/pie/accessibility.d.ts +28 -0
  299. package/dist/v2/react-native/charts/pie/accessibility.d.ts.map +1 -0
  300. package/dist/v2/react-native/charts/pie/accessibility.js +49 -0
  301. package/dist/v2/react-native/charts/pie/activeSlice.d.ts +15 -0
  302. package/dist/v2/react-native/charts/pie/activeSlice.d.ts.map +1 -0
  303. package/dist/v2/react-native/charts/pie/activeSlice.js +26 -0
  304. package/dist/v2/react-native/charts/pie/arcLabels.d.ts +32 -0
  305. package/dist/v2/react-native/charts/pie/arcLabels.d.ts.map +1 -0
  306. package/dist/v2/react-native/charts/pie/arcLabels.js +191 -0
  307. package/dist/v2/react-native/charts/pie/interaction.d.ts +26 -0
  308. package/dist/v2/react-native/charts/pie/interaction.d.ts.map +1 -0
  309. package/dist/v2/react-native/charts/pie/interaction.js +66 -0
  310. package/dist/v2/react-native/charts/pie/model.d.ts +15 -0
  311. package/dist/v2/react-native/charts/pie/model.d.ts.map +1 -0
  312. package/dist/v2/react-native/charts/pie/model.js +157 -0
  313. package/dist/v2/react-native/charts/pie/selectionAnimation.d.ts +33 -0
  314. package/dist/v2/react-native/charts/pie/selectionAnimation.d.ts.map +1 -0
  315. package/dist/v2/react-native/charts/pie/selectionAnimation.js +121 -0
  316. package/dist/v2/react-native/charts/pie/sliceSeparator.d.ts +7 -0
  317. package/dist/v2/react-native/charts/pie/sliceSeparator.d.ts.map +1 -0
  318. package/dist/v2/react-native/charts/pie/sliceSeparator.js +26 -0
  319. package/dist/v2/react-native/charts/pie/slices.d.ts +20 -0
  320. package/dist/v2/react-native/charts/pie/slices.d.ts.map +1 -0
  321. package/dist/v2/react-native/charts/pie/slices.js +54 -0
  322. package/dist/v2/react-native/charts/pie/types.d.ts +165 -0
  323. package/dist/v2/react-native/charts/pie/types.d.ts.map +1 -0
  324. package/dist/v2/react-native/charts/pie/types.js +1 -0
  325. package/dist/v2/react-native/charts/progress/ProgressChart.d.ts +7 -0
  326. package/dist/v2/react-native/charts/progress/ProgressChart.d.ts.map +1 -0
  327. package/dist/v2/react-native/charts/progress/ProgressChart.js +111 -0
  328. package/dist/v2/react-native/charts/progress/accessibility.d.ts +26 -0
  329. package/dist/v2/react-native/charts/progress/accessibility.d.ts.map +1 -0
  330. package/dist/v2/react-native/charts/progress/accessibility.js +71 -0
  331. package/dist/v2/react-native/charts/progress/animation.d.ts +36 -0
  332. package/dist/v2/react-native/charts/progress/animation.d.ts.map +1 -0
  333. package/dist/v2/react-native/charts/progress/animation.js +103 -0
  334. package/dist/v2/react-native/charts/progress/model.d.ts +14 -0
  335. package/dist/v2/react-native/charts/progress/model.d.ts.map +1 -0
  336. package/dist/v2/react-native/charts/progress/model.js +133 -0
  337. package/dist/v2/react-native/charts/progress/types.d.ts +72 -0
  338. package/dist/v2/react-native/charts/progress/types.d.ts.map +1 -0
  339. package/dist/v2/react-native/charts/progress/types.js +1 -0
  340. package/dist/v2/react-native/index.d.ts +24 -0
  341. package/dist/v2/react-native/index.d.ts.map +1 -0
  342. package/dist/v2/react-native/index.js +14 -0
  343. package/dist/v2/react-native/selection/ChartSelectionProvider.d.ts +27 -0
  344. package/dist/v2/react-native/selection/ChartSelectionProvider.d.ts.map +1 -0
  345. package/dist/v2/react-native/selection/ChartSelectionProvider.js +92 -0
  346. package/dist/v2/react-native/selection/index.d.ts +2 -0
  347. package/dist/v2/react-native/selection/index.d.ts.map +1 -0
  348. package/dist/v2/react-native/selection/index.js +1 -0
  349. package/dist/v2/react-native/selection/scope.d.ts +16 -0
  350. package/dist/v2/react-native/selection/scope.d.ts.map +1 -0
  351. package/dist/v2/react-native/selection/scope.js +18 -0
  352. package/dist/v2/react-native/theme/index.d.ts +4 -0
  353. package/dist/v2/react-native/theme/index.d.ts.map +1 -0
  354. package/dist/v2/react-native/theme/index.js +2 -0
  355. package/dist/v2/react-native/theme/presets.d.ts +84 -0
  356. package/dist/v2/react-native/theme/presets.d.ts.map +1 -0
  357. package/dist/v2/react-native/theme/presets.js +298 -0
  358. package/dist/v2/react-native/theme/provider.d.ts +20 -0
  359. package/dist/v2/react-native/theme/provider.d.ts.map +1 -0
  360. package/dist/v2/react-native/theme/provider.js +27 -0
  361. package/dist/v2/react-native/viewport/bounds.d.ts +7 -0
  362. package/dist/v2/react-native/viewport/bounds.d.ts.map +1 -0
  363. package/dist/v2/react-native/viewport/bounds.js +7 -0
  364. package/dist/v2/react-native/viewport/config.d.ts +13 -0
  365. package/dist/v2/react-native/viewport/config.d.ts.map +1 -0
  366. package/dist/v2/react-native/viewport/config.js +64 -0
  367. package/dist/v2/react-native/viewport/pan.d.ts +23 -0
  368. package/dist/v2/react-native/viewport/pan.d.ts.map +1 -0
  369. package/dist/v2/react-native/viewport/pan.js +110 -0
  370. package/dist/v2/react-native/viewport/panResponder.d.ts +14 -0
  371. package/dist/v2/react-native/viewport/panResponder.d.ts.map +1 -0
  372. package/dist/v2/react-native/viewport/panResponder.js +115 -0
  373. package/dist/v2/react-native/viewport/pinchZoom.d.ts +17 -0
  374. package/dist/v2/react-native/viewport/pinchZoom.d.ts.map +1 -0
  375. package/dist/v2/react-native/viewport/pinchZoom.js +131 -0
  376. package/dist/v2/react-native/viewport/types.d.ts +55 -0
  377. package/dist/v2/react-native/viewport/types.d.ts.map +1 -0
  378. package/dist/v2/react-native/viewport/types.js +1 -0
  379. package/dist/v2/svg-renderer/capabilities.d.ts +3 -0
  380. package/dist/v2/svg-renderer/capabilities.d.ts.map +1 -0
  381. package/dist/v2/svg-renderer/capabilities.js +12 -0
  382. package/dist/v2/svg-renderer/clipPath.d.ts +4 -0
  383. package/dist/v2/svg-renderer/clipPath.d.ts.map +1 -0
  384. package/dist/v2/svg-renderer/clipPath.js +35 -0
  385. package/dist/v2/svg-renderer/defs.d.ts +6 -0
  386. package/dist/v2/svg-renderer/defs.d.ts.map +1 -0
  387. package/dist/v2/svg-renderer/defs.js +18 -0
  388. package/dist/v2/svg-renderer/ensureConsole.d.ts +4 -0
  389. package/dist/v2/svg-renderer/ensureConsole.d.ts.map +1 -0
  390. package/dist/v2/svg-renderer/ensureConsole.js +54 -0
  391. package/dist/v2/svg-renderer/hitRegions.d.ts +3 -0
  392. package/dist/v2/svg-renderer/hitRegions.d.ts.map +1 -0
  393. package/dist/v2/svg-renderer/hitRegions.js +6 -0
  394. package/dist/v2/svg-renderer/index.d.ts +14 -0
  395. package/dist/v2/svg-renderer/index.d.ts.map +1 -0
  396. package/dist/v2/svg-renderer/index.js +13 -0
  397. package/dist/v2/svg-renderer/layerOrder.d.ts +19 -0
  398. package/dist/v2/svg-renderer/layerOrder.d.ts.map +1 -0
  399. package/dist/v2/svg-renderer/layerOrder.js +18 -0
  400. package/dist/v2/svg-renderer/layers.d.ts +3 -0
  401. package/dist/v2/svg-renderer/layers.d.ts.map +1 -0
  402. package/dist/v2/svg-renderer/layers.js +4 -0
  403. package/dist/v2/svg-renderer/primitives.d.ts +12 -0
  404. package/dist/v2/svg-renderer/primitives.d.ts.map +1 -0
  405. package/dist/v2/svg-renderer/primitives.js +13 -0
  406. package/dist/v2/svg-renderer/renderer.d.ts +4 -0
  407. package/dist/v2/svg-renderer/renderer.d.ts.map +1 -0
  408. package/dist/v2/svg-renderer/renderer.js +24 -0
  409. package/dist/v2/svg-renderer/symbolGeometry.d.ts +6 -0
  410. package/dist/v2/svg-renderer/symbolGeometry.d.ts.map +1 -0
  411. package/dist/v2/svg-renderer/symbolGeometry.js +10 -0
  412. package/dist/v2/svg-renderer/symbols.d.ts +3 -0
  413. package/dist/v2/svg-renderer/symbols.d.ts.map +1 -0
  414. package/dist/v2/svg-renderer/symbols.js +23 -0
  415. package/dist/v2/svg-renderer/testIds.d.ts +2 -0
  416. package/dist/v2/svg-renderer/testIds.d.ts.map +1 -0
  417. package/dist/v2/svg-renderer/testIds.js +10 -0
  418. package/dist/v2/svg-renderer/textMeasurement.d.ts +4 -0
  419. package/dist/v2/svg-renderer/textMeasurement.d.ts.map +1 -0
  420. package/dist/v2/svg-renderer/textMeasurement.js +37 -0
  421. package/dist/v2/svg-renderer/types.d.ts +134 -0
  422. package/dist/v2/svg-renderer/types.d.ts.map +1 -0
  423. package/dist/v2/svg-renderer/types.js +1 -0
  424. package/package.json +46 -47
  425. package/v2/index.d.ts +1 -0
  426. package/v2/index.js +1 -0
  427. package/v2/package.json +6 -0
  428. package/scripts/chartkit-codemod.mjs +0 -256
@@ -0,0 +1,201 @@
1
+ const defaultBarWidthRatio = 0.72;
2
+ const defaultBarGapRatio = 0.12;
3
+ const clampRatio = (value, fallback) => typeof value === "number" && Number.isFinite(value)
4
+ ? Math.max(0, Math.min(1, value))
5
+ : fallback;
6
+ const isFinitePosition = (value) => typeof value === "number" && Number.isFinite(value);
7
+ const buildRect = ({ baselineY, dataIndex, heightValue, raw, scaledValue, series, seriesIndex, value, width, x, xValue, yScale }) => {
8
+ const valueY = yScale(heightValue);
9
+ if (!isFinitePosition(valueY)) {
10
+ return undefined;
11
+ }
12
+ return {
13
+ key: `${series.key}-${dataIndex}`,
14
+ seriesKey: series.key,
15
+ seriesLabel: series.label,
16
+ seriesIndex,
17
+ dataIndex,
18
+ xValue,
19
+ value,
20
+ scaledValue,
21
+ x,
22
+ y: Math.min(valueY, baselineY),
23
+ width,
24
+ height: Math.abs(baselineY - valueY),
25
+ baselineY,
26
+ defined: true,
27
+ raw
28
+ };
29
+ };
30
+ const getSeriesPoint = (series, rowIndex) => series.points[rowIndex];
31
+ const getSeriesRowCount = (series) => Math.max(0, ...series.map((item) => item.points.length));
32
+ const getStackTotals = (series, rowIndex) => {
33
+ let positive = 0;
34
+ let negative = 0;
35
+ series.forEach((item) => {
36
+ const value = getSeriesPoint(item, rowIndex)?.value;
37
+ if (typeof value !== "number" || !Number.isFinite(value)) {
38
+ return;
39
+ }
40
+ if (value >= 0) {
41
+ positive += value;
42
+ }
43
+ else {
44
+ negative += Math.abs(value);
45
+ }
46
+ });
47
+ return { negative, positive };
48
+ };
49
+ const getStackedScaledValue = ({ mode, rowIndex, series, value }) => {
50
+ if (mode !== "stacked100") {
51
+ return value;
52
+ }
53
+ const totals = getStackTotals(series, rowIndex);
54
+ if (value >= 0) {
55
+ return totals.positive > 0 ? (value / totals.positive) * 100 : 0;
56
+ }
57
+ return totals.negative > 0 ? (value / totals.negative) * 100 : 0;
58
+ };
59
+ const buildGroupedBars = ({ baselineY, barGapRatio, barWidthRatio, dataIndexOffset, series, xBand, yScale }) => {
60
+ const rowCount = getSeriesRowCount(series);
61
+ const bars = [];
62
+ const seriesCount = Math.max(1, series.length);
63
+ for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
64
+ const referencePoint = series[0]?.points[rowIndex];
65
+ if (!referencePoint) {
66
+ continue;
67
+ }
68
+ const band = xBand(referencePoint.x, rowIndex + dataIndexOffset, referencePoint.raw);
69
+ if (!band || !Number.isFinite(band.x) || !Number.isFinite(band.width)) {
70
+ continue;
71
+ }
72
+ const groupWidth = band.width * barWidthRatio;
73
+ const groupX = band.x + (band.width - groupWidth) / 2;
74
+ const totalGapWidth = groupWidth * barGapRatio * Math.max(0, seriesCount - 1);
75
+ const barWidth = Math.max(0, (groupWidth - totalGapWidth) / seriesCount);
76
+ const gapWidth = seriesCount > 1 ? groupWidth * barGapRatio : 0;
77
+ series.forEach((item, seriesIndex) => {
78
+ const point = getSeriesPoint(item, rowIndex);
79
+ if (!point ||
80
+ typeof point.value !== "number" ||
81
+ !Number.isFinite(point.value)) {
82
+ return;
83
+ }
84
+ const rect = buildRect({
85
+ baselineY,
86
+ dataIndex: rowIndex + dataIndexOffset,
87
+ heightValue: point.value,
88
+ raw: point.raw,
89
+ scaledValue: point.value,
90
+ series: item,
91
+ seriesIndex,
92
+ value: point.value,
93
+ width: barWidth,
94
+ x: groupX + seriesIndex * (barWidth + gapWidth),
95
+ xValue: point.x,
96
+ yScale
97
+ });
98
+ if (rect) {
99
+ bars.push(rect);
100
+ }
101
+ });
102
+ }
103
+ return bars;
104
+ };
105
+ const buildStackedBars = ({ baselineY, barWidthRatio, dataIndexOffset, mode, series, xBand, yScale }) => {
106
+ const rowCount = getSeriesRowCount(series);
107
+ const bars = [];
108
+ for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
109
+ const referencePoint = series[0]?.points[rowIndex];
110
+ if (!referencePoint) {
111
+ continue;
112
+ }
113
+ const band = xBand(referencePoint.x, rowIndex + dataIndexOffset, referencePoint.raw);
114
+ if (!band || !Number.isFinite(band.x) || !Number.isFinite(band.width)) {
115
+ continue;
116
+ }
117
+ let positiveStart = 0;
118
+ let negativeStart = 0;
119
+ const barWidth = band.width * barWidthRatio;
120
+ const x = band.x + (band.width - barWidth) / 2;
121
+ series.forEach((item, seriesIndex) => {
122
+ const point = getSeriesPoint(item, rowIndex);
123
+ if (!point ||
124
+ typeof point.value !== "number" ||
125
+ !Number.isFinite(point.value)) {
126
+ return;
127
+ }
128
+ const scaledValue = getStackedScaledValue({
129
+ mode,
130
+ rowIndex,
131
+ series,
132
+ value: point.value
133
+ });
134
+ const stackStart = scaledValue >= 0 ? positiveStart : negativeStart;
135
+ const stackEnd = stackStart + scaledValue;
136
+ const stackStartY = yScale(stackStart);
137
+ const stackEndY = yScale(stackEnd);
138
+ if (!isFinitePosition(stackStartY) || !isFinitePosition(stackEndY)) {
139
+ return;
140
+ }
141
+ const rect = {
142
+ key: `${item.key}-${rowIndex + dataIndexOffset}`,
143
+ seriesKey: item.key,
144
+ seriesLabel: item.label,
145
+ seriesIndex,
146
+ dataIndex: rowIndex + dataIndexOffset,
147
+ xValue: point.x,
148
+ value: point.value,
149
+ scaledValue,
150
+ x,
151
+ y: Math.min(stackStartY, stackEndY),
152
+ width: barWidth,
153
+ height: Math.abs(stackStartY - stackEndY),
154
+ baselineY,
155
+ defined: true,
156
+ raw: point.raw,
157
+ stackStart,
158
+ stackEnd
159
+ };
160
+ bars.push(rect);
161
+ if (scaledValue >= 0) {
162
+ positiveStart = stackEnd;
163
+ }
164
+ else {
165
+ negativeStart = stackEnd;
166
+ }
167
+ });
168
+ }
169
+ return bars;
170
+ };
171
+ export const buildBarGeometry = ({ series, xBand, yScale, mode = "grouped", baselineValue = 0, barWidthRatio: rawBarWidthRatio, barGapRatio: rawBarGapRatio, dataIndexOffset = 0 }) => {
172
+ const baselineY = yScale(baselineValue);
173
+ if (!isFinitePosition(baselineY) || series.length === 0) {
174
+ return { mode, bars: [] };
175
+ }
176
+ const barWidthRatio = clampRatio(rawBarWidthRatio, defaultBarWidthRatio);
177
+ const barGapRatio = clampRatio(rawBarGapRatio, defaultBarGapRatio);
178
+ const bars = mode === "grouped"
179
+ ? buildGroupedBars({
180
+ baselineY,
181
+ barGapRatio,
182
+ barWidthRatio,
183
+ dataIndexOffset,
184
+ series,
185
+ xBand,
186
+ yScale
187
+ })
188
+ : buildStackedBars({
189
+ baselineY,
190
+ barWidthRatio,
191
+ dataIndexOffset,
192
+ mode,
193
+ series,
194
+ xBand,
195
+ yScale
196
+ });
197
+ return {
198
+ mode,
199
+ bars
200
+ };
201
+ };
@@ -0,0 +1,49 @@
1
+ import type { NormalizedContributionData } from "../data";
2
+ export type ContributionHeatmapCell<TData = unknown> = {
3
+ index: number;
4
+ date: Date;
5
+ value: number | null;
6
+ defined: boolean;
7
+ outOfRange: boolean;
8
+ weekIndex: number;
9
+ weekdayIndex: number;
10
+ x: number;
11
+ y: number;
12
+ size: number;
13
+ raw?: TData;
14
+ };
15
+ export type ContributionHeatmapMonthLabel = {
16
+ key: string;
17
+ date: Date;
18
+ monthIndex: number;
19
+ x: number;
20
+ y: number;
21
+ };
22
+ export type ContributionHeatmapWeekdayLabel = {
23
+ key: string;
24
+ weekdayIndex: number;
25
+ dayIndex: number;
26
+ x: number;
27
+ y: number;
28
+ };
29
+ export type ContributionHeatmapModel<TData = unknown> = {
30
+ cells: Array<ContributionHeatmapCell<TData>>;
31
+ monthLabels: ContributionHeatmapMonthLabel[];
32
+ weekdayLabels: ContributionHeatmapWeekdayLabel[];
33
+ width: number;
34
+ height: number;
35
+ weekCount: number;
36
+ valueMin: number;
37
+ valueMax: number;
38
+ };
39
+ export type BuildContributionHeatmapOptions<TData = unknown> = {
40
+ data: NormalizedContributionData<TData>;
41
+ cellSize: number;
42
+ gutterSize?: number | undefined;
43
+ weekStartsOn?: number | undefined;
44
+ showOutOfRangeDays?: boolean | undefined;
45
+ monthLabelHeight?: number | undefined;
46
+ weekdayLabelWidth?: number | undefined;
47
+ };
48
+ export declare const buildContributionHeatmap: <TData = unknown>({ data, cellSize, gutterSize, weekStartsOn, showOutOfRangeDays, monthLabelHeight, weekdayLabelWidth }: BuildContributionHeatmapOptions<TData>) => ContributionHeatmapModel<TData>;
49
+ //# sourceMappingURL=contributionHeatmap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contributionHeatmap.d.ts","sourceRoot":"","sources":["../../src/geometry/contributionHeatmap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,uBAAuB,CAAC,KAAK,GAAG,OAAO,IAAI;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,wBAAwB,CAAC,KAAK,GAAG,OAAO,IAAI;IACtD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC7C,aAAa,EAAE,+BAA+B,EAAE,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,+BAA+B,CAAC,KAAK,GAAG,OAAO,IAAI;IAC7D,IAAI,EAAE,0BAA0B,CAAC,KAAK,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC;AA2BF,eAAO,MAAM,wBAAwB,GAAI,KAAK,GAAG,OAAO,EAAE,uGAQvD,+BAA+B,CAAC,KAAK,CAAC,KAAG,wBAAwB,CAAC,KAAK,CAgHzE,CAAC"}
@@ -0,0 +1,107 @@
1
+ const daysInWeek = 7;
2
+ const defaultMonthLabelHeight = 18;
3
+ const defaultWeekdayLabelWidth = 28;
4
+ const millisecondsInOneDay = 24 * 60 * 60 * 1000;
5
+ const clampInteger = (value, min, max) => {
6
+ if (!Number.isFinite(value)) {
7
+ return min;
8
+ }
9
+ return Math.min(Math.max(Math.floor(value), min), max);
10
+ };
11
+ const shiftDate = (date, numDays) => {
12
+ const shiftedDate = new Date(date);
13
+ shiftedDate.setDate(shiftedDate.getDate() + numDays);
14
+ return shiftedDate;
15
+ };
16
+ const getDayOffset = (date, weekStartsOn) => (date.getDay() - weekStartsOn + daysInWeek) % daysInWeek;
17
+ const getDayIndex = (date, startDate) => Math.round((date.valueOf() - startDate.valueOf()) / millisecondsInOneDay);
18
+ export const buildContributionHeatmap = ({ data, cellSize, gutterSize = 3, weekStartsOn = 0, showOutOfRangeDays = false, monthLabelHeight = defaultMonthLabelHeight, weekdayLabelWidth = defaultWeekdayLabelWidth }) => {
19
+ const safeCellSize = Number.isFinite(cellSize) && cellSize > 0 ? cellSize : 0;
20
+ const safeGutterSize = Number.isFinite(gutterSize) && gutterSize >= 0 ? gutterSize : 0;
21
+ const safeWeekStartsOn = clampInteger(weekStartsOn, 0, daysInWeek - 1);
22
+ const safeMonthLabelHeight = Number.isFinite(monthLabelHeight) && monthLabelHeight > 0
23
+ ? monthLabelHeight
24
+ : 0;
25
+ const safeWeekdayLabelWidth = Number.isFinite(weekdayLabelWidth) && weekdayLabelWidth > 0
26
+ ? weekdayLabelWidth
27
+ : 0;
28
+ const startOffset = getDayOffset(data.startDate, safeWeekStartsOn);
29
+ const totalSlots = startOffset + data.days.length;
30
+ const endOffset = totalSlots % daysInWeek === 0 ? 0 : daysInWeek - (totalSlots % daysInWeek);
31
+ const weekCount = Math.ceil((totalSlots + endOffset) / daysInWeek);
32
+ const step = safeCellSize + safeGutterSize;
33
+ const firstSlotDate = shiftDate(data.startDate, -startOffset);
34
+ const daysByIndex = new Map(data.days.map((day) => [day.index, day]));
35
+ const cells = Array.from({ length: weekCount * daysInWeek }, (_, slotIndex) => {
36
+ const weekIndex = Math.floor(slotIndex / daysInWeek);
37
+ const weekdayIndex = slotIndex % daysInWeek;
38
+ const date = shiftDate(firstSlotDate, slotIndex);
39
+ const inRangeIndex = getDayIndex(date, data.startDate);
40
+ const day = inRangeIndex >= 0 && inRangeIndex < data.days.length
41
+ ? daysByIndex.get(inRangeIndex)
42
+ : undefined;
43
+ const outOfRange = day === undefined;
44
+ const cell = {
45
+ index: day?.index ?? -1,
46
+ date,
47
+ value: day?.value ?? null,
48
+ defined: day?.defined ?? false,
49
+ outOfRange,
50
+ weekIndex,
51
+ weekdayIndex,
52
+ x: safeWeekdayLabelWidth + weekIndex * step,
53
+ y: safeMonthLabelHeight + weekdayIndex * step,
54
+ size: safeCellSize
55
+ };
56
+ if (day?.raw !== undefined) {
57
+ cell.raw = day.raw;
58
+ }
59
+ return cell;
60
+ }).filter((cell) => showOutOfRangeDays || !cell.outOfRange);
61
+ const visibleValues = cells
62
+ .map((cell) => cell.value)
63
+ .filter((value) => value !== null && Number.isFinite(value));
64
+ const valueMin = visibleValues.length > 0 ? Math.min(...visibleValues) : 0;
65
+ const valueMax = visibleValues.length > 0 ? Math.max(...visibleValues) : 0;
66
+ const monthLabels = [];
67
+ const seenMonths = new Set();
68
+ data.days.forEach((day) => {
69
+ if (day.date.getDate() !== 1 && day.index !== 0) {
70
+ return;
71
+ }
72
+ const slotIndex = startOffset + day.index;
73
+ const weekIndex = Math.floor(slotIndex / daysInWeek);
74
+ const key = `${day.date.getFullYear()}-${day.date.getMonth()}`;
75
+ if (seenMonths.has(key)) {
76
+ return;
77
+ }
78
+ seenMonths.add(key);
79
+ monthLabels.push({
80
+ key,
81
+ date: day.date,
82
+ monthIndex: day.date.getMonth(),
83
+ x: safeWeekdayLabelWidth + weekIndex * step,
84
+ y: Math.max(10, safeMonthLabelHeight - 6)
85
+ });
86
+ });
87
+ const weekdayLabels = [1, 3, 5].map((weekdayIndex) => {
88
+ const dayIndex = (safeWeekStartsOn + weekdayIndex) % daysInWeek;
89
+ return {
90
+ key: `weekday-${weekdayIndex}`,
91
+ weekdayIndex,
92
+ dayIndex,
93
+ x: 0,
94
+ y: safeMonthLabelHeight + weekdayIndex * step + safeCellSize * 0.75
95
+ };
96
+ });
97
+ return {
98
+ cells,
99
+ monthLabels,
100
+ weekdayLabels,
101
+ width: safeWeekdayLabelWidth + Math.max(0, weekCount * step - safeGutterSize),
102
+ height: safeMonthLabelHeight + Math.max(0, daysInWeek * step - safeGutterSize),
103
+ weekCount,
104
+ valueMin,
105
+ valueMax
106
+ };
107
+ };
@@ -0,0 +1,27 @@
1
+ import type { ChartXValue, NormalizedSeries } from "../data";
2
+ import type { BarGeometryMode, ProjectBarValueScale, ProjectedBarRect } from "./barRects";
3
+ export type ProjectedHorizontalBarBand<TData = unknown> = {
4
+ y: number;
5
+ height: number;
6
+ raw?: TData;
7
+ };
8
+ export type ProjectHorizontalBarBand<TData = unknown> = (value: ChartXValue, dataIndex: number, raw: TData | undefined) => ProjectedHorizontalBarBand<TData> | undefined;
9
+ export type ProjectedHorizontalBarRect<TData = unknown> = ProjectedBarRect<TData> & {
10
+ baselineX: number;
11
+ };
12
+ export type HorizontalBarGeometry<TData = unknown> = {
13
+ mode: BarGeometryMode;
14
+ bars: Array<ProjectedHorizontalBarRect<TData>>;
15
+ };
16
+ export type BuildHorizontalBarGeometryOptions<TData = unknown> = {
17
+ series: Array<NormalizedSeries<TData>>;
18
+ yBand: ProjectHorizontalBarBand<TData>;
19
+ xScale: ProjectBarValueScale;
20
+ mode?: BarGeometryMode;
21
+ baselineValue?: number;
22
+ barWidthRatio?: number;
23
+ barGapRatio?: number;
24
+ dataIndexOffset?: number;
25
+ };
26
+ export declare const buildHorizontalBarGeometry: <TData = unknown>({ series, yBand, xScale, mode, baselineValue, barWidthRatio: rawBarWidthRatio, barGapRatio: rawBarGapRatio, dataIndexOffset }: BuildHorizontalBarGeometryOptions<TData>) => HorizontalBarGeometry<TData>;
27
+ //# sourceMappingURL=horizontalBarRects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontalBarRects.d.ts","sourceRoot":"","sources":["../../src/geometry/horizontalBarRects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,0BAA0B,CAAC,KAAK,GAAG,OAAO,IAAI;IACxD,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,wBAAwB,CAAC,KAAK,GAAG,OAAO,IAAI,CACtD,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,KAAK,GAAG,SAAS,KACnB,0BAA0B,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,CAAC,KAAK,GAAG,OAAO,IACpD,gBAAgB,CAAC,KAAK,CAAC,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEJ,MAAM,MAAM,qBAAqB,CAAC,KAAK,GAAG,OAAO,IAAI;IACnD,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,KAAK,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,iCAAiC,CAAC,KAAK,GAAG,OAAO,IAAI;IAC/D,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AA8SF,eAAO,MAAM,0BAA0B,GAAI,KAAK,GAAG,OAAO,EAAE,+HASzD,iCAAiC,CAAC,KAAK,CAAC,KAAG,qBAAqB,CAAC,KAAK,CAkCxE,CAAC"}
@@ -0,0 +1,202 @@
1
+ const defaultBarWidthRatio = 0.72;
2
+ const defaultBarGapRatio = 0.12;
3
+ const clampRatio = (value, fallback) => typeof value === "number" && Number.isFinite(value)
4
+ ? Math.max(0, Math.min(1, value))
5
+ : fallback;
6
+ const isFinitePosition = (value) => typeof value === "number" && Number.isFinite(value);
7
+ const getSeriesPoint = (series, rowIndex) => series.points[rowIndex];
8
+ const getSeriesRowCount = (series) => Math.max(0, ...series.map((item) => item.points.length));
9
+ const getStackTotals = (series, rowIndex) => {
10
+ let positive = 0;
11
+ let negative = 0;
12
+ series.forEach((item) => {
13
+ const value = getSeriesPoint(item, rowIndex)?.value;
14
+ if (typeof value !== "number" || !Number.isFinite(value)) {
15
+ return;
16
+ }
17
+ if (value >= 0) {
18
+ positive += value;
19
+ }
20
+ else {
21
+ negative += Math.abs(value);
22
+ }
23
+ });
24
+ return { negative, positive };
25
+ };
26
+ const getStackedScaledValue = ({ mode, rowIndex, series, value }) => {
27
+ if (mode !== "stacked100") {
28
+ return value;
29
+ }
30
+ const totals = getStackTotals(series, rowIndex);
31
+ if (value >= 0) {
32
+ return totals.positive > 0 ? (value / totals.positive) * 100 : 0;
33
+ }
34
+ return totals.negative > 0 ? (value / totals.negative) * 100 : 0;
35
+ };
36
+ const buildRect = ({ baselineX, dataIndex, height, raw, scaledValue, series, seriesIndex, value, widthValue, xScale, xValue, y }) => {
37
+ const valueX = xScale(widthValue);
38
+ if (!isFinitePosition(valueX)) {
39
+ return undefined;
40
+ }
41
+ return {
42
+ key: `${series.key}-${dataIndex}`,
43
+ seriesKey: series.key,
44
+ seriesLabel: series.label,
45
+ seriesIndex,
46
+ dataIndex,
47
+ xValue,
48
+ value,
49
+ scaledValue,
50
+ x: Math.min(valueX, baselineX),
51
+ y,
52
+ width: Math.abs(valueX - baselineX),
53
+ height,
54
+ baselineX,
55
+ baselineY: y + height / 2,
56
+ defined: true,
57
+ raw
58
+ };
59
+ };
60
+ const buildGroupedHorizontalBars = ({ baselineX, barGapRatio, barWidthRatio, dataIndexOffset, series, xScale, yBand }) => {
61
+ const rowCount = getSeriesRowCount(series);
62
+ const bars = [];
63
+ const seriesCount = Math.max(1, series.length);
64
+ for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
65
+ const referencePoint = series[0]?.points[rowIndex];
66
+ if (!referencePoint) {
67
+ continue;
68
+ }
69
+ const band = yBand(referencePoint.x, rowIndex + dataIndexOffset, referencePoint.raw);
70
+ if (!band || !Number.isFinite(band.y) || !Number.isFinite(band.height)) {
71
+ continue;
72
+ }
73
+ const groupHeight = band.height * barWidthRatio;
74
+ const groupY = band.y + (band.height - groupHeight) / 2;
75
+ const totalGapHeight = groupHeight * barGapRatio * Math.max(0, seriesCount - 1);
76
+ const barHeight = Math.max(0, (groupHeight - totalGapHeight) / seriesCount);
77
+ const gapHeight = seriesCount > 1 ? groupHeight * barGapRatio : 0;
78
+ series.forEach((item, seriesIndex) => {
79
+ const point = getSeriesPoint(item, rowIndex);
80
+ if (!point ||
81
+ typeof point.value !== "number" ||
82
+ !Number.isFinite(point.value)) {
83
+ return;
84
+ }
85
+ const rect = buildRect({
86
+ baselineX,
87
+ dataIndex: rowIndex + dataIndexOffset,
88
+ height: barHeight,
89
+ raw: point.raw,
90
+ scaledValue: point.value,
91
+ series: item,
92
+ seriesIndex,
93
+ value: point.value,
94
+ widthValue: point.value,
95
+ xScale,
96
+ xValue: point.x,
97
+ y: groupY + seriesIndex * (barHeight + gapHeight)
98
+ });
99
+ if (rect) {
100
+ bars.push(rect);
101
+ }
102
+ });
103
+ }
104
+ return bars;
105
+ };
106
+ const buildStackedHorizontalBars = ({ baselineX, barWidthRatio, dataIndexOffset, mode, series, xScale, yBand }) => {
107
+ const rowCount = getSeriesRowCount(series);
108
+ const bars = [];
109
+ for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
110
+ const referencePoint = series[0]?.points[rowIndex];
111
+ if (!referencePoint) {
112
+ continue;
113
+ }
114
+ const band = yBand(referencePoint.x, rowIndex + dataIndexOffset, referencePoint.raw);
115
+ if (!band || !Number.isFinite(band.y) || !Number.isFinite(band.height)) {
116
+ continue;
117
+ }
118
+ let positiveStart = 0;
119
+ let negativeStart = 0;
120
+ const barHeight = band.height * barWidthRatio;
121
+ const y = band.y + (band.height - barHeight) / 2;
122
+ series.forEach((item, seriesIndex) => {
123
+ const point = getSeriesPoint(item, rowIndex);
124
+ if (!point ||
125
+ typeof point.value !== "number" ||
126
+ !Number.isFinite(point.value)) {
127
+ return;
128
+ }
129
+ const scaledValue = getStackedScaledValue({
130
+ mode,
131
+ rowIndex,
132
+ series,
133
+ value: point.value
134
+ });
135
+ const stackStart = scaledValue >= 0 ? positiveStart : negativeStart;
136
+ const stackEnd = stackStart + scaledValue;
137
+ const stackStartX = xScale(stackStart);
138
+ const stackEndX = xScale(stackEnd);
139
+ if (!isFinitePosition(stackStartX) || !isFinitePosition(stackEndX)) {
140
+ return;
141
+ }
142
+ bars.push({
143
+ key: `${item.key}-${rowIndex + dataIndexOffset}`,
144
+ seriesKey: item.key,
145
+ seriesLabel: item.label,
146
+ seriesIndex,
147
+ dataIndex: rowIndex + dataIndexOffset,
148
+ xValue: point.x,
149
+ value: point.value,
150
+ scaledValue,
151
+ x: Math.min(stackStartX, stackEndX),
152
+ y,
153
+ width: Math.abs(stackEndX - stackStartX),
154
+ height: barHeight,
155
+ baselineX,
156
+ baselineY: y + barHeight / 2,
157
+ defined: true,
158
+ raw: point.raw,
159
+ stackStart,
160
+ stackEnd
161
+ });
162
+ if (scaledValue >= 0) {
163
+ positiveStart = stackEnd;
164
+ }
165
+ else {
166
+ negativeStart = stackEnd;
167
+ }
168
+ });
169
+ }
170
+ return bars;
171
+ };
172
+ export const buildHorizontalBarGeometry = ({ series, yBand, xScale, mode = "grouped", baselineValue = 0, barWidthRatio: rawBarWidthRatio, barGapRatio: rawBarGapRatio, dataIndexOffset = 0 }) => {
173
+ const baselineX = xScale(baselineValue);
174
+ if (!isFinitePosition(baselineX) || series.length === 0) {
175
+ return { mode, bars: [] };
176
+ }
177
+ const barWidthRatio = clampRatio(rawBarWidthRatio, defaultBarWidthRatio);
178
+ const barGapRatio = clampRatio(rawBarGapRatio, defaultBarGapRatio);
179
+ const bars = mode === "grouped"
180
+ ? buildGroupedHorizontalBars({
181
+ baselineX,
182
+ barGapRatio,
183
+ barWidthRatio,
184
+ dataIndexOffset,
185
+ series,
186
+ xScale,
187
+ yBand
188
+ })
189
+ : buildStackedHorizontalBars({
190
+ baselineX,
191
+ barWidthRatio,
192
+ dataIndexOffset,
193
+ mode,
194
+ series,
195
+ xScale,
196
+ yBand
197
+ });
198
+ return {
199
+ mode,
200
+ bars
201
+ };
202
+ };
@@ -0,0 +1,12 @@
1
+ export * from "./areaPath";
2
+ export * from "./barRects";
3
+ export * from "./contributionHeatmap";
4
+ export * from "./horizontalBarRects";
5
+ export * from "./lineDecimation";
6
+ export * from "./linePath";
7
+ export * from "./lineSeries";
8
+ export * from "./path";
9
+ export * from "./pieArcs";
10
+ export * from "./progressRings";
11
+ export * from "./types";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ export * from "./areaPath";
2
+ export * from "./barRects";
3
+ export * from "./contributionHeatmap";
4
+ export * from "./horizontalBarRects";
5
+ export * from "./lineDecimation";
6
+ export * from "./linePath";
7
+ export * from "./lineSeries";
8
+ export * from "./path";
9
+ export * from "./pieArcs";
10
+ export * from "./progressRings";
11
+ export * from "./types";
@@ -0,0 +1,8 @@
1
+ import type { GeometryPoint, LinePathDecimationConfig } from "./types";
2
+ export declare const splitLinePathSegments: <TPoint extends GeometryPoint = GeometryPoint>(points: TPoint[], connectNulls?: boolean) => TPoint[][];
3
+ export declare const getDecimatedLinePathSegments: <TPoint extends GeometryPoint = GeometryPoint>({ connectNulls, decimation, points }: {
4
+ connectNulls?: boolean;
5
+ decimation?: false | LinePathDecimationConfig | undefined;
6
+ points: TPoint[];
7
+ }) => TPoint[][];
8
+ //# sourceMappingURL=lineDecimation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineDecimation.d.ts","sourceRoot":"","sources":["../../src/geometry/lineDecimation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAiBvE,eAAO,MAAM,qBAAqB,GAChC,MAAM,SAAS,aAAa,GAAG,aAAa,EAE5C,QAAQ,MAAM,EAAE,EAChB,sBAAoB,KACnB,MAAM,EAAE,EAyBV,CAAC;AA4GF,eAAO,MAAM,4BAA4B,GACvC,MAAM,SAAS,aAAa,GAAG,aAAa,EAC5C,sCAIC;IACD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,GAAG,wBAAwB,GAAG,SAAS,CAAC;IAC1D,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,KAAG,MAAM,EAAE,EA4BX,CAAC"}