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

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
@@ -1,41 +0,0 @@
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;
@@ -1,17 +0,0 @@
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 };
package/dist/chart.d.ts DELETED
@@ -1,88 +0,0 @@
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 DELETED
@@ -1,250 +0,0 @@
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 "@pie-element/shared-lodash";
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 };
@@ -1,70 +0,0 @@
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
- };
@@ -1,106 +0,0 @@
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 };