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,94 @@
1
+ export const normalizeLineChartSelectedIndex = (selectedIndex) => {
2
+ return typeof selectedIndex === "number" && Number.isFinite(selectedIndex)
3
+ ? Math.round(selectedIndex)
4
+ : undefined;
5
+ };
6
+ export const getLineChartInteractionConfig = (interaction) => {
7
+ if (!interaction) {
8
+ return {
9
+ mode: "none",
10
+ selectionPersistence: "persist",
11
+ deselectOnOutsidePress: false
12
+ };
13
+ }
14
+ if (typeof interaction === "string") {
15
+ return {
16
+ mode: interaction,
17
+ selectionPersistence: "persist",
18
+ deselectOnOutsidePress: true
19
+ };
20
+ }
21
+ const mode = interaction.mode ?? "tap";
22
+ return {
23
+ mode,
24
+ selectionPersistence: interaction.selectionPersistence ?? "persist",
25
+ deselectOnOutsidePress: interaction.deselectOnOutsidePress ?? true,
26
+ ...(interaction.onSelect ? { onSelect: interaction.onSelect } : {}),
27
+ ...(interaction.onDeselect ? { onDeselect: interaction.onDeselect } : {}),
28
+ ...(interaction.onGestureStart
29
+ ? { onGestureStart: interaction.onGestureStart }
30
+ : {}),
31
+ ...(interaction.onGestureEnd
32
+ ? { onGestureEnd: interaction.onGestureEnd }
33
+ : {})
34
+ };
35
+ };
36
+ export const isLineChartInteractionEnabled = (config) => config.mode !== "none";
37
+ export const isLineChartInteractionInBounds = ({ bounds, locationX, locationY, touchSlop = 16 }) => {
38
+ return (locationX >= bounds.x - touchSlop &&
39
+ locationX <= bounds.x + bounds.width + touchSlop &&
40
+ locationY >= bounds.y - touchSlop &&
41
+ locationY <= bounds.y + bounds.height + touchSlop);
42
+ };
43
+ export const getLineChartVisibleInteractionBounds = ({ bounds, scrollable, viewportWidth }) => {
44
+ if (!scrollable) {
45
+ return bounds;
46
+ }
47
+ return {
48
+ ...bounds,
49
+ width: Math.max(0, viewportWidth - bounds.x)
50
+ };
51
+ };
52
+ export const getNearestLineChartInteractionIndex = ({ locationX, points }) => {
53
+ let nearest;
54
+ points.forEach((point) => {
55
+ if (!Number.isFinite(point.x)) {
56
+ return;
57
+ }
58
+ const distance = Math.abs(point.x - locationX);
59
+ if (!nearest || distance < nearest.distance) {
60
+ nearest = {
61
+ dataIndex: point.dataIndex,
62
+ distance
63
+ };
64
+ }
65
+ });
66
+ return nearest?.dataIndex;
67
+ };
68
+ export const buildLineChartSelectEvent = ({ interactionPoints, selectedDataIndex, selectedSeries }) => {
69
+ const interactionPoint = interactionPoints.find((point) => point.dataIndex === selectedDataIndex);
70
+ if (!interactionPoint || selectedSeries.length === 0) {
71
+ return undefined;
72
+ }
73
+ const y = Math.min(...selectedSeries.map((item) => item.point.y));
74
+ const event = {
75
+ index: selectedDataIndex,
76
+ x: interactionPoint.xValue,
77
+ xLabel: interactionPoint.xLabel,
78
+ position: {
79
+ x: interactionPoint.x,
80
+ y
81
+ },
82
+ series: selectedSeries.map((item) => ({
83
+ key: item.key,
84
+ label: item.label,
85
+ color: item.color,
86
+ value: item.value,
87
+ formattedValue: item.formattedValue,
88
+ point: item.point
89
+ }))
90
+ };
91
+ return interactionPoint.raw !== undefined
92
+ ? { ...event, raw: interactionPoint.raw }
93
+ : event;
94
+ };
@@ -0,0 +1,35 @@
1
+ import { solveChartBoxes } from "../../../core/index";
2
+ import type { Size } from "../../../core/index";
3
+ import type { ResolvedCartesianChartTheme } from "../../theme";
4
+ import type { LineChartLegendAlign, LineChartLegendRenderProps, LineChartLegendPosition, LineChartProps, LineChartRenderer, ResolvedLineChartLegendConfig } from "./types";
5
+ export declare const getLegendConfig: (legend: LineChartProps<Record<string, unknown>>["legend"], seriesCount: number, theme: ResolvedCartesianChartTheme) => ResolvedLineChartLegendConfig;
6
+ export declare const getLegendX: ({ align, boxes, legendWidth, width }: {
7
+ align: LineChartLegendAlign;
8
+ boxes: ReturnType<typeof solveChartBoxes>;
9
+ legendWidth: number;
10
+ width: number;
11
+ }) => number;
12
+ export declare const getLegendY: ({ boxes, xLabelHeight, xLabelLineHeight, legendHeight, position }: {
13
+ boxes: ReturnType<typeof solveChartBoxes>;
14
+ xLabelHeight: number;
15
+ xLabelLineHeight: number;
16
+ legendHeight: number;
17
+ position: LineChartLegendPosition;
18
+ }) => number;
19
+ export declare const renderConfiguredLegend: ({ legend, config, renderer }: {
20
+ legend: LineChartLegendRenderProps;
21
+ config: ResolvedLineChartLegendConfig;
22
+ renderer: LineChartRenderer;
23
+ }) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
24
+ export declare const buildLegendLayout: ({ config, items, maxWidth, measureText }: {
25
+ config: ResolvedLineChartLegendConfig;
26
+ items: Array<{
27
+ id: string;
28
+ label: string;
29
+ }>;
30
+ maxWidth: number;
31
+ measureText: (text: string, options: {
32
+ fontSize: number;
33
+ }) => Size;
34
+ }) => import("../../../core/index").LegendLayout;
35
+ //# sourceMappingURL=legend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../../src/charts/line/legend.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EACV,oBAAoB,EAEpB,0BAA0B,EAC1B,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,eAAe,GAC1B,QAAQ,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EACzD,aAAa,MAAM,EACnB,OAAO,2BAA2B,KACjC,6BA4BF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,sCAKxB;IACD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,WAUA,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,mEAMxB;IACD,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,uBAAuB,CAAC;CACnC,WAYA,CAAC;AA6DF,eAAO,MAAM,sBAAsB,GAAI,8BAIpC;IACD,MAAM,EAAE,0BAA0B,CAAC;IACnC,MAAM,EAAE,6BAA6B,CAAC;IACtC,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,4WAoBA,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,0CAK/B;IACD,MAAM,EAAE,6BAA6B,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACpE,2CA4BA,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { layoutLegend } from "../../../core/index";
3
+ import { getFontFamilyProps } from "./text";
4
+ export const getLegendConfig = (legend, seriesCount, theme) => {
5
+ const config = typeof legend === "object" ? legend : {};
6
+ const visible = typeof legend === "boolean"
7
+ ? legend
8
+ : config.visible !== undefined
9
+ ? config.visible
10
+ : seriesCount > 1;
11
+ return {
12
+ visible,
13
+ position: config.position ?? "top",
14
+ align: config.align ?? "start",
15
+ wrap: config.wrap ?? true,
16
+ itemGap: config.itemGap ?? 20,
17
+ rowGap: config.rowGap ?? 8,
18
+ padding: config.padding ?? 0,
19
+ labelGap: config.labelGap ?? 6,
20
+ itemPaddingHorizontal: config.itemPaddingHorizontal ?? 0,
21
+ itemPaddingVertical: config.itemPaddingVertical ?? 0,
22
+ markerSize: config.markerSize ?? 8,
23
+ marker: config.marker ?? "square",
24
+ labelColor: config.labelColor ?? theme.text,
25
+ fontSize: config.fontSize ?? theme.typography.legendLabelSize,
26
+ fontFamily: config.fontFamily ?? theme.typography.fontFamily,
27
+ renderItem: config.renderItem,
28
+ renderLegend: config.renderLegend
29
+ };
30
+ };
31
+ export const getLegendX = ({ align, boxes, legendWidth, width }) => {
32
+ if (align === "center") {
33
+ return Math.max(4, (width - legendWidth) / 2);
34
+ }
35
+ if (align === "end") {
36
+ return Math.max(4, width - boxes.padding.right - legendWidth);
37
+ }
38
+ return boxes.plot.x;
39
+ };
40
+ export const getLegendY = ({ boxes, xLabelHeight, xLabelLineHeight, legendHeight, position }) => {
41
+ if (position === "bottom") {
42
+ return (boxes.plot.y +
43
+ boxes.plot.height +
44
+ (xLabelHeight > 0
45
+ ? 20 + Math.max(0, xLabelHeight - xLabelLineHeight) + 10
46
+ : 10));
47
+ }
48
+ return Math.max(8, boxes.plot.y - legendHeight - 8);
49
+ };
50
+ const renderDefaultLegendItem = (item, renderer) => {
51
+ const markerCenterY = item.contentY + item.contentHeight / 2;
52
+ const legendLineStrokeWidth = Math.min(3, Math.max(1.5, item.strokeWidth));
53
+ const { Circle, Group, Line, Rect, Text } = renderer;
54
+ return (_jsxs(Group, { children: [item.marker === "line" ? (_jsx(Line, { x1: item.contentX, x2: item.contentX + item.markerSize, y1: markerCenterY, y2: markerCenterY, stroke: item.color, strokeLinecap: item.strokeLinecap, strokeOpacity: item.strokeOpacity, strokeWidth: legendLineStrokeWidth, ...(item.strokeDasharray
55
+ ? { strokeDasharray: item.strokeDasharray }
56
+ : {}) })) : item.marker === "circle" ? (_jsx(Circle, { cx: item.contentX + item.markerSize / 2, cy: markerCenterY, r: item.markerSize / 2, fill: item.color, opacity: item.strokeOpacity, stroke: item.color })) : (_jsx(Rect, { x: item.contentX, y: markerCenterY - item.markerSize / 2, width: item.markerSize, height: item.markerSize, rx: 2, fill: item.color, opacity: item.strokeOpacity, stroke: item.color })), _jsx(Text, { x: item.contentX + item.markerSize + item.labelGap, y: item.contentY + item.contentHeight / 2 + item.fontSize * 0.36, fill: item.labelColor, fontSize: item.fontSize, text: item.label, ...getFontFamilyProps(item.fontFamily), children: item.label })] }, `legend-${item.key}`));
57
+ };
58
+ export const renderConfiguredLegend = ({ legend, config, renderer }) => {
59
+ if (config.renderLegend) {
60
+ return config.renderLegend(legend);
61
+ }
62
+ if (!config.renderItem && renderer.capabilities?.text === false) {
63
+ return null;
64
+ }
65
+ const { Group } = renderer;
66
+ return (_jsx(Group, { children: legend.items.map((item) => config.renderItem
67
+ ? config.renderItem(item)
68
+ : renderDefaultLegendItem(item, renderer)) }));
69
+ };
70
+ export const buildLegendLayout = ({ config, items, maxWidth, measureText }) => {
71
+ const markerSize = config.marker === "line" ? config.markerSize + 8 : config.markerSize;
72
+ return layoutLegend({
73
+ items: items.map((item) => {
74
+ const labelSize = measureText(item.label, {
75
+ fontSize: config.fontSize,
76
+ ...getFontFamilyProps(config.fontFamily)
77
+ });
78
+ return {
79
+ id: item.id,
80
+ label: item.label,
81
+ markerSize,
82
+ labelWidth: labelSize.width,
83
+ labelHeight: labelSize.height
84
+ };
85
+ }),
86
+ position: config.position,
87
+ maxWidth: config.wrap ? Math.max(0, maxWidth - 32) : 100000,
88
+ itemGap: config.itemGap,
89
+ rowGap: config.rowGap,
90
+ padding: config.padding,
91
+ labelGap: config.labelGap,
92
+ itemPaddingHorizontal: config.itemPaddingHorizontal,
93
+ itemPaddingVertical: config.itemPaddingVertical
94
+ });
95
+ };
@@ -0,0 +1,11 @@
1
+ import type { ResolvedCartesianChartTheme } from "../../theme";
2
+ import type { LineChartDotRenderProps, LineChartRenderer } from "./types";
3
+ import type { LineChartDotColor } from "./options";
4
+ export declare const resolveDotColor: ({ color, fallback, seriesColor, theme }: {
5
+ color: LineChartDotColor;
6
+ fallback: string;
7
+ seriesColor: string;
8
+ theme: ResolvedCartesianChartTheme;
9
+ }) => string;
10
+ export declare const renderDefaultDot: <TData>({ color, config, point, theme }: LineChartDotRenderProps<TData>, renderer: LineChartRenderer) => import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=markers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../src/charts/line/markers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,eAAO,MAAM,eAAe,GAAI,yCAK7B;IACD,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,2BAA2B,CAAC;CACpC,WAUA,CAAC;AAsBF,eAAO,MAAM,gBAAgB,GAAI,KAAK,EACpC,iCAAiC,uBAAuB,CAAC,KAAK,CAAC,EAC/D,UAAU,iBAAiB,4CA0D5B,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createSvgTestId } from "../../../svg-renderer/index";
3
+ export const resolveDotColor = ({ color, fallback, seriesColor, theme }) => {
4
+ if (color === "background") {
5
+ return theme.background;
6
+ }
7
+ if (color === "series") {
8
+ return seriesColor;
9
+ }
10
+ return color || fallback;
11
+ };
12
+ const createDiamondPath = ({ size, x, y }) => {
13
+ const radius = size / 2;
14
+ return [
15
+ `M ${x} ${y - radius}`,
16
+ `L ${x + radius} ${y}`,
17
+ `L ${x} ${y + radius}`,
18
+ `L ${x - radius} ${y}`,
19
+ "Z"
20
+ ].join(" ");
21
+ };
22
+ export const renderDefaultDot = ({ color, config, point, theme }, renderer) => {
23
+ const fill = resolveDotColor({
24
+ color: config.fill,
25
+ fallback: theme.background,
26
+ seriesColor: color,
27
+ theme
28
+ });
29
+ const stroke = resolveDotColor({
30
+ color: config.stroke,
31
+ fallback: color,
32
+ seriesColor: color,
33
+ theme
34
+ });
35
+ const dotKey = `dot-${point.seriesKey}-${point.index}`;
36
+ const commonProps = {
37
+ testID: createSvgTestId("line-dot", point.seriesKey, point.index),
38
+ fill,
39
+ opacity: config.opacity,
40
+ stroke,
41
+ strokeWidth: config.strokeWidth
42
+ };
43
+ const { Circle, Path, Rect } = renderer;
44
+ const size = config.radius * 2;
45
+ if (config.shape === "square") {
46
+ return (_jsx(Rect, { x: point.x - size / 2, y: point.y - size / 2, width: size, height: size, rx: Math.min(3, config.radius * 0.45), ...commonProps }, dotKey));
47
+ }
48
+ if (config.shape === "diamond") {
49
+ return (_jsx(Path, { d: createDiamondPath({ x: point.x, y: point.y, size }), ...commonProps }, dotKey));
50
+ }
51
+ return (_jsx(Circle, { cx: point.x, cy: point.y, r: config.radius, ...commonProps }, dotKey));
52
+ };
@@ -0,0 +1,172 @@
1
+ import type { LinePathDecimationStrategy } from "../../../core/index";
2
+ import type { ResolvedCartesianChartTooltipTheme } from "../../theme";
3
+ export type LineChartDotShape = "circle" | "square" | "diamond";
4
+ export type LineChartDotColor = string | "background" | "series";
5
+ export type LineChartDotConfig = {
6
+ visible?: boolean;
7
+ shape?: LineChartDotShape;
8
+ radius?: number;
9
+ fill?: LineChartDotColor;
10
+ stroke?: LineChartDotColor;
11
+ strokeWidth?: number;
12
+ opacity?: number;
13
+ };
14
+ export type ResolvedLineChartDotConfig = {
15
+ visible: boolean;
16
+ shape: LineChartDotShape;
17
+ radius: number;
18
+ fill: LineChartDotColor;
19
+ stroke: LineChartDotColor;
20
+ strokeWidth: number;
21
+ opacity: number;
22
+ };
23
+ export type LineChartCrosshairConfig = {
24
+ visible?: boolean;
25
+ color?: string;
26
+ strokeWidth?: number;
27
+ opacity?: number;
28
+ strokeDasharray?: readonly number[];
29
+ };
30
+ export type ResolvedLineChartCrosshairConfig = {
31
+ visible: boolean;
32
+ color: string;
33
+ strokeWidth: number;
34
+ opacity: number;
35
+ strokeDasharray?: readonly number[];
36
+ };
37
+ export type LineChartStrokeLinecap = "butt" | "round" | "square";
38
+ export type LineChartStrokeLinejoin = "bevel" | "miter" | "round";
39
+ export type LineChartStrokeStyleConfig = {
40
+ strokeDasharray?: readonly number[] | undefined;
41
+ strokeLinecap?: LineChartStrokeLinecap | undefined;
42
+ strokeLinejoin?: LineChartStrokeLinejoin | undefined;
43
+ strokeOpacity?: number | undefined;
44
+ };
45
+ export type ResolvedLineChartStrokeStyle = {
46
+ strokeLinecap: LineChartStrokeLinecap;
47
+ strokeLinejoin: LineChartStrokeLinejoin;
48
+ strokeOpacity: number;
49
+ strokeDasharray?: readonly number[] | undefined;
50
+ };
51
+ export type LineChartAreaFillConfig = {
52
+ fromColor?: string;
53
+ toColor?: string;
54
+ fromOpacity?: number;
55
+ toOpacity?: number;
56
+ };
57
+ export type ResolvedLineChartAreaFillConfig = {
58
+ fromColor: string;
59
+ toColor: string;
60
+ fromOpacity: number;
61
+ toOpacity: number;
62
+ };
63
+ export type LineChartThresholdStyleConfig = {
64
+ y: number;
65
+ aboveColor?: string;
66
+ belowColor?: string;
67
+ aboveOpacity?: number;
68
+ belowOpacity?: number;
69
+ areaAboveColor?: string;
70
+ areaBelowColor?: string;
71
+ areaOpacity?: number;
72
+ };
73
+ export type ResolvedLineChartThresholdStyle = {
74
+ y: number;
75
+ aboveColor: string;
76
+ belowColor: string;
77
+ aboveOpacity: number;
78
+ belowOpacity: number;
79
+ areaAboveColor: string;
80
+ areaBelowColor: string;
81
+ areaOpacity: number;
82
+ };
83
+ export type LineChartDecimationConfig = {
84
+ enabled?: boolean;
85
+ maxPoints?: number;
86
+ strategy?: LinePathDecimationStrategy;
87
+ };
88
+ export type ResolvedLineChartDecimationConfig = {
89
+ maxPoints: number;
90
+ strategy: LinePathDecimationStrategy;
91
+ };
92
+ export type LineChartTooltipConfig = {
93
+ visible?: boolean;
94
+ shared?: boolean;
95
+ anchor?: LineChartTooltipAnchor;
96
+ placement?: LineChartTooltipPlacement;
97
+ offset?: number;
98
+ edgePadding?: number;
99
+ width?: number;
100
+ padding?: number;
101
+ borderRadius?: number;
102
+ backgroundColor?: string;
103
+ borderColor?: string;
104
+ textColor?: string;
105
+ labelColor?: string;
106
+ shadowColor?: string;
107
+ shadowOpacity?: number;
108
+ shadowOffsetX?: number;
109
+ shadowOffsetY?: number;
110
+ fontFamily?: string;
111
+ fontSize?: number;
112
+ labelFontSize?: number;
113
+ positionAnimationDuration?: number;
114
+ };
115
+ export type LineChartTooltipAnchor = "point" | "pointer";
116
+ export type LineChartTooltipPlacement = "auto" | "above" | "below";
117
+ export declare const defaultLineChartTooltipPositionAnimationDuration = 220;
118
+ export type ResolvedLineChartTooltipConfig = {
119
+ visible: boolean;
120
+ shared: boolean;
121
+ anchor: LineChartTooltipAnchor;
122
+ placement: LineChartTooltipPlacement;
123
+ offset: number;
124
+ edgePadding: number;
125
+ width: number | undefined;
126
+ padding: number;
127
+ borderRadius: number;
128
+ backgroundColor: string;
129
+ borderColor: string;
130
+ textColor: string;
131
+ labelColor: string;
132
+ shadowColor: string;
133
+ shadowOpacity: number;
134
+ shadowOffsetX: number;
135
+ shadowOffsetY: number;
136
+ fontFamily: string | undefined;
137
+ fontSize: number;
138
+ labelFontSize: number;
139
+ positionAnimationDuration: number;
140
+ };
141
+ export declare const getLineChartStrokeStyle: ({ strokeDasharray, strokeLinecap, strokeLinejoin, strokeOpacity }?: LineChartStrokeStyleConfig) => ResolvedLineChartStrokeStyle;
142
+ export declare const getLineChartAreaFillConfig: ({ areaFill, seriesColor }: {
143
+ areaFill: LineChartAreaFillConfig | undefined;
144
+ seriesColor: string;
145
+ }) => ResolvedLineChartAreaFillConfig;
146
+ export declare const resolveLineChartDecimationConfig: ({ decimation, plotWidth }: {
147
+ decimation: false | "auto" | number | LineChartDecimationConfig | undefined;
148
+ plotWidth: number;
149
+ }) => ResolvedLineChartDecimationConfig | undefined;
150
+ export declare const getLineChartThresholdStyle: ({ seriesColor, threshold }: {
151
+ seriesColor: string;
152
+ threshold: LineChartThresholdStyleConfig | undefined;
153
+ }) => ResolvedLineChartThresholdStyle | undefined;
154
+ export declare const getLineChartDotConfig: ({ dots, seriesDot, showDots }: {
155
+ dots: boolean | LineChartDotConfig | undefined;
156
+ seriesDot: boolean | LineChartDotConfig | undefined;
157
+ showDots: boolean;
158
+ }) => ResolvedLineChartDotConfig;
159
+ export declare const getLineChartActiveDotConfig: ({ activeDot, baseDot }: {
160
+ activeDot: boolean | LineChartDotConfig | undefined;
161
+ baseDot: ResolvedLineChartDotConfig;
162
+ }) => ResolvedLineChartDotConfig;
163
+ export declare const getLineChartCrosshairConfig: ({ crosshair, themeAxisColor }: {
164
+ crosshair: boolean | LineChartCrosshairConfig | undefined;
165
+ themeAxisColor: string;
166
+ }) => ResolvedLineChartCrosshairConfig;
167
+ export declare const getLineChartTooltipConfig: ({ themeFontFamily, themeTooltip, tooltip }: {
168
+ tooltip: boolean | LineChartTooltipConfig | undefined;
169
+ themeFontFamily?: string | undefined;
170
+ themeTooltip: ResolvedCartesianChartTooltipTheme;
171
+ }) => ResolvedLineChartTooltipConfig;
172
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/charts/line/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBA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C;CACrB,KAAG,+BAKF,CAAC;AAEH,eAAO,MAAM,gCAAgC,GAAI,2BAG9C;IACD,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,yBAAyB,GAAG,SAAS,CAAC;IAC5E,SAAS,EAAE,MAAM,CAAC;CACnB,KAAG,iCAAiC,GAAG,SAuCvC,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,4BAGxC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,6BAA6B,GAAG,SAAS,CAAC;CACtD,KAAG,+BAA+B,GAAG,SAsBrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,+BAInC;IACD,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAAC;IAC/C,SAAS,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAAC;IACpD,QAAQ,EAAE,OAAO,CAAC;CACnB,KAAG,0BAuBH,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,wBAGzC;IACD,SAAS,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAAC;IACpD,OAAO,EAAE,0BAA0B,CAAC;CACrC,KAAG,0BAkBH,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,+BAGzC;IACD,SAAS,EAAE,OAAO,GAAG,wBAAwB,GAAG,SAAS,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;CACxB,KAAG,gCAoBH,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,4CAIvC;IACD,OAAO,EAAE,OAAO,GAAG,sBAAsB,GAAG,SAAS,CAAC;IACtD,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,kCAAkC,CAAC;CAClD,KAAG,8BAsCH,CAAC"}
@@ -0,0 +1,168 @@
1
+ export const defaultLineChartTooltipPositionAnimationDuration = 220;
2
+ const resolveNonNegativeNumber = (value, fallback) => typeof value === "number" && Number.isFinite(value)
3
+ ? Math.max(0, value)
4
+ : fallback;
5
+ const resolveOpacity = (value, fallback) => typeof value === "number" && Number.isFinite(value)
6
+ ? Math.max(0, Math.min(1, value))
7
+ : fallback;
8
+ const getAutoDecimationMaxPoints = (plotWidth) => {
9
+ const safePlotWidth = Number.isFinite(plotWidth) && plotWidth > 0 ? plotWidth : 320;
10
+ return Math.max(120, Math.ceil(safePlotWidth * 2));
11
+ };
12
+ export const getLineChartStrokeStyle = ({ strokeDasharray, strokeLinecap, strokeLinejoin, strokeOpacity } = {}) => {
13
+ const resolved = {
14
+ strokeLinecap: strokeLinecap ?? "round",
15
+ strokeLinejoin: strokeLinejoin ?? "round",
16
+ strokeOpacity: resolveOpacity(strokeOpacity, 1)
17
+ };
18
+ if (strokeDasharray !== undefined) {
19
+ resolved.strokeDasharray = strokeDasharray;
20
+ }
21
+ return resolved;
22
+ };
23
+ export const getLineChartAreaFillConfig = ({ areaFill, seriesColor }) => ({
24
+ fromColor: areaFill?.fromColor ?? seriesColor,
25
+ toColor: areaFill?.toColor ?? areaFill?.fromColor ?? seriesColor,
26
+ fromOpacity: resolveOpacity(areaFill?.fromOpacity, 0.22),
27
+ toOpacity: resolveOpacity(areaFill?.toOpacity, 0.02)
28
+ });
29
+ export const resolveLineChartDecimationConfig = ({ decimation, plotWidth }) => {
30
+ if (decimation === false) {
31
+ return undefined;
32
+ }
33
+ if (decimation === undefined || decimation === "auto") {
34
+ return {
35
+ maxPoints: getAutoDecimationMaxPoints(plotWidth),
36
+ strategy: "min-max"
37
+ };
38
+ }
39
+ if (typeof decimation === "number") {
40
+ if (!Number.isFinite(decimation) || decimation <= 0) {
41
+ return undefined;
42
+ }
43
+ return {
44
+ maxPoints: Math.floor(decimation),
45
+ strategy: "min-max"
46
+ };
47
+ }
48
+ if (decimation.enabled === false) {
49
+ return undefined;
50
+ }
51
+ const configuredMaxPoints = decimation.maxPoints;
52
+ const maxPoints = configuredMaxPoints !== undefined &&
53
+ Number.isFinite(configuredMaxPoints) &&
54
+ configuredMaxPoints > 0
55
+ ? Math.floor(configuredMaxPoints)
56
+ : getAutoDecimationMaxPoints(plotWidth);
57
+ return {
58
+ maxPoints,
59
+ strategy: decimation.strategy ?? "min-max"
60
+ };
61
+ };
62
+ export const getLineChartThresholdStyle = ({ seriesColor, threshold }) => {
63
+ if (!threshold ||
64
+ typeof threshold.y !== "number" ||
65
+ !Number.isFinite(threshold.y)) {
66
+ return undefined;
67
+ }
68
+ const aboveColor = threshold.aboveColor ?? seriesColor;
69
+ const belowColor = threshold.belowColor ?? seriesColor;
70
+ return {
71
+ y: threshold.y,
72
+ aboveColor,
73
+ belowColor,
74
+ aboveOpacity: resolveOpacity(threshold.aboveOpacity, 1),
75
+ belowOpacity: resolveOpacity(threshold.belowOpacity, 1),
76
+ areaAboveColor: threshold.areaAboveColor ?? aboveColor,
77
+ areaBelowColor: threshold.areaBelowColor ?? belowColor,
78
+ areaOpacity: resolveOpacity(threshold.areaOpacity, 0.12)
79
+ };
80
+ };
81
+ export const getLineChartDotConfig = ({ dots, seriesDot, showDots }) => {
82
+ const globalConfig = typeof dots === "object" ? dots : {};
83
+ const seriesConfig = typeof seriesDot === "object" ? seriesDot : {};
84
+ const visible = typeof seriesDot === "boolean"
85
+ ? seriesDot
86
+ : typeof seriesConfig.visible === "boolean"
87
+ ? seriesConfig.visible
88
+ : typeof dots === "boolean"
89
+ ? dots
90
+ : typeof globalConfig.visible === "boolean"
91
+ ? globalConfig.visible
92
+ : showDots;
93
+ return {
94
+ visible,
95
+ shape: seriesConfig.shape ?? globalConfig.shape ?? "circle",
96
+ radius: seriesConfig.radius ?? globalConfig.radius ?? 3.5,
97
+ fill: seriesConfig.fill ?? globalConfig.fill ?? "background",
98
+ stroke: seriesConfig.stroke ?? globalConfig.stroke ?? "series",
99
+ strokeWidth: seriesConfig.strokeWidth ?? globalConfig.strokeWidth ?? 2,
100
+ opacity: seriesConfig.opacity ?? globalConfig.opacity ?? 1
101
+ };
102
+ };
103
+ export const getLineChartActiveDotConfig = ({ activeDot, baseDot }) => {
104
+ const config = typeof activeDot === "object" ? activeDot : {};
105
+ const visible = typeof activeDot === "boolean"
106
+ ? activeDot
107
+ : typeof config.visible === "boolean"
108
+ ? config.visible
109
+ : true;
110
+ return {
111
+ visible,
112
+ shape: config.shape ?? baseDot.shape,
113
+ radius: config.radius ?? Math.max(5, baseDot.radius + 1.5),
114
+ fill: config.fill ?? baseDot.fill,
115
+ stroke: config.stroke ?? baseDot.stroke,
116
+ strokeWidth: config.strokeWidth ?? Math.max(2.5, baseDot.strokeWidth),
117
+ opacity: config.opacity ?? 1
118
+ };
119
+ };
120
+ export const getLineChartCrosshairConfig = ({ crosshair, themeAxisColor }) => {
121
+ const config = typeof crosshair === "object" ? crosshair : {};
122
+ const visible = typeof crosshair === "boolean"
123
+ ? crosshair
124
+ : typeof config.visible === "boolean"
125
+ ? config.visible
126
+ : crosshair !== undefined;
127
+ const resolved = {
128
+ visible,
129
+ color: config.color ?? themeAxisColor,
130
+ strokeWidth: config.strokeWidth ?? 1,
131
+ opacity: config.opacity ?? 0.95
132
+ };
133
+ if (config.strokeDasharray !== undefined) {
134
+ resolved.strokeDasharray = config.strokeDasharray;
135
+ }
136
+ return resolved;
137
+ };
138
+ export const getLineChartTooltipConfig = ({ themeFontFamily, themeTooltip, tooltip }) => {
139
+ const config = typeof tooltip === "object" ? tooltip : {};
140
+ const visible = typeof tooltip === "boolean"
141
+ ? tooltip
142
+ : typeof config.visible === "boolean"
143
+ ? config.visible
144
+ : tooltip !== undefined;
145
+ return {
146
+ visible,
147
+ shared: config.shared ?? true,
148
+ anchor: config.anchor ?? "point",
149
+ placement: config.placement ?? "auto",
150
+ offset: resolveNonNegativeNumber(config.offset, 12),
151
+ edgePadding: resolveNonNegativeNumber(config.edgePadding, 4),
152
+ width: config.width,
153
+ padding: config.padding ?? themeTooltip.padding,
154
+ borderRadius: config.borderRadius ?? themeTooltip.borderRadius,
155
+ backgroundColor: config.backgroundColor ?? themeTooltip.background,
156
+ borderColor: config.borderColor ?? themeTooltip.border,
157
+ textColor: config.textColor ?? themeTooltip.text,
158
+ labelColor: config.labelColor ?? themeTooltip.mutedText,
159
+ shadowColor: config.shadowColor ?? themeTooltip.shadowColor,
160
+ shadowOpacity: resolveOpacity(config.shadowOpacity, themeTooltip.shadowOpacity),
161
+ shadowOffsetX: config.shadowOffsetX ?? themeTooltip.shadowOffsetX,
162
+ shadowOffsetY: config.shadowOffsetY ?? themeTooltip.shadowOffsetY,
163
+ fontFamily: config.fontFamily ?? themeFontFamily,
164
+ fontSize: config.fontSize ?? themeTooltip.fontSize,
165
+ labelFontSize: config.labelFontSize ?? themeTooltip.labelFontSize,
166
+ positionAnimationDuration: resolveNonNegativeNumber(config.positionAnimationDuration, defaultLineChartTooltipPositionAnimationDuration)
167
+ };
168
+ };
@@ -0,0 +1,15 @@
1
+ import type { LineChartInteractionBounds } from "./interaction";
2
+ export type LineChartOutsidePressSurface = {
3
+ height: number;
4
+ key: "top" | "left" | "right" | "bottom";
5
+ left: number;
6
+ top: number;
7
+ width: number;
8
+ };
9
+ export declare const getLineChartOutsidePressSurfaces: ({ enabled, mainHeight, visibleInteractionBounds, width }: {
10
+ enabled: boolean;
11
+ mainHeight: number;
12
+ visibleInteractionBounds: LineChartInteractionBounds;
13
+ width: number;
14
+ }) => LineChartOutsidePressSurface[];
15
+ //# sourceMappingURL=outsidePressSurfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outsidePressSurfaces.d.ts","sourceRoot":"","sources":["../../../src/charts/line/outsidePressSurfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAEhE,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,0DAK9C;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB,EAAE,0BAA0B,CAAC;IACrD,KAAK,EAAE,MAAM,CAAC;CACf,KAAG,4BAA4B,EAwC/B,CAAC"}