@chipmobilesdk/rn-chart 0.3.0 → 0.5.0

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 (373) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/README.md +45 -3
  3. package/lib/commonjs/a11y/summary.js +190 -0
  4. package/lib/commonjs/a11y/summary.js.map +1 -0
  5. package/lib/commonjs/contract/datasource.js +64 -0
  6. package/lib/commonjs/contract/datasource.js.map +1 -0
  7. package/lib/commonjs/contract/distribution.js +45 -0
  8. package/lib/commonjs/contract/distribution.js.map +1 -0
  9. package/lib/commonjs/contract/errors.js +88 -0
  10. package/lib/commonjs/contract/errors.js.map +1 -0
  11. package/lib/commonjs/contract/format.js +133 -0
  12. package/lib/commonjs/contract/format.js.map +1 -0
  13. package/lib/commonjs/contract/interaction.js +24 -0
  14. package/lib/commonjs/contract/interaction.js.map +1 -0
  15. package/lib/commonjs/contract/marker.js +55 -0
  16. package/lib/commonjs/contract/marker.js.map +1 -0
  17. package/lib/commonjs/contract/props.js +6 -0
  18. package/lib/commonjs/contract/props.js.map +1 -0
  19. package/lib/commonjs/contract/state.js +68 -0
  20. package/lib/commonjs/contract/state.js.map +1 -0
  21. package/lib/commonjs/contract/strings.js +54 -0
  22. package/lib/commonjs/contract/strings.js.map +1 -0
  23. package/lib/commonjs/contract/theme.js +116 -0
  24. package/lib/commonjs/contract/theme.js.map +1 -0
  25. package/lib/commonjs/contract/value.js +112 -0
  26. package/lib/commonjs/contract/value.js.map +1 -0
  27. package/lib/commonjs/geometry/bar.js +257 -0
  28. package/lib/commonjs/geometry/bar.js.map +1 -0
  29. package/lib/commonjs/geometry/distribution.js +197 -0
  30. package/lib/commonjs/geometry/distribution.js.map +1 -0
  31. package/lib/commonjs/geometry/heatmap.js +186 -0
  32. package/lib/commonjs/geometry/heatmap.js.map +1 -0
  33. package/lib/commonjs/geometry/hitTest.js +117 -0
  34. package/lib/commonjs/geometry/hitTest.js.map +1 -0
  35. package/lib/commonjs/geometry/layout.js +134 -0
  36. package/lib/commonjs/geometry/layout.js.map +1 -0
  37. package/lib/commonjs/geometry/markers.js +59 -0
  38. package/lib/commonjs/geometry/markers.js.map +1 -0
  39. package/lib/commonjs/geometry/path.js +166 -0
  40. package/lib/commonjs/geometry/path.js.map +1 -0
  41. package/lib/commonjs/geometry/progress.js +203 -0
  42. package/lib/commonjs/geometry/progress.js.map +1 -0
  43. package/lib/commonjs/geometry/scale.js +127 -0
  44. package/lib/commonjs/geometry/scale.js.map +1 -0
  45. package/lib/commonjs/geometry/ticks.js +120 -0
  46. package/lib/commonjs/geometry/ticks.js.map +1 -0
  47. package/lib/commonjs/geometry/timeSeries.js +157 -0
  48. package/lib/commonjs/geometry/timeSeries.js.map +1 -0
  49. package/lib/commonjs/geometry/types.js +43 -0
  50. package/lib/commonjs/geometry/types.js.map +1 -0
  51. package/lib/commonjs/index.js +284 -0
  52. package/lib/commonjs/index.js.map +1 -0
  53. package/lib/commonjs/package.json +1 -0
  54. package/lib/commonjs/react/ChartBoundary.js +82 -0
  55. package/lib/commonjs/react/ChartBoundary.js.map +1 -0
  56. package/lib/commonjs/react/ChartFrame.js +270 -0
  57. package/lib/commonjs/react/ChartFrame.js.map +1 -0
  58. package/lib/commonjs/react/ChartLegend.js +242 -0
  59. package/lib/commonjs/react/ChartLegend.js.map +1 -0
  60. package/lib/commonjs/react/ChartPlot.js +62 -0
  61. package/lib/commonjs/react/ChartPlot.js.map +1 -0
  62. package/lib/commonjs/react/ChartStateOverlay.js +89 -0
  63. package/lib/commonjs/react/ChartStateOverlay.js.map +1 -0
  64. package/lib/commonjs/react/ChartThemeProvider.js +51 -0
  65. package/lib/commonjs/react/ChartThemeProvider.js.map +1 -0
  66. package/lib/commonjs/react/charts.js +108 -0
  67. package/lib/commonjs/react/charts.js.map +1 -0
  68. package/lib/commonjs/react/pointEvent.js +35 -0
  69. package/lib/commonjs/react/pointEvent.js.map +1 -0
  70. package/lib/commonjs/react/useChartA11y.js +97 -0
  71. package/lib/commonjs/react/useChartA11y.js.map +1 -0
  72. package/lib/commonjs/react/useChartFormatters.js +66 -0
  73. package/lib/commonjs/react/useChartFormatters.js.map +1 -0
  74. package/lib/commonjs/react/useChartLayout.js +100 -0
  75. package/lib/commonjs/react/useChartLayout.js.map +1 -0
  76. package/lib/commonjs/react/useChartSelection.js +131 -0
  77. package/lib/commonjs/react/useChartSelection.js.map +1 -0
  78. package/lib/commonjs/react/useChartStatus.js +74 -0
  79. package/lib/commonjs/react/useChartStatus.js.map +1 -0
  80. package/lib/commonjs/render/Axis.js +88 -0
  81. package/lib/commonjs/render/Axis.js.map +1 -0
  82. package/lib/commonjs/render/Marks.js +184 -0
  83. package/lib/commonjs/render/Marks.js.map +1 -0
  84. package/lib/commonjs/validation/budgets.js +106 -0
  85. package/lib/commonjs/validation/budgets.js.map +1 -0
  86. package/lib/commonjs/validation/validateDatasource.js +189 -0
  87. package/lib/commonjs/validation/validateDatasource.js.map +1 -0
  88. package/lib/module/a11y/summary.js +184 -0
  89. package/lib/module/a11y/summary.js.map +1 -0
  90. package/lib/module/contract/datasource.js +57 -0
  91. package/lib/module/contract/datasource.js.map +1 -0
  92. package/lib/module/contract/distribution.js +40 -0
  93. package/lib/module/contract/distribution.js.map +1 -0
  94. package/lib/module/contract/errors.js +80 -0
  95. package/lib/module/contract/errors.js.map +1 -0
  96. package/lib/module/contract/format.js +123 -0
  97. package/lib/module/contract/format.js.map +1 -0
  98. package/lib/module/contract/interaction.js +20 -0
  99. package/lib/module/contract/interaction.js.map +1 -0
  100. package/lib/module/contract/marker.js +49 -0
  101. package/lib/module/contract/marker.js.map +1 -0
  102. package/lib/module/contract/props.js +4 -0
  103. package/lib/module/contract/props.js.map +1 -0
  104. package/lib/module/contract/state.js +61 -0
  105. package/lib/module/contract/state.js.map +1 -0
  106. package/lib/module/contract/strings.js +49 -0
  107. package/lib/module/contract/strings.js.map +1 -0
  108. package/lib/module/contract/theme.js +109 -0
  109. package/lib/module/contract/theme.js.map +1 -0
  110. package/lib/module/contract/value.js +101 -0
  111. package/lib/module/contract/value.js.map +1 -0
  112. package/lib/module/geometry/bar.js +253 -0
  113. package/lib/module/geometry/bar.js.map +1 -0
  114. package/lib/module/geometry/distribution.js +193 -0
  115. package/lib/module/geometry/distribution.js.map +1 -0
  116. package/lib/module/geometry/heatmap.js +182 -0
  117. package/lib/module/geometry/heatmap.js.map +1 -0
  118. package/lib/module/geometry/hitTest.js +110 -0
  119. package/lib/module/geometry/hitTest.js.map +1 -0
  120. package/lib/module/geometry/layout.js +122 -0
  121. package/lib/module/geometry/layout.js.map +1 -0
  122. package/lib/module/geometry/markers.js +53 -0
  123. package/lib/module/geometry/markers.js.map +1 -0
  124. package/lib/module/geometry/path.js +157 -0
  125. package/lib/module/geometry/path.js.map +1 -0
  126. package/lib/module/geometry/progress.js +199 -0
  127. package/lib/module/geometry/progress.js.map +1 -0
  128. package/lib/module/geometry/scale.js +119 -0
  129. package/lib/module/geometry/scale.js.map +1 -0
  130. package/lib/module/geometry/ticks.js +112 -0
  131. package/lib/module/geometry/ticks.js.map +1 -0
  132. package/lib/module/geometry/timeSeries.js +153 -0
  133. package/lib/module/geometry/timeSeries.js.map +1 -0
  134. package/lib/module/geometry/types.js +39 -0
  135. package/lib/module/geometry/types.js.map +1 -0
  136. package/lib/module/index.js +85 -0
  137. package/lib/module/index.js.map +1 -0
  138. package/lib/module/package.json +1 -0
  139. package/lib/module/react/ChartBoundary.js +75 -0
  140. package/lib/module/react/ChartBoundary.js.map +1 -0
  141. package/lib/module/react/ChartFrame.js +263 -0
  142. package/lib/module/react/ChartFrame.js.map +1 -0
  143. package/lib/module/react/ChartLegend.js +234 -0
  144. package/lib/module/react/ChartLegend.js.map +1 -0
  145. package/lib/module/react/ChartPlot.js +56 -0
  146. package/lib/module/react/ChartPlot.js.map +1 -0
  147. package/lib/module/react/ChartStateOverlay.js +82 -0
  148. package/lib/module/react/ChartStateOverlay.js.map +1 -0
  149. package/lib/module/react/ChartThemeProvider.js +44 -0
  150. package/lib/module/react/ChartThemeProvider.js.map +1 -0
  151. package/lib/module/react/charts.js +102 -0
  152. package/lib/module/react/charts.js.map +1 -0
  153. package/lib/module/react/pointEvent.js +30 -0
  154. package/lib/module/react/pointEvent.js.map +1 -0
  155. package/lib/module/react/useChartA11y.js +92 -0
  156. package/lib/module/react/useChartA11y.js.map +1 -0
  157. package/lib/module/react/useChartFormatters.js +61 -0
  158. package/lib/module/react/useChartFormatters.js.map +1 -0
  159. package/lib/module/react/useChartLayout.js +95 -0
  160. package/lib/module/react/useChartLayout.js.map +1 -0
  161. package/lib/module/react/useChartSelection.js +125 -0
  162. package/lib/module/react/useChartSelection.js.map +1 -0
  163. package/lib/module/react/useChartStatus.js +69 -0
  164. package/lib/module/react/useChartStatus.js.map +1 -0
  165. package/lib/module/render/Axis.js +80 -0
  166. package/lib/module/render/Axis.js.map +1 -0
  167. package/lib/module/render/Marks.js +173 -0
  168. package/lib/module/render/Marks.js.map +1 -0
  169. package/lib/module/validation/budgets.js +97 -0
  170. package/lib/module/validation/budgets.js.map +1 -0
  171. package/lib/module/validation/validateDatasource.js +184 -0
  172. package/lib/module/validation/validateDatasource.js.map +1 -0
  173. package/lib/typescript/commonjs/a11y/summary.d.ts +38 -0
  174. package/lib/typescript/commonjs/a11y/summary.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/contract/datasource.d.ts +94 -0
  176. package/lib/typescript/commonjs/contract/datasource.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/contract/distribution.d.ts +17 -0
  178. package/lib/typescript/commonjs/contract/distribution.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/contract/errors.d.ts +53 -0
  180. package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/contract/format.d.ts +63 -0
  182. package/lib/typescript/commonjs/contract/format.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/contract/interaction.d.ts +53 -0
  184. package/lib/typescript/commonjs/contract/interaction.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/contract/marker.d.ts +39 -0
  186. package/lib/typescript/commonjs/contract/marker.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/contract/props.d.ts +58 -0
  188. package/lib/typescript/commonjs/contract/props.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/contract/state.d.ts +45 -0
  190. package/lib/typescript/commonjs/contract/state.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/contract/strings.d.ts +39 -0
  192. package/lib/typescript/commonjs/contract/strings.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/contract/theme.d.ts +85 -0
  194. package/lib/typescript/commonjs/contract/theme.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/contract/value.d.ts +69 -0
  196. package/lib/typescript/commonjs/contract/value.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/geometry/bar.d.ts +18 -0
  198. package/lib/typescript/commonjs/geometry/bar.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/geometry/distribution.d.ts +23 -0
  200. package/lib/typescript/commonjs/geometry/distribution.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/geometry/heatmap.d.ts +24 -0
  202. package/lib/typescript/commonjs/geometry/heatmap.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/geometry/hitTest.d.ts +68 -0
  204. package/lib/typescript/commonjs/geometry/hitTest.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/geometry/layout.d.ts +67 -0
  206. package/lib/typescript/commonjs/geometry/layout.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/geometry/markers.d.ts +29 -0
  208. package/lib/typescript/commonjs/geometry/markers.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/geometry/path.d.ts +66 -0
  210. package/lib/typescript/commonjs/geometry/path.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/geometry/progress.d.ts +17 -0
  212. package/lib/typescript/commonjs/geometry/progress.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/geometry/scale.d.ts +55 -0
  214. package/lib/typescript/commonjs/geometry/scale.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/geometry/ticks.d.ts +48 -0
  216. package/lib/typescript/commonjs/geometry/ticks.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/geometry/timeSeries.d.ts +20 -0
  218. package/lib/typescript/commonjs/geometry/timeSeries.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/geometry/types.d.ts +91 -0
  220. package/lib/typescript/commonjs/geometry/types.d.ts.map +1 -0
  221. package/lib/typescript/commonjs/index.d.ts +47 -0
  222. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/package.json +1 -0
  224. package/lib/typescript/commonjs/react/ChartBoundary.d.ts +47 -0
  225. package/lib/typescript/commonjs/react/ChartBoundary.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/react/ChartFrame.d.ts +31 -0
  227. package/lib/typescript/commonjs/react/ChartFrame.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/react/ChartLegend.d.ts +31 -0
  229. package/lib/typescript/commonjs/react/ChartLegend.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/react/ChartPlot.d.ts +19 -0
  231. package/lib/typescript/commonjs/react/ChartPlot.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/react/ChartStateOverlay.d.ts +25 -0
  233. package/lib/typescript/commonjs/react/ChartStateOverlay.d.ts.map +1 -0
  234. package/lib/typescript/commonjs/react/ChartThemeProvider.d.ts +21 -0
  235. package/lib/typescript/commonjs/react/ChartThemeProvider.d.ts.map +1 -0
  236. package/lib/typescript/commonjs/react/charts.d.ts +51 -0
  237. package/lib/typescript/commonjs/react/charts.d.ts.map +1 -0
  238. package/lib/typescript/commonjs/react/pointEvent.d.ts +13 -0
  239. package/lib/typescript/commonjs/react/pointEvent.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/react/useChartA11y.d.ts +37 -0
  241. package/lib/typescript/commonjs/react/useChartA11y.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/react/useChartFormatters.d.ts +21 -0
  243. package/lib/typescript/commonjs/react/useChartFormatters.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/react/useChartLayout.d.ts +27 -0
  245. package/lib/typescript/commonjs/react/useChartLayout.d.ts.map +1 -0
  246. package/lib/typescript/commonjs/react/useChartSelection.d.ts +52 -0
  247. package/lib/typescript/commonjs/react/useChartSelection.d.ts.map +1 -0
  248. package/lib/typescript/commonjs/react/useChartStatus.d.ts +22 -0
  249. package/lib/typescript/commonjs/react/useChartStatus.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/render/Axis.d.ts +31 -0
  251. package/lib/typescript/commonjs/render/Axis.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/render/Marks.d.ts +44 -0
  253. package/lib/typescript/commonjs/render/Marks.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/validation/budgets.d.ts +24 -0
  255. package/lib/typescript/commonjs/validation/budgets.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/validation/validateDatasource.d.ts +26 -0
  257. package/lib/typescript/commonjs/validation/validateDatasource.d.ts.map +1 -0
  258. package/lib/typescript/module/a11y/summary.d.ts +38 -0
  259. package/lib/typescript/module/a11y/summary.d.ts.map +1 -0
  260. package/lib/typescript/module/contract/datasource.d.ts +94 -0
  261. package/lib/typescript/module/contract/datasource.d.ts.map +1 -0
  262. package/lib/typescript/module/contract/distribution.d.ts +17 -0
  263. package/lib/typescript/module/contract/distribution.d.ts.map +1 -0
  264. package/lib/typescript/module/contract/errors.d.ts +53 -0
  265. package/lib/typescript/module/contract/errors.d.ts.map +1 -0
  266. package/lib/typescript/module/contract/format.d.ts +63 -0
  267. package/lib/typescript/module/contract/format.d.ts.map +1 -0
  268. package/lib/typescript/module/contract/interaction.d.ts +53 -0
  269. package/lib/typescript/module/contract/interaction.d.ts.map +1 -0
  270. package/lib/typescript/module/contract/marker.d.ts +39 -0
  271. package/lib/typescript/module/contract/marker.d.ts.map +1 -0
  272. package/lib/typescript/module/contract/props.d.ts +58 -0
  273. package/lib/typescript/module/contract/props.d.ts.map +1 -0
  274. package/lib/typescript/module/contract/state.d.ts +45 -0
  275. package/lib/typescript/module/contract/state.d.ts.map +1 -0
  276. package/lib/typescript/module/contract/strings.d.ts +39 -0
  277. package/lib/typescript/module/contract/strings.d.ts.map +1 -0
  278. package/lib/typescript/module/contract/theme.d.ts +85 -0
  279. package/lib/typescript/module/contract/theme.d.ts.map +1 -0
  280. package/lib/typescript/module/contract/value.d.ts +69 -0
  281. package/lib/typescript/module/contract/value.d.ts.map +1 -0
  282. package/lib/typescript/module/geometry/bar.d.ts +18 -0
  283. package/lib/typescript/module/geometry/bar.d.ts.map +1 -0
  284. package/lib/typescript/module/geometry/distribution.d.ts +23 -0
  285. package/lib/typescript/module/geometry/distribution.d.ts.map +1 -0
  286. package/lib/typescript/module/geometry/heatmap.d.ts +24 -0
  287. package/lib/typescript/module/geometry/heatmap.d.ts.map +1 -0
  288. package/lib/typescript/module/geometry/hitTest.d.ts +68 -0
  289. package/lib/typescript/module/geometry/hitTest.d.ts.map +1 -0
  290. package/lib/typescript/module/geometry/layout.d.ts +67 -0
  291. package/lib/typescript/module/geometry/layout.d.ts.map +1 -0
  292. package/lib/typescript/module/geometry/markers.d.ts +29 -0
  293. package/lib/typescript/module/geometry/markers.d.ts.map +1 -0
  294. package/lib/typescript/module/geometry/path.d.ts +66 -0
  295. package/lib/typescript/module/geometry/path.d.ts.map +1 -0
  296. package/lib/typescript/module/geometry/progress.d.ts +17 -0
  297. package/lib/typescript/module/geometry/progress.d.ts.map +1 -0
  298. package/lib/typescript/module/geometry/scale.d.ts +55 -0
  299. package/lib/typescript/module/geometry/scale.d.ts.map +1 -0
  300. package/lib/typescript/module/geometry/ticks.d.ts +48 -0
  301. package/lib/typescript/module/geometry/ticks.d.ts.map +1 -0
  302. package/lib/typescript/module/geometry/timeSeries.d.ts +20 -0
  303. package/lib/typescript/module/geometry/timeSeries.d.ts.map +1 -0
  304. package/lib/typescript/module/geometry/types.d.ts +91 -0
  305. package/lib/typescript/module/geometry/types.d.ts.map +1 -0
  306. package/lib/typescript/module/index.d.ts +47 -0
  307. package/lib/typescript/module/index.d.ts.map +1 -0
  308. package/lib/typescript/module/package.json +1 -0
  309. package/lib/typescript/module/react/ChartBoundary.d.ts +47 -0
  310. package/lib/typescript/module/react/ChartBoundary.d.ts.map +1 -0
  311. package/lib/typescript/module/react/ChartFrame.d.ts +31 -0
  312. package/lib/typescript/module/react/ChartFrame.d.ts.map +1 -0
  313. package/lib/typescript/module/react/ChartLegend.d.ts +31 -0
  314. package/lib/typescript/module/react/ChartLegend.d.ts.map +1 -0
  315. package/lib/typescript/module/react/ChartPlot.d.ts +19 -0
  316. package/lib/typescript/module/react/ChartPlot.d.ts.map +1 -0
  317. package/lib/typescript/module/react/ChartStateOverlay.d.ts +25 -0
  318. package/lib/typescript/module/react/ChartStateOverlay.d.ts.map +1 -0
  319. package/lib/typescript/module/react/ChartThemeProvider.d.ts +21 -0
  320. package/lib/typescript/module/react/ChartThemeProvider.d.ts.map +1 -0
  321. package/lib/typescript/module/react/charts.d.ts +51 -0
  322. package/lib/typescript/module/react/charts.d.ts.map +1 -0
  323. package/lib/typescript/module/react/pointEvent.d.ts +13 -0
  324. package/lib/typescript/module/react/pointEvent.d.ts.map +1 -0
  325. package/lib/typescript/module/react/useChartA11y.d.ts +37 -0
  326. package/lib/typescript/module/react/useChartA11y.d.ts.map +1 -0
  327. package/lib/typescript/module/react/useChartFormatters.d.ts +21 -0
  328. package/lib/typescript/module/react/useChartFormatters.d.ts.map +1 -0
  329. package/lib/typescript/module/react/useChartLayout.d.ts +27 -0
  330. package/lib/typescript/module/react/useChartLayout.d.ts.map +1 -0
  331. package/lib/typescript/module/react/useChartSelection.d.ts +52 -0
  332. package/lib/typescript/module/react/useChartSelection.d.ts.map +1 -0
  333. package/lib/typescript/module/react/useChartStatus.d.ts +22 -0
  334. package/lib/typescript/module/react/useChartStatus.d.ts.map +1 -0
  335. package/lib/typescript/module/render/Axis.d.ts +31 -0
  336. package/lib/typescript/module/render/Axis.d.ts.map +1 -0
  337. package/lib/typescript/module/render/Marks.d.ts +44 -0
  338. package/lib/typescript/module/render/Marks.d.ts.map +1 -0
  339. package/lib/typescript/module/validation/budgets.d.ts +24 -0
  340. package/lib/typescript/module/validation/budgets.d.ts.map +1 -0
  341. package/lib/typescript/module/validation/validateDatasource.d.ts +26 -0
  342. package/lib/typescript/module/validation/validateDatasource.d.ts.map +1 -0
  343. package/package.json +40 -15
  344. package/skills/sdk-rn-chart/SKILL.md +49 -14
  345. package/src/a11y/summary.ts +34 -15
  346. package/src/contract/distribution.ts +44 -0
  347. package/src/contract/errors.ts +6 -0
  348. package/src/contract/interaction.ts +2 -2
  349. package/src/contract/strings.ts +2 -0
  350. package/src/geometry/bar.ts +27 -16
  351. package/src/geometry/distribution.ts +11 -6
  352. package/src/geometry/heatmap.ts +34 -17
  353. package/src/geometry/hitTest.ts +35 -0
  354. package/src/geometry/progress.ts +0 -1
  355. package/src/geometry/ticks.ts +0 -13
  356. package/src/geometry/timeSeries.ts +7 -2
  357. package/src/geometry/types.ts +11 -0
  358. package/src/index.ts +4 -1
  359. package/src/react/ChartFrame.tsx +126 -373
  360. package/src/react/ChartLegend.tsx +60 -3
  361. package/src/react/ChartPlot.tsx +57 -0
  362. package/src/react/ChartStateOverlay.tsx +94 -0
  363. package/src/react/charts.tsx +27 -12
  364. package/src/react/pointEvent.ts +40 -0
  365. package/src/react/useChartA11y.ts +113 -0
  366. package/src/react/useChartFormatters.ts +105 -0
  367. package/src/react/useChartLayout.ts +5 -2
  368. package/src/react/useChartSelection.ts +77 -40
  369. package/src/react/useChartStatus.ts +85 -0
  370. package/src/render/Axis.tsx +26 -22
  371. package/src/render/Marks.tsx +2 -9
  372. package/src/validation/budgets.ts +6 -4
  373. package/src/validation/validateDatasource.ts +38 -14
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Tick generation and label thinning (FR-070).
5
+ *
6
+ * React Native offers no synchronous text measurement, and an `onLayout`
7
+ * round-trip per label would cost a second layout pass — enough to breach the
8
+ * first-paint budget. So we estimate width from character count and thin ticks
9
+ * to fit.
10
+ *
11
+ * The estimate is deliberately generous: over-estimating drops one tick too
12
+ * many, which is legible. Under-estimating produces overlapping text, which is
13
+ * the failure FR-070 exists to prevent. See research.md R6.
14
+ *
15
+ * PURE. No React, no SVG.
16
+ */
17
+
18
+ /**
19
+ * Average glyph advance as a fraction of font size, for the Latin digits and
20
+ * letters that dominate axis labels. Rounded up from the ~0.5-0.55 typical of
21
+ * the platform sans-serif faces.
22
+ */
23
+ export const AVERAGE_ADVANCE_RATIO = 0.62;
24
+
25
+ /** Minimum breathing room between two adjacent labels, in px. */
26
+ export const LABEL_GUTTER = 8;
27
+ export function estimateTextWidth(text, fontSize) {
28
+ return text.length * fontSize * AVERAGE_ADVANCE_RATIO;
29
+ }
30
+ /**
31
+ * "Nice" step sizes: 1, 2, 5 and their powers of ten. Standard axis practice —
32
+ * these are the intervals people read fluently.
33
+ */
34
+ function niceStep(rawStep) {
35
+ if (rawStep <= 0 || !Number.isFinite(rawStep)) {
36
+ return 1;
37
+ }
38
+ const magnitude = Math.pow(10, Math.floor(Math.log10(rawStep)));
39
+ const normalized = rawStep / magnitude;
40
+ if (normalized <= 1) {
41
+ return magnitude;
42
+ }
43
+ if (normalized <= 2) {
44
+ return 2 * magnitude;
45
+ }
46
+ if (normalized <= 5) {
47
+ return 5 * magnitude;
48
+ }
49
+ return 10 * magnitude;
50
+ }
51
+ export function niceTickValues(domain, targetCount) {
52
+ const span = domain.max - domain.min;
53
+ if (span <= 0 || targetCount < 1) {
54
+ return [domain.min];
55
+ }
56
+ const step = niceStep(span / targetCount);
57
+ const start = Math.ceil(domain.min / step) * step;
58
+ const values = [];
59
+ // Guard against a pathological step producing an unbounded loop.
60
+ for (let v = start, guard = 0; v <= domain.max && guard < 1000; v += step) {
61
+ // Re-round to kill floating-point drift such as 0.30000000000000004.
62
+ values.push(Number((Math.round(v / step) * step).toFixed(10)));
63
+ guard += 1;
64
+ }
65
+ return values.length > 0 ? values : [domain.min];
66
+ }
67
+
68
+ /**
69
+ * Drops ticks until no two labels can overlap.
70
+ *
71
+ * Thinning is preferred over rotation as the default: rotated labels are harder
72
+ * to read on a phone and cost vertical space a mobile chart cannot spare.
73
+ * Rotation stays available as an opt-in for dense category axes.
74
+ *
75
+ * The first tick is always kept, so an axis never renders empty.
76
+ */
77
+ export function thinTicks(ticks, fontSize, axisLengthPx) {
78
+ if (ticks.length <= 1) {
79
+ return [...ticks];
80
+ }
81
+ let widest = 0;
82
+ for (const t of ticks) {
83
+ widest = Math.max(widest, estimateTextWidth(t.label, fontSize));
84
+ }
85
+ const slot = widest + LABEL_GUTTER;
86
+ const maxLabels = Math.max(1, Math.floor(axisLengthPx / slot));
87
+ if (ticks.length <= maxLabels) {
88
+ return [...ticks];
89
+ }
90
+ const stride = Math.ceil(ticks.length / maxLabels);
91
+ return ticks.filter((_, i) => i % stride === 0);
92
+ }
93
+
94
+ /**
95
+ * How much space an axis must reserve for its labels, at the current system
96
+ * font scale (FR-071).
97
+ */
98
+ export function reserveAxisSpace(labels, fontSize, orientation) {
99
+ if (labels.length === 0) {
100
+ return 0;
101
+ }
102
+ if (orientation === 'horizontal') {
103
+ // One line of text plus a gutter.
104
+ return fontSize * 1.4 + LABEL_GUTTER;
105
+ }
106
+ let widest = 0;
107
+ for (const label of labels) {
108
+ widest = Math.max(widest, estimateTextWidth(label, fontSize));
109
+ }
110
+ return widest + LABEL_GUTTER;
111
+ }
112
+ //# sourceMappingURL=ticks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AVERAGE_ADVANCE_RATIO","LABEL_GUTTER","estimateTextWidth","text","fontSize","length","niceStep","rawStep","Number","isFinite","magnitude","Math","pow","floor","log10","normalized","niceTickValues","domain","targetCount","span","max","min","step","start","ceil","values","v","guard","push","round","toFixed","thinTicks","ticks","axisLengthPx","widest","t","label","slot","maxLabels","stride","filter","_","i","reserveAxisSpace","labels","orientation"],"sourceRoot":"../../../src","sources":["geometry/ticks.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,IAAI;;AAEzC;AACA,OAAO,MAAMC,YAAY,GAAG,CAAC;AAE7B,OAAO,SAASC,iBAAiBA,CAACC,IAAY,EAAEC,QAAgB,EAAU;EACzE,OAAOD,IAAI,CAACE,MAAM,GAAGD,QAAQ,GAAGJ,qBAAqB;AACtD;AAUA;AACA;AACA;AACA;AACA,SAASM,QAAQA,CAACC,OAAe,EAAU;EAC1C,IAAIA,OAAO,IAAI,CAAC,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,OAAO,CAAC,EAAE;IAC9C,OAAO,CAAC;EACT;EACA,MAAMG,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,EAAE,EAAED,IAAI,CAACE,KAAK,CAACF,IAAI,CAACG,KAAK,CAACP,OAAO,CAAC,CAAC,CAAC;EAC/D,MAAMQ,UAAU,GAAGR,OAAO,GAAGG,SAAS;EAEtC,IAAIK,UAAU,IAAI,CAAC,EAAE;IACpB,OAAOL,SAAS;EACjB;EACA,IAAIK,UAAU,IAAI,CAAC,EAAE;IACpB,OAAO,CAAC,GAAGL,SAAS;EACrB;EACA,IAAIK,UAAU,IAAI,CAAC,EAAE;IACpB,OAAO,CAAC,GAAGL,SAAS;EACrB;EACA,OAAO,EAAE,GAAGA,SAAS;AACtB;AAEA,OAAO,SAASM,cAAcA,CAACC,MAAa,EAAEC,WAAmB,EAAY;EAC5E,MAAMC,IAAI,GAAGF,MAAM,CAACG,GAAG,GAAGH,MAAM,CAACI,GAAG;EACpC,IAAIF,IAAI,IAAI,CAAC,IAAID,WAAW,GAAG,CAAC,EAAE;IACjC,OAAO,CAACD,MAAM,CAACI,GAAG,CAAC;EACpB;EAEA,MAAMC,IAAI,GAAGhB,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AIL,KAAK,CAAC3B,MAAM,IAAIiC,SAAS,EAAE;IAC9B,OAAO,CAAC,GAAGN,KAAK,CAAC;EAClB;EAEA,MAAMO,MAAM,GAAG5B,IAAI,CAACa,IAAI,CAACQ,KAAK,CAAC3B,MAAM,GAAGiC,SAAS,CAAC;EAClD,OAAON,KAAK,CAACQ,MAAM,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKA,CAAC,GAAGH,MAAM,KAAK,CAAC,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAC/BC,MAAyB,EACzBxC,QAAgB,EAChByC,WAAsC,EAC7B;EACT,IAAID,MAAM,CAACvC,MAAM,KAAK,CAAC,EAAE;IACxB,OAAO,CAAC;EACT;EACA,IAAIwC,WAAW,KAAK,YAAY,EAAE;IACjC;IACA,OAAOzC,QAAQ,GAAG,GAAG,GAAGH,YAAY;EACrC;EAEA,IAAIiC,MAAM,GAAG,CAAC;EACd,KAAK,MAAME,KAAK,IAAIQ,MAAM,EAAE;IAC3BV,MAAM,GAAGvB,IAAI,CAACS,GAAG,CAACc,MAAM,EAAEhC,iBAAiB,CAACkC,KAAK,EAAEhC,QAAQ,CAAC,CAAC;EAC9D;EACA,OAAO8B,MAAM,GAAGjC,YAAY;AAC7B","ignoreList":[]}
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Time-series geometry: one stroked path per series over an instant domain.
5
+ *
6
+ * Gaps are the interesting part. A non-known value contributes `null` to the
7
+ * point list, `linePath` lifts the pen there, and the line simply does not
8
+ * exist across the gap (FR-012).
9
+ *
10
+ * PURE. No React, no SVG.
11
+ */
12
+
13
+ import { isKnown, isWithheld } from "../contract/value.js";
14
+ import { insetForAxes, plotBottom, plotRight } from "./layout.js";
15
+ import { horizontalMarkers, markerDomainValues } from "./markers.js";
16
+ import { linePath } from "./path.js";
17
+ import { domainFrom, linearScale, timeScale, widenDegenerateDomain } from "./scale.js";
18
+ import { niceTickValues, thinTicks } from "./ticks.js";
19
+ function visiblePoints(series, range) {
20
+ const points = [...series.points].filter(p => p.position.kind === 'instant')
21
+ // Out-of-order input must still produce a correct axis.
22
+ .sort((a, b) => {
23
+ const at = a.position.kind === 'instant' ? a.position.at : 0;
24
+ const bt = b.position.kind === 'instant' ? b.position.at : 0;
25
+ return at - bt;
26
+ });
27
+ if (!range) {
28
+ return points;
29
+ }
30
+ return points.filter(p => {
31
+ const at = p.position.kind === 'instant' ? p.position.at : 0;
32
+ return at >= range.from && at <= range.to;
33
+ });
34
+ }
35
+ export function buildTimeSeriesGeometry(datasource, input, options = {}) {
36
+ const instants = [];
37
+ const values = [];
38
+ let excluded = 0;
39
+
40
+ // Sorted and windowed once per series; both passes below read the result.
41
+ const ordered = new Map(datasource.series.map(series => [series, visiblePoints(series, options.range)]));
42
+ for (const series of datasource.series) {
43
+ for (const point of ordered.get(series) ?? []) {
44
+ if (point.position.kind === 'instant') {
45
+ instants.push(point.position.at);
46
+ }
47
+ if (isKnown(point.value)) {
48
+ values.push(point.value.value);
49
+ } else {
50
+ excluded += 1;
51
+ }
52
+ }
53
+ }
54
+ if (instants.length === 0) {
55
+ return {
56
+ plot: input.plot,
57
+ paths: [],
58
+ markers: [],
59
+ labels: [],
60
+ xTicks: [],
61
+ yTicks: [],
62
+ hitRegions: [],
63
+ incomplete: excluded > 0
64
+ };
65
+ }
66
+
67
+ // Tick labels depend only on the domains, so the plot can make room for
68
+ // them before anything is projected.
69
+ // Widened here, as the scales would, so the ticks label the axes actually drawn.
70
+ const xDomain = widenDegenerateDomain(domainFrom(instants));
71
+ const yDomain = widenDegenerateDomain(domainFrom([...values, ...markerDomainValues(datasource.markers)], {
72
+ padFraction: 0.1
73
+ }));
74
+ const xTickValues = niceTickValues(xDomain, 4);
75
+ const yTickValues = niceTickValues(yDomain, 4);
76
+ const plot = insetForAxes(input.plot, {
77
+ xLabels: xTickValues.map(input.formatInstant),
78
+ yLabels: yTickValues.map(input.formatValue),
79
+ fontSize: input.fontSize
80
+ });
81
+ const x = timeScale(xDomain, {
82
+ min: plot.x,
83
+ max: plotRight(plot)
84
+ });
85
+ const y = linearScale(yDomain, {
86
+ min: plotBottom(plot),
87
+ max: plot.y
88
+ });
89
+ const paths = [];
90
+ const hitRegions = [];
91
+ for (const series of datasource.series) {
92
+ if (series.hidden) {
93
+ continue;
94
+ }
95
+ const pts = [];
96
+ for (const point of ordered.get(series) ?? []) {
97
+ const at = point.position.kind === 'instant' ? point.position.at : 0;
98
+ const px = x.project(at);
99
+ if (!isKnown(point.value)) {
100
+ // The gap. No coordinate is produced, so no segment can span it.
101
+ pts.push(null);
102
+ continue;
103
+ }
104
+ const py = y.project(point.value.value);
105
+ pts.push({
106
+ x: px,
107
+ y: py
108
+ });
109
+ hitRegions.push({
110
+ seriesId: series.id,
111
+ pointId: point.id,
112
+ x: px,
113
+ y: py,
114
+ // Withheld values are never selectable, so a callback can never
115
+ // carry one (FR-053).
116
+ selectable: !isWithheld(point.value)
117
+ });
118
+ }
119
+ const d = linePath(pts);
120
+ if (d.length > 0) {
121
+ paths.push({
122
+ key: `line-${series.id}`,
123
+ seriesId: series.id,
124
+ d,
125
+ color: input.seriesColors[series.id],
126
+ pattern: series.pattern ?? 'solid',
127
+ filled: false
128
+ });
129
+ }
130
+ }
131
+ const xTicks = xTickValues.map(v => ({
132
+ value: v,
133
+ position: x.project(v),
134
+ label: input.formatInstant(v)
135
+ }));
136
+ const yTicks = yTickValues.map(v => ({
137
+ value: v,
138
+ position: y.project(v),
139
+ label: input.formatValue(v)
140
+ }));
141
+ const markers = horizontalMarkers(datasource.markers, plot, y.project);
142
+ return {
143
+ plot,
144
+ paths,
145
+ markers: markers.lines,
146
+ labels: markers.labels,
147
+ xTicks: thinTicks(xTicks, input.fontSize, plot.width),
148
+ yTicks,
149
+ hitRegions,
150
+ incomplete: excluded > 0
151
+ };
152
+ }
153
+ //# sourceMappingURL=timeSeries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isKnown","isWithheld","insetForAxes","plotBottom","plotRight","horizontalMarkers","markerDomainValues","linePath","domainFrom","linearScale","timeScale","widenDegenerateDomain","niceTickValues","thinTicks","visiblePoints","series","range","points","filter","p","position","kind","sort","a","b","at","bt","from","to","buildTimeSeriesGeometry","datasource","input","options","instants","values","excluded","ordered","Map","map","point","get","push","value","length","plot","paths","markers","labels","xTicks","yTicks","hitRegions","incomplete","xDomain","yDomain","padFraction","xTickValues","yTickValues","xLabels","formatInstant","yLabels","formatValue","fontSize","x","min","max","y","hidden","pts","px","project","py","seriesId","id","pointId","selectable","d","key","color","seriesColors","pattern","filled","v","label","lines","width"],"sourceRoot":"../../../src","sources":["geometry/timeSeries.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,EAAEC,UAAU,QAAQ,sBAAmB;AAEvD,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAQ,aAAU;AAC9D,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,cAAW;AACjE,SAASC,QAAQ,QAAsB,WAAQ;AAC/C,SAASC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,qBAAqB,QAAQ,YAAS;AACnF,SAASC,cAAc,EAAEC,SAAS,QAAmB,YAAS;AAQ9D,SAASC,aAAaA,CAAIC,MAAiB,EAAEC,KAAkC,EAAE;EAChF,MAAMC,MAAM,GAAG,CAAC,GAAGF,MAAM,CAACE,MAAM,CAAC,CAC/BC,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,QAAQ,CAACC,IAAI,KAAK,SAAS;EAC1C;EAAA,CACCC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACf,MAAMC,EAAE,GAAGF,CAAC,CAACH,QAAQ,CAACC,IAAI,KAAK,SAAS,GAAGE,CAAC,CAACH,QAAQ,CAACK,EAAE,GAAG,CAAC;IAC5D,MAAMC,EAAE,GAAGF,CAAC,CAACJ,QAAQ,CAACC,IAAI,KAA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GAAG;EACxB,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The single memoized artefact each chart produces.
5
+ *
6
+ * `ResolvedGeometry` is keyed on datasource identity, plot rectangle, theme
7
+ * identity, and formatter identity — and deliberately **not** on selection.
8
+ * Highlighting a point must repaint the highlight, not recompute every scale
9
+ * and path string (research.md R3, FR-073).
10
+ *
11
+ * PURE. No React, no SVG.
12
+ */
13
+
14
+ /** One drawable group. Element count scales with these, never with points. */
15
+
16
+ /** A target, baseline, or threshold drawn across the plot. */
17
+
18
+ /** Text the chart draws itself, such as progress values or segment labels. */
19
+
20
+ /** What a colour ramp runs from and to, for the legend that explains it. */
21
+
22
+ export const EMPTY_GEOMETRY = {
23
+ plot: {
24
+ x: 0,
25
+ y: 0,
26
+ width: 0,
27
+ height: 0
28
+ },
29
+ paths: [],
30
+ markers: [],
31
+ labels: [],
32
+ xTicks: [],
33
+ yTicks: [],
34
+ hitRegions: [],
35
+ incomplete: false
36
+ };
37
+
38
+ /** Inputs every family geometry builder needs. */
39
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EMPTY_GEOMETRY","plot","x","y","width","height","paths","markers","labels","xTicks","yTicks","hitRegions","incomplete"],"sourceRoot":"../../../src","sources":["geometry/types.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;;AAcA;;AAQA;;AAUA;;AAwBA,OAAO,MAAMA,cAAgC,GAAG;EAC/CC,IAAI,EAAE;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC;EACzCC,KAAK,EAAE,EAAE;EACTC,OAAO,EAAE,EAAE;EACXC,MAAM,EAAE,EAAE;EACVC,MAAM,EAAE,EAAE;EACVC,MAAM,EAAE,EAAE;EACVC,UAAU,EAAE,EAAE;EACdC,UAAU,EAAE;AACb,CAAC;;AAED","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @chipmobilesdk/rn-chart — domain-agnostic charting for ChipMobileSdk-family
5
+ * React Native apps.
6
+ *
7
+ * This is the single public entrypoint (LIB-003). Modules under `geometry/`,
8
+ * `render/`, `validation/`, and the internals of `react/` are private; import
9
+ * them only through this file. Keeping them private is what lets the geometry,
10
+ * the layout maths, and the rendering substrate change without a breaking
11
+ * release.
12
+ *
13
+ * The package makes no network request, calls no AI service, reads no
14
+ * database, persists nothing, and logs no data value or series label. It
15
+ * renders numeric data and app-supplied labels — nothing else.
16
+ *
17
+ * There is deliberately **no insight, message, or narrative surface**: apps
18
+ * render their own text around a chart, and a chart imposes no outer margin
19
+ * that would fight that layout.
20
+ */
21
+
22
+ // ---------------------------------------------------------------------------
23
+ // Value semantics — the foundation of the contract
24
+ // ---------------------------------------------------------------------------
25
+
26
+ export { isKnown, isWithheld, known, notApplicable, participatesInTotals, sumKnown, unknown, withheld } from "./contract/value.js";
27
+
28
+ // ---------------------------------------------------------------------------
29
+ // Datasource contract
30
+ // ---------------------------------------------------------------------------
31
+
32
+ export { FAMILY_POSITION_KINDS, familyAcceptsPositionKind, resolveFormat, resolveUnit } from "./contract/datasource.js";
33
+ export { findTarget, isUsableTarget, readProgress } from "./contract/marker.js";
34
+
35
+ // ---------------------------------------------------------------------------
36
+ // Formatting
37
+ // ---------------------------------------------------------------------------
38
+
39
+ export { NON_VALUE_TEXT, formatLegendDefault, formatPositionDefault, formatValueDefault, seriesRef } from "./contract/format.js";
40
+
41
+ // ---------------------------------------------------------------------------
42
+ // State and errors
43
+ // ---------------------------------------------------------------------------
44
+
45
+ export { STATUS_PRECEDENCE, drawsData, resolveStatus, suppressesInteraction } from "./contract/state.js";
46
+ export { isChartError } from "./contract/errors.js";
47
+
48
+ // ---------------------------------------------------------------------------
49
+ // Interaction
50
+ // ---------------------------------------------------------------------------
51
+
52
+ export { sameSelection } from "./contract/interaction.js";
53
+
54
+ // ---------------------------------------------------------------------------
55
+ // Theme
56
+ // ---------------------------------------------------------------------------
57
+
58
+ export { defaultChartTheme, resolveSeriesColor } from "./contract/theme.js";
59
+
60
+ // ---------------------------------------------------------------------------
61
+ // Props and accessibility
62
+ // ---------------------------------------------------------------------------
63
+
64
+ // ---------------------------------------------------------------------------
65
+ // Dataset budgets
66
+ // ---------------------------------------------------------------------------
67
+
68
+ export { DATASET_BUDGETS, checkBudget } from "./validation/budgets.js";
69
+
70
+ // ---------------------------------------------------------------------------
71
+ // Components
72
+ // ---------------------------------------------------------------------------
73
+
74
+ export { BarChart, DistributionChart, HeatmapChart, ProgressChart, TimeSeriesChart } from "./react/charts.js";
75
+ export { ChartLegend, ColorScaleLegend, buildLegendEntries } from "./react/ChartLegend.js";
76
+ export { ChartThemeProvider, useChartTheme } from "./react/ChartThemeProvider.js";
77
+
78
+ // ---------------------------------------------------------------------------
79
+ // Accessibility helpers
80
+ // ---------------------------------------------------------------------------
81
+ export { buildChartSummary, buildPointAnnouncement, buildTotalAnnouncement } from "./a11y/summary.js";
82
+
83
+ // The package's own texts, for translation (CHT-05).
84
+ export { chartStrings } from "./contract/strings.js";
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isKnown","isWithheld","known","notApplicable","participatesInTotals","sumKnown","unknown","withheld","FAMILY_POSITION_KINDS","familyAcceptsPositionKind","resolveFormat","resolveUnit","findTarget","isUsableTarget","readProgress","NON_VALUE_TEXT","formatLegendDefault","formatPositionDefault","formatValueDefault","seriesRef","STATUS_PRECEDENCE","drawsData","resolveStatus","suppressesInteraction","isChartError","sameSelection","defaultChartTheme","resolveSeriesColor","DATASET_BUDGETS","checkBudget","BarChart","DistributionChart","HeatmapChart","ProgressChart","TimeSeriesChart","ChartLegend","ColorScaleLegend","buildLegendEntries","ChartThemeProvider","useChartTheme","buildChartSummary","buildPointAnnouncement","buildTotalAnnouncement","chartStrings"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAUA,SACCA,OAAO,EACPC,UAAU,EACVC,KAAK,EACLC,aAAa,EACbC,oBAAoB,EACpBC,QAAQ,EACRC,OAAO,EACPC,QAAQ,QACF,qBAAkB;;AAEzB;AACA;AACA;;AAaA,SACCC,qBAAqB,EACrBC,yBAAyB,EACzBC,aAAa,EACbC,WAAW,QACL,0BAAuB;AAK9B,SAASC,UAAU,EAAEC,cAAc,EAAEC,YAAY,QAAQ,sBAAmB;;AAE5E;AACA;AACA;;AAEA,SACCC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,kBAAkB,EAClBC,SAAS,QACH,sBAAmB;;AAE1B;AACA;AACA;;AAOA,SACCC,iBAAiB,EACjBC,SAAS,EACTC,aAAa,EACbC,qBAAqB,QACf,qBAAkB;AASzB,SAASC,YAAY,QAAQ,sBAAmB;;AAEhD;AACA;AACA;;AAQA,SAASC,aAAa,QAAQ,2BAAwB;;AAEtD;AACA;AACA;;AAEA,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,qBAAkB;;AAExE;AACA;AACA;;AAGA;AACA;AACA;;AAEA,SAASC,eAAe,EAAEC,WAAW,QAAQ,yBAAsB;;AAEnE;AACA;AACA;;AAQA,SACCC,QAAQ,EACRC,iBAAiB,EACjBC,YAAY,EACZC,aAAa,EACbC,eAAe,QACT,mBAAgB;AAEvB,SAASC,WAAW,EAAEC,gBAAgB,EAAEC,kBAAkB,QAAQ,wBAAqB;AAEvF,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,+BAA4B;;AAE9E;AACA;AACA;AACA,SAASC,iBAAiB,EAAEC,sBAAsB,EAAEC,sBAAsB,QAAQ,mBAAgB;;AAElG;AACA,SAASC,YAAY,QAAQ,uBAAoB","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Per-chart render-failure containment (FR-038a, FR-038b).
5
+ *
6
+ * React 19 still has no hook equivalent of an error boundary —
7
+ * `getDerivedStateFromError` and `componentDidCatch` remain class-only — so
8
+ * this is a class. Forty lines beats adding a dependency for it.
9
+ *
10
+ * Three behaviours are deliberate:
11
+ *
12
+ * - **Reset only on a real change.** The boundary clears its error when the
13
+ * datasource identity or chart key changes, never on an unrelated parent
14
+ * re-render. A deterministic geometry defect therefore cannot pin the CPU in
15
+ * a render-fail-render loop.
16
+ * - **Report once per distinct failure.** De-duplicated by signature, so a
17
+ * chart re-rendered by a sibling's state change does not re-report.
18
+ * - **Redact.** The report carries the chart identity and a catalogue message.
19
+ * A third-party exception's own text is never copied in, because we cannot
20
+ * promise it is free of data (POL-011).
21
+ */
22
+ import React from 'react';
23
+ import { chartError, failureSignature, toFailureReport } from "../contract/errors.js";
24
+ export class ChartBoundary extends React.Component {
25
+ constructor(props) {
26
+ super(props);
27
+ this.state = {
28
+ resetKey: props.resetKey
29
+ };
30
+ }
31
+ static getDerivedStateFromProps(props, state) {
32
+ if (props.resetKey !== state.resetKey) {
33
+ // New data: give the chart another chance.
34
+ return {
35
+ resetKey: props.resetKey,
36
+ error: undefined
37
+ };
38
+ }
39
+ return null;
40
+ }
41
+ static getDerivedStateFromError() {
42
+ // This must set the error, not just acknowledge it. Returning an empty
43
+ // object leaves render() showing the children again, they throw again,
44
+ // and React escalates past the boundary — which is exactly the
45
+ // screen-blanking failure this class exists to prevent.
46
+ //
47
+ // componentDidCatch then refines this into a report carrying the chart
48
+ // identity and family.
49
+ return {
50
+ error: chartError('render', 'renderException')
51
+ };
52
+ }
53
+ componentDidCatch(error, info) {
54
+ const report = toFailureReport(this.props.family, error, this.props.chartId, info?.componentStack ?? undefined);
55
+ const signature = failureSignature(report);
56
+ if (this.state.reportedSignature === signature) {
57
+ this.setState({
58
+ error: report.error
59
+ });
60
+ return;
61
+ }
62
+ this.setState({
63
+ error: report.error,
64
+ reportedSignature: signature
65
+ });
66
+ this.props.onFailure?.(report);
67
+ }
68
+ render() {
69
+ if (this.state.error) {
70
+ return this.props.renderFallback(this.state.error);
71
+ }
72
+ return this.props.children;
73
+ }
74
+ }
75
+ //# sourceMappingURL=ChartBoundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","chartError","failureSignature","toFailureReport","ChartBoundary","Component","constructor","props","state","resetKey","getDerivedStateFromProps","error","undefined","getDerivedStateFromError","componentDidCatch","info","report","family","chartId","componentStack","signature","reportedSignature","setState","onFailure","render","renderFallback","children"],"sourceRoot":"../../../src","sources":["react/ChartBoundary.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SACCC,UAAU,EACVC,gBAAgB,EAChBC,eAAe,QAGT,uBAAoB;AAkB3B,OAAO,MAAMC,aAAa,SAASJ,KAAK,CAACK,SAAS,CAAe;EAChEC,WAAWA,CAACC,KAAY,EAAE;IACzB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MAAEC,QAAQ,EAAEF,KAAK,CAACE;IAAS,CAAC;EAC1C;EAEA,OAAOC,wBAAwBA,CAACH,KAAY,EAAEC,KAAY,EAAgB;IACzE,IAAID,KAAK,CAACE,QAAQ,KAAKD,KAAK,CAACC,QAAQ,EAAE;MACtC;MACA,OAAO;QAAEA,QAAQ,EAAEF,KAAK,CAACE,QAAQ;QAAEE,KAAK,EAAEC;MAAU,CAAC;IACtD;IACA,OAAO,IAAI;EACZ;EAEA,OAAOC,wBAAwBA,CAAA,EAAmB;IACjD;IACA;IACA;IACA;IACA;IACA;IACA;IACA,OAAO;MAAEF,KAAK,EAAEV,UAAU,CAAC,QAAQ,EAAE,iBAAiB;IAAE,CAAC;EAC1D;EAESa,iBAAiBA,C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