@pie-lib/graphing 4.0.5-next.31 → 4.0.5-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 (453) hide show
  1. package/CHANGELOG.json +1 -0
  2. package/CHANGELOG.md +1469 -0
  3. package/LICENSE.md +5 -0
  4. package/lib/axis/arrow.js +79 -0
  5. package/lib/axis/arrow.js.map +1 -0
  6. package/lib/axis/axes.js +329 -0
  7. package/lib/axis/axes.js.map +1 -0
  8. package/lib/axis/index.js +21 -0
  9. package/lib/axis/index.js.map +1 -0
  10. package/lib/bg.js +114 -0
  11. package/lib/bg.js.map +1 -0
  12. package/lib/container/actions.js +18 -0
  13. package/lib/container/actions.js.map +1 -0
  14. package/lib/container/index.js +127 -0
  15. package/lib/container/index.js.map +1 -0
  16. package/lib/container/marks.js +22 -0
  17. package/lib/container/marks.js.map +1 -0
  18. package/lib/container/middleware.js +19 -0
  19. package/lib/container/middleware.js.map +1 -0
  20. package/lib/container/reducer.js +18 -0
  21. package/lib/container/reducer.js.map +1 -0
  22. package/lib/coordinates-label.js +79 -0
  23. package/lib/coordinates-label.js.map +1 -0
  24. package/lib/graph-with-controls.js +294 -0
  25. package/lib/graph-with-controls.js.map +1 -0
  26. package/lib/graph.js +327 -0
  27. package/lib/graph.js.map +1 -0
  28. package/lib/grid-setup.js +414 -0
  29. package/lib/grid-setup.js.map +1 -0
  30. package/lib/grid.js +131 -0
  31. package/lib/grid.js.map +1 -0
  32. package/lib/index.js +47 -0
  33. package/lib/index.js.map +1 -0
  34. package/lib/key-legend.js +201 -0
  35. package/lib/key-legend.js.map +1 -0
  36. package/lib/label-svg-icon.js +50 -0
  37. package/lib/label-svg-icon.js.map +1 -0
  38. package/lib/labels.js +243 -0
  39. package/lib/labels.js.map +1 -0
  40. package/lib/mark-label.js +285 -0
  41. package/lib/mark-label.js.map +1 -0
  42. package/lib/toggle-bar.js +252 -0
  43. package/lib/toggle-bar.js.map +1 -0
  44. package/lib/tool-menu.js +78 -0
  45. package/lib/tool-menu.js.map +1 -0
  46. package/lib/tools/absolute/component.js +29 -0
  47. package/lib/tools/absolute/component.js.map +1 -0
  48. package/lib/tools/absolute/index.js +50 -0
  49. package/lib/tools/absolute/index.js.map +1 -0
  50. package/lib/tools/circle/bg-circle.js +123 -0
  51. package/lib/tools/circle/bg-circle.js.map +1 -0
  52. package/lib/tools/circle/component.js +321 -0
  53. package/lib/tools/circle/component.js.map +1 -0
  54. package/lib/tools/circle/index.js +41 -0
  55. package/lib/tools/circle/index.js.map +1 -0
  56. package/lib/tools/exponential/component.js +28 -0
  57. package/lib/tools/exponential/component.js.map +1 -0
  58. package/lib/tools/exponential/index.js +56 -0
  59. package/lib/tools/exponential/index.js.map +1 -0
  60. package/lib/tools/index.js +86 -0
  61. package/lib/tools/index.js.map +1 -0
  62. package/lib/tools/line/component.js +97 -0
  63. package/lib/tools/line/component.js.map +1 -0
  64. package/lib/tools/line/index.js +11 -0
  65. package/lib/tools/line/index.js.map +1 -0
  66. package/lib/tools/parabola/component.js +28 -0
  67. package/lib/tools/parabola/component.js.map +1 -0
  68. package/lib/tools/parabola/index.js +50 -0
  69. package/lib/tools/parabola/index.js.map +1 -0
  70. package/lib/tools/point/component.js +148 -0
  71. package/lib/tools/point/component.js.map +1 -0
  72. package/lib/tools/point/index.js +24 -0
  73. package/lib/tools/point/index.js.map +1 -0
  74. package/lib/tools/polygon/component.js +437 -0
  75. package/lib/tools/polygon/component.js.map +1 -0
  76. package/lib/tools/polygon/index.js +89 -0
  77. package/lib/tools/polygon/index.js.map +1 -0
  78. package/lib/tools/polygon/line.js +112 -0
  79. package/lib/tools/polygon/line.js.map +1 -0
  80. package/lib/tools/polygon/polygon.js +130 -0
  81. package/lib/tools/polygon/polygon.js.map +1 -0
  82. package/lib/tools/ray/component.js +95 -0
  83. package/lib/tools/ray/component.js.map +1 -0
  84. package/lib/tools/ray/index.js +11 -0
  85. package/lib/tools/ray/index.js.map +1 -0
  86. package/lib/tools/segment/component.js +71 -0
  87. package/lib/tools/segment/component.js.map +1 -0
  88. package/lib/tools/segment/index.js +11 -0
  89. package/lib/tools/segment/index.js.map +1 -0
  90. package/lib/tools/shared/arrow-head.js +111 -0
  91. package/lib/tools/shared/arrow-head.js.map +1 -0
  92. package/lib/tools/shared/icons/CorrectSVG.js +40 -0
  93. package/lib/tools/shared/icons/CorrectSVG.js.map +1 -0
  94. package/lib/tools/shared/icons/IncorrectSVG.js +40 -0
  95. package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -0
  96. package/lib/tools/shared/icons/MissingSVG.js +39 -0
  97. package/lib/tools/shared/icons/MissingSVG.js.map +1 -0
  98. package/lib/tools/shared/line/index.js +550 -0
  99. package/lib/tools/shared/line/index.js.map +1 -0
  100. package/lib/tools/shared/line/line-path.js +118 -0
  101. package/lib/tools/shared/line/line-path.js.map +1 -0
  102. package/lib/tools/shared/line/with-root-edge.js +121 -0
  103. package/lib/tools/shared/line/with-root-edge.js.map +1 -0
  104. package/lib/tools/shared/point/arrow-point.js +72 -0
  105. package/lib/tools/shared/point/arrow-point.js.map +1 -0
  106. package/lib/tools/shared/point/arrow.js +67 -0
  107. package/lib/tools/shared/point/arrow.js.map +1 -0
  108. package/lib/tools/shared/point/base-point.js +157 -0
  109. package/lib/tools/shared/point/base-point.js.map +1 -0
  110. package/lib/tools/shared/point/index.js +68 -0
  111. package/lib/tools/shared/point/index.js.map +1 -0
  112. package/lib/tools/shared/styles.js +33 -0
  113. package/lib/tools/shared/styles.js.map +1 -0
  114. package/lib/tools/shared/types.js +16 -0
  115. package/lib/tools/shared/types.js.map +1 -0
  116. package/lib/tools/sine/component.js +40 -0
  117. package/lib/tools/sine/component.js.map +1 -0
  118. package/lib/tools/sine/index.js +50 -0
  119. package/lib/tools/sine/index.js.map +1 -0
  120. package/lib/tools/vector/component.js +68 -0
  121. package/lib/tools/vector/component.js.map +1 -0
  122. package/lib/tools/vector/index.js +11 -0
  123. package/lib/tools/vector/index.js.map +1 -0
  124. package/lib/undo-redo.js +86 -0
  125. package/lib/undo-redo.js.map +1 -0
  126. package/lib/use-debounce.js +25 -0
  127. package/lib/use-debounce.js.map +1 -0
  128. package/lib/utils.js +229 -0
  129. package/lib/utils.js.map +1 -0
  130. package/package.json +33 -45
  131. package/src/__tests__/bg.test.jsx +250 -0
  132. package/src/__tests__/coordinates-label.test.jsx +243 -0
  133. package/src/__tests__/graph-with-controls.test.jsx +198 -0
  134. package/src/__tests__/graph.test.jsx +721 -0
  135. package/src/__tests__/grid-setup.test.jsx +645 -0
  136. package/src/__tests__/grid.test.jsx +22 -0
  137. package/src/__tests__/key-legend.test.jsx +260 -0
  138. package/src/__tests__/label-svg-icon.test.jsx +278 -0
  139. package/src/__tests__/labels.test.jsx +55 -0
  140. package/src/__tests__/mark-label.test.jsx +63 -0
  141. package/src/__tests__/toggle-bar.test.jsx +146 -0
  142. package/src/__tests__/tool-menu.test.jsx +115 -0
  143. package/src/__tests__/undo-redo.test.jsx +24 -0
  144. package/src/__tests__/use-debounce.test.js +21 -0
  145. package/src/__tests__/utils.js +41 -0
  146. package/src/__tests__/utils.test.js +105 -0
  147. package/src/axis/__tests__/arrow.test.jsx +38 -0
  148. package/src/axis/__tests__/axes.test.jsx +216 -0
  149. package/src/axis/arrow.jsx +57 -0
  150. package/src/axis/axes.jsx +285 -0
  151. package/src/axis/index.js +3 -0
  152. package/src/bg.jsx +96 -0
  153. package/src/container/__tests__/actions.test.js +105 -0
  154. package/src/container/__tests__/index.test.jsx +319 -0
  155. package/src/container/__tests__/marks.test.js +172 -0
  156. package/src/container/__tests__/middleware.test.js +235 -0
  157. package/src/container/__tests__/reducer.test.js +324 -0
  158. package/src/container/actions.js +8 -0
  159. package/src/container/index.jsx +91 -0
  160. package/src/container/marks.js +14 -0
  161. package/src/container/middleware.js +7 -0
  162. package/src/container/reducer.js +5 -0
  163. package/src/coordinates-label.jsx +63 -0
  164. package/src/graph-with-controls.jsx +239 -0
  165. package/src/graph.jsx +303 -0
  166. package/src/grid-setup.jsx +432 -0
  167. package/src/grid.jsx +133 -0
  168. package/src/index.js +7 -0
  169. package/src/key-legend.jsx +142 -0
  170. package/src/label-svg-icon.jsx +39 -0
  171. package/src/labels.jsx +207 -0
  172. package/src/mark-label.jsx +244 -0
  173. package/src/toggle-bar.jsx +224 -0
  174. package/src/tool-menu.jsx +49 -0
  175. package/src/tools/absolute/__tests__/component.test.jsx +53 -0
  176. package/src/tools/absolute/component.jsx +23 -0
  177. package/src/tools/absolute/index.js +31 -0
  178. package/src/tools/circle/__tests__/bg-circle.test.jsx +26 -0
  179. package/src/tools/circle/__tests__/component.test.jsx +494 -0
  180. package/src/tools/circle/__tests__/index.test.js +480 -0
  181. package/src/tools/circle/bg-circle.jsx +81 -0
  182. package/src/tools/circle/component.jsx +264 -0
  183. package/src/tools/circle/index.js +25 -0
  184. package/src/tools/exponential/__tests__/component.test.jsx +53 -0
  185. package/src/tools/exponential/__tests__/index.test.js +729 -0
  186. package/src/tools/exponential/component.jsx +23 -0
  187. package/src/tools/exponential/index.js +39 -0
  188. package/src/tools/index.js +48 -0
  189. package/src/tools/line/__tests__/component.test.jsx +37 -0
  190. package/src/tools/line/component.jsx +93 -0
  191. package/src/tools/line/index.js +4 -0
  192. package/src/tools/parabola/__tests__/component.test.jsx +48 -0
  193. package/src/tools/parabola/__tests__/index.test.js +470 -0
  194. package/src/tools/parabola/component.jsx +23 -0
  195. package/src/tools/parabola/index.js +31 -0
  196. package/src/tools/point/__tests__/component.test.jsx +349 -0
  197. package/src/tools/point/__tests__/index.test.js +241 -0
  198. package/src/tools/point/component.jsx +126 -0
  199. package/src/tools/point/index.js +11 -0
  200. package/src/tools/polygon/__tests__/component.test.jsx +471 -0
  201. package/src/tools/polygon/__tests__/index.test.js +294 -0
  202. package/src/tools/polygon/__tests__/line.test.jsx +35 -0
  203. package/src/tools/polygon/__tests__/polygon.test.jsx +61 -0
  204. package/src/tools/polygon/component.jsx +409 -0
  205. package/src/tools/polygon/index.js +52 -0
  206. package/src/tools/polygon/line.jsx +74 -0
  207. package/src/tools/polygon/polygon.jsx +110 -0
  208. package/src/tools/ray/__tests__/component.test.jsx +29 -0
  209. package/src/tools/ray/component.jsx +92 -0
  210. package/src/tools/ray/index.js +4 -0
  211. package/src/tools/segment/__tests__/component.test.jsx +28 -0
  212. package/src/tools/segment/component.jsx +65 -0
  213. package/src/tools/segment/index.js +4 -0
  214. package/src/tools/shared/__tests__/arrow-head.test.jsx +31 -0
  215. package/src/tools/shared/arrow-head.jsx +102 -0
  216. package/src/tools/shared/icons/CorrectSVG.jsx +32 -0
  217. package/src/tools/shared/icons/IncorrectSVG.jsx +30 -0
  218. package/src/tools/shared/icons/MissingSVG.jsx +31 -0
  219. package/src/tools/shared/line/__tests__/index.test.jsx +109 -0
  220. package/src/tools/shared/line/__tests__/line-path.test.jsx +53 -0
  221. package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +73 -0
  222. package/src/tools/shared/line/index.jsx +487 -0
  223. package/src/tools/shared/line/line-path.jsx +80 -0
  224. package/src/tools/shared/line/with-root-edge.jsx +97 -0
  225. package/src/tools/shared/point/__tests__/arrow-point.test.jsx +91 -0
  226. package/src/tools/shared/point/__tests__/base-point.test.jsx +87 -0
  227. package/src/tools/shared/point/arrow-point.jsx +46 -0
  228. package/src/tools/shared/point/arrow.jsx +37 -0
  229. package/src/tools/shared/point/base-point.jsx +121 -0
  230. package/src/tools/shared/point/index.jsx +54 -0
  231. package/src/tools/shared/styles.js +27 -0
  232. package/src/tools/shared/types.js +10 -0
  233. package/src/tools/sine/__tests__/component.test.jsx +51 -0
  234. package/src/tools/sine/component.jsx +32 -0
  235. package/src/tools/sine/index.js +33 -0
  236. package/src/tools/vector/__tests__/component.test.jsx +25 -0
  237. package/src/tools/vector/component.jsx +56 -0
  238. package/src/tools/vector/index.js +4 -0
  239. package/src/undo-redo.jsx +45 -0
  240. package/src/use-debounce.js +13 -0
  241. package/src/utils.js +224 -0
  242. package/dist/_virtual/_rolldown/runtime.js +0 -23
  243. package/dist/autosize-input.d.ts +0 -10
  244. package/dist/autosize-input.js +0 -66
  245. package/dist/axis/arrow.d.ts +0 -13
  246. package/dist/axis/arrow.js +0 -34
  247. package/dist/axis/axes.d.ts +0 -132
  248. package/dist/axis/axes.js +0 -214
  249. package/dist/axis/index.d.ts +0 -10
  250. package/dist/bg.d.ts +0 -51
  251. package/dist/bg.js +0 -44
  252. package/dist/container/actions.d.ts +0 -15
  253. package/dist/container/actions.js +0 -7
  254. package/dist/container/index.d.ts +0 -58
  255. package/dist/container/index.js +0 -48
  256. package/dist/container/marks.d.ts +0 -10
  257. package/dist/container/marks.js +0 -11
  258. package/dist/container/middleware.d.ts +0 -10
  259. package/dist/container/middleware.js +0 -4
  260. package/dist/container/reducer.d.ts +0 -14
  261. package/dist/container/reducer.js +0 -7
  262. package/dist/coordinates-label.d.ts +0 -50
  263. package/dist/coordinates-label.js +0 -46
  264. package/dist/graph-with-controls.d.ts +0 -88
  265. package/dist/graph-with-controls.js +0 -154
  266. package/dist/graph.d.ts +0 -126
  267. package/dist/graph.js +0 -209
  268. package/dist/grid-setup.d.ts +0 -27
  269. package/dist/grid-setup.js +0 -307
  270. package/dist/grid.d.ts +0 -43
  271. package/dist/grid.js +0 -59
  272. package/dist/index.d.ts +0 -15
  273. package/dist/index.js +0 -7
  274. package/dist/key-legend.d.ts +0 -21
  275. package/dist/key-legend.js +0 -231
  276. package/dist/label-svg-icon.d.ts +0 -18
  277. package/dist/label-svg-icon.js +0 -42
  278. package/dist/labels.d.ts +0 -37
  279. package/dist/labels.js +0 -152
  280. package/dist/mark-label.d.ts +0 -58
  281. package/dist/mark-label.js +0 -171
  282. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +0 -101
  283. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +0 -63
  284. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +0 -44
  285. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +0 -9
  286. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +0 -14
  287. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +0 -21
  288. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +0 -16
  289. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +0 -8
  290. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +0 -15
  291. package/dist/node_modules/.bun/@visx_curve@3.12.0/node_modules/@visx/curve/esm/index.js +0 -2
  292. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/Grid.js +0 -79
  293. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +0 -79
  294. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +0 -79
  295. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +0 -6
  296. package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +0 -50
  297. package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +0 -18
  298. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +0 -10
  299. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +0 -9
  300. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +0 -6
  301. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +0 -47
  302. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +0 -50
  303. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +0 -9
  304. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +0 -6
  305. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +0 -53
  306. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +0 -57
  307. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +0 -91
  308. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +0 -21
  309. package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +0 -32
  310. package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +0 -33
  311. package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +0 -32
  312. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
  313. package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +0 -28
  314. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js +0 -21
  315. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js +0 -21
  316. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js +0 -10
  317. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js +0 -21
  318. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js +0 -9
  319. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +0 -14
  320. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +0 -15
  321. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +0 -16
  322. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js +0 -9
  323. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +0 -8
  324. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js +0 -14
  325. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js +0 -15
  326. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js +0 -19
  327. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js +0 -11
  328. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js +0 -13
  329. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js +0 -12
  330. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js +0 -18
  331. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js +0 -14
  332. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js +0 -14
  333. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js +0 -12
  334. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js +0 -16
  335. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +0 -11
  336. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +0 -14
  337. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +0 -14
  338. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +0 -13
  339. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +0 -14
  340. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +0 -19
  341. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +0 -14
  342. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +0 -13
  343. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +0 -13
  344. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +0 -14
  345. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +0 -9
  346. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js +0 -12
  347. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js +0 -10
  348. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js +0 -20
  349. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js +0 -11
  350. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js +0 -16
  351. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js +0 -12
  352. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/memoize.js +0 -20
  353. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +0 -37
  354. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +0 -509
  355. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +0 -108
  356. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +0 -31
  357. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +0 -45
  358. package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +0 -471
  359. package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +0 -49
  360. package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +0 -34
  361. package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +0 -185
  362. package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +0 -198
  363. package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +0 -53
  364. package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +0 -51
  365. package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/with-selector.js +0 -10
  366. package/dist/toggle-bar.d.ts +0 -40
  367. package/dist/toggle-bar.js +0 -155
  368. package/dist/tool-menu.d.ts +0 -29
  369. package/dist/tool-menu.js +0 -41
  370. package/dist/tools/absolute/component.d.ts +0 -16
  371. package/dist/tools/absolute/component.js +0 -15
  372. package/dist/tools/absolute/index.d.ts +0 -20
  373. package/dist/tools/absolute/index.js +0 -32
  374. package/dist/tools/circle/bg-circle.d.ts +0 -116
  375. package/dist/tools/circle/bg-circle.js +0 -72
  376. package/dist/tools/circle/component.d.ts +0 -83
  377. package/dist/tools/circle/component.js +0 -195
  378. package/dist/tools/circle/index.d.ts +0 -20
  379. package/dist/tools/circle/index.js +0 -22
  380. package/dist/tools/exponential/component.d.ts +0 -16
  381. package/dist/tools/exponential/component.js +0 -14
  382. package/dist/tools/exponential/index.d.ts +0 -20
  383. package/dist/tools/exponential/index.js +0 -32
  384. package/dist/tools/index.d.ts +0 -27
  385. package/dist/tools/index.js +0 -55
  386. package/dist/tools/line/component.d.ts +0 -124
  387. package/dist/tools/line/component.js +0 -72
  388. package/dist/tools/line/index.d.ts +0 -13
  389. package/dist/tools/line/index.js +0 -6
  390. package/dist/tools/parabola/component.d.ts +0 -16
  391. package/dist/tools/parabola/component.js +0 -14
  392. package/dist/tools/parabola/index.d.ts +0 -20
  393. package/dist/tools/parabola/index.js +0 -32
  394. package/dist/tools/point/component.d.ts +0 -50
  395. package/dist/tools/point/component.js +0 -85
  396. package/dist/tools/point/index.d.ts +0 -15
  397. package/dist/tools/point/index.js +0 -13
  398. package/dist/tools/polygon/component.d.ts +0 -120
  399. package/dist/tools/polygon/component.js +0 -262
  400. package/dist/tools/polygon/index.d.ts +0 -19
  401. package/dist/tools/polygon/index.js +0 -55
  402. package/dist/tools/polygon/line.d.ts +0 -125
  403. package/dist/tools/polygon/line.js +0 -63
  404. package/dist/tools/polygon/polygon.d.ts +0 -122
  405. package/dist/tools/polygon/polygon.js +0 -74
  406. package/dist/tools/ray/component.d.ts +0 -101
  407. package/dist/tools/ray/component.js +0 -71
  408. package/dist/tools/ray/index.d.ts +0 -13
  409. package/dist/tools/ray/index.js +0 -6
  410. package/dist/tools/segment/component.d.ts +0 -100
  411. package/dist/tools/segment/component.js +0 -52
  412. package/dist/tools/segment/index.d.ts +0 -13
  413. package/dist/tools/segment/index.js +0 -6
  414. package/dist/tools/shared/arrow-head.d.ts +0 -51
  415. package/dist/tools/shared/arrow-head.js +0 -63
  416. package/dist/tools/shared/icons/CorrectSVG.d.ts +0 -26
  417. package/dist/tools/shared/icons/CorrectSVG.js +0 -29
  418. package/dist/tools/shared/icons/IncorrectSVG.d.ts +0 -26
  419. package/dist/tools/shared/icons/IncorrectSVG.js +0 -27
  420. package/dist/tools/shared/icons/MissingSVG.d.ts +0 -26
  421. package/dist/tools/shared/icons/MissingSVG.js +0 -28
  422. package/dist/tools/shared/line/index.d.ts +0 -245
  423. package/dist/tools/shared/line/index.js +0 -319
  424. package/dist/tools/shared/line/line-path.d.ts +0 -57
  425. package/dist/tools/shared/line/line-path.js +0 -71
  426. package/dist/tools/shared/line/with-root-edge.d.ts +0 -142
  427. package/dist/tools/shared/line/with-root-edge.js +0 -73
  428. package/dist/tools/shared/point/arrow-point.d.ts +0 -56
  429. package/dist/tools/shared/point/arrow-point.js +0 -41
  430. package/dist/tools/shared/point/arrow.d.ts +0 -45
  431. package/dist/tools/shared/point/arrow.js +0 -35
  432. package/dist/tools/shared/point/base-point.d.ts +0 -52
  433. package/dist/tools/shared/point/base-point.js +0 -103
  434. package/dist/tools/shared/point/index.d.ts +0 -216
  435. package/dist/tools/shared/point/index.js +0 -45
  436. package/dist/tools/shared/styles.d.ts +0 -29
  437. package/dist/tools/shared/styles.js +0 -20
  438. package/dist/tools/shared/types.d.ts +0 -21
  439. package/dist/tools/shared/types.js +0 -11
  440. package/dist/tools/sine/component.d.ts +0 -16
  441. package/dist/tools/sine/component.js +0 -22
  442. package/dist/tools/sine/index.d.ts +0 -20
  443. package/dist/tools/sine/index.js +0 -32
  444. package/dist/tools/vector/component.d.ts +0 -100
  445. package/dist/tools/vector/component.js +0 -44
  446. package/dist/tools/vector/index.d.ts +0 -13
  447. package/dist/tools/vector/index.js +0 -6
  448. package/dist/undo-redo.d.ts +0 -22
  449. package/dist/undo-redo.js +0 -47
  450. package/dist/use-debounce.d.ts +0 -9
  451. package/dist/use-debounce.js +0 -13
  452. package/dist/utils.d.ts +0 -61
  453. package/dist/utils.js +0 -75
package/dist/axis/axes.js DELETED
@@ -1,214 +0,0 @@
1
- import e from "../node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js";
2
- import t from "./arrow.js";
3
- import { amountToIncreaseWidth as n, countWords as r, findLongestWord as i, getTickValues as a } from "../utils.js";
4
- import o from "react";
5
- import s from "prop-types";
6
- import { types as c } from "@pie-lib/plot";
7
- import { styled as l } from "@mui/material/styles";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import * as f from "@pie-lib/render-ui";
10
- import { Readable as p, color as m } from "@pie-lib/render-ui";
11
- //#region src/axis/axes.tsx
12
- function h(e) {
13
- return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
14
- }
15
- function g(e, t) {
16
- return !e || h(e) ? e : h(e.default) ? e.default : t && h(e[t]) ? e[t] : t && h(e[t]?.default) ? e[t].default : e;
17
- }
18
- var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b = y && typeof y == "object" ? y : v, x = {
19
- includeArrows: s.object,
20
- graphProps: s.object
21
- }, S = { includeArrows: {
22
- left: !0,
23
- right: !0,
24
- up: !0,
25
- down: !0
26
- } }, C = l(t)(() => ({ fill: m.defaults.PRIMARY })), w = l("div")(({ theme: e, centered: t }) => ({
27
- padding: 0,
28
- margin: 0,
29
- "* > *": {
30
- margin: 0,
31
- padding: 0
32
- },
33
- "& p": { margin: 0 },
34
- fontSize: e.typography.fontSize,
35
- ...t && { textAlign: "center" }
36
- })), T = l("g")(() => ({
37
- "& .visx-axis-line": {
38
- stroke: m.defaults.PRIMARY,
39
- strokeWidth: 3
40
- },
41
- "& .visx-axis-tick": {
42
- fill: m.defaults.PRIMARY,
43
- "& line": { stroke: m.defaults.PRIMARY }
44
- }
45
- })), E = {
46
- fontFamily: "Roboto",
47
- fontSize: "14px",
48
- cursor: "inherit"
49
- }, D = (e, t, n, r, i, a) => {
50
- let o = [];
51
- return e === t && n - i < r && r < n + i && n - i < a && a < n + i && o.push(e), o;
52
- }, O = (e) => (e || []).find((e) => e < 0), k = class extends o.Component {
53
- static propTypes = {
54
- ...x,
55
- graphProps: c.GraphPropsType.isRequired
56
- };
57
- static defaultProps = S;
58
- render() {
59
- let { includeArrows: t, graphProps: a, columnTicksValues: o, skipValues: s, distanceFromOriginToFirstNegativeY: c, dy: l } = this.props, { scale: f, domain: p, size: m, range: h } = a || {}, g = (e) => {
60
- let t = s && s[0] === e ? c + 4 : l;
61
- return {
62
- ...E,
63
- textAnchor: "middle",
64
- y: t,
65
- dx: e === 0 ? -10 : 0,
66
- dy: e === 0 ? -7 : 0
67
- };
68
- }, v = r(p.axisLabel), y = n(i(p.axisLabel)) + 2;
69
- return /* @__PURE__ */ d(T, { children: [
70
- /* @__PURE__ */ u(e, {
71
- scale: f.x,
72
- top: f.y(0),
73
- left: 0,
74
- label: p.label,
75
- rangePadding: 8,
76
- tickFormat: (e) => e,
77
- tickLabelProps: g,
78
- tickValues: o,
79
- hideZero: !(p.labelStep || h.labelStep) && p.min <= 0
80
- }),
81
- t && t.left && /* @__PURE__ */ u(C, {
82
- direction: "left",
83
- x: p.min,
84
- y: 0,
85
- scale: f
86
- }),
87
- t && t.right && /* @__PURE__ */ u(C, {
88
- direction: "right",
89
- x: p.max,
90
- y: 0,
91
- scale: f
92
- }),
93
- p.axisLabel && /* @__PURE__ */ u("foreignObject", {
94
- x: m.width + 17,
95
- y: f.y(0) - 9,
96
- width: y,
97
- height: 20 * v,
98
- children: /* @__PURE__ */ u(_, {
99
- false: !0,
100
- children: /* @__PURE__ */ u(w, { dangerouslySetInnerHTML: { __html: p.axisLabel } })
101
- })
102
- })
103
- ] });
104
- }
105
- }, A = class extends o.Component {
106
- static propTypes = {
107
- ...x,
108
- graphProps: c.GraphPropsType.isRequired
109
- };
110
- static defaultProps = S;
111
- render() {
112
- let { includeArrows: t, graphProps: r, skipValues: i, rowTickValues: a } = this.props, { scale: o, range: s, size: c } = r || {}, l = s.axisLabel ? n(s.axisLabel.length) : 0;
113
- return /* @__PURE__ */ d(T, { children: [
114
- /* @__PURE__ */ u(e, {
115
- orientation: "left",
116
- scale: o.y,
117
- top: 0,
118
- height: c.height,
119
- left: o.x(0),
120
- label: s.label,
121
- labelProps: { "data-pie-readable": !1 },
122
- rangePadding: 8,
123
- tickLength: 10,
124
- tickFormat: (e) => i && i.indexOf(e) >= 0 ? "" : e,
125
- tickLabelProps: (e) => {
126
- let t = e.toLocaleString().replace(/[.-]/g, "").length || 1;
127
- return {
128
- ...E,
129
- dy: 4,
130
- dx: -10 - t * 9,
131
- "data-pie-readable": !1
132
- };
133
- },
134
- hideZero: !0,
135
- tickTextAnchor: "bottom",
136
- tickValues: a
137
- }),
138
- t && t.down && /* @__PURE__ */ u(C, {
139
- direction: "down",
140
- x: 0,
141
- y: s.min,
142
- scale: o
143
- }),
144
- t && t.up && /* @__PURE__ */ u(C, {
145
- direction: "up",
146
- x: 0,
147
- y: s.max,
148
- scale: o
149
- }),
150
- s.axisLabel && /* @__PURE__ */ u("foreignObject", {
151
- x: o.x(0) - l / 2,
152
- y: -33,
153
- width: l,
154
- height: "20",
155
- children: /* @__PURE__ */ u(_, {
156
- false: !0,
157
- children: /* @__PURE__ */ u(w, {
158
- centered: !0,
159
- dangerouslySetInnerHTML: { __html: s.axisLabel }
160
- })
161
- })
162
- })
163
- ] });
164
- }
165
- }, j = class extends o.Component {
166
- static propTypes = {
167
- ...x,
168
- graphProps: c.GraphPropsType.isRequired
169
- };
170
- static defaultProps = S;
171
- xValues = () => {
172
- let { graphProps: e } = this.props, { scale: t, domain: n } = e || {};
173
- if (!n || !t) return;
174
- let r = a({
175
- ...n,
176
- step: n.labelStep
177
- }), i = O(r);
178
- return {
179
- columnTicksValues: r,
180
- firstNegativeX: i,
181
- distanceFromOriginToFirstNegativeX: Math.abs(t.y(0) - t.y(i))
182
- };
183
- };
184
- yValues = () => {
185
- let { graphProps: e } = this.props, { scale: t, range: n } = e || {};
186
- if (!n || !t) return;
187
- let r = a({
188
- ...n,
189
- step: n.labelStep
190
- }), i = O(r);
191
- return {
192
- rowTickValues: r,
193
- firstNegativeY: i,
194
- distanceFromOriginToFirstNegativeY: Math.abs(t.x(0) - t.x(i))
195
- };
196
- };
197
- render() {
198
- let { graphProps: e } = this.props, { domain: t, range: n } = e || {}, { columnTicksValues: r, firstNegativeX: i, distanceFromOriginToFirstNegativeX: a } = this.xValues(), { rowTickValues: o, firstNegativeY: s, distanceFromOriginToFirstNegativeY: c } = this.yValues(), l = D(i, s, a, c, 6, 25);
199
- return /* @__PURE__ */ d(T, { children: [n.min <= 0 ? /* @__PURE__ */ u(k, {
200
- ...this.props,
201
- skipValues: l,
202
- columnTicksValues: r,
203
- distanceFromOriginToFirstNegativeY: c,
204
- dy: 25
205
- }) : null, t.min <= 0 ? /* @__PURE__ */ u(A, {
206
- ...this.props,
207
- skipValues: l,
208
- rowTickValues: o,
209
- distanceFromOriginToFirstNegativeX: a
210
- }) : null] });
211
- }
212
- };
213
- //#endregion
214
- export { x as AxisPropTypes, j as default };
@@ -1,10 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/axis/index.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 Axes, { AxisPropTypes } from './axes.js';
10
- export { Axes, AxisPropTypes };
package/dist/bg.d.ts DELETED
@@ -1,51 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/bg.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 default class Bg extends React.Component {
12
- static propTypes: {
13
- width: PropTypes.Validator<number>;
14
- height: PropTypes.Validator<number>;
15
- onClick: PropTypes.Validator<(...args: any[]) => any>;
16
- graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
17
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
18
- x: PropTypes.Validator<(...args: any[]) => any>;
19
- y: PropTypes.Validator<(...args: any[]) => any>;
20
- }>>>;
21
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
22
- x: PropTypes.Validator<(...args: any[]) => any>;
23
- y: PropTypes.Validator<(...args: any[]) => any>;
24
- }>>>;
25
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
26
- min: PropTypes.Validator<number>;
27
- max: PropTypes.Validator<number>;
28
- step: PropTypes.Requireable<number>;
29
- }>>>;
30
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
31
- min: PropTypes.Validator<number>;
32
- max: PropTypes.Validator<number>;
33
- step: PropTypes.Requireable<number>;
34
- }>>>;
35
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
36
- width: PropTypes.Validator<number>;
37
- height: PropTypes.Validator<number>;
38
- }>>>;
39
- }>>>;
40
- };
41
- static defaultProps: {};
42
- componentDidMount(): void;
43
- shouldComponentUpdate(nextProps: any): boolean;
44
- getRectPadding: any;
45
- /**
46
- * Note: we use d3 click + pointer to give us domain values directly.
47
- * Saves us having to calculate them ourselves from a MouseEvent.
48
- */
49
- onRectClick: any;
50
- render(): React.JSX.Element;
51
- }
package/dist/bg.js DELETED
@@ -1,44 +0,0 @@
1
- import { getTickValues as e, thinnerShapesNeeded as t } from "./utils.js";
2
- import n from "react";
3
- import r from "prop-types";
4
- import { types as i, utils as a } from "@pie-lib/plot";
5
- import { jsx as o } from "react/jsx-runtime";
6
- import { pointer as s, select as c } from "d3-selection";
7
- //#region src/bg.tsx
8
- var l = class extends n.Component {
9
- static propTypes = {
10
- width: r.number.isRequired,
11
- height: r.number.isRequired,
12
- onClick: r.func.isRequired,
13
- graphProps: i.GraphPropsType.isRequired
14
- };
15
- static defaultProps = {};
16
- componentDidMount() {
17
- let e = c(this.rect);
18
- e.on("click", (t) => this.onRectClick(e, t));
19
- }
20
- shouldComponentUpdate(e) {
21
- return !a.isDomainRangeEqual(this.props.graphProps, e.graphProps) || this.props.width !== e.width || this.props.height !== e.height;
22
- }
23
- getRectPadding = () => {
24
- let { graphProps: e } = this.props;
25
- return t(e) ? 6 : 10;
26
- };
27
- onRectClick = (t, n) => {
28
- let { onClick: r, graphProps: i } = this.props, { scale: a } = i, o = this.getRectPadding(), c = s(n, t.node()), l = a.x.invert(c[0] - o), u = a.y.invert(c[1] - o), d = e(i.range), f = e(i.domain), p = (e, t) => e.length && e.reduce((e, n) => Math.abs(n - t) <= Math.abs(e - t) ? n : e), m = {};
29
- f.indexOf(l) >= 0 && d.indexOf(u) >= 0 ? (m.x = l, m.y = u) : (m.x = p(f, l), m.y = p(d, u)), r(m);
30
- };
31
- render() {
32
- let { width: e, height: t } = this.props, n = this.getRectPadding();
33
- return /* @__PURE__ */ o("rect", {
34
- ref: (e) => this.rect = e,
35
- transform: `translate(-${n}, -${n})`,
36
- fill: "red",
37
- fillOpacity: "0.0",
38
- width: e + n * 2,
39
- height: t + n * 2
40
- });
41
- }
42
- };
43
- //#endregion
44
- export { l as default };
@@ -1,15 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/container/actions.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
- export declare const addMark: () => {
10
- type: string;
11
- };
12
- export declare const changeMarks: (marks: any) => {
13
- type: string;
14
- marks: any;
15
- };
@@ -1,7 +0,0 @@
1
- //#region src/container/actions.ts
2
- var e = (e) => ({
3
- type: "CHANGE_MARKS",
4
- marks: e
5
- });
6
- //#endregion
7
- export { e as changeMarks };
@@ -1,58 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/container/index.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
- import GraphWithControls from '../graph-with-controls.js';
12
- export declare const GraphContainer: import("react-redux").ConnectedComponent<React.ComponentType<import("react-redux").Matching<{
13
- marks: any;
14
- } & {
15
- onChangeMarks: (m: any) => any;
16
- onUndo: () => any;
17
- onRedo: () => any;
18
- onReset: () => any;
19
- }, React.ClassAttributes<GraphWithControls>>>, {
20
- ref?: React.LegacyRef<GraphWithControls> | undefined;
21
- key?: React.Key | null | undefined;
22
- context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
23
- store?: import("redux").Store | undefined;
24
- } | {
25
- ref?: ((string | ((instance: React.Component<import("react-redux").Matching<{
26
- marks: any;
27
- } & {
28
- onChangeMarks: (m: any) => any;
29
- onUndo: () => any;
30
- onRedo: () => any;
31
- onReset: () => any;
32
- }, React.ClassAttributes<GraphWithControls>>, any, any> | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<React.Component<import("react-redux").Matching<{
33
- marks: any;
34
- } & {
35
- onChangeMarks: (m: any) => any;
36
- onUndo: () => any;
37
- onRedo: () => any;
38
- onReset: () => any;
39
- }, React.ClassAttributes<GraphWithControls>>, any, any>>) & (string | ((instance: GraphWithControls | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<GraphWithControls>)) | null | undefined;
40
- key?: React.Key | null | undefined;
41
- context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
42
- store?: import("redux").Store | undefined;
43
- }>;
44
- /**
45
- * The graph component entry point with undo/redo
46
- * Redux is an implementation detail, hide it in the react component.
47
- */
48
- declare class Root extends React.Component {
49
- static propTypes: {
50
- onChangeMarks: PropTypes.Requireable<(...args: any[]) => any>;
51
- marks: PropTypes.Requireable<any[]>;
52
- };
53
- constructor(props: any);
54
- componentDidUpdate(prevProps: any): void;
55
- onStoreChange: any;
56
- render(): React.JSX.Element;
57
- }
58
- export default Root;
@@ -1,48 +0,0 @@
1
- import { Provider_default as e, connect as t } from "../node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js";
2
- import { applyMiddleware as n, createStore as r } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
3
- import { M as i } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
4
- import a from "./reducer.js";
5
- import { changeMarks as o } from "./actions.js";
6
- import s from "../graph-with-controls.js";
7
- import { lastActionMiddleware as c } from "./middleware.js";
8
- import l from "react";
9
- import u from "prop-types";
10
- import { isEqual as d } from "@pie-element/shared-lodash";
11
- import { jsx as f } from "react/jsx-runtime";
12
- var p = t((e) => ({ marks: e.marks.present }), (e) => ({
13
- onChangeMarks: (t) => e(o(t)),
14
- onUndo: () => e(i.undo()),
15
- onRedo: () => e(i.redo()),
16
- onReset: () => e(o([]))
17
- }))(s), m = class extends l.Component {
18
- static propTypes = {
19
- onChangeMarks: u.func,
20
- marks: u.array
21
- };
22
- constructor(e) {
23
- super(e);
24
- let t = a();
25
- this.store = r(t, { marks: e.marks }, n(c)), this.store.subscribe(this.onStoreChange);
26
- }
27
- componentDidUpdate(e) {
28
- let { marks: t } = this.props;
29
- d(this.store.getState().marks.present, t) || d(e.marks, t) || t && t.find((e) => e.correctness) || this.store.dispatch(o(t));
30
- }
31
- onStoreChange = () => {
32
- let { marks: e, onChangeMarks: t } = this.props, n = this.store.getState();
33
- d(n.marks.present, e) || t(n.marks.present);
34
- };
35
- render() {
36
- let { onChangeMarks: t, marks: n, ...r } = this.props, i = n && n.find((e) => e.correctness);
37
- return i ? /* @__PURE__ */ f(s, {
38
- ...r,
39
- marks: n,
40
- disabled: i
41
- }) : /* @__PURE__ */ f(e, {
42
- store: this.store,
43
- children: /* @__PURE__ */ f(p, { ...r })
44
- });
45
- }
46
- };
47
- //#endregion
48
- export { m as default };
@@ -1,10 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/container/marks.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 marks: (state: never[] | undefined, action: any) => any;
10
- export default marks;
@@ -1,11 +0,0 @@
1
- //#region src/container/marks.ts
2
- var e = (e = [], t) => {
3
- switch (t.type) {
4
- case "CHANGE_MARKS":
5
- if (Array.isArray(t.marks)) return t.marks;
6
- throw Error("marks must be an array");
7
- default: return e;
8
- }
9
- };
10
- //#endregion
11
- export { e as default };
@@ -1,10 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/container/middleware.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
- export declare const getLastAction: () => any;
10
- export declare const lastActionMiddleware: () => (next: any) => (action: any) => any;
@@ -1,4 +0,0 @@
1
- //#region src/container/middleware.ts
2
- var e = () => (e) => (t) => e(t);
3
- //#endregion
4
- export { e as lastActionMiddleware };
@@ -1,14 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/container/reducer.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: () => import("redux").Reducer<{
10
- marks: import("redux-undo").StateWithHistory<never[]>;
11
- }, import("redux").UnknownAction, Partial<{
12
- marks: import("redux-undo").StateWithHistory<never[]> | undefined;
13
- }>>;
14
- export default _default;
@@ -1,7 +0,0 @@
1
- import { combineReducers as e } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
2
- import t from "./marks.js";
3
- import { C as n } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
4
- //#region src/container/reducer.ts
5
- var r = () => e({ marks: n(t, { debug: !1 }) });
6
- //#endregion
7
- export { r as default };
@@ -1,50 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing/src/coordinates-label.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 getLabelPosition: (graphProps: any, x: any, y: any, labelLength: any) => {
12
- left: any;
13
- top: number;
14
- };
15
- export declare const CoordinatesLabel: {
16
- ({ x, y, graphProps }: {
17
- x: any;
18
- y: any;
19
- graphProps: any;
20
- }): React.JSX.Element;
21
- propTypes: {
22
- graphProps: PropTypes.Requireable<PropTypes.InferProps<{
23
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
24
- x: PropTypes.Validator<(...args: any[]) => any>;
25
- y: PropTypes.Validator<(...args: any[]) => any>;
26
- }>>>;
27
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
28
- x: PropTypes.Validator<(...args: any[]) => any>;
29
- y: PropTypes.Validator<(...args: any[]) => any>;
30
- }>>>;
31
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
32
- min: PropTypes.Validator<number>;
33
- max: PropTypes.Validator<number>;
34
- step: PropTypes.Requireable<number>;
35
- }>>>;
36
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
37
- min: PropTypes.Validator<number>;
38
- max: PropTypes.Validator<number>;
39
- step: PropTypes.Requireable<number>;
40
- }>>>;
41
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
42
- width: PropTypes.Validator<number>;
43
- height: PropTypes.Validator<number>;
44
- }>>>;
45
- }>>;
46
- x: PropTypes.Requireable<number>;
47
- y: PropTypes.Requireable<number>;
48
- };
49
- };
50
- export default CoordinatesLabel;
@@ -1,46 +0,0 @@
1
- import { roundNumber as e } from "./utils.js";
2
- import "react";
3
- import t from "prop-types";
4
- import { types as n } from "@pie-lib/plot";
5
- import { styled as r } from "@mui/material/styles";
6
- import { jsx as i } from "react/jsx-runtime";
7
- import { color as a } from "@pie-lib/render-ui";
8
- import o from "@mui/material/InputBase";
9
- //#region src/coordinates-label.tsx
10
- var s = r(o)(({ theme: e }) => ({
11
- fontFamily: e.typography.fontFamily,
12
- fontSize: e.typography.fontSize,
13
- borderRadius: "8px",
14
- background: e.palette.common.white,
15
- color: a.defaults.PRIMARY_DARK,
16
- "& .MuiInputBase-input": { padding: 0 }
17
- })), c = (e, t, n, r) => {
18
- let { scale: i, domain: a, range: o } = e, s = n === o.min ? 16 : n === o.max ? 0 : 8;
19
- return i.x(t) + r + 10 >= i.x(a.max) ? {
20
- left: i.x(t) - 10 - r,
21
- top: i.y(n) - s
22
- } : {
23
- left: i.x(t) + 10,
24
- top: i.y(n) - s
25
- };
26
- }, l = ({ x: t, y: n, graphProps: r }) => {
27
- let a = `(${e(t)}, ${e(n)})`, o = (a.length || 0) * 6;
28
- return /* @__PURE__ */ i(s, {
29
- style: {
30
- position: "absolute",
31
- pointerEvents: "auto",
32
- width: o,
33
- padding: 0,
34
- ...c(r, t, n, o)
35
- },
36
- value: a,
37
- inputProps: { ariaLabel: "naked" }
38
- });
39
- };
40
- l.propTypes = {
41
- graphProps: n.GraphPropsType,
42
- x: t.number,
43
- y: t.number
44
- };
45
- //#endregion
46
- export { l as default };