@pie-lib/graphing-solution-set 4.0.4-next.30 → 4.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 (310) hide show
  1. package/CHANGELOG.json +1 -0
  2. package/CHANGELOG.md +449 -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 +327 -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 +129 -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 +77 -0
  23. package/lib/coordinates-label.js.map +1 -0
  24. package/lib/graph-with-controls.js +297 -0
  25. package/lib/graph-with-controls.js.map +1 -0
  26. package/lib/graph.js +353 -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 +40 -0
  33. package/lib/index.js.map +1 -0
  34. package/lib/labels.js +199 -0
  35. package/lib/labels.js.map +1 -0
  36. package/lib/mark-label.js +159 -0
  37. package/lib/mark-label.js.map +1 -0
  38. package/lib/toggle-bar.js +248 -0
  39. package/lib/toggle-bar.js.map +1 -0
  40. package/lib/tool-menu.js +218 -0
  41. package/lib/tool-menu.js.map +1 -0
  42. package/lib/tools/index.js +24 -0
  43. package/lib/tools/index.js.map +1 -0
  44. package/lib/tools/line/component.js +92 -0
  45. package/lib/tools/line/component.js.map +1 -0
  46. package/lib/tools/line/index.js +11 -0
  47. package/lib/tools/line/index.js.map +1 -0
  48. package/lib/tools/polygon/component.js +358 -0
  49. package/lib/tools/polygon/component.js.map +1 -0
  50. package/lib/tools/polygon/index.js +89 -0
  51. package/lib/tools/polygon/index.js.map +1 -0
  52. package/lib/tools/polygon/line.js +114 -0
  53. package/lib/tools/polygon/line.js.map +1 -0
  54. package/lib/tools/polygon/polygon.js +128 -0
  55. package/lib/tools/polygon/polygon.js.map +1 -0
  56. package/lib/tools/shared/arrow-head.js +62 -0
  57. package/lib/tools/shared/arrow-head.js.map +1 -0
  58. package/lib/tools/shared/line/index.js +539 -0
  59. package/lib/tools/shared/line/index.js.map +1 -0
  60. package/lib/tools/shared/line/line-path.js +121 -0
  61. package/lib/tools/shared/line/line-path.js.map +1 -0
  62. package/lib/tools/shared/line/with-root-edge.js +121 -0
  63. package/lib/tools/shared/line/with-root-edge.js.map +1 -0
  64. package/lib/tools/shared/point/arrow-point.js +86 -0
  65. package/lib/tools/shared/point/arrow-point.js.map +1 -0
  66. package/lib/tools/shared/point/arrow.js +70 -0
  67. package/lib/tools/shared/point/arrow.js.map +1 -0
  68. package/lib/tools/shared/point/base-point.js +137 -0
  69. package/lib/tools/shared/point/base-point.js.map +1 -0
  70. package/lib/tools/shared/point/index.js +80 -0
  71. package/lib/tools/shared/point/index.js.map +1 -0
  72. package/lib/tools/shared/styles.js +26 -0
  73. package/lib/tools/shared/styles.js.map +1 -0
  74. package/lib/tools/shared/types.js +15 -0
  75. package/lib/tools/shared/types.js.map +1 -0
  76. package/lib/undo-redo.js +67 -0
  77. package/lib/undo-redo.js.map +1 -0
  78. package/lib/use-debounce.js +25 -0
  79. package/lib/use-debounce.js.map +1 -0
  80. package/lib/utils.js +235 -0
  81. package/lib/utils.js.map +1 -0
  82. package/package.json +34 -46
  83. package/src/__tests__/bg.test.jsx +250 -0
  84. package/src/__tests__/coordinates-label.test.jsx +243 -0
  85. package/src/__tests__/graph-with-controls.test.jsx +184 -0
  86. package/src/__tests__/graph.test.jsx +93 -0
  87. package/src/__tests__/grid-setup.test.jsx +645 -0
  88. package/src/__tests__/grid.test.jsx +23 -0
  89. package/src/__tests__/labels.test.jsx +41 -0
  90. package/src/__tests__/mark-label.test.jsx +66 -0
  91. package/src/__tests__/toggle-bar.test.jsx +106 -0
  92. package/src/__tests__/tool-menu.test.jsx +453 -0
  93. package/src/__tests__/undo-redo.test.jsx +26 -0
  94. package/src/__tests__/use-debounce.test.js +21 -0
  95. package/src/__tests__/utils.js +41 -0
  96. package/src/__tests__/utils.test.js +105 -0
  97. package/src/axis/__tests__/arrow.test.jsx +43 -0
  98. package/src/axis/__tests__/axes.test.jsx +182 -0
  99. package/src/axis/arrow.jsx +57 -0
  100. package/src/axis/axes.jsx +284 -0
  101. package/src/axis/index.js +3 -0
  102. package/src/bg.jsx +96 -0
  103. package/src/container/__tests__/actions.test.js +105 -0
  104. package/src/container/__tests__/index.test.jsx +227 -0
  105. package/src/container/__tests__/marks.test.js +172 -0
  106. package/src/container/__tests__/middleware.test.js +235 -0
  107. package/src/container/__tests__/reducer.test.js +324 -0
  108. package/src/container/actions.js +8 -0
  109. package/src/container/index.jsx +93 -0
  110. package/src/container/marks.js +14 -0
  111. package/src/container/middleware.js +7 -0
  112. package/src/container/reducer.js +5 -0
  113. package/src/coordinates-label.jsx +62 -0
  114. package/src/graph-with-controls.jsx +242 -0
  115. package/src/graph.jsx +333 -0
  116. package/src/grid-setup.jsx +432 -0
  117. package/src/grid.jsx +133 -0
  118. package/src/index.js +7 -0
  119. package/src/labels.jsx +173 -0
  120. package/src/mark-label.jsx +125 -0
  121. package/src/toggle-bar.jsx +221 -0
  122. package/src/tool-menu.jsx +235 -0
  123. package/src/tools/index.js +8 -0
  124. package/src/tools/line/__tests__/component.test.jsx +37 -0
  125. package/src/tools/line/component.jsx +77 -0
  126. package/src/tools/line/index.js +4 -0
  127. package/src/tools/polygon/__tests__/component.test.jsx +487 -0
  128. package/src/tools/polygon/__tests__/index.test.js +65 -0
  129. package/src/tools/polygon/__tests__/line.test.jsx +23 -0
  130. package/src/tools/polygon/__tests__/polygon.test.jsx +44 -0
  131. package/src/tools/polygon/component.jsx +324 -0
  132. package/src/tools/polygon/index.js +52 -0
  133. package/src/tools/polygon/line.jsx +80 -0
  134. package/src/tools/polygon/polygon.jsx +93 -0
  135. package/src/tools/shared/__tests__/arrow-head.test.jsx +33 -0
  136. package/src/tools/shared/arrow-head.jsx +46 -0
  137. package/src/tools/shared/line/__tests__/index.test.jsx +553 -0
  138. package/src/tools/shared/line/__tests__/line-path.test.jsx +56 -0
  139. package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +488 -0
  140. package/src/tools/shared/line/index.jsx +471 -0
  141. package/src/tools/shared/line/line-path.jsx +85 -0
  142. package/src/tools/shared/line/with-root-edge.jsx +97 -0
  143. package/src/tools/shared/point/__tests__/arrow-point.test.jsx +91 -0
  144. package/src/tools/shared/point/__tests__/arrow.test.jsx +469 -0
  145. package/src/tools/shared/point/__tests__/base-point.test.jsx +87 -0
  146. package/src/tools/shared/point/arrow-point.jsx +60 -0
  147. package/src/tools/shared/point/arrow.jsx +40 -0
  148. package/src/tools/shared/point/base-point.jsx +113 -0
  149. package/src/tools/shared/point/index.jsx +58 -0
  150. package/src/tools/shared/styles.js +20 -0
  151. package/src/tools/shared/types.js +8 -0
  152. package/src/undo-redo.jsx +37 -0
  153. package/src/use-debounce.js +13 -0
  154. package/src/utils.js +230 -0
  155. package/dist/_virtual/_rolldown/runtime.js +0 -23
  156. package/dist/autosize-input.d.ts +0 -10
  157. package/dist/autosize-input.js +0 -66
  158. package/dist/axis/arrow.d.ts +0 -13
  159. package/dist/axis/arrow.js +0 -34
  160. package/dist/axis/axes.d.ts +0 -132
  161. package/dist/axis/axes.js +0 -214
  162. package/dist/axis/index.d.ts +0 -10
  163. package/dist/bg.d.ts +0 -51
  164. package/dist/bg.js +0 -44
  165. package/dist/container/actions.d.ts +0 -15
  166. package/dist/container/actions.js +0 -7
  167. package/dist/container/index.d.ts +0 -58
  168. package/dist/container/index.js +0 -48
  169. package/dist/container/marks.d.ts +0 -10
  170. package/dist/container/marks.js +0 -11
  171. package/dist/container/middleware.d.ts +0 -10
  172. package/dist/container/middleware.js +0 -4
  173. package/dist/container/reducer.d.ts +0 -14
  174. package/dist/container/reducer.js +0 -7
  175. package/dist/coordinates-label.d.ts +0 -50
  176. package/dist/coordinates-label.js +0 -46
  177. package/dist/graph-with-controls.d.ts +0 -85
  178. package/dist/graph-with-controls.js +0 -155
  179. package/dist/graph.d.ts +0 -119
  180. package/dist/graph.js +0 -221
  181. package/dist/grid-setup.d.ts +0 -27
  182. package/dist/grid-setup.js +0 -307
  183. package/dist/grid.d.ts +0 -43
  184. package/dist/grid.js +0 -59
  185. package/dist/index.d.ts +0 -14
  186. package/dist/index.js +0 -6
  187. package/dist/labels.d.ts +0 -73
  188. package/dist/labels.js +0 -134
  189. package/dist/mark-label.d.ts +0 -50
  190. package/dist/mark-label.js +0 -84
  191. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +0 -101
  192. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +0 -63
  193. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +0 -44
  194. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +0 -9
  195. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +0 -14
  196. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +0 -21
  197. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +0 -16
  198. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +0 -8
  199. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +0 -15
  200. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/Grid.js +0 -79
  201. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +0 -79
  202. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +0 -79
  203. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +0 -6
  204. package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +0 -50
  205. package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +0 -18
  206. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +0 -10
  207. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +0 -9
  208. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +0 -6
  209. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +0 -47
  210. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +0 -53
  211. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +0 -57
  212. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +0 -91
  213. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +0 -21
  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/invariant@2.2.4/node_modules/invariant/browser.js +0 -28
  219. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Hash.js +0 -21
  220. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_ListCache.js +0 -21
  221. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Map.js +0 -10
  222. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_MapCache.js +0 -21
  223. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Symbol.js +0 -9
  224. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +0 -14
  225. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +0 -15
  226. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +0 -16
  227. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_coreJsData.js +0 -9
  228. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +0 -8
  229. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getMapData.js +0 -14
  230. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getNative.js +0 -15
  231. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getRawTag.js +0 -19
  232. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getValue.js +0 -11
  233. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashClear.js +0 -13
  234. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashDelete.js +0 -12
  235. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashGet.js +0 -18
  236. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashHas.js +0 -14
  237. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashSet.js +0 -14
  238. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isKeyable.js +0 -12
  239. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isMasked.js +0 -16
  240. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +0 -11
  241. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +0 -14
  242. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +0 -14
  243. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +0 -13
  244. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +0 -14
  245. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +0 -19
  246. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +0 -14
  247. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +0 -13
  248. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +0 -13
  249. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +0 -14
  250. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +0 -9
  251. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_objectToString.js +0 -12
  252. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_root.js +0 -10
  253. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_toSource.js +0 -20
  254. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/eq.js +0 -11
  255. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isFunction.js +0 -16
  256. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isObject.js +0 -12
  257. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/memoize.js +0 -20
  258. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +0 -37
  259. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +0 -509
  260. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +0 -108
  261. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +0 -31
  262. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +0 -45
  263. package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +0 -471
  264. package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +0 -49
  265. package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +0 -34
  266. package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +0 -185
  267. package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +0 -198
  268. 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
  269. 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
  270. package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/with-selector.js +0 -10
  271. package/dist/toggle-bar.d.ts +0 -40
  272. package/dist/tool-menu.d.ts +0 -21
  273. package/dist/tool-menu.js +0 -188
  274. package/dist/tools/index.d.ts +0 -17
  275. package/dist/tools/index.js +0 -12
  276. package/dist/tools/line/component.d.ts +0 -113
  277. package/dist/tools/line/component.js +0 -58
  278. package/dist/tools/line/index.d.ts +0 -13
  279. package/dist/tools/line/index.js +0 -6
  280. package/dist/tools/polygon/component.d.ts +0 -117
  281. package/dist/tools/polygon/component.js +0 -194
  282. package/dist/tools/polygon/index.d.ts +0 -19
  283. package/dist/tools/polygon/index.js +0 -55
  284. package/dist/tools/polygon/line.d.ts +0 -125
  285. package/dist/tools/polygon/polygon.d.ts +0 -122
  286. package/dist/tools/polygon/polygon.js +0 -62
  287. package/dist/tools/shared/arrow-head.d.ts +0 -43
  288. package/dist/tools/shared/arrow-head.js +0 -37
  289. package/dist/tools/shared/line/index.d.ts +0 -240
  290. package/dist/tools/shared/line/index.js +0 -320
  291. package/dist/tools/shared/line/line-path.d.ts +0 -57
  292. package/dist/tools/shared/line/with-root-edge.d.ts +0 -143
  293. package/dist/tools/shared/point/arrow-point.d.ts +0 -57
  294. package/dist/tools/shared/point/arrow-point.js +0 -47
  295. package/dist/tools/shared/point/arrow.d.ts +0 -46
  296. package/dist/tools/shared/point/arrow.js +0 -36
  297. package/dist/tools/shared/point/base-point.d.ts +0 -50
  298. package/dist/tools/shared/point/base-point.js +0 -88
  299. package/dist/tools/shared/point/index.d.ts +0 -217
  300. package/dist/tools/shared/point/index.js +0 -51
  301. package/dist/tools/shared/styles.d.ts +0 -24
  302. package/dist/tools/shared/styles.js +0 -17
  303. package/dist/tools/shared/types.d.ts +0 -15
  304. package/dist/tools/shared/types.js +0 -10
  305. package/dist/undo-redo.d.ts +0 -20
  306. package/dist/undo-redo.js +0 -33
  307. package/dist/use-debounce.d.ts +0 -9
  308. package/dist/use-debounce.js +0 -13
  309. package/dist/utils.d.ts +0 -58
  310. package/dist/utils.js +0 -72
@@ -1,194 +0,0 @@
1
- import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
2
- import { require_browser as t } from "../../node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js";
3
- import { equalPoints as n, getMiddleOfTwoPoints as r, getRightestPoints as i } from "../../utils.js";
4
- import { ToolPropTypeFields as a } from "../shared/types.js";
5
- import o from "./polygon.js";
6
- import s from "../../mark-label.js";
7
- import c from "react";
8
- import l from "prop-types";
9
- import { chunk as u, isEmpty as d } from "@pie-element/shared-lodash";
10
- import { types as f } from "@pie-lib/plot";
11
- import p from "debug";
12
- import { jsx as m } from "react/jsx-runtime";
13
- import h from "react-dom";
14
- //#region src/tools/polygon/component.tsx
15
- var g = /* @__PURE__ */ e(t(), 1), _ = p("pie-lib:graphing-solution-set:polygon"), v = (e, ...t) => u(t, 2).reduce((e, t) => {
16
- if (t.length === 2) {
17
- let [n, r] = t;
18
- (0, g.default)(Number.isFinite(n.index), "Index must be defined");
19
- let i = n.index;
20
- return i >= 0 && e.splice(i, 1, r), e;
21
- } else return e;
22
- }, [...e]), y = class extends c.Component {
23
- static propTypes = {
24
- className: l.string,
25
- disabled: l.bool,
26
- correctness: l.string,
27
- points: l.arrayOf(f.PointType),
28
- closed: l.bool,
29
- isSolution: l.bool,
30
- coordinatesOnHover: l.bool,
31
- onChange: l.func.isRequired,
32
- onClosePolygon: l.func.isRequired,
33
- onDragStart: l.func,
34
- onDragStop: l.func,
35
- onClick: l.func,
36
- graphProps: f.GraphPropsType.isRequired,
37
- isToolActive: l.bool,
38
- middle: l.object,
39
- labelNode: l.object,
40
- labelModeEnabled: l.bool,
41
- onChangeLabelProps: l.func,
42
- onChangeProps: l.func
43
- };
44
- static defaultProps = { points: [] };
45
- dragPoint = (e, t, r) => {
46
- _("[dragPoint] from, to:", t, r);
47
- let { onChange: i, points: a } = this.props, o = [...a], s = !!(a || []).find((e) => n(e, r));
48
- n(t, r) || s || (a[e].label && (r.label = a[e].label), o.splice(e, 1, r), i(o));
49
- };
50
- dragLine = (e, t) => {
51
- _("[dragLine]: ", e, t);
52
- let { onChange: n } = this.props;
53
- e.from.label && (t.from.label = e.from.label), e.to.label && (t.to.label = e.to.label), n(v(this.props.points, e.from, t.from, e.to, t.to));
54
- };
55
- dragPoly = (e, t) => {
56
- _("[dragPoly] ", e, t);
57
- let { onChange: n } = this.props;
58
- t.forEach((n, r) => {
59
- e[r].label && (t[r].label = e[r].label);
60
- }), n(t);
61
- };
62
- close = () => {
63
- let { points: e, onClosePolygon: t } = this.props;
64
- _("[close] ..."), e.length >= 3 ? t() : _("[close] - nope");
65
- };
66
- labelChange = (e, t) => {
67
- let { points: n, onChangeProps: r } = this.props, i = { ...e };
68
- (!e.label || d(e.label)) && delete i.label;
69
- let a = [...n];
70
- a.splice(t, 1, i), r(a);
71
- };
72
- clickPoint = (e, t, n) => {
73
- let { closed: a, disabled: o, onClick: s, isToolActive: c, labelModeEnabled: l, onChangeProps: u, onChangeLabelProps: d, points: f } = this.props;
74
- if (l) {
75
- if (o) return;
76
- if (f && t === f.length) {
77
- let { a: t, b: n } = i(f);
78
- d({
79
- label: "",
80
- ...e,
81
- ...r(t, n)
82
- });
83
- } else {
84
- let n = [...f];
85
- n.splice(t, 1, {
86
- label: "",
87
- ...e
88
- }), u(n);
89
- }
90
- this.input[t] && this.input[t].focus();
91
- return;
92
- }
93
- if (c && !a && t === 0) {
94
- this.close();
95
- return;
96
- }
97
- s(e || n);
98
- };
99
- input = {};
100
- render() {
101
- let { closed: e, graphProps: t, onChangeLabelProps: n, points: r, middle: i, labelNode: a, labelModeEnabled: l, isSolution: u = !1 } = this.props, d = r && r.length || 0;
102
- return a && i && Object.prototype.hasOwnProperty.call(i, "label") && h.createPortal(/* @__PURE__ */ m(s, {
103
- inputRef: (e) => this.input[d] = e,
104
- disabled: !l,
105
- mark: i,
106
- graphProps: t,
107
- onChange: (e) => n({
108
- ...i,
109
- label: e
110
- })
111
- }), a), /* @__PURE__ */ m("g", { children: /* @__PURE__ */ m(c.Fragment, { children: /* @__PURE__ */ m(o, {
112
- points: r,
113
- closed: e,
114
- isSolution: u,
115
- graphProps: t,
116
- onClick: this.clickPoint.bind(this, i, d)
117
- }) }) });
118
- }
119
- }, b = class extends c.Component {
120
- static propTypes = {
121
- ...a,
122
- graphProps: f.GraphPropsType.isRequired
123
- };
124
- static defaultProps = {};
125
- constructor(e) {
126
- super(e), this.state = {};
127
- }
128
- change = (e) => {
129
- let { mark: { middle: t } } = this.props, n = {
130
- ...this.state.mark,
131
- points: e
132
- };
133
- if (t) {
134
- let { a, b: o } = i(e);
135
- n.middle = {
136
- ...t,
137
- ...r(a, o)
138
- };
139
- }
140
- this.setState({ mark: n });
141
- };
142
- changeProps = (e) => {
143
- let t = {
144
- ...this.props.mark,
145
- points: e
146
- };
147
- this.props.onChange(this.props.mark, t);
148
- };
149
- changeLabelProps = (e) => {
150
- let { mark: t, onChange: n } = this.props, r = {
151
- ...t.middle,
152
- ...e
153
- };
154
- n(t, {
155
- ...t,
156
- middle: r
157
- });
158
- };
159
- closePolygon = () => {
160
- _("[closePolygon] ...");
161
- let { onComplete: e, mark: t } = this.props;
162
- e(t, {
163
- ...t,
164
- closed: !0
165
- });
166
- };
167
- dragStart = () => this.setState({ mark: this.props.mark });
168
- dragStop = () => {
169
- let { onChange: e } = this.props, t = { ...this.state.mark };
170
- this.setState({ mark: void 0 }, () => {
171
- e(this.props.mark, t);
172
- });
173
- };
174
- render() {
175
- let { coordinatesOnHover: e, mark: t, graphProps: n, onClick: r, isToolActive: i, labelNode: a, labelModeEnabled: o } = this.props, { mark: s } = this.state;
176
- return /* @__PURE__ */ m(y, {
177
- ...s || t,
178
- coordinatesOnHover: e,
179
- onChange: this.change,
180
- onChangeLabelProps: this.changeLabelProps,
181
- onChangeProps: this.changeProps,
182
- onClosePolygon: this.closePolygon,
183
- onDragStart: this.dragStart,
184
- onDragStop: this.dragStop,
185
- onClick: r,
186
- graphProps: n,
187
- isToolActive: i,
188
- labelNode: a,
189
- labelModeEnabled: o
190
- });
191
- }
192
- };
193
- //#endregion
194
- export { b as default };
@@ -1,19 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing-solution-set/src/tools/polygon/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 Polygon from './component.js';
10
- export declare const addPointToArray: (point: any, arr: any) => {
11
- points: any;
12
- closed: any;
13
- } | undefined;
14
- export declare const tool: () => {
15
- type: string;
16
- Component: typeof Polygon;
17
- complete: (data: any, mark: any) => any;
18
- addPoint: (point: any, mark: any) => any;
19
- };
@@ -1,55 +0,0 @@
1
- import { equalPoints as e } from "../../utils.js";
2
- import t from "./component.js";
3
- //#region src/tools/polygon/index.ts
4
- var n = (t, n) => {
5
- if (n ||= [], n.length === 0) return {
6
- points: [t],
7
- closed: !1
8
- };
9
- if (n.length === 1) return e(t, n[0]) ? {
10
- points: n,
11
- closed: !1
12
- } : {
13
- points: [...n, t],
14
- closed: !1
15
- };
16
- if (n.length >= 2) {
17
- let r = e(t, n[0]);
18
- return r ? {
19
- points: n,
20
- closed: r
21
- } : n.find((n) => e(n, t)) ? {
22
- points: n,
23
- closed: !1
24
- } : {
25
- points: [...n, t],
26
- closed: !1
27
- };
28
- }
29
- }, r = () => ({
30
- type: "polygon",
31
- Component: t,
32
- complete: (e, t) => ({
33
- ...t,
34
- building: !1,
35
- closed: !0
36
- }),
37
- addPoint: (e, t) => {
38
- if (t) {
39
- let { closed: r, points: i } = n(e, t.points);
40
- return {
41
- ...t,
42
- closed: r,
43
- points: i,
44
- building: !r
45
- };
46
- } else return {
47
- type: "polygon",
48
- points: [e],
49
- closed: !1,
50
- building: !0
51
- };
52
- }
53
- });
54
- //#endregion
55
- export { r as tool };
@@ -1,125 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing-solution-set/src/tools/polygon/line.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
- declare class RawLine extends React.Component {
12
- static propTypes: {
13
- className: PropTypes.Requireable<string>;
14
- from: PropTypes.Requireable<PropTypes.InferProps<{
15
- x: PropTypes.Validator<number>;
16
- y: PropTypes.Validator<number>;
17
- }>>;
18
- to: PropTypes.Requireable<PropTypes.InferProps<{
19
- x: PropTypes.Validator<number>;
20
- y: PropTypes.Validator<number>;
21
- }>>;
22
- graphProps: PropTypes.Validator<NonNullable<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
- disabled: PropTypes.Requireable<boolean>;
47
- correctness: PropTypes.Requireable<string>;
48
- };
49
- static defaultProps: {
50
- from: {};
51
- to: {};
52
- };
53
- render(): React.JSX.Element;
54
- }
55
- export declare const Line: typeof RawLine;
56
- declare const _default: {
57
- new (props: any): {
58
- grid: any;
59
- onStart: any;
60
- position: any;
61
- tiny: any;
62
- getScaledBounds: any;
63
- getClientPoint: any;
64
- skipDragOutsideOfBounds: any;
65
- onDrag: any;
66
- getDelta: any;
67
- applyDelta: any;
68
- onStop: any;
69
- render(): React.JSX.Element;
70
- context: unknown;
71
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
72
- forceUpdate(callback?: (() => void) | undefined): void;
73
- readonly props: Readonly<{}>;
74
- state: Readonly<{}>;
75
- refs: {
76
- [key: string]: React.ReactInstance;
77
- };
78
- componentDidMount?(): void;
79
- shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
80
- componentWillUnmount?(): void;
81
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
82
- getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
83
- componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
84
- componentWillMount?(): void;
85
- UNSAFE_componentWillMount?(): void;
86
- componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
87
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
88
- componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
89
- UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
90
- };
91
- propTypes: {
92
- disabled: PropTypes.Requireable<boolean>;
93
- onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
94
- onDrag: PropTypes.Requireable<(...args: any[]) => any>;
95
- onDragStop: PropTypes.Requireable<(...args: any[]) => any>;
96
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
97
- onMove: PropTypes.Requireable<(...args: any[]) => any>;
98
- graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
99
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
100
- x: PropTypes.Validator<(...args: any[]) => any>;
101
- y: PropTypes.Validator<(...args: any[]) => any>;
102
- }>>>;
103
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
104
- x: PropTypes.Validator<(...args: any[]) => any>;
105
- y: PropTypes.Validator<(...args: any[]) => any>;
106
- }>>>;
107
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
108
- min: PropTypes.Validator<number>;
109
- max: PropTypes.Validator<number>;
110
- step: PropTypes.Requireable<number>;
111
- }>>>;
112
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
113
- min: PropTypes.Validator<number>;
114
- max: PropTypes.Validator<number>;
115
- step: PropTypes.Requireable<number>;
116
- }>>>;
117
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
118
- width: PropTypes.Validator<number>;
119
- height: PropTypes.Validator<number>;
120
- }>>>;
121
- }>>>;
122
- };
123
- contextType?: React.Context<any> | undefined;
124
- };
125
- export default _default;
@@ -1,122 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing-solution-set/src/tools/polygon/polygon.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 getPointString: (points: any, scale: any) => any;
12
- export declare class RawPolygon extends React.Component {
13
- static propTypes: {
14
- className: PropTypes.Requireable<string>;
15
- isSolution: PropTypes.Requireable<boolean>;
16
- points: PropTypes.Requireable<(PropTypes.InferProps<{
17
- x: PropTypes.Validator<number>;
18
- y: PropTypes.Validator<number>;
19
- }> | null | undefined)[]>;
20
- graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
21
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
22
- x: PropTypes.Validator<(...args: any[]) => any>;
23
- y: PropTypes.Validator<(...args: any[]) => any>;
24
- }>>>;
25
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
26
- x: PropTypes.Validator<(...args: any[]) => any>;
27
- y: PropTypes.Validator<(...args: any[]) => any>;
28
- }>>>;
29
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
30
- min: PropTypes.Validator<number>;
31
- max: PropTypes.Validator<number>;
32
- step: PropTypes.Requireable<number>;
33
- }>>>;
34
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
35
- min: PropTypes.Validator<number>;
36
- max: PropTypes.Validator<number>;
37
- step: PropTypes.Requireable<number>;
38
- }>>>;
39
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
40
- width: PropTypes.Validator<number>;
41
- height: PropTypes.Validator<number>;
42
- }>>>;
43
- }>>>;
44
- closed: PropTypes.Validator<boolean>;
45
- correctness: PropTypes.Requireable<string>;
46
- };
47
- static defaultProps: {
48
- points: never[];
49
- };
50
- render(): React.JSX.Element;
51
- }
52
- export declare const Polygon: typeof RawPolygon;
53
- declare const _default: {
54
- new (props: any): {
55
- grid: any;
56
- onStart: any;
57
- position: any;
58
- tiny: any;
59
- getScaledBounds: any;
60
- getClientPoint: any;
61
- skipDragOutsideOfBounds: any;
62
- onDrag: any;
63
- getDelta: any;
64
- applyDelta: any;
65
- onStop: any;
66
- render(): React.JSX.Element;
67
- context: unknown;
68
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
69
- forceUpdate(callback?: (() => void) | undefined): void;
70
- readonly props: Readonly<{}>;
71
- state: Readonly<{}>;
72
- refs: {
73
- [key: string]: React.ReactInstance;
74
- };
75
- componentDidMount?(): void;
76
- shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
77
- componentWillUnmount?(): void;
78
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
79
- getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
80
- componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
81
- componentWillMount?(): void;
82
- UNSAFE_componentWillMount?(): void;
83
- componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
84
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
85
- componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
86
- UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
87
- };
88
- propTypes: {
89
- disabled: PropTypes.Requireable<boolean>;
90
- onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
91
- onDrag: PropTypes.Requireable<(...args: any[]) => any>;
92
- onDragStop: PropTypes.Requireable<(...args: any[]) => any>;
93
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
94
- onMove: PropTypes.Requireable<(...args: any[]) => any>;
95
- graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
96
- scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
97
- x: PropTypes.Validator<(...args: any[]) => any>;
98
- y: PropTypes.Validator<(...args: any[]) => any>;
99
- }>>>;
100
- snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
101
- x: PropTypes.Validator<(...args: any[]) => any>;
102
- y: PropTypes.Validator<(...args: any[]) => any>;
103
- }>>>;
104
- domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
105
- min: PropTypes.Validator<number>;
106
- max: PropTypes.Validator<number>;
107
- step: PropTypes.Requireable<number>;
108
- }>>>;
109
- range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
110
- min: PropTypes.Validator<number>;
111
- max: PropTypes.Validator<number>;
112
- step: PropTypes.Requireable<number>;
113
- }>>>;
114
- size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
115
- width: PropTypes.Validator<number>;
116
- height: PropTypes.Validator<number>;
117
- }>>>;
118
- }>>>;
119
- };
120
- contextType?: React.Context<any> | undefined;
121
- };
122
- export default _default;
@@ -1,62 +0,0 @@
1
- import { bounds as e, point as t, polygonToArea as n } from "../../utils.js";
2
- import { correct as r, incorrect as i } from "../shared/styles.js";
3
- import a from "react";
4
- import o from "prop-types";
5
- import { gridDraggable as s, types as c } from "@pie-lib/plot";
6
- import { styled as l } from "@mui/material/styles";
7
- import { jsx as u } from "react/jsx-runtime";
8
- //#region src/tools/polygon/polygon.tsx
9
- var d = l("polygon", { shouldForwardProp: (e) => !["isSolution", "correctness"].includes(e) })(({ isSolution: e, correctness: t }) => ({
10
- fill: e ? "rgb(60, 73, 150, 0.6)" : "transparent",
11
- strokeWidth: 2,
12
- "&:hover": { fill: e ? "rgb(60, 73, 150, 0.6)" : "rgb(0, 0, 0, 0.25)" },
13
- ...t === "correct" && r("stroke"),
14
- ...t === "incorrect" && i("stroke")
15
- })), f = l("polyline", { shouldForwardProp: (e) => !["isSolution", "correctness"].includes(e) })(({ isSolution: e, correctness: t }) => ({
16
- fill: e ? "rgb(60, 73, 150, 0.6)" : "transparent",
17
- strokeWidth: 2,
18
- "&:hover": { fill: e ? "rgb(60, 73, 150, 0.6)" : "rgb(0, 0, 0, 0.25)" },
19
- ...t === "correct" && r("stroke"),
20
- ...t === "incorrect" && i("stroke")
21
- })), p = (e, t) => (e || []).map((e) => {
22
- let n = {
23
- x: t.x(e.x),
24
- y: t.y(e.y)
25
- };
26
- return `${n.x},${n.y}`;
27
- }).join(" "), m = class extends a.Component {
28
- static propTypes = {
29
- className: o.string,
30
- isSolution: o.bool,
31
- points: o.arrayOf(c.PointType),
32
- graphProps: c.GraphPropsType.isRequired,
33
- closed: o.bool.isRequired,
34
- correctness: o.string
35
- };
36
- static defaultProps = { points: [] };
37
- render() {
38
- let { points: e, className: t, correctness: n, graphProps: r, closed: i, isSolution: a, ...o } = this.props, { scale: s } = r, c = p(e, s);
39
- return /* @__PURE__ */ u(i ? d : f, {
40
- points: c,
41
- isSolution: a,
42
- correctness: n,
43
- className: t,
44
- ...o
45
- });
46
- }
47
- }, h = s({
48
- bounds: (t, { domain: r, range: i }) => {
49
- let { points: a } = t;
50
- return e(n(a), r, i);
51
- },
52
- anchorPoint: (e) => {
53
- let { points: t } = e;
54
- return t[0];
55
- },
56
- fromDelta: (e, n) => {
57
- let { points: r } = e;
58
- return r.map((e) => t(e).add(t(n)));
59
- }
60
- })(m);
61
- //#endregion
62
- export { h as default };
@@ -1,43 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/graphing-solution-set/src/tools/shared/arrow-head.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 ArrowHead: {
12
- ({ size, transform, points }: {
13
- size: any;
14
- transform: any;
15
- points: any;
16
- }): React.JSX.Element;
17
- propTypes: {
18
- points: PropTypes.Requireable<string>;
19
- size: PropTypes.Requireable<number>;
20
- transform: PropTypes.Requireable<string>;
21
- };
22
- defaultProps: {
23
- points: string;
24
- size: number;
25
- transform: string;
26
- };
27
- };
28
- export declare const genUid: () => string;
29
- export declare const ArrowMarker: {
30
- ({ id, size, className }: {
31
- id: any;
32
- size: any;
33
- className: any;
34
- }): React.JSX.Element;
35
- propTypes: {
36
- id: PropTypes.Requireable<string>;
37
- size: PropTypes.Requireable<number>;
38
- className: PropTypes.Requireable<string>;
39
- };
40
- defaultProps: {
41
- size: number;
42
- };
43
- };
@@ -1,37 +0,0 @@
1
- import "react";
2
- import e from "prop-types";
3
- import { jsx as t } from "react/jsx-runtime";
4
- import { color as n } from "@pie-lib/render-ui";
5
- //#region src/tools/shared/arrow-head.tsx
6
- var r = ({ size: e, transform: n, points: r }) => /* @__PURE__ */ t("polygon", {
7
- points: r || `0,0 ${e},${e / 2} 0,${e}`,
8
- transform: n
9
- });
10
- r.propTypes = {
11
- points: e.string,
12
- size: e.number,
13
- transform: e.string
14
- }, r.defaultProps = {
15
- points: "",
16
- size: 10,
17
- transform: ""
18
- };
19
- var i = () => `arrow-${(Math.random() * 1e3).toFixed(0)}`, a = ({ id: e, size: i, className: a }) => /* @__PURE__ */ t("marker", {
20
- id: e,
21
- viewBox: `0 0 ${i} ${i}`,
22
- refX: i / 2,
23
- refY: i / 2,
24
- markerWidth: i,
25
- markerHeight: i,
26
- orient: "auto-start-reverse",
27
- className: a,
28
- style: { fill: n.defaults.BLACK },
29
- children: /* @__PURE__ */ t(r, { size: i })
30
- });
31
- a.propTypes = {
32
- id: e.string,
33
- size: e.number,
34
- className: e.string
35
- }, a.defaultProps = { size: 5 };
36
- //#endregion
37
- export { r as ArrowHead, a as ArrowMarker, i as genUid };