@pie-lib/charting 7.0.3 → 7.0.4-next.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 (269) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +23 -0
  2. package/dist/actions-button.d.ts +26 -0
  3. package/dist/actions-button.js +84 -0
  4. package/dist/axes.d.ts +84 -0
  5. package/dist/axes.js +376 -0
  6. package/dist/bars/bar.d.ts +47 -0
  7. package/dist/bars/bar.js +27 -0
  8. package/dist/bars/common/bars.d.ts +98 -0
  9. package/dist/bars/common/bars.js +174 -0
  10. package/dist/bars/common/correct-check-icon.d.ts +18 -0
  11. package/dist/bars/common/correct-check-icon.js +50 -0
  12. package/dist/bars/histogram.d.ts +47 -0
  13. package/dist/bars/histogram.js +28 -0
  14. package/dist/chart-setup.d.ts +29 -0
  15. package/dist/chart-setup.js +231 -0
  16. package/dist/chart-type.d.ts +32 -0
  17. package/dist/chart-type.js +68 -0
  18. package/dist/chart-types.d.ts +41 -0
  19. package/dist/chart-types.js +17 -0
  20. package/dist/chart.d.ts +88 -0
  21. package/dist/chart.js +250 -0
  22. package/dist/common/correctness-indicators.d.ts +70 -0
  23. package/dist/common/correctness-indicators.js +106 -0
  24. package/dist/common/drag-handle.d.ts +129 -0
  25. package/dist/common/drag-handle.js +120 -0
  26. package/dist/common/drag-icon.d.ts +23 -0
  27. package/dist/common/drag-icon.js +45 -0
  28. package/dist/common/styles.d.ts +23 -0
  29. package/dist/common/styles.js +17 -0
  30. package/dist/grid.d.ts +45 -0
  31. package/dist/grid.js +56 -0
  32. package/dist/index.d.ts +14 -0
  33. package/dist/index.js +6 -0
  34. package/dist/key-legend.d.ts +19 -0
  35. package/dist/key-legend.js +46 -0
  36. package/dist/line/common/drag-handle.d.ts +120 -0
  37. package/dist/line/common/drag-handle.js +92 -0
  38. package/dist/line/common/line.d.ts +96 -0
  39. package/dist/line/common/line.js +114 -0
  40. package/dist/line/line-cross.d.ts +47 -0
  41. package/dist/line/line-cross.js +133 -0
  42. package/dist/line/line-dot.d.ts +47 -0
  43. package/dist/line/line-dot.js +101 -0
  44. package/dist/mark-label.d.ts +55 -0
  45. package/dist/mark-label.js +139 -0
  46. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +100 -0
  47. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisBottom.js +45 -0
  48. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisLeft.js +46 -0
  49. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +61 -0
  50. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +42 -0
  51. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
  52. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
  53. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +21 -0
  54. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
  55. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
  56. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +15 -0
  57. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +79 -0
  58. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +79 -0
  59. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
  60. package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +49 -0
  61. package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +18 -0
  62. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/align.js +6 -0
  63. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/base.js +6 -0
  64. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/clamp.js +6 -0
  65. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/constant.js +6 -0
  66. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/domain.js +6 -0
  67. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/exponent.js +6 -0
  68. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/interpolate.js +10 -0
  69. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/nice.js +37 -0
  70. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/padding.js +6 -0
  71. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/range.js +6 -0
  72. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/reverse.js +9 -0
  73. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/round.js +7 -0
  74. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/scaleOperator.js +58 -0
  75. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/unknown.js +6 -0
  76. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/zero.js +9 -0
  77. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/band.js +9 -0
  78. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/point.js +9 -0
  79. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +10 -0
  80. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/createColorInterpolator.js +29 -0
  81. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +9 -0
  82. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/isUtcScale.js +7 -0
  83. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
  84. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Bar.js +28 -0
  85. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Circle.js +28 -0
  86. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +46 -0
  87. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +49 -0
  88. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +9 -0
  89. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +6 -0
  90. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +52 -0
  91. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +57 -0
  92. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +91 -0
  93. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +21 -0
  94. package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-interpolate.js +8 -0
  95. package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-scale.js +8 -0
  96. package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-time.js +8 -0
  97. package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +32 -0
  98. package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +33 -0
  99. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Hash.js +21 -0
  100. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_ListCache.js +21 -0
  101. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Map.js +10 -0
  102. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_MapCache.js +21 -0
  103. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Symbol.js +9 -0
  104. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +14 -0
  105. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +15 -0
  106. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +16 -0
  107. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_coreJsData.js +9 -0
  108. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +8 -0
  109. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getMapData.js +14 -0
  110. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getNative.js +15 -0
  111. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getRawTag.js +19 -0
  112. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getValue.js +11 -0
  113. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashClear.js +13 -0
  114. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashDelete.js +12 -0
  115. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashGet.js +18 -0
  116. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashHas.js +14 -0
  117. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashSet.js +14 -0
  118. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isKeyable.js +12 -0
  119. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isMasked.js +16 -0
  120. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +11 -0
  121. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +14 -0
  122. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +14 -0
  123. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +13 -0
  124. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +14 -0
  125. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +19 -0
  126. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +14 -0
  127. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +13 -0
  128. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +13 -0
  129. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +14 -0
  130. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +9 -0
  131. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_objectToString.js +12 -0
  132. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_root.js +10 -0
  133. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_toSource.js +20 -0
  134. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/eq.js +11 -0
  135. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isFunction.js +16 -0
  136. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isObject.js +12 -0
  137. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/memoize.js +20 -0
  138. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +37 -0
  139. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +509 -0
  140. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +108 -0
  141. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +31 -0
  142. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +45 -0
  143. package/dist/node_modules/.bun/react-input-autosize@2.2.2_f4eacebf2041cd4f/node_modules/react-input-autosize/lib/AutosizeInput.js +216 -0
  144. package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +49 -0
  145. package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +34 -0
  146. package/dist/plot/common/plot.d.ts +103 -0
  147. package/dist/plot/common/plot.js +227 -0
  148. package/dist/plot/dot.d.ts +47 -0
  149. package/dist/plot/dot.js +62 -0
  150. package/dist/plot/line.d.ts +47 -0
  151. package/dist/plot/line.js +84 -0
  152. package/dist/tool-menu.d.ts +31 -0
  153. package/dist/utils.d.ts +39 -0
  154. package/dist/utils.js +101 -0
  155. package/package.json +35 -25
  156. package/CHANGELOG.json +0 -17
  157. package/CHANGELOG.md +0 -1116
  158. package/LICENSE.md +0 -5
  159. package/lib/actions-button.js +0 -145
  160. package/lib/actions-button.js.map +0 -1
  161. package/lib/axes.js +0 -643
  162. package/lib/axes.js.map +0 -1
  163. package/lib/bars/bar.js +0 -58
  164. package/lib/bars/bar.js.map +0 -1
  165. package/lib/bars/common/bars.js +0 -277
  166. package/lib/bars/common/bars.js.map +0 -1
  167. package/lib/bars/common/correct-check-icon.js +0 -54
  168. package/lib/bars/common/correct-check-icon.js.map +0 -1
  169. package/lib/bars/histogram.js +0 -59
  170. package/lib/bars/histogram.js.map +0 -1
  171. package/lib/chart-setup.js +0 -382
  172. package/lib/chart-setup.js.map +0 -1
  173. package/lib/chart-type.js +0 -80
  174. package/lib/chart-type.js.map +0 -1
  175. package/lib/chart-types.js +0 -22
  176. package/lib/chart-types.js.map +0 -1
  177. package/lib/chart.js +0 -384
  178. package/lib/chart.js.map +0 -1
  179. package/lib/common/correctness-indicators.js +0 -156
  180. package/lib/common/correctness-indicators.js.map +0 -1
  181. package/lib/common/drag-handle.js +0 -160
  182. package/lib/common/drag-handle.js.map +0 -1
  183. package/lib/common/drag-icon.js +0 -52
  184. package/lib/common/drag-icon.js.map +0 -1
  185. package/lib/common/styles.js +0 -22
  186. package/lib/common/styles.js.map +0 -1
  187. package/lib/grid.js +0 -112
  188. package/lib/grid.js.map +0 -1
  189. package/lib/index.js +0 -42
  190. package/lib/index.js.map +0 -1
  191. package/lib/key-legend.js +0 -87
  192. package/lib/key-legend.js.map +0 -1
  193. package/lib/line/common/drag-handle.js +0 -146
  194. package/lib/line/common/drag-handle.js.map +0 -1
  195. package/lib/line/common/line.js +0 -214
  196. package/lib/line/common/line.js.map +0 -1
  197. package/lib/line/line-cross.js +0 -214
  198. package/lib/line/line-cross.js.map +0 -1
  199. package/lib/line/line-dot.js +0 -158
  200. package/lib/line/line-dot.js.map +0 -1
  201. package/lib/mark-label.js +0 -237
  202. package/lib/mark-label.js.map +0 -1
  203. package/lib/plot/common/plot.js +0 -349
  204. package/lib/plot/common/plot.js.map +0 -1
  205. package/lib/plot/dot.js +0 -110
  206. package/lib/plot/dot.js.map +0 -1
  207. package/lib/plot/line.js +0 -140
  208. package/lib/plot/line.js.map +0 -1
  209. package/lib/tool-menu.js +0 -106
  210. package/lib/tool-menu.js.map +0 -1
  211. package/lib/utils.js +0 -189
  212. package/lib/utils.js.map +0 -1
  213. package/src/__tests__/actions-button.test.jsx +0 -280
  214. package/src/__tests__/axes.test.jsx +0 -667
  215. package/src/__tests__/chart-setup.test.jsx +0 -532
  216. package/src/__tests__/chart-type.test.jsx +0 -23
  217. package/src/__tests__/chart.test.jsx +0 -86
  218. package/src/__tests__/grid.test.jsx +0 -37
  219. package/src/__tests__/key-legend.test.jsx +0 -223
  220. package/src/__tests__/mark-label.test.jsx +0 -33
  221. package/src/__tests__/tool-menu.test.jsx +0 -522
  222. package/src/__tests__/utils.js +0 -36
  223. package/src/__tests__/utils.test.js +0 -100
  224. package/src/actions-button.jsx +0 -115
  225. package/src/axes.jsx +0 -594
  226. package/src/bars/__tests__/bar.test.jsx +0 -45
  227. package/src/bars/__tests__/histogram.test.jsx +0 -45
  228. package/src/bars/__tests__/utils.js +0 -30
  229. package/src/bars/bar.js +0 -28
  230. package/src/bars/common/__tests__/bars.test.jsx +0 -68
  231. package/src/bars/common/__tests__/utils.js +0 -30
  232. package/src/bars/common/bars.jsx +0 -249
  233. package/src/bars/common/correct-check-icon.jsx +0 -25
  234. package/src/bars/histogram.js +0 -28
  235. package/src/chart-setup.jsx +0 -356
  236. package/src/chart-type.js +0 -59
  237. package/src/chart-types.js +0 -8
  238. package/src/chart.jsx +0 -357
  239. package/src/common/__tests__/correctness-indicators.test.jsx +0 -720
  240. package/src/common/__tests__/drag-handle.test.jsx +0 -58
  241. package/src/common/__tests__/utils.js +0 -30
  242. package/src/common/correctness-indicators.jsx +0 -128
  243. package/src/common/drag-handle.jsx +0 -125
  244. package/src/common/drag-icon.jsx +0 -36
  245. package/src/common/styles.js +0 -19
  246. package/src/grid.jsx +0 -80
  247. package/src/index.js +0 -7
  248. package/src/key-legend.jsx +0 -77
  249. package/src/line/__tests__/line-cross.test.jsx +0 -463
  250. package/src/line/__tests__/line-dot.test.jsx +0 -41
  251. package/src/line/__tests__/utils.js +0 -36
  252. package/src/line/common/__tests__/drag-handle.test.jsx +0 -62
  253. package/src/line/common/__tests__/line.test.jsx +0 -79
  254. package/src/line/common/__tests__/utils.js +0 -30
  255. package/src/line/common/drag-handle.jsx +0 -114
  256. package/src/line/common/line.jsx +0 -171
  257. package/src/line/line-cross.js +0 -144
  258. package/src/line/line-dot.js +0 -111
  259. package/src/mark-label.jsx +0 -238
  260. package/src/plot/__tests__/dot.test.jsx +0 -344
  261. package/src/plot/__tests__/line.test.jsx +0 -375
  262. package/src/plot/__tests__/utils.js +0 -30
  263. package/src/plot/common/__tests__/plot.test.jsx +0 -69
  264. package/src/plot/common/__tests__/utils.js +0 -30
  265. package/src/plot/common/plot.jsx +0 -358
  266. package/src/plot/dot.js +0 -74
  267. package/src/plot/line.js +0 -98
  268. package/src/tool-menu.jsx +0 -85
  269. package/src/utils.js +0 -201
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/charting/src/chart-type.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ declare const ChartType: {
12
+ ({ onChange, value, availableChartTypes, chartTypeLabel }: {
13
+ onChange: any;
14
+ value: any;
15
+ availableChartTypes: any;
16
+ chartTypeLabel: any;
17
+ }): React.JSX.Element;
18
+ propTypes: {
19
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
20
+ value: PropTypes.Validator<string>;
21
+ availableChartTypes: PropTypes.Requireable<PropTypes.InferProps<{
22
+ histogram: PropTypes.Requireable<string>;
23
+ bar: PropTypes.Requireable<string>;
24
+ lineDot: PropTypes.Requireable<string>;
25
+ lineCross: PropTypes.Requireable<string>;
26
+ dotPlot: PropTypes.Requireable<string>;
27
+ linePlot: PropTypes.Requireable<string>;
28
+ }>>;
29
+ chartTypeLabel: PropTypes.Requireable<string>;
30
+ };
31
+ };
32
+ export default ChartType;
@@ -0,0 +1,68 @@
1
+ import "react";
2
+ import e from "prop-types";
3
+ import { styled as t } from "@mui/material/styles";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import i from "@mui/material/MenuItem";
6
+ import a from "@mui/material/FormControl";
7
+ import o from "@mui/material/InputLabel";
8
+ import { Select as s } from "@mui/material";
9
+ //#region src/chart-type.tsx
10
+ var c = t("div")(() => ({ width: "160px" })), l = t(a)(() => ({ width: "160px" })), u = t(o)(() => ({ backgroundColor: "transparent" })), d = ({ onChange: e, value: t, availableChartTypes: a, chartTypeLabel: o }) => /* @__PURE__ */ n(c, { children: /* @__PURE__ */ r(l, {
11
+ variant: "outlined",
12
+ children: [/* @__PURE__ */ n(u, {
13
+ id: "type-helper-label",
14
+ children: o
15
+ }), /* @__PURE__ */ r(s, {
16
+ labelId: "type-helper-label",
17
+ id: "type-helper-label-select",
18
+ name: "chartType",
19
+ value: t,
20
+ onChange: e,
21
+ label: o,
22
+ MenuProps: { transitionDuration: {
23
+ enter: 225,
24
+ exit: 195
25
+ } },
26
+ children: [
27
+ a?.histogram && /* @__PURE__ */ n(i, {
28
+ value: "histogram",
29
+ children: a.histogram
30
+ }),
31
+ a?.bar && /* @__PURE__ */ n(i, {
32
+ value: "bar",
33
+ children: a.bar
34
+ }),
35
+ a?.lineDot && /* @__PURE__ */ n(i, {
36
+ value: "lineDot",
37
+ children: a.lineDot
38
+ }),
39
+ a?.lineCross && /* @__PURE__ */ n(i, {
40
+ value: "lineCross",
41
+ children: a.lineCross
42
+ }),
43
+ a?.dotPlot && /* @__PURE__ */ n(i, {
44
+ value: "dotPlot",
45
+ children: a.dotPlot
46
+ }),
47
+ a?.linePlot && /* @__PURE__ */ n(i, {
48
+ value: "linePlot",
49
+ children: a.linePlot
50
+ })
51
+ ]
52
+ })]
53
+ }) });
54
+ d.propTypes = {
55
+ onChange: e.func.isRequired,
56
+ value: e.string.isRequired,
57
+ availableChartTypes: e.shape({
58
+ histogram: e.string,
59
+ bar: e.string,
60
+ lineDot: e.string,
61
+ lineCross: e.string,
62
+ dotPlot: e.string,
63
+ linePlot: e.string
64
+ }),
65
+ chartTypeLabel: e.string
66
+ };
67
+ //#endregion
68
+ export { d as default };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/charting/src/chart-types.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const _default: {
10
+ Bar: () => {
11
+ type: string;
12
+ Component: typeof import("./bars/bar.js").Bar;
13
+ name: string;
14
+ };
15
+ Histogram: () => {
16
+ type: string;
17
+ Component: typeof import("./bars/histogram.js").Histogram;
18
+ name: string;
19
+ };
20
+ LineDot: () => {
21
+ type: string;
22
+ Component: typeof import("./line/line-dot.js").LineDot;
23
+ name: string;
24
+ };
25
+ DotPlot: () => {
26
+ type: string;
27
+ Component: typeof import("./plot/dot.js").DotPlot;
28
+ name: string;
29
+ };
30
+ LinePlot: () => {
31
+ type: string;
32
+ Component: typeof import("./plot/line.js").LinePlot;
33
+ name: string;
34
+ };
35
+ LineCross: () => {
36
+ type: string;
37
+ Component: typeof import("./line/line-cross.js").LineCross;
38
+ name: string;
39
+ };
40
+ };
41
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import e from "./bars/bar.js";
2
+ import t from "./bars/histogram.js";
3
+ import n from "./line/line-dot.js";
4
+ import r from "./line/line-cross.js";
5
+ import i from "./plot/dot.js";
6
+ import a from "./plot/line.js";
7
+ //#region src/chart-types.ts
8
+ var o = {
9
+ Bar: e,
10
+ Histogram: t,
11
+ LineDot: n,
12
+ DotPlot: i,
13
+ LinePlot: a,
14
+ LineCross: r
15
+ };
16
+ //#endregion
17
+ export { o as default };
@@ -0,0 +1,88 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/charting/src/chart.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Chart extends React.Component {
12
+ constructor(props: any);
13
+ static propTypes: {
14
+ className: PropTypes.Requireable<string>;
15
+ chartType: PropTypes.Validator<string>;
16
+ size: PropTypes.Requireable<PropTypes.InferProps<{
17
+ width: PropTypes.Requireable<number>;
18
+ height: PropTypes.Requireable<number>;
19
+ }>>;
20
+ domain: PropTypes.Requireable<PropTypes.InferProps<{
21
+ label: PropTypes.Requireable<string>;
22
+ min: PropTypes.Requireable<number>;
23
+ max: PropTypes.Requireable<number>;
24
+ axisLabel: PropTypes.Requireable<string>;
25
+ }>>;
26
+ data: PropTypes.Requireable<(PropTypes.InferProps<{
27
+ label: PropTypes.Requireable<string>;
28
+ value: PropTypes.Requireable<number>;
29
+ }> | null | undefined)[]>;
30
+ range: PropTypes.Requireable<PropTypes.InferProps<{
31
+ label: PropTypes.Requireable<string>;
32
+ min: PropTypes.Requireable<number>;
33
+ max: PropTypes.Requireable<number>;
34
+ step: PropTypes.Requireable<number>;
35
+ labelStep: PropTypes.Requireable<number>;
36
+ axisLabel: PropTypes.Requireable<string>;
37
+ }>>;
38
+ charts: PropTypes.Requireable<any[]>;
39
+ labelsPlaceholders: PropTypes.Requireable<object>;
40
+ title: PropTypes.Requireable<string>;
41
+ titlePlaceholder: PropTypes.Requireable<string>;
42
+ onDataChange: PropTypes.Requireable<(...args: any[]) => any>;
43
+ onChangeLabels: PropTypes.Requireable<(...args: any[]) => any>;
44
+ onChangeTitle: PropTypes.Requireable<(...args: any[]) => any>;
45
+ error: PropTypes.Requireable<any>;
46
+ addCategoryEnabled: PropTypes.Requireable<boolean>;
47
+ showPixelGuides: PropTypes.Requireable<boolean>;
48
+ categoryDefaultLabel: PropTypes.Requireable<string>;
49
+ categoryDefaults: PropTypes.Requireable<object>;
50
+ defineChart: PropTypes.Requireable<boolean>;
51
+ theme: PropTypes.Requireable<object>;
52
+ chartingOptions: PropTypes.Requireable<object>;
53
+ changeInteractiveEnabled: PropTypes.Requireable<boolean>;
54
+ changeEditableEnabled: PropTypes.Requireable<boolean>;
55
+ language: PropTypes.Requireable<string>;
56
+ mathMlOptions: PropTypes.Requireable<object>;
57
+ labelsCharactersLimit: PropTypes.Requireable<number>;
58
+ correctData: PropTypes.Requireable<(PropTypes.InferProps<{
59
+ label: PropTypes.Requireable<string>;
60
+ value: PropTypes.Requireable<number>;
61
+ }> | null | undefined)[]>;
62
+ };
63
+ static defaultProps: {
64
+ size: {
65
+ width: number;
66
+ height: number;
67
+ };
68
+ };
69
+ state: {
70
+ charts: {
71
+ type: string;
72
+ Component: typeof import("./bars/bar.jsx").Bar;
73
+ name: string;
74
+ }[];
75
+ autoFocus: boolean;
76
+ };
77
+ generateMaskId(): string;
78
+ handleAlertDialog: (open: any, callback: any) => void;
79
+ getChart: any;
80
+ changeData: any;
81
+ changeCategory: any;
82
+ addCategory: any;
83
+ deleteCategory: any;
84
+ getFilteredCategories: any;
85
+ resetAutoFocus: any;
86
+ render(): React.JSX.Element;
87
+ }
88
+ export default Chart;
package/dist/chart.js ADDED
@@ -0,0 +1,250 @@
1
+ import e from "./grid.js";
2
+ import { dataToXBand as t, getDomainAndRangeByChartType as n, getGridLinesAndAxisByChartType as r, getTopPadding as i } from "./utils.js";
3
+ import a from "./axes.js";
4
+ import o from "./chart-types.js";
5
+ import s from "./actions-button.js";
6
+ import c from "react";
7
+ import l from "prop-types";
8
+ import { styled as u } from "@mui/material/styles";
9
+ import d from "debug";
10
+ import { cloneDeep as f } from "lodash-es";
11
+ import { Root as p, createGraphProps as m } from "@pie-lib/plot";
12
+ import { AlertDialog as h } from "@pie-lib/config-ui";
13
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import v from "@pie-lib/translator";
15
+ //#region src/chart.tsx
16
+ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({ width: "min-content" })), S = class extends c.Component {
17
+ constructor(e) {
18
+ super(e), this.state = {
19
+ dialog: { open: !1 },
20
+ actionsAnchorEl: null
21
+ }, this.maskUid = this.generateMaskId();
22
+ }
23
+ static propTypes = {
24
+ className: l.string,
25
+ chartType: l.string.isRequired,
26
+ size: l.shape({
27
+ width: l.number,
28
+ height: l.number
29
+ }),
30
+ domain: l.shape({
31
+ label: l.string,
32
+ min: l.number,
33
+ max: l.number,
34
+ axisLabel: l.string
35
+ }),
36
+ data: l.arrayOf(l.shape({
37
+ label: l.string,
38
+ value: l.number
39
+ })),
40
+ range: l.shape({
41
+ label: l.string,
42
+ min: l.number,
43
+ max: l.number,
44
+ step: l.number,
45
+ labelStep: l.number,
46
+ axisLabel: l.string
47
+ }),
48
+ charts: l.array,
49
+ labelsPlaceholders: l.object,
50
+ title: l.string,
51
+ titlePlaceholder: l.string,
52
+ onDataChange: l.func,
53
+ onChangeLabels: l.func,
54
+ onChangeTitle: l.func,
55
+ error: l.any,
56
+ addCategoryEnabled: l.bool,
57
+ showPixelGuides: l.bool,
58
+ categoryDefaultLabel: l.string,
59
+ categoryDefaults: l.object,
60
+ defineChart: l.bool,
61
+ theme: l.object,
62
+ chartingOptions: l.object,
63
+ changeInteractiveEnabled: l.bool,
64
+ changeEditableEnabled: l.bool,
65
+ language: l.string,
66
+ mathMlOptions: l.object,
67
+ labelsCharactersLimit: l.number,
68
+ correctData: l.arrayOf(l.shape({
69
+ label: l.string,
70
+ value: l.number
71
+ }))
72
+ };
73
+ static defaultProps = { size: {
74
+ width: 480,
75
+ height: 480
76
+ } };
77
+ state = {
78
+ charts: [
79
+ o.Bar(),
80
+ o.Histogram(),
81
+ o.LineDot(),
82
+ o.LineCross(),
83
+ o.DotPlot(),
84
+ o.LinePlot()
85
+ ],
86
+ autoFocus: !1
87
+ };
88
+ generateMaskId() {
89
+ return "chart-" + (Math.random() * 1e4).toFixed();
90
+ }
91
+ handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
92
+ getChart = () => {
93
+ let e = this.props.charts || this.state.charts, { chartType: t } = this.props, n = null, r = null;
94
+ return t ? (r = e && e.find((e) => e.type === t), n = r && r.Component) : (r = e && e[0], n = r && r.Component, t = r && r.type), {
95
+ type: t,
96
+ ChartComponent: n
97
+ };
98
+ };
99
+ changeData = (e) => {
100
+ let { onDataChange: t } = this.props;
101
+ t(e);
102
+ };
103
+ changeCategory = (e, t) => {
104
+ let n = parseInt(e, 10);
105
+ if (n >= 0) {
106
+ let { data: e, onDataChange: r } = this.props;
107
+ e[n] = {
108
+ ...e[n],
109
+ ...t
110
+ }, r(e);
111
+ }
112
+ };
113
+ addCategory = () => {
114
+ let { onDataChange: e, data: t, categoryDefaultLabel: n, defineChart: r, categoryDefaults: i, language: a } = this.props;
115
+ (t || []).length > 19 ? this.setState({ dialog: {
116
+ open: !0,
117
+ title: y.t("common:warning", { lng: a }),
118
+ text: y.t("charting.reachedLimit_other", {
119
+ count: 20,
120
+ lng: a
121
+ }),
122
+ onConfirm: () => this.handleAlertDialog(!1)
123
+ } }) : (this.setState({ autoFocus: !0 }), e([...t, {
124
+ inDefineChart: r,
125
+ label: n || y.t("charting.newLabel", { lng: a }),
126
+ value: 0,
127
+ deletable: !0,
128
+ editable: i ? i?.editable : !0,
129
+ interactive: i ? i?.interactive : !0
130
+ }]));
131
+ };
132
+ deleteCategory = (e) => {
133
+ let { data: t, onDataChange: n } = this.props;
134
+ typeof e != "number" || e < 0 || t && t.length > 0 && n(t.filter((t, n) => n !== e));
135
+ };
136
+ getFilteredCategories = () => {
137
+ let { data: e, defineChart: t } = this.props;
138
+ return e ? e.map((e) => ({
139
+ ...e,
140
+ deletable: t || e.deletable
141
+ })) : [];
142
+ };
143
+ resetAutoFocus = () => {
144
+ this.setState({ autoFocus: !1 });
145
+ };
146
+ render() {
147
+ let { domain: o = {}, range: c = {}, chartingOptions: l, size: u, title: d, onChangeTitle: v, onChangeLabels: y, labelsPlaceholders: S, titlePlaceholder: C, addCategoryEnabled: w, changeInteractiveEnabled: T, changeEditableEnabled: E, showPixelGuides: D, error: O, mathMlOptions: k = {}, language: A, labelsCharactersLimit: j, correctData: M } = this.props, { chartType: N } = this.props, { dialog: P } = this.state, F = this.props.defineChart || !1, { width: I, height: L } = u || {}, R = {
148
+ left: c?.label || "",
149
+ bottom: o?.label || ""
150
+ }, { ChartComponent: z } = this.getChart(), B = this.getFilteredCategories(), V = n(o, c, N), { verticalLines: H, horizontalLines: U, leftAxis: W } = r(V.range, N), G = { graphProps: m(V.domain, V.range, u, () => this.rootNode) };
151
+ b("[render] common:", G);
152
+ let K = {
153
+ x: -10,
154
+ y: -75,
155
+ width: I + 20,
156
+ height: L + 130
157
+ }, { scale: q } = G.graphProps, J = t(q.x, B, I, N), Y = J.bandwidth() || q.x(V.domain.max) / B.length, X = F ? 160 : 60, Z = i(Y), Q = f(G);
158
+ return Q.graphProps.size.height += Z + X, (N === "dotPlot" || N === "linePlot") && M?.length && R.bottom && (Q.graphProps.size.height += 25), /* @__PURE__ */ _(x, { children: [/* @__PURE__ */ _(p, {
159
+ title: d,
160
+ onChangeTitle: v,
161
+ disabledTitle: !F,
162
+ showTitle: !0,
163
+ showLabels: !0,
164
+ labels: R,
165
+ onChangeLabels: y,
166
+ labelsPlaceholders: S,
167
+ titlePlaceholder: C,
168
+ defineChart: F,
169
+ disabledLabels: !F,
170
+ isChart: !0,
171
+ showPixelGuides: D,
172
+ rootRef: (e) => this.rootNode = e,
173
+ mathMlOptions: k,
174
+ labelsCharactersLimit: j,
175
+ ...Q,
176
+ children: [
177
+ /* @__PURE__ */ g(e, {
178
+ ...G,
179
+ xBand: J,
180
+ rowTickValues: U,
181
+ columnTickValues: H
182
+ }),
183
+ /* @__PURE__ */ g(a, {
184
+ autoFocus: this.state.autoFocus,
185
+ onAutoFocusUsed: this.resetAutoFocus,
186
+ ...G,
187
+ defineChart: F,
188
+ categories: B,
189
+ xBand: J,
190
+ leftAxis: W,
191
+ onChange: this.changeData,
192
+ onChangeCategory: this.changeCategory,
193
+ chartingOptions: l,
194
+ changeInteractiveEnabled: T,
195
+ changeEditableEnabled: E,
196
+ top: Z,
197
+ error: O,
198
+ showCorrectness: N === "linePlot" || N === "dotPlot"
199
+ }),
200
+ w ? /* @__PURE__ */ g("foreignObject", {
201
+ x: I,
202
+ y: L - 16,
203
+ width: I,
204
+ height: L,
205
+ children: /* @__PURE__ */ g("div", {
206
+ xmlns: "http://www.w3.org/1999/xhtml",
207
+ style: {
208
+ display: "flex",
209
+ justifyContent: "flex-start"
210
+ },
211
+ children: /* @__PURE__ */ g(s, {
212
+ categories: B,
213
+ addCategory: this.addCategory,
214
+ deleteCategory: this.deleteCategory,
215
+ language: A
216
+ })
217
+ })
218
+ }) : null,
219
+ /* @__PURE__ */ g("mask", {
220
+ id: `${this.maskUid}`,
221
+ children: /* @__PURE__ */ g("rect", {
222
+ ...K,
223
+ fill: "white"
224
+ })
225
+ }),
226
+ /* @__PURE__ */ g("g", {
227
+ id: "marks",
228
+ mask: `url('#${this.maskUid}')`,
229
+ children: z && /* @__PURE__ */ g(z, {
230
+ ...G,
231
+ data: B,
232
+ height: Q.graphProps.size.height,
233
+ defineChart: F,
234
+ onChange: this.changeData,
235
+ onChangeCategory: this.changeCategory,
236
+ correctData: M
237
+ })
238
+ })
239
+ ]
240
+ }), /* @__PURE__ */ g(h, {
241
+ open: P.open,
242
+ title: P.title,
243
+ text: P.text,
244
+ onClose: P.onClose,
245
+ onConfirm: P.onConfirm
246
+ })] });
247
+ }
248
+ };
249
+ //#endregion
250
+ export { S as default };
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/charting/src/common/correctness-indicators.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare const CorrectnessIndicator: {
12
+ ({ scale, x, y, correctness, interactive }: {
13
+ scale: any;
14
+ x: any;
15
+ y: any;
16
+ correctness: any;
17
+ interactive: any;
18
+ }): React.JSX.Element | null;
19
+ propTypes: {
20
+ scale: PropTypes.Requireable<PropTypes.InferProps<{
21
+ x: PropTypes.Requireable<(...args: any[]) => any>;
22
+ y: PropTypes.Requireable<(...args: any[]) => any>;
23
+ }>>;
24
+ x: PropTypes.Validator<number>;
25
+ y: PropTypes.Validator<number>;
26
+ correctness: PropTypes.Requireable<PropTypes.InferProps<{
27
+ value: PropTypes.Requireable<string>;
28
+ label: PropTypes.Requireable<string>;
29
+ }>>;
30
+ interactive: PropTypes.Requireable<boolean>;
31
+ };
32
+ };
33
+ export declare const SmallCorrectPointIndicator: {
34
+ ({ scale, x, correctness, correctData, label }: {
35
+ scale: any;
36
+ x: any;
37
+ correctness: any;
38
+ correctData: any;
39
+ label: any;
40
+ }): React.JSX.Element | null;
41
+ propTypes: {
42
+ scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
43
+ x: PropTypes.Requireable<(...args: any[]) => any>;
44
+ y: PropTypes.Requireable<(...args: any[]) => any>;
45
+ }>>>;
46
+ x: PropTypes.Validator<number>;
47
+ correctness: PropTypes.Requireable<PropTypes.InferProps<{
48
+ value: PropTypes.Requireable<string>;
49
+ label: PropTypes.Requireable<string>;
50
+ }>>;
51
+ correctData: PropTypes.Requireable<(PropTypes.InferProps<{
52
+ label: PropTypes.Requireable<string>;
53
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
54
+ }> | null | undefined)[]>;
55
+ label: PropTypes.Requireable<string>;
56
+ };
57
+ };
58
+ export declare const TickCorrectnessIndicator: {
59
+ ({ correctness, interactive }: {
60
+ correctness: any;
61
+ interactive: any;
62
+ }): React.JSX.Element | null;
63
+ propTypes: {
64
+ correctness: PropTypes.Requireable<PropTypes.InferProps<{
65
+ value: PropTypes.Requireable<string>;
66
+ label: PropTypes.Requireable<string>;
67
+ }>>;
68
+ interactive: PropTypes.Requireable<boolean>;
69
+ };
70
+ };
@@ -0,0 +1,106 @@
1
+ import "react";
2
+ import e from "prop-types";
3
+ import { styled as t } from "@mui/material/styles";
4
+ import { color as n } from "@pie-lib/render-ui";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ import i from "@mui/icons-material/Check";
7
+ import a from "@mui/icons-material/Close";
8
+ //#region src/common/correctness-indicators.tsx
9
+ var o = t(i)(({ theme: e }) => ({
10
+ borderRadius: e.spacing(2),
11
+ color: n.defaults.WHITE,
12
+ fontSize: "16px",
13
+ width: "16px",
14
+ height: "16px",
15
+ padding: "2px",
16
+ border: `1px solid ${n.defaults.WHITE}`,
17
+ stroke: "initial",
18
+ boxSizing: "unset",
19
+ backgroundColor: n.correct(),
20
+ display: "block",
21
+ "&.small": {
22
+ fontSize: "10px",
23
+ width: "10px",
24
+ height: "10px"
25
+ }
26
+ })), s = t(a)(({ theme: e }) => ({
27
+ borderRadius: e.spacing(2),
28
+ color: n.defaults.WHITE,
29
+ fontSize: "16px",
30
+ width: "16px",
31
+ height: "16px",
32
+ padding: "2px",
33
+ border: `1px solid ${n.defaults.WHITE}`,
34
+ stroke: "initial",
35
+ boxSizing: "unset",
36
+ backgroundColor: n.incorrectWithIcon(),
37
+ display: "block",
38
+ "&.small": {
39
+ fontSize: "10px",
40
+ width: "10px",
41
+ height: "10px"
42
+ }
43
+ })), c = ({ scale: e, x: t, y: n, correctness: i, interactive: a }) => {
44
+ if (!i || !a) return null;
45
+ let c = e ? e.x(t) : t, l = e ? e.y(n) : n, u = i.value === "correct";
46
+ return /* @__PURE__ */ r("foreignObject", {
47
+ x: c - 11,
48
+ y: l - 11,
49
+ width: 22,
50
+ height: 22,
51
+ children: r(u ? o : s, { title: i.label })
52
+ });
53
+ }, l = ({ scale: e, x: t, correctness: n, correctData: i, label: a }) => {
54
+ if (n && n.value === "incorrect") {
55
+ let s = parseFloat(i.find((e) => e.label === a)?.value);
56
+ if (isNaN(s)) return null;
57
+ let c = e.y(s) - 7.5;
58
+ return /* @__PURE__ */ r("foreignObject", {
59
+ x: e.x(t) - 7.5,
60
+ y: c,
61
+ width: 15,
62
+ height: 15,
63
+ children: /* @__PURE__ */ r(o, {
64
+ className: "small",
65
+ title: n.label
66
+ })
67
+ });
68
+ }
69
+ return null;
70
+ }, u = ({ correctness: e, interactive: t }) => !e || !t ? null : e.value === "correct" ? /* @__PURE__ */ r(o, { title: e.label }) : /* @__PURE__ */ r(s, { title: e.label });
71
+ c.propTypes = {
72
+ scale: e.shape({
73
+ x: e.func,
74
+ y: e.func
75
+ }),
76
+ x: e.number.isRequired,
77
+ y: e.number.isRequired,
78
+ correctness: e.shape({
79
+ value: e.string,
80
+ label: e.string
81
+ }),
82
+ interactive: e.bool
83
+ }, l.propTypes = {
84
+ scale: e.shape({
85
+ x: e.func,
86
+ y: e.func
87
+ }).isRequired,
88
+ x: e.number.isRequired,
89
+ correctness: e.shape({
90
+ value: e.string,
91
+ label: e.string
92
+ }),
93
+ correctData: e.arrayOf(e.shape({
94
+ label: e.string,
95
+ value: e.oneOfType([e.string, e.number])
96
+ })),
97
+ label: e.string
98
+ }, u.propTypes = {
99
+ correctness: e.shape({
100
+ value: e.string,
101
+ label: e.string
102
+ }),
103
+ interactive: e.bool
104
+ };
105
+ //#endregion
106
+ export { c as CorrectnessIndicator, l as SmallCorrectPointIndicator, u as TickCorrectnessIndicator };