@pie-lib/charting 7.0.4-next.31 → 7.0.4-next.34

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 (272) hide show
  1. package/CHANGELOG.json +17 -0
  2. package/CHANGELOG.md +1116 -0
  3. package/LICENSE.md +5 -0
  4. package/lib/actions-button.js +145 -0
  5. package/lib/actions-button.js.map +1 -0
  6. package/lib/axes.js +643 -0
  7. package/lib/axes.js.map +1 -0
  8. package/lib/bars/bar.js +58 -0
  9. package/lib/bars/bar.js.map +1 -0
  10. package/lib/bars/common/bars.js +277 -0
  11. package/lib/bars/common/bars.js.map +1 -0
  12. package/lib/bars/common/correct-check-icon.js +54 -0
  13. package/lib/bars/common/correct-check-icon.js.map +1 -0
  14. package/lib/bars/histogram.js +59 -0
  15. package/lib/bars/histogram.js.map +1 -0
  16. package/lib/chart-setup.js +382 -0
  17. package/lib/chart-setup.js.map +1 -0
  18. package/lib/chart-type.js +80 -0
  19. package/lib/chart-type.js.map +1 -0
  20. package/lib/chart-types.js +22 -0
  21. package/lib/chart-types.js.map +1 -0
  22. package/lib/chart.js +384 -0
  23. package/lib/chart.js.map +1 -0
  24. package/lib/common/correctness-indicators.js +156 -0
  25. package/lib/common/correctness-indicators.js.map +1 -0
  26. package/lib/common/drag-handle.js +160 -0
  27. package/lib/common/drag-handle.js.map +1 -0
  28. package/lib/common/drag-icon.js +52 -0
  29. package/lib/common/drag-icon.js.map +1 -0
  30. package/lib/common/styles.js +22 -0
  31. package/lib/common/styles.js.map +1 -0
  32. package/lib/grid.js +112 -0
  33. package/lib/grid.js.map +1 -0
  34. package/lib/index.js +42 -0
  35. package/lib/index.js.map +1 -0
  36. package/lib/key-legend.js +87 -0
  37. package/lib/key-legend.js.map +1 -0
  38. package/lib/line/common/drag-handle.js +146 -0
  39. package/lib/line/common/drag-handle.js.map +1 -0
  40. package/lib/line/common/line.js +214 -0
  41. package/lib/line/common/line.js.map +1 -0
  42. package/lib/line/line-cross.js +214 -0
  43. package/lib/line/line-cross.js.map +1 -0
  44. package/lib/line/line-dot.js +158 -0
  45. package/lib/line/line-dot.js.map +1 -0
  46. package/lib/mark-label.js +237 -0
  47. package/lib/mark-label.js.map +1 -0
  48. package/lib/plot/common/plot.js +349 -0
  49. package/lib/plot/common/plot.js.map +1 -0
  50. package/lib/plot/dot.js +110 -0
  51. package/lib/plot/dot.js.map +1 -0
  52. package/lib/plot/line.js +140 -0
  53. package/lib/plot/line.js.map +1 -0
  54. package/lib/tool-menu.js +106 -0
  55. package/lib/tool-menu.js.map +1 -0
  56. package/lib/utils.js +189 -0
  57. package/lib/utils.js.map +1 -0
  58. package/package.json +28 -39
  59. package/src/__tests__/actions-button.test.jsx +280 -0
  60. package/src/__tests__/axes.test.jsx +667 -0
  61. package/src/__tests__/chart-setup.test.jsx +532 -0
  62. package/src/__tests__/chart-type.test.jsx +23 -0
  63. package/src/__tests__/chart.test.jsx +86 -0
  64. package/src/__tests__/grid.test.jsx +37 -0
  65. package/src/__tests__/key-legend.test.jsx +223 -0
  66. package/src/__tests__/mark-label.test.jsx +33 -0
  67. package/src/__tests__/tool-menu.test.jsx +522 -0
  68. package/src/__tests__/utils.js +36 -0
  69. package/src/__tests__/utils.test.js +100 -0
  70. package/src/actions-button.jsx +115 -0
  71. package/src/axes.jsx +594 -0
  72. package/src/bars/__tests__/bar.test.jsx +45 -0
  73. package/src/bars/__tests__/histogram.test.jsx +45 -0
  74. package/src/bars/__tests__/utils.js +30 -0
  75. package/src/bars/bar.js +28 -0
  76. package/src/bars/common/__tests__/bars.test.jsx +68 -0
  77. package/src/bars/common/__tests__/utils.js +30 -0
  78. package/src/bars/common/bars.jsx +249 -0
  79. package/src/bars/common/correct-check-icon.jsx +25 -0
  80. package/src/bars/histogram.js +28 -0
  81. package/src/chart-setup.jsx +356 -0
  82. package/src/chart-type.js +59 -0
  83. package/src/chart-types.js +8 -0
  84. package/src/chart.jsx +357 -0
  85. package/src/common/__tests__/correctness-indicators.test.jsx +720 -0
  86. package/src/common/__tests__/drag-handle.test.jsx +58 -0
  87. package/src/common/__tests__/utils.js +30 -0
  88. package/src/common/correctness-indicators.jsx +128 -0
  89. package/src/common/drag-handle.jsx +125 -0
  90. package/src/common/drag-icon.jsx +36 -0
  91. package/src/common/styles.js +19 -0
  92. package/src/grid.jsx +80 -0
  93. package/src/index.js +7 -0
  94. package/src/key-legend.jsx +77 -0
  95. package/src/line/__tests__/line-cross.test.jsx +463 -0
  96. package/src/line/__tests__/line-dot.test.jsx +41 -0
  97. package/src/line/__tests__/utils.js +36 -0
  98. package/src/line/common/__tests__/drag-handle.test.jsx +62 -0
  99. package/src/line/common/__tests__/line.test.jsx +79 -0
  100. package/src/line/common/__tests__/utils.js +30 -0
  101. package/src/line/common/drag-handle.jsx +114 -0
  102. package/src/line/common/line.jsx +171 -0
  103. package/src/line/line-cross.js +144 -0
  104. package/src/line/line-dot.js +111 -0
  105. package/src/mark-label.jsx +238 -0
  106. package/src/plot/__tests__/dot.test.jsx +344 -0
  107. package/src/plot/__tests__/line.test.jsx +375 -0
  108. package/src/plot/__tests__/utils.js +30 -0
  109. package/src/plot/common/__tests__/plot.test.jsx +69 -0
  110. package/src/plot/common/__tests__/utils.js +30 -0
  111. package/src/plot/common/plot.jsx +358 -0
  112. package/src/plot/dot.js +74 -0
  113. package/src/plot/line.js +98 -0
  114. package/src/tool-menu.jsx +85 -0
  115. package/src/utils.js +201 -0
  116. package/dist/_virtual/_rolldown/runtime.js +0 -23
  117. package/dist/actions-button.d.ts +0 -26
  118. package/dist/actions-button.js +0 -84
  119. package/dist/autosize-input.d.ts +0 -10
  120. package/dist/autosize-input.js +0 -66
  121. package/dist/axes.d.ts +0 -84
  122. package/dist/axes.js +0 -376
  123. package/dist/bars/bar.d.ts +0 -47
  124. package/dist/bars/bar.js +0 -27
  125. package/dist/bars/common/bars.d.ts +0 -98
  126. package/dist/bars/common/bars.js +0 -174
  127. package/dist/bars/common/correct-check-icon.d.ts +0 -18
  128. package/dist/bars/common/correct-check-icon.js +0 -50
  129. package/dist/bars/histogram.d.ts +0 -47
  130. package/dist/bars/histogram.js +0 -28
  131. package/dist/chart-setup.d.ts +0 -29
  132. package/dist/chart-setup.js +0 -231
  133. package/dist/chart-type.d.ts +0 -32
  134. package/dist/chart-type.js +0 -68
  135. package/dist/chart-types.d.ts +0 -41
  136. package/dist/chart-types.js +0 -17
  137. package/dist/chart.d.ts +0 -88
  138. package/dist/chart.js +0 -250
  139. package/dist/common/correctness-indicators.d.ts +0 -70
  140. package/dist/common/correctness-indicators.js +0 -106
  141. package/dist/common/drag-handle.d.ts +0 -129
  142. package/dist/common/drag-handle.js +0 -120
  143. package/dist/common/drag-icon.d.ts +0 -23
  144. package/dist/common/drag-icon.js +0 -45
  145. package/dist/common/styles.d.ts +0 -23
  146. package/dist/common/styles.js +0 -17
  147. package/dist/grid.d.ts +0 -45
  148. package/dist/grid.js +0 -56
  149. package/dist/index.d.ts +0 -14
  150. package/dist/index.js +0 -6
  151. package/dist/key-legend.d.ts +0 -19
  152. package/dist/key-legend.js +0 -46
  153. package/dist/line/common/drag-handle.d.ts +0 -120
  154. package/dist/line/common/drag-handle.js +0 -92
  155. package/dist/line/common/line.d.ts +0 -96
  156. package/dist/line/common/line.js +0 -114
  157. package/dist/line/line-cross.d.ts +0 -47
  158. package/dist/line/line-cross.js +0 -133
  159. package/dist/line/line-dot.d.ts +0 -47
  160. package/dist/line/line-dot.js +0 -101
  161. package/dist/mark-label.d.ts +0 -55
  162. package/dist/mark-label.js +0 -138
  163. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +0 -101
  164. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisBottom.js +0 -46
  165. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisLeft.js +0 -47
  166. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +0 -63
  167. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +0 -44
  168. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +0 -9
  169. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +0 -14
  170. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +0 -21
  171. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +0 -16
  172. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +0 -8
  173. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +0 -15
  174. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +0 -79
  175. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +0 -79
  176. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +0 -6
  177. package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +0 -50
  178. package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +0 -18
  179. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/align.js +0 -6
  180. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/base.js +0 -6
  181. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/clamp.js +0 -6
  182. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/constant.js +0 -6
  183. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/domain.js +0 -6
  184. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/exponent.js +0 -6
  185. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/interpolate.js +0 -10
  186. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/nice.js +0 -37
  187. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/padding.js +0 -6
  188. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/range.js +0 -6
  189. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/reverse.js +0 -9
  190. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/round.js +0 -7
  191. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/scaleOperator.js +0 -58
  192. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/unknown.js +0 -6
  193. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/zero.js +0 -9
  194. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/band.js +0 -9
  195. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/point.js +0 -9
  196. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +0 -10
  197. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/createColorInterpolator.js +0 -29
  198. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +0 -9
  199. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/isUtcScale.js +0 -7
  200. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +0 -6
  201. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Bar.js +0 -29
  202. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Circle.js +0 -29
  203. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +0 -47
  204. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +0 -50
  205. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +0 -9
  206. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +0 -6
  207. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +0 -53
  208. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +0 -57
  209. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +0 -91
  210. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +0 -21
  211. package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-interpolate.js +0 -8
  212. package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-scale.js +0 -8
  213. package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-time.js +0 -8
  214. package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +0 -32
  215. package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +0 -33
  216. package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +0 -32
  217. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
  218. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js +0 -21
  219. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js +0 -21
  220. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js +0 -10
  221. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js +0 -21
  222. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js +0 -9
  223. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +0 -14
  224. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +0 -15
  225. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +0 -16
  226. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js +0 -9
  227. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +0 -8
  228. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js +0 -14
  229. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js +0 -15
  230. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js +0 -19
  231. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js +0 -11
  232. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js +0 -13
  233. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js +0 -12
  234. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js +0 -18
  235. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js +0 -14
  236. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js +0 -14
  237. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js +0 -12
  238. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js +0 -16
  239. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +0 -11
  240. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +0 -14
  241. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +0 -14
  242. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +0 -13
  243. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +0 -14
  244. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +0 -19
  245. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +0 -14
  246. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +0 -13
  247. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +0 -13
  248. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +0 -14
  249. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +0 -9
  250. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js +0 -12
  251. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js +0 -10
  252. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js +0 -20
  253. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js +0 -11
  254. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js +0 -16
  255. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js +0 -12
  256. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/memoize.js +0 -20
  257. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +0 -37
  258. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +0 -509
  259. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +0 -108
  260. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +0 -31
  261. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +0 -45
  262. package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +0 -49
  263. package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +0 -34
  264. package/dist/plot/common/plot.d.ts +0 -103
  265. package/dist/plot/common/plot.js +0 -227
  266. package/dist/plot/dot.d.ts +0 -47
  267. package/dist/plot/dot.js +0 -62
  268. package/dist/plot/line.d.ts +0 -47
  269. package/dist/plot/line.js +0 -84
  270. package/dist/tool-menu.d.ts +0 -31
  271. package/dist/utils.d.ts +0 -39
  272. package/dist/utils.js +0 -101
package/dist/axes.js DELETED
@@ -1,376 +0,0 @@
1
- import e from "./node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisLeft.js";
2
- import t from "./node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisBottom.js";
3
- import { TickCorrectnessIndicator as n } from "./common/correctness-indicators.js";
4
- import { bandKey as r, getRotateAngle as i, getTickValues as a } from "./utils.js";
5
- import o from "./mark-label.js";
6
- import s from "react";
7
- import c from "prop-types";
8
- import { styled as l } from "@mui/material/styles";
9
- import { types as u } from "@pie-lib/plot";
10
- import { AlertDialog as d } from "@pie-lib/config-ui";
11
- import { color as f } from "@pie-lib/render-ui";
12
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
13
- import h from "@mui/material/Checkbox";
14
- import { renderMath as g } from "@pie-element/shared-math-rendering-mathjax";
15
- //#region src/axes.tsx
16
- var _ = /* @__PURE__ */ new Set(), v = null;
17
- function y(e) {
18
- _.add(e), !v && typeof document < "u" && (v = new MutationObserver(() => {
19
- _.forEach((e) => e());
20
- }), v.observe(document.body, {
21
- childList: !0,
22
- subtree: !0
23
- }));
24
- }
25
- function b(e) {
26
- _.delete(e), _.size === 0 && v && (v.disconnect(), v = null);
27
- }
28
- var x = l("text")(({ theme: e }) => ({
29
- fontSize: e.typography.fontSize - 2,
30
- fill: e.palette.error.main
31
- })), S = l(h)(() => ({ color: `${f.tertiary()} !important` })), C = l("g")(({ theme: e }) => ({
32
- "& .vx-axis-line": {
33
- stroke: f.visualElementsColors.AXIS_LINE_COLOR,
34
- strokeWidth: 2
35
- },
36
- "& .vx-axis-tick": {
37
- fill: f.visualElementsColors.AXIS_TICK_COLOR,
38
- "& line": {
39
- stroke: f.visualElementsColors.AXIS_TICK_COLOR,
40
- strokeWidth: 2
41
- },
42
- fontFamily: e.typography.body1?.fontFamily,
43
- fontSize: e.typography.fontSize,
44
- textAnchor: "middle"
45
- }
46
- })), w = (e) => ({
47
- borderRadius: e.spacing(2),
48
- color: f.defaults.WHITE,
49
- fontSize: "16px",
50
- width: "16px",
51
- height: "16px",
52
- padding: "2px",
53
- border: `1px solid ${f.defaults.WHITE}`,
54
- boxSizing: "unset"
55
- }), T = { backgroundColor: f.incorrectWithIcon() }, E = { backgroundColor: f.correct() }, D = class extends s.Component {
56
- static propTypes = {
57
- defineChart: c.bool,
58
- error: c.any
59
- };
60
- constructor(e) {
61
- super(e), this.state = { dialog: { open: !1 } };
62
- }
63
- componentDidUpdate(e) {
64
- this.props.autoFocus && !e.autoFocus && this.props.onAutoFocusUsed();
65
- }
66
- handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
67
- changeCategory = (e, t) => {
68
- let { categories: n, onChangeCategory: r } = this.props, i = n[e];
69
- r(e, {
70
- ...i,
71
- label: t
72
- });
73
- };
74
- changeInteractive = (e, t) => {
75
- let { categories: n, onChangeCategory: r } = this.props, i = n[e];
76
- t ? r(e, {
77
- ...i,
78
- interactive: !i.interactive
79
- }) : this.setState({ dialog: {
80
- open: !0,
81
- title: "Warning",
82
- text: "This will remove the correct answer value that has been defined for this category.",
83
- onConfirm: () => this.handleAlertDialog(!1, r(e, {
84
- ...i,
85
- interactive: !i.interactive
86
- })),
87
- onClose: () => this.handleAlertDialog(!1)
88
- } });
89
- };
90
- changeEditable = (e, t) => {
91
- let { categories: n, onChangeCategory: r } = this.props, i = n[e];
92
- t ? r(e, {
93
- ...i,
94
- editable: !i.editable || !1
95
- }) : this.setState({ dialog: {
96
- open: !0,
97
- title: "Warning",
98
- text: "This will remove the correct answer category name that has been defined for this category.",
99
- onConfirm: () => this.handleAlertDialog(!1, r(e, {
100
- ...i,
101
- editable: !i.editable || !1
102
- })),
103
- onClose: () => this.handleAlertDialog(!1)
104
- } });
105
- };
106
- splitText = (e, t) => {
107
- let n = [];
108
- for (; (e || "").length > 0;) {
109
- let r;
110
- e.length > t ? (r = e.lastIndexOf(" ", t), r === -1 && (r = t)) : r = e.length, n.push(e.substring(0, r)), e = e.substring(r).trim();
111
- }
112
- return n;
113
- };
114
- render() {
115
- let { categories: e, xBand: t, bandWidth: i, barWidth: a, rotate: s, top: c, graphProps: l, defineChart: u, chartingOptions: f, x: h, y: g, formattedValue: _, changeInteractiveEnabled: v, changeEditableEnabled: y, error: b, autoFocus: C, hiddenLabelRef: D, showCorrectness: O } = this.props;
116
- if (!_) return null;
117
- let k = {
118
- correctnessIcon: w,
119
- incorrectIcon: T,
120
- correctIcon: E
121
- }, { dialog: A } = this.state, { changeEditable: j, changeInteractive: M } = f || {}, N = parseInt(_.split("-")[0], 10), P = e[N], { editable: F, interactive: I, label: L, correctness: R } = P || {}, z = t(r({ label: L }, N)), B = (e || []).reduce((e, t) => (e && e.label ? e.label.length : 0) > (t && t.label ? t.label.length : 0) ? e : t, { label: "" }), V = b ? [...new Set(Object.values(b))].join(" ") : "";
122
- return /* @__PURE__ */ m("g", { children: [
123
- /* @__PURE__ */ m("foreignObject", {
124
- x: i ? z : h - a / 2,
125
- y: 18,
126
- width: a,
127
- height: 4,
128
- style: {
129
- pointerEvents: "none",
130
- overflow: "visible"
131
- },
132
- children: [N === 0 && /* @__PURE__ */ p(o, {
133
- isHiddenLabel: !0,
134
- inputRef: D,
135
- disabled: !0,
136
- mark: B,
137
- graphProps: l,
138
- barWidth: a
139
- }), /* @__PURE__ */ p(o, {
140
- autoFocus: u && C,
141
- inputRef: (e) => this.input = e,
142
- disabled: !u && !F,
143
- mark: P,
144
- graphProps: l,
145
- onChange: (e) => this.changeCategory(N, e),
146
- barWidth: a,
147
- rotate: s,
148
- correctness: R,
149
- error: b && b[N],
150
- limitCharacters: !0,
151
- correctnessIndicator: O && R && /* @__PURE__ */ p(n, {
152
- correctness: R,
153
- interactive: I,
154
- classes: k
155
- })
156
- })]
157
- }),
158
- b && N === 0 && /* @__PURE__ */ p(x, {
159
- y: g + 23,
160
- height: 6,
161
- textAnchor: "start",
162
- children: V
163
- }),
164
- u && N === 0 && /* @__PURE__ */ m("svg", {
165
- x: -55,
166
- style: { overflow: "visible" },
167
- children: [v && /* @__PURE__ */ p("text", {
168
- y: g + 90 + c,
169
- width: a,
170
- height: 4,
171
- style: {
172
- position: "absolute",
173
- pointerEvents: "none",
174
- wordBreak: "break-word",
175
- maxWidth: a,
176
- display: "inline-block"
177
- },
178
- children: this.splitText(M?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ p("tspan", {
179
- x: "0",
180
- dy: `${t > 0 ? "1.2em" : ".6em"}`,
181
- children: e
182
- }, t))
183
- }), y && /* @__PURE__ */ p("text", {
184
- y: g + 145 + c,
185
- width: a,
186
- height: 4,
187
- style: {
188
- position: "absolute",
189
- pointerEvents: "none",
190
- wordBreak: "break-word",
191
- maxWidth: a,
192
- display: "inline-block"
193
- },
194
- children: this.splitText(j?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ p("tspan", {
195
- x: "0",
196
- dy: `${t > 0 ? "1.2em" : ".6em"}`,
197
- children: e
198
- }, t))
199
- })]
200
- }),
201
- u && v && /* @__PURE__ */ p("foreignObject", {
202
- x: h - 24,
203
- y: g + 80 + c,
204
- width: a,
205
- height: 4,
206
- style: {
207
- pointerEvents: "visible",
208
- overflow: "visible"
209
- },
210
- children: /* @__PURE__ */ p(S, {
211
- style: { position: "fixed" },
212
- checked: I,
213
- onChange: (e) => this.changeInteractive(N, e.target.checked)
214
- })
215
- }),
216
- u && y && /* @__PURE__ */ p("foreignObject", {
217
- x: h - 24,
218
- y: g + 130 + c,
219
- width: a,
220
- height: 4,
221
- style: {
222
- pointerEvents: "visible",
223
- overflow: "visible"
224
- },
225
- children: /* @__PURE__ */ p(S, {
226
- style: { position: "fixed" },
227
- checked: F,
228
- onChange: (e) => this.changeEditable(N, e.target.checked)
229
- })
230
- }),
231
- /* @__PURE__ */ p("foreignObject", {
232
- x: h - 24,
233
- y: g + 100 + c,
234
- width: a,
235
- height: 4,
236
- style: {
237
- pointerEvents: "visible",
238
- overflow: "visible"
239
- },
240
- children: /* @__PURE__ */ p(d, {
241
- open: A.open,
242
- title: A.title,
243
- text: A.text,
244
- onClose: A.onClose,
245
- onConfirm: A.onConfirm
246
- })
247
- })
248
- ] });
249
- }
250
- };
251
- D.propTypes = {
252
- categories: c.array,
253
- xBand: c.func,
254
- bandWidth: c.number,
255
- barWidth: c.number,
256
- rotate: c.number,
257
- top: c.number,
258
- x: c.number,
259
- y: c.number,
260
- graphProps: c.object,
261
- formattedValue: c.string,
262
- onChangeCategory: c.func,
263
- onChange: c.func,
264
- error: c.object,
265
- defineChart: c.bool,
266
- chartingOptions: c.object,
267
- changeInteractiveEnabled: c.bool,
268
- changeEditableEnabled: c.bool,
269
- autoFocus: c.bool,
270
- onAutoFocusUsed: c.func,
271
- showCorrectness: c.bool,
272
- hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })])
273
- };
274
- var O = class extends s.Component {
275
- static propTypes = {
276
- bottomScale: c.func,
277
- categories: c.array,
278
- defineChart: c.bool,
279
- error: c.any,
280
- graphProps: u.GraphPropsType.isRequired,
281
- xBand: c.func,
282
- leftAxis: c.bool,
283
- onChange: c.func,
284
- onChangeCategory: c.func,
285
- top: c.number,
286
- theme: c.object,
287
- chartingOptions: c.object,
288
- changeInteractiveEnabled: c.bool,
289
- changeEditableEnabled: c.bool,
290
- autoFocus: c.bool,
291
- onAutoFocusUsed: c.func,
292
- showCorrectness: c.bool,
293
- hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })])
294
- };
295
- state = {
296
- height: 0,
297
- width: 0
298
- };
299
- measureHiddenLabel = () => {
300
- if (!this.hiddenLabelRef) return;
301
- let e = this.hiddenLabelRef.querySelector("mjx-container"), t = this.hiddenLabelRef.querySelector("input"), n = (e || t || this.hiddenLabelRef).getBoundingClientRect(), r = Math.floor(n.height), i = Math.floor(n.width);
302
- (r !== this.state.height || i !== this.state.width) && this.setState({
303
- height: r,
304
- width: i
305
- });
306
- };
307
- _onDocMutation = () => {
308
- this.hiddenLabelRef && this.hiddenLabelRef.querySelector("mjx-container") && this.measureHiddenLabel();
309
- };
310
- observeHiddenLabel = (e) => {
311
- if (!e) return;
312
- let t = e.querySelector("[data-latex], [data-raw]");
313
- t && g(e), (e.querySelector("mjx-container") || !t) && this.measureHiddenLabel(), y(this._onDocMutation);
314
- };
315
- setHiddenLabelRef = (e) => {
316
- e && e !== this.hiddenLabelRef && (this.hiddenLabelRef = e, this.observeHiddenLabel(e));
317
- };
318
- componentDidMount() {
319
- this.hiddenLabelRef && this.observeHiddenLabel(this.hiddenLabelRef);
320
- }
321
- componentWillUnmount() {
322
- b(this._onDocMutation), this._updateTimer && clearTimeout(this._updateTimer);
323
- }
324
- componentDidUpdate(e) {
325
- e.categories !== this.props.categories && (this._updateTimer && clearTimeout(this._updateTimer), this._updateTimer = setTimeout(() => this.measureHiddenLabel(), 50));
326
- }
327
- render() {
328
- let { graphProps: n, xBand: r, leftAxis: o, onChange: s, onChangeCategory: c, categories: l = [], top: u, defineChart: d, chartingOptions: f, changeInteractiveEnabled: h, changeEditableEnabled: g, theme: _, autoFocus: v, onAutoFocusUsed: y, error: b, showCorrectness: x } = this.props, { scale: S = {}, range: w = {}, domain: T = {}, size: E = {} } = n || {}, { height: O, width: k } = this.state, A = r && typeof r.rangeRound == "function" && r.rangeRound([0, E.width]), j = r && typeof r.bandwidth == "function" && r.bandwidth(), M = j || S.x && S.x(T.max) / l.length, N = a({
329
- ...w,
330
- step: w.labelStep
331
- }), P = i(_ && _.typography ? _.typography.fontSize : 14, O), F = k > M ? 25 : 0;
332
- return /* @__PURE__ */ m(C, { children: [o && /* @__PURE__ */ p(e, {
333
- scale: S.y,
334
- tickLength: 10,
335
- tickFormat: (e) => e,
336
- tickValues: N,
337
- tickLabelProps: (e) => ({
338
- dy: 4,
339
- dx: -10 - (e.toLocaleString().length || 1) * 5
340
- })
341
- }), /* @__PURE__ */ p(t, {
342
- scale: A,
343
- labelProps: { y: 60 + u },
344
- top: S.y && S.y(w.min),
345
- textLabelProps: () => ({ textAnchor: "middle" }),
346
- tickFormat: (e) => e,
347
- tickComponent: (e) => /* @__PURE__ */ p(D, {
348
- hiddenLabelRef: this.setHiddenLabelRef,
349
- categories: l,
350
- xBand: r,
351
- bandWidth: j,
352
- barWidth: M,
353
- rotate: P || F,
354
- top: u,
355
- defineChart: d,
356
- chartingOptions: f,
357
- autoFocus: v,
358
- onAutoFocusUsed: y,
359
- error: b,
360
- onChangeCategory: c,
361
- changeInteractiveEnabled: h,
362
- changeEditableEnabled: g,
363
- onChange: s,
364
- graphProps: n,
365
- x: e.x,
366
- y: e.y,
367
- formattedValue: e.formattedValue,
368
- showCorrectness: x
369
- }),
370
- autoFocus: v,
371
- onAutoFocusUsed: y
372
- })] });
373
- }
374
- };
375
- //#endregion
376
- export { O as default };
@@ -1,47 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/charting/src/bars/bar.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
- export declare class Bar extends React.Component {
12
- static propTypes: {
13
- data: PropTypes.Requireable<any[]>;
14
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
15
- graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
16
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
17
- x: PropTypes.Validator<(...args: any[]) => any>;
18
- y: PropTypes.Validator<(...args: any[]) => any>;
19
- }>>>;
20
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
21
- x: PropTypes.Validator<(...args: any[]) => any>;
22
- y: PropTypes.Validator<(...args: any[]) => any>;
23
- }>>>;
24
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
25
- min: PropTypes.Validator<number>;
26
- max: PropTypes.Validator<number>;
27
- step: PropTypes.Requireable<number>;
28
- }>>>;
29
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
30
- min: PropTypes.Validator<number>;
31
- max: PropTypes.Validator<number>;
32
- step: PropTypes.Requireable<number>;
33
- }>>>;
34
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
35
- width: PropTypes.Validator<number>;
36
- height: PropTypes.Validator<number>;
37
- }>>>;
38
- }>>>;
39
- };
40
- render(): React.JSX.Element;
41
- }
42
- declare const _default: () => {
43
- type: string;
44
- Component: typeof Bar;
45
- name: string;
46
- };
47
- export default _default;
package/dist/bars/bar.js DELETED
@@ -1,27 +0,0 @@
1
- import { dataToXBand as e } from "../utils.js";
2
- import t from "./common/bars.js";
3
- import n from "react";
4
- import r from "prop-types";
5
- import { types as i } from "@pie-lib/plot";
6
- import { jsx as a } from "react/jsx-runtime";
7
- //#region src/bars/bar.tsx
8
- var o = class extends n.Component {
9
- static propTypes = {
10
- data: r.array,
11
- onChange: r.func,
12
- graphProps: i.GraphPropsType.isRequired
13
- };
14
- render() {
15
- let n = this.props, { data: r, graphProps: i } = n, { scale: o = {}, size: s = {} } = i || {}, c = e(o.x, r, s.width, "bar");
16
- return /* @__PURE__ */ a(t, {
17
- ...n,
18
- xBand: c
19
- });
20
- }
21
- }, s = () => ({
22
- type: "bar",
23
- Component: o,
24
- name: "Bar"
25
- });
26
- //#endregion
27
- export { s as default };
@@ -1,98 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/charting/src/bars/common/bars.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 RawBar extends React.Component {
12
- static propTypes: {
13
- barColor: PropTypes.Requireable<string>;
14
- onChangeCategory: PropTypes.Requireable<(...args: any[]) => any>;
15
- value: PropTypes.Requireable<number>;
16
- label: PropTypes.Requireable<string>;
17
- xBand: PropTypes.Requireable<(...args: any[]) => any>;
18
- index: PropTypes.Validator<number>;
19
- graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
20
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
21
- x: PropTypes.Validator<(...args: any[]) => any>;
22
- y: PropTypes.Validator<(...args: any[]) => any>;
23
- }>>>;
24
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
25
- x: PropTypes.Validator<(...args: any[]) => any>;
26
- y: PropTypes.Validator<(...args: any[]) => any>;
27
- }>>>;
28
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
29
- min: PropTypes.Validator<number>;
30
- max: PropTypes.Validator<number>;
31
- step: PropTypes.Requireable<number>;
32
- }>>>;
33
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
34
- min: PropTypes.Validator<number>;
35
- max: PropTypes.Validator<number>;
36
- step: PropTypes.Requireable<number>;
37
- }>>>;
38
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
39
- width: PropTypes.Validator<number>;
40
- height: PropTypes.Validator<number>;
41
- }>>>;
42
- }>>>;
43
- interactive: PropTypes.Requireable<boolean>;
44
- correctness: PropTypes.Requireable<PropTypes.InferProps<{
45
- value: PropTypes.Requireable<string>;
46
- label: PropTypes.Requireable<string>;
47
- }>>;
48
- correctData: PropTypes.Requireable<any[]>;
49
- defineChart: PropTypes.Requireable<boolean>;
50
- };
51
- constructor(props: any);
52
- componentDidMount(): void;
53
- componentWillUnmount(): void;
54
- handleMouseMove: any;
55
- isMouseInsideSvgElement: any;
56
- handleMouseEnter: () => void;
57
- handleMouseLeave: () => void;
58
- setDragValue: (dragValue: any) => void;
59
- dragStop: any;
60
- dragValue: any;
61
- render(): React.JSX.Element;
62
- }
63
- export declare class Bars extends React.Component {
64
- static propTypes: {
65
- data: PropTypes.Requireable<any[]>;
66
- correctData: PropTypes.Requireable<any[]>;
67
- onChangeCategory: PropTypes.Requireable<(...args: any[]) => any>;
68
- defineChart: PropTypes.Requireable<boolean>;
69
- xBand: PropTypes.Requireable<(...args: any[]) => any>;
70
- graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
71
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
72
- x: PropTypes.Validator<(...args: any[]) => any>;
73
- y: PropTypes.Validator<(...args: any[]) => any>;
74
- }>>>;
75
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
76
- x: PropTypes.Validator<(...args: any[]) => any>;
77
- y: PropTypes.Validator<(...args: any[]) => any>;
78
- }>>>;
79
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
80
- min: PropTypes.Validator<number>;
81
- max: PropTypes.Validator<number>;
82
- step: PropTypes.Requireable<number>;
83
- }>>>;
84
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
85
- min: PropTypes.Validator<number>;
86
- max: PropTypes.Validator<number>;
87
- step: PropTypes.Requireable<number>;
88
- }>>>;
89
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
90
- width: PropTypes.Validator<number>;
91
- height: PropTypes.Validator<number>;
92
- }>>>;
93
- }>>>;
94
- histogram: PropTypes.Requireable<boolean>;
95
- };
96
- render(): React.JSX.Element;
97
- }
98
- export default Bars;