@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
@@ -0,0 +1,321 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = exports.RawBaseCircle = exports.BaseCircle = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+ var _react = _interopRequireDefault(require("react"));
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+ var _classnames = _interopRequireDefault(require("classnames"));
18
+ var _point = require("../shared/point");
19
+ var _bgCircle = _interopRequireDefault(require("./bg-circle"));
20
+ var _utils = require("../../utils");
21
+ var _plot = require("@pie-lib/plot");
22
+ var _withRootEdge = require("../shared/line/with-root-edge");
23
+ var _reactDom = _interopRequireDefault(require("react-dom"));
24
+ var _markLabel = _interopRequireDefault(require("../../mark-label"));
25
+ var _lodashEs = require("lodash-es");
26
+ var _renderUi = require("@pie-lib/render-ui");
27
+ var _styles = require("@mui/material/styles");
28
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
31
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
32
+ var opacityPulsate = function opacityPulsate(opacity) {
33
+ return (0, _styles.keyframes)({
34
+ '0%': {
35
+ opacity: '0.0'
36
+ },
37
+ '50%': {
38
+ opacity: opacity
39
+ },
40
+ '100%': {
41
+ opacity: '0.0'
42
+ }
43
+ });
44
+ };
45
+ var getRadius = function getRadius(from, outer) {
46
+ var c = (0, _utils.point)(from);
47
+ return c.dist((0, _utils.point)(outer));
48
+ };
49
+ var RawBaseCircle = exports.RawBaseCircle = /*#__PURE__*/function (_React$Component) {
50
+ function RawBaseCircle() {
51
+ var _this;
52
+ (0, _classCallCheck2["default"])(this, RawBaseCircle);
53
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
54
+ args[_key] = arguments[_key];
55
+ }
56
+ _this = _callSuper(this, RawBaseCircle, [].concat(args));
57
+ (0, _defineProperty2["default"])(_this, "onChangePoint", function (point) {
58
+ var _this$props = _this.props,
59
+ middle = _this$props.middle,
60
+ onChange = _this$props.onChange;
61
+ var from = point.from,
62
+ to = point.to;
63
+ if (!(0, _utils.equalPoints)(from, to)) {
64
+ if (middle) {
65
+ point.middle = _objectSpread(_objectSpread({}, middle), (0, _utils.getMiddleOfTwoPoints)(from, to));
66
+ }
67
+ onChange(point);
68
+ }
69
+ });
70
+ (0, _defineProperty2["default"])(_this, "dragFrom", function (draggedFrom) {
71
+ var _this$props2 = _this.props,
72
+ from = _this$props2.from,
73
+ to = _this$props2.to;
74
+ if (from.label) draggedFrom.label = from.label;
75
+ if (!(0, _utils.equalPoints)(draggedFrom, to)) {
76
+ _this.onChangePoint({
77
+ from: draggedFrom,
78
+ to: to
79
+ });
80
+ }
81
+ });
82
+ (0, _defineProperty2["default"])(_this, "dragTo", function (draggedTo) {
83
+ var _this$props3 = _this.props,
84
+ from = _this$props3.from,
85
+ to = _this$props3.to;
86
+ if (to.label) draggedTo.label = to.label;
87
+ if (!(0, _utils.equalPoints)(from, draggedTo)) {
88
+ _this.onChangePoint({
89
+ from: from,
90
+ to: draggedTo
91
+ });
92
+ }
93
+ });
94
+ (0, _defineProperty2["default"])(_this, "dragCircle", function (draggedFrom) {
95
+ var _this$props4 = _this.props,
96
+ from = _this$props4.from,
97
+ to = _this$props4.to,
98
+ onChange = _this$props4.onChange,
99
+ middle = _this$props4.middle;
100
+ var diff = (0, _utils.point)(from).sub((0, _utils.point)(draggedFrom));
101
+ var draggedTo = (0, _utils.point)(to).sub(diff);
102
+ if (from.label) draggedFrom.label = from.label;
103
+ if (to.label) draggedTo.label = to.label;
104
+ var updated = {
105
+ from: draggedFrom,
106
+ to: draggedTo
107
+ };
108
+ if (middle) {
109
+ updated.middle = _objectSpread(_objectSpread({}, middle), (0, _utils.getMiddleOfTwoPoints)(draggedFrom, draggedTo));
110
+ }
111
+ _this.setState({
112
+ draggedroot: undefined,
113
+ draggedOuter: undefined,
114
+ isCircleDrag: false
115
+ }, function () {
116
+ return onChange(updated);
117
+ });
118
+ });
119
+ (0, _defineProperty2["default"])(_this, "labelChange", function (point, type) {
120
+ var changeMarkProps = _this.props.changeMarkProps;
121
+ var update = _objectSpread({}, point);
122
+ if (!point.label || (0, _lodashEs.isEmpty)(point.label)) delete update.label;
123
+ changeMarkProps((0, _defineProperty2["default"])({}, type, update));
124
+ });
125
+ (0, _defineProperty2["default"])(_this, "clickPoint", function (point, type, data) {
126
+ var _this$props5 = _this.props,
127
+ changeMarkProps = _this$props5.changeMarkProps,
128
+ disabled = _this$props5.disabled,
129
+ from = _this$props5.from,
130
+ to = _this$props5.to,
131
+ middle = _this$props5.middle,
132
+ labelModeEnabled = _this$props5.labelModeEnabled,
133
+ limitLabeling = _this$props5.limitLabeling,
134
+ onClick = _this$props5.onClick;
135
+ if (!labelModeEnabled) {
136
+ onClick(point || data);
137
+ return;
138
+ }
139
+ if (disabled || limitLabeling) return;
140
+ if (type === 'middle' && !point && from && to) {
141
+ point = _objectSpread(_objectSpread({}, point), (0, _utils.getMiddleOfTwoPoints)(from, to));
142
+ }
143
+ changeMarkProps((0, _defineProperty2["default"])({
144
+ from: (0, _utils.stripEmptyLabel)(from),
145
+ to: (0, _utils.stripEmptyLabel)(to),
146
+ middle: (0, _utils.stripEmptyLabel)(middle)
147
+ }, type, _objectSpread({
148
+ label: ''
149
+ }, point)));
150
+ if (_this.input[type]) {
151
+ _this.input[type].focus();
152
+ }
153
+ });
154
+ (0, _defineProperty2["default"])(_this, "input", {});
155
+ return _this;
156
+ }
157
+ (0, _inherits2["default"])(RawBaseCircle, _React$Component);
158
+ return (0, _createClass2["default"])(RawBaseCircle, [{
159
+ key: "render",
160
+ value: function render() {
161
+ var _this2 = this;
162
+ var _this$props6 = this.props,
163
+ from = _this$props6.from,
164
+ to = _this$props6.to,
165
+ middle = _this$props6.middle,
166
+ disabled = _this$props6.disabled,
167
+ building = _this$props6.building,
168
+ coordinatesOnHover = _this$props6.coordinatesOnHover,
169
+ onDragStart = _this$props6.onDragStart,
170
+ onDragStop = _this$props6.onDragStop,
171
+ onClick = _this$props6.onClick,
172
+ correctness = _this$props6.correctness,
173
+ graphProps = _this$props6.graphProps,
174
+ labelNode = _this$props6.labelNode,
175
+ labelModeEnabled = _this$props6.labelModeEnabled;
176
+ var common = {
177
+ onDragStart: onDragStart,
178
+ onDragStop: onDragStop,
179
+ graphProps: graphProps,
180
+ onClick: onClick
181
+ };
182
+ to = to || from;
183
+ var radius = getRadius(from, to);
184
+ var fromLabelNode = null;
185
+ var toLabelNode = null;
186
+ var circleLabelNode = null;
187
+ if (labelNode) {
188
+ var _to;
189
+ if ((from === null || from === void 0 ? void 0 : from.label) !== undefined) {
190
+ fromLabelNode = /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/_react["default"].createElement(_markLabel["default"], {
191
+ inputRef: function inputRef(r) {
192
+ return _this2.input.from = r;
193
+ },
194
+ disabled: !labelModeEnabled,
195
+ mark: from,
196
+ graphProps: graphProps,
197
+ onChange: function onChange(label) {
198
+ return _this2.labelChange(_objectSpread(_objectSpread({}, from), {}, {
199
+ label: label
200
+ }), 'from');
201
+ }
202
+ }), labelNode);
203
+ }
204
+ if (((_to = to) === null || _to === void 0 ? void 0 : _to.label) !== undefined) {
205
+ toLabelNode = /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/_react["default"].createElement(_markLabel["default"], {
206
+ inputRef: function inputRef(r) {
207
+ return _this2.input.to = r;
208
+ },
209
+ disabled: !labelModeEnabled,
210
+ mark: to,
211
+ graphProps: graphProps,
212
+ onChange: function onChange(label) {
213
+ return _this2.labelChange(_objectSpread(_objectSpread({}, to), {}, {
214
+ label: label
215
+ }), 'to');
216
+ }
217
+ }), labelNode);
218
+ }
219
+ if ((middle === null || middle === void 0 ? void 0 : middle.label) !== undefined) {
220
+ circleLabelNode = /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/_react["default"].createElement(_markLabel["default"], {
221
+ inputRef: function inputRef(r) {
222
+ return _this2.input.middle = r;
223
+ },
224
+ disabled: !labelModeEnabled,
225
+ mark: middle,
226
+ graphProps: graphProps,
227
+ onChange: function onChange(label) {
228
+ return _this2.labelChange(_objectSpread(_objectSpread({}, middle), {}, {
229
+ label: label
230
+ }), 'middle');
231
+ }
232
+ }), labelNode);
233
+ }
234
+ }
235
+ return /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement(StyledBgCircle, (0, _extends2["default"])({
236
+ disabled: building || disabled,
237
+ correctness: correctness,
238
+ className: (0, _classnames["default"])(building && 'bgCircleBuilding'),
239
+ x: from.x,
240
+ y: from.y,
241
+ radius: radius,
242
+ onDrag: this.dragCircle
243
+ }, common, {
244
+ onClick: function onClick(data) {
245
+ return _this2.clickPoint(middle, 'middle', data);
246
+ }
247
+ })), circleLabelNode, /*#__PURE__*/_react["default"].createElement(_point.BasePoint, (0, _extends2["default"])({
248
+ disabled: building || disabled,
249
+ coordinatesOnHover: coordinatesOnHover,
250
+ correctness: correctness,
251
+ labelNode: labelNode,
252
+ x: to.x,
253
+ y: to.y,
254
+ onDrag: this.dragTo
255
+ }, common, {
256
+ onClick: function onClick(data) {
257
+ return _this2.clickPoint(to, 'to', data);
258
+ }
259
+ })), toLabelNode, /*#__PURE__*/_react["default"].createElement(_point.BasePoint, (0, _extends2["default"])({
260
+ disabled: building || disabled,
261
+ coordinatesOnHover: coordinatesOnHover,
262
+ correctness: correctness,
263
+ labelNode: labelNode,
264
+ x: from.x,
265
+ y: from.y,
266
+ className: "from",
267
+ onDrag: this.dragFrom
268
+ }, common, {
269
+ onClick: function onClick(data) {
270
+ return _this2.clickPoint(from, 'from', data);
271
+ }
272
+ })), fromLabelNode);
273
+ }
274
+ }]);
275
+ }(_react["default"].Component); // MUI v5 styled() replaces withStyles
276
+ (0, _defineProperty2["default"])(RawBaseCircle, "propTypes", {
277
+ building: _propTypes["default"].bool,
278
+ className: _propTypes["default"].string,
279
+ coordinatesOnHover: _propTypes["default"].bool,
280
+ correctness: _propTypes["default"].string,
281
+ from: _plot.types.PointType,
282
+ disabled: _propTypes["default"].bool,
283
+ to: _plot.types.PointType,
284
+ middle: _plot.types.PointType,
285
+ onChange: _propTypes["default"].func.isRequired,
286
+ onDragStart: _propTypes["default"].func,
287
+ onDragStop: _propTypes["default"].func,
288
+ graphProps: _plot.types.GraphPropsType.isRequired,
289
+ onClick: _propTypes["default"].func,
290
+ labelNode: _propTypes["default"].object,
291
+ labelModeEnabled: _propTypes["default"].bool,
292
+ changeMarkProps: _propTypes["default"].func,
293
+ limitLabeling: _propTypes["default"].bool
294
+ });
295
+ (0, _defineProperty2["default"])(RawBaseCircle, "defaultProps", {
296
+ onClick: function onClick() {
297
+ return {};
298
+ }
299
+ });
300
+ var StyledBgCircle = (0, _styles.styled)(_bgCircle["default"])(function () {
301
+ return {
302
+ '&.outerLine': {
303
+ fill: _renderUi.color.transparent(),
304
+ stroke: _renderUi.color.defaults.BLACK,
305
+ strokeWidth: 4,
306
+ '&:hover': {
307
+ strokeWidth: 6,
308
+ stroke: _renderUi.color.defaults.PRIMARY_DARK
309
+ }
310
+ },
311
+ '&.bgCircleBuilding': {
312
+ stroke: _renderUi.color.defaults.BLACK,
313
+ animation: "".concat(opacityPulsate('0.3'), " 2s ease-out infinite"),
314
+ opacity: 1
315
+ }
316
+ };
317
+ });
318
+ var BaseCircle = exports.BaseCircle = RawBaseCircle;
319
+ var Component = (0, _withRootEdge.rootEdgeComponent)(BaseCircle);
320
+ var _default = exports["default"] = Component;
321
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","names":["_react","_interopRequireDefault","require","_propTypes","_classnames","_point","_bgCircle","_utils","_plot","_withRootEdge","_reactDom","_markLabel","_lodashEs","_renderUi","_styles","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","Boolean","prototype","valueOf","call","opacityPulsate","opacity","keyframes","getRadius","from","outer","c","point","dist","RawBaseCircle","exports","_React$Component","_this","_classCallCheck2","_len","args","Array","_key","concat","_this$props","props","middle","onChange","to","equalPoints","getMiddleOfTwoPoints","draggedFrom","_this$props2","label","onChangePoint","draggedTo","_this$props3","_this$props4","diff","sub","updated","setState","draggedroot","undefined","draggedOuter","isCircleDrag","type","changeMarkProps","update","isEmpty","data","_this$props5","disabled","labelModeEnabled","limitLabeling","onClick","stripEmptyLabel","input","focus","_inherits2","_createClass2","key","value","render","_this2","_this$props6","building","coordinatesOnHover","onDragStart","onDragStop","correctness","graphProps","labelNode","common","radius","fromLabelNode","toLabelNode","circleLabelNode","_to","ReactDOM","createPortal","createElement","inputRef","mark","labelChange","StyledBgCircle","_extends2","className","classNames","x","y","onDrag","dragCircle","clickPoint","BasePoint","dragTo","dragFrom","React","Component","PropTypes","bool","string","types","PointType","func","isRequired","GraphPropsType","object","styled","BgCircle","fill","color","transparent","stroke","defaults","BLACK","strokeWidth","PRIMARY_DARK","animation","BaseCircle","rootEdgeComponent","_default"],"sources":["../../../src/tools/circle/component.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { BasePoint } from '../shared/point';\nimport BgCircle from './bg-circle';\nimport { equalPoints, getMiddleOfTwoPoints, point, stripEmptyLabel } from '../../utils';\nimport { types } from '@pie-lib/plot';\nimport { rootEdgeComponent } from '../shared/line/with-root-edge';\nimport ReactDOM from 'react-dom';\nimport MarkLabel from '../../mark-label';\nimport { isEmpty } from 'lodash-es';\nimport { color } from '@pie-lib/render-ui';\nimport { keyframes, styled } from '@mui/material/styles';\n\nconst opacityPulsate = (opacity) =>\n keyframes({\n '0%': { opacity: '0.0' },\n '50%': { opacity },\n '100%': { opacity: '0.0' },\n });\n\nconst getRadius = (from, outer) => {\n const c = point(from);\n return c.dist(point(outer));\n};\n\nexport class RawBaseCircle extends React.Component {\n static propTypes = {\n building: PropTypes.bool,\n className: PropTypes.string,\n coordinatesOnHover: PropTypes.bool,\n correctness: PropTypes.string,\n from: types.PointType,\n disabled: PropTypes.bool,\n to: types.PointType,\n middle: types.PointType,\n onChange: PropTypes.func.isRequired,\n onDragStart: PropTypes.func,\n onDragStop: PropTypes.func,\n graphProps: types.GraphPropsType.isRequired,\n onClick: PropTypes.func,\n labelNode: PropTypes.object,\n labelModeEnabled: PropTypes.bool,\n changeMarkProps: PropTypes.func,\n limitLabeling: PropTypes.bool,\n };\n\n static defaultProps = {\n onClick: () => ({}),\n };\n\n onChangePoint = (point) => {\n const { middle, onChange } = this.props;\n const { from, to } = point;\n\n if (!equalPoints(from, to)) {\n if (middle) {\n point.middle = { ...middle, ...getMiddleOfTwoPoints(from, to) };\n }\n onChange(point);\n }\n };\n\n dragFrom = (draggedFrom) => {\n const { from, to } = this.props;\n\n if (from.label) draggedFrom.label = from.label;\n if (!equalPoints(draggedFrom, to)) {\n this.onChangePoint({ from: draggedFrom, to });\n }\n };\n\n dragTo = (draggedTo) => {\n const { from, to } = this.props;\n\n if (to.label) draggedTo.label = to.label;\n if (!equalPoints(from, draggedTo)) {\n this.onChangePoint({ from, to: draggedTo });\n }\n };\n\n dragCircle = (draggedFrom) => {\n const { from, to, onChange, middle } = this.props;\n const diff = point(from).sub(point(draggedFrom));\n const draggedTo = point(to).sub(diff);\n\n if (from.label) draggedFrom.label = from.label;\n if (to.label) draggedTo.label = to.label;\n\n const updated = { from: draggedFrom, to: draggedTo };\n if (middle) {\n updated.middle = { ...middle, ...getMiddleOfTwoPoints(draggedFrom, draggedTo) };\n }\n\n this.setState({ draggedroot: undefined, draggedOuter: undefined, isCircleDrag: false }, () => onChange(updated));\n };\n\n labelChange = (point, type) => {\n const { changeMarkProps } = this.props;\n const update = { ...point };\n if (!point.label || isEmpty(point.label)) delete update.label;\n changeMarkProps({ [type]: update });\n };\n\n clickPoint = (point, type, data) => {\n const { changeMarkProps, disabled, from, to, middle, labelModeEnabled, limitLabeling, onClick } = this.props;\n\n if (!labelModeEnabled) {\n onClick(point || data);\n return;\n }\n\n if (disabled || limitLabeling) return;\n\n if (type === 'middle' && !point && from && to) {\n point = { ...point, ...getMiddleOfTwoPoints(from, to) };\n }\n changeMarkProps({\n from: stripEmptyLabel(from),\n to: stripEmptyLabel(to),\n middle: stripEmptyLabel(middle),\n [type]: { label: '', ...point },\n });\n\n if (this.input[type]) {\n this.input[type].focus();\n }\n };\n\n input = {};\n\n render() {\n let {\n from,\n to,\n middle,\n disabled,\n building,\n coordinatesOnHover,\n onDragStart,\n onDragStop,\n onClick,\n correctness,\n graphProps,\n labelNode,\n labelModeEnabled,\n } = this.props;\n\n const common = { onDragStart, onDragStop, graphProps, onClick };\n to = to || from;\n const radius = getRadius(from, to);\n\n let fromLabelNode = null;\n let toLabelNode = null;\n let circleLabelNode = null;\n\n if (labelNode) {\n if (from?.label !== undefined) {\n fromLabelNode = ReactDOM.createPortal(\n <MarkLabel\n inputRef={(r) => (this.input.from = r)}\n disabled={!labelModeEnabled}\n mark={from}\n graphProps={graphProps}\n onChange={(label) => this.labelChange({ ...from, label }, 'from')}\n />,\n labelNode,\n );\n }\n\n if (to?.label !== undefined) {\n toLabelNode = ReactDOM.createPortal(\n <MarkLabel\n inputRef={(r) => (this.input.to = r)}\n disabled={!labelModeEnabled}\n mark={to}\n graphProps={graphProps}\n onChange={(label) => this.labelChange({ ...to, label }, 'to')}\n />,\n labelNode,\n );\n }\n\n if (middle?.label !== undefined) {\n circleLabelNode = ReactDOM.createPortal(\n <MarkLabel\n inputRef={(r) => (this.input.middle = r)}\n disabled={!labelModeEnabled}\n mark={middle}\n graphProps={graphProps}\n onChange={(label) => this.labelChange({ ...middle, label }, 'middle')}\n />,\n labelNode,\n );\n }\n }\n\n return (\n <g>\n <StyledBgCircle\n disabled={building || disabled}\n correctness={correctness}\n className={classNames(building && 'bgCircleBuilding')}\n x={from.x}\n y={from.y}\n radius={radius}\n onDrag={this.dragCircle}\n {...common}\n onClick={(data) => this.clickPoint(middle, 'middle', data)}\n />\n {circleLabelNode}\n\n <BasePoint\n disabled={building || disabled}\n coordinatesOnHover={coordinatesOnHover}\n correctness={correctness}\n labelNode={labelNode}\n x={to.x}\n y={to.y}\n onDrag={this.dragTo}\n {...common}\n onClick={(data) => this.clickPoint(to, 'to', data)}\n />\n {toLabelNode}\n\n <BasePoint\n disabled={building || disabled}\n coordinatesOnHover={coordinatesOnHover}\n correctness={correctness}\n labelNode={labelNode}\n x={from.x}\n y={from.y}\n className=\"from\"\n onDrag={this.dragFrom}\n {...common}\n onClick={(data) => this.clickPoint(from, 'from', data)}\n />\n {fromLabelNode}\n </g>\n );\n }\n}\n\n// MUI v5 styled() replaces withStyles\nconst StyledBgCircle = styled(BgCircle)(() => ({\n '&.outerLine': {\n fill: color.transparent(),\n stroke: color.defaults.BLACK,\n strokeWidth: 4,\n '&:hover': {\n strokeWidth: 6,\n stroke: color.defaults.PRIMARY_DARK,\n },\n },\n '&.bgCircleBuilding': {\n stroke: color.defaults.BLACK,\n animation: `${opacityPulsate('0.3')} 2s ease-out infinite`,\n opacity: 1,\n },\n}));\n\nexport const BaseCircle = RawBaseCircle;\nconst Component = rootEdgeComponent(BaseCircle);\nexport default Component;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,UAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AAAyD,SAAAa,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ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AC5BG,SAAS,KAAA/F,MAAA,CAAKlB,cAAc,CAAC,KAAK,CAAC,0BAAuB;MAC1DC,OAAO,EAAE;IACX;EACF,CAAC;AAAA,CAAC,CAAC;AAEI,IAAMiH,UAAU,GAAAxG,OAAA,CAAAwG,UAAA,GAAGzG,aAAa;AACvC,IAAMoF,SAAS,GAAG,IAAAsB,+BAAiB,EAACD,UAAU,CAAC;AAAC,IAAAE,QAAA,GAAA1G,OAAA,cACjCmF,SAAS","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.tool = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _component = _interopRequireDefault(require("./component"));
10
+ var _utils = require("../../utils");
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ var tool = exports.tool = function tool() {
14
+ return {
15
+ type: 'circle',
16
+ Component: _component["default"],
17
+ hover: function hover(point, mark) {
18
+ return _objectSpread(_objectSpread({}, mark), {}, {
19
+ edge: point
20
+ });
21
+ },
22
+ addPoint: function addPoint(point, mark) {
23
+ if (mark && (0, _utils.equalPoints)(mark.root, point)) {
24
+ return mark;
25
+ }
26
+ if (!mark) {
27
+ return {
28
+ type: 'circle',
29
+ root: point,
30
+ building: true
31
+ };
32
+ } else {
33
+ return _objectSpread(_objectSpread({}, mark), {}, {
34
+ edge: point,
35
+ building: false
36
+ });
37
+ }
38
+ }
39
+ };
40
+ };
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_component","_interopRequireDefault","require","_utils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","tool","exports","type","Component","Circle","hover","point","mark","edge","addPoint","equalPoints","root","building"],"sources":["../../../src/tools/circle/index.js"],"sourcesContent":["import Circle from './component';\nimport { equalPoints } from '../../utils';\n\nexport const tool = () => ({\n type: 'circle',\n Component: Circle,\n hover: (point, mark) => {\n return { ...mark, edge: point };\n },\n addPoint: (point, mark) => {\n if (mark && equalPoints(mark.root, point)) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'circle',\n root: point,\n building: true,\n };\n } else {\n return { ...mark, edge: point, building: false };\n }\n },\n});\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA0C,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAA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I;UAAEC,IAAI,EAAEF,KAAK;UAAEM,QAAQ,EAAE;QAAK;MAChD;IACF;EACF,CAAC;AAAA,CAAC","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _debug = _interopRequireDefault(require("debug"));
9
+ var _graphingUtils = require("@pie-lib/graphing-utils");
10
+ var _withRootEdge = require("../shared/line/with-root-edge");
11
+ var log = (0, _debug["default"])('pie-lib:graphing:exponential');
12
+ var Exponential = (0, _withRootEdge.withRootEdge)(function (props) {
13
+ var root = props.root,
14
+ edge = props.edge,
15
+ graphProps = props.graphProps;
16
+ var domain = graphProps.domain,
17
+ range = graphProps.range;
18
+ var dataPoints = edge && edge.x === root.x ? [] : (0, _graphingUtils.buildDataPoints)(domain, range, root, edge, (0, _graphingUtils.exponentialFromTwoPoints)(root, edge), true);
19
+ log('dataPoints:', dataPoints);
20
+ return {
21
+ root: props.root,
22
+ edge: props.edge,
23
+ dataPoints: dataPoints
24
+ };
25
+ });
26
+ var Component = (0, _withRootEdge.rootEdgeComponent)(Exponential);
27
+ var _default = exports["default"] = Component;
28
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","names":["_debug","_interopRequireDefault","require","_graphingUtils","_withRootEdge","log","debug","Exponential","withRootEdge","props","root","edge","graphProps","domain","range","dataPoints","x","buildDataPoints","exponentialFromTwoPoints","Component","rootEdgeComponent","_default","exports"],"sources":["../../../src/tools/exponential/component.jsx"],"sourcesContent":["import debug from 'debug';\nimport { buildDataPoints, exponentialFromTwoPoints } from '@pie-lib/graphing-utils';\nimport { rootEdgeComponent, withRootEdge } from '../shared/line/with-root-edge';\n\nconst log = debug('pie-lib:graphing:exponential');\n\nconst Exponential = withRootEdge((props) => {\n const { root, edge, graphProps } = props;\n const { domain, range } = graphProps;\n\n const dataPoints =\n edge && edge.x === root.x\n ? []\n : buildDataPoints(domain, range, root, edge, exponentialFromTwoPoints(root, edge), true);\n\n log('dataPoints:', dataPoints);\n\n return { root: props.root, edge: props.edge, dataPoints };\n});\n\nconst Component = rootEdgeComponent(Exponential);\n\nexport default Component;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAMG,GAAG,GAAG,IAAAC,iBAAK,EAAC,8BAA8B,CAAC;AAEjD,IAAMC,WAAW,GAAG,IAAAC,0BAAY,EAAC,UAACC,KAAK,EAAK;EAC1C,IAAQC,IAAI,GAAuBD,KAAK,CAAhCC,IAAI;IAAEC,IAAI,GAAiBF,KAAK,CAA1BE,IAAI;IAAEC,UAAU,GAAKH,KAAK,CAApBG,UAAU;EAC9B,IAAQC,MAAM,GAAYD,UAAU,CAA5BC,MAAM;IAAEC,KAAK,GAAKF,UAAU,CAApBE,KAAK;EAErB,IAAMC,UAAU,GACdJ,IAAI,IAAIA,IAAI,CAACK,CAAC,KAAKN,IAAI,CAACM,CAAC,GACrB,EAAE,GACF,IAAAC,8BAAe,EAACJ,MAAM,EAAEC,KAAK,EAAEJ,IAAI,EAAEC,IAAI,EAAE,IAAAO,uCAAwB,EAACR,IAAI,EAAEC,IAAI,CAAC,EAAE,IAAI,CAAC;EAE5FN,GAAG,CAAC,aAAa,EAAEU,UAAU,CAAC;EAE9B,OAAO;IAAEL,IAAI,EAAED,KAAK,CAACC,IAAI;IAAEC,IAAI,EAAEF,KAAK,CAACE,IAAI;IAAEI,UAAU,EAAVA;EAAW,CAAC;AAC3D,CAAC,CAAC;AAEF,IAAMI,SAAS,GAAG,IAAAC,+BAAiB,EAACb,WAAW,CAAC;AAAC,IAAAc,QAAA,GAAAC,OAAA,cAElCH,SAAS","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.tool = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _component = _interopRequireDefault(require("./component"));
10
+ var _debug = _interopRequireDefault(require("debug"));
11
+ var _utils = require("../../utils");
12
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
+ var log = (0, _debug["default"])('pie-lib:graphing:exponential');
15
+ var tool = exports.tool = function tool() {
16
+ return {
17
+ type: 'exponential',
18
+ Component: _component["default"],
19
+ complete: function complete(data, mark) {
20
+ return _objectSpread(_objectSpread({}, mark), {}, {
21
+ building: false,
22
+ closed: true
23
+ });
24
+ },
25
+ addPoint: function addPoint(point, mark) {
26
+ log('add point to exponential model: ', point, 'mark: ', mark);
27
+ if (mark && ((0, _utils.equalPoints)(mark.root, point) || (0, _utils.sameAxes)(mark.root, point))) {
28
+ return mark;
29
+ }
30
+ if (mark && mark.root.y * point.y < 0) {
31
+ return mark;
32
+ }
33
+ if (point.y === 0) {
34
+ return mark;
35
+ }
36
+ if (!mark) {
37
+ return {
38
+ type: 'exponential',
39
+ root: point,
40
+ edge: undefined,
41
+ closed: false,
42
+ building: true
43
+ };
44
+ } else if (mark && !mark.root) {
45
+ throw new Error('no root - should never happen');
46
+ } else {
47
+ return _objectSpread(_objectSpread({}, mark), {}, {
48
+ edge: point,
49
+ closed: true,
50
+ building: false
51
+ });
52
+ }
53
+ }
54
+ };
55
+ };
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_component","_interopRequireDefault","require","_debug","_utils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","log","debug","tool","exports","type","Component","Exponential","complete","data","mark","building","closed","addPoint","point","equalPoints","root","sameAxes","y","edge","undefined","Error"],"sources":["../../../src/tools/exponential/index.js"],"sourcesContent":["import Exponential from './component';\nimport debug from 'debug';\nimport { equalPoints, sameAxes } from '../../utils';\n\nconst log = debug('pie-lib:graphing:exponential');\n\nexport const tool = () => ({\n type: 'exponential',\n Component: Exponential,\n complete: (data, mark) => ({ ...mark, building: false, closed: true }),\n addPoint: (point, mark) => {\n log('add point to exponential model: ', point, 'mark: ', mark);\n if (mark && (equalPoints(mark.root, point) || sameAxes(mark.root, point))) {\n return mark;\n }\n\n if (mark && mark.root.y * point.y < 0) {\n return mark;\n }\n\n if (point.y === 0) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'exponential',\n root: point,\n edge: undefined,\n closed: false,\n building: true,\n };\n } else if (mark && !mark.root) {\n throw new Error('no root - should never happen');\n } else {\n return { ...mark, edge: point, closed: true, building: false };\n }\n },\n});\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAoD,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAA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E;MAAI;IAAA,CAAG;IACtEC,QAAQ,EAAE,SAAVA,QAAQA,CAAGC,KAAK,EAAEJ,IAAI,EAAK;MACzBT,GAAG,CAAC,kCAAkC,EAAEa,KAAK,EAAE,QAAQ,EAAEJ,IAAI,CAAC;MAC9D,IAAIA,IAAI,KAAK,IAAAK,kBAAW,EAACL,IAAI,CAACM,IAAI,EAAEF,KAAK,CAAC,IAAI,IAAAG,eAAQ,EAACP,IAAI,CAACM,IAAI,EAAEF,KAAK,CAAC,CAAC,EAAE;QACzE,OAAOJ,IAAI;MACb;MAEA,IAAIA,IAAI,IAAIA,IAAI,CAACM,IAAI,CAACE,CAAC,GAAGJ,KAAK,CAACI,CAAC,GAAG,CAAC,EAAE;QACrC,OAAOR,IAAI;MACb;MAEA,IAAII,KAAK,CAACI,CAAC,KAAK,CAAC,EAAE;QACjB,OAAOR,IAAI;MACb;MAEA,IAAI,CAACA,IAAI,EAAE;QACT,OAAO;UACLL,IAAI,EAAE,aAAa;UACnBW,IAAI,EAAEF,KAAK;UACXK,IAAI,EAAEC,SAAS;UACfR,MAAM,EAAE,KAAK;UACbD,QAAQ,EAAE;QACZ,CAAC;MACH,CAAC,MAAM,IAAID,IAAI,IAAI,CAACA,IAAI,CAACM,IAAI,EAAE;QAC7B,MAAM,IAAIK,KAAK,CAAC,+BAA+B,CAAC;MAClD,CAAC,MAAM;QACL,OAAA5B,aAAA,CAAAA,aAAA,KAAYiB,IAAI;UAAES,IAAI,EAAEL,KAAK;UAAEF,MAAM,EAAE,IAAI;UAAED,QAAQ,EAAE;QAAK;MAC9D;IACF;EACF,CAAC;AAAA,CAAC","ignoreList":[]}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "absolute", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _absolute.tool;
10
+ }
11
+ });
12
+ exports.allTools = void 0;
13
+ Object.defineProperty(exports, "circle", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _circle.tool;
17
+ }
18
+ });
19
+ Object.defineProperty(exports, "exponential", {
20
+ enumerable: true,
21
+ get: function get() {
22
+ return _exponential.tool;
23
+ }
24
+ });
25
+ Object.defineProperty(exports, "line", {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _line.tool;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "parabola", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _parabola.tool;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "point", {
38
+ enumerable: true,
39
+ get: function get() {
40
+ return _point.tool;
41
+ }
42
+ });
43
+ Object.defineProperty(exports, "polygon", {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _polygon.tool;
47
+ }
48
+ });
49
+ Object.defineProperty(exports, "ray", {
50
+ enumerable: true,
51
+ get: function get() {
52
+ return _ray.tool;
53
+ }
54
+ });
55
+ Object.defineProperty(exports, "sine", {
56
+ enumerable: true,
57
+ get: function get() {
58
+ return _sine.tool;
59
+ }
60
+ });
61
+ exports.toolsArr = void 0;
62
+ Object.defineProperty(exports, "vector", {
63
+ enumerable: true,
64
+ get: function get() {
65
+ return _vector.tool;
66
+ }
67
+ });
68
+ var _point = require("./point");
69
+ var _circle = require("./circle");
70
+ var _polygon = require("./polygon");
71
+ var _sine = require("./sine");
72
+ var _parabola = require("./parabola");
73
+ var _line = require("./line");
74
+ var _segment = require("./segment");
75
+ var _ray = require("./ray");
76
+ var _vector = require("./vector");
77
+ var _absolute = require("./absolute");
78
+ var _exponential = require("./exponential");
79
+ var allTools = exports.allTools = ['circle', 'line', 'label', 'parabola', 'point', 'polygon', 'ray', 'segment', 'sine', 'vector', 'absolute', 'exponential'];
80
+
81
+ // need this because now we should treat label as other tools PD-3736
82
+ var labelTool = {
83
+ type: 'label'
84
+ };
85
+ var toolsArr = exports.toolsArr = [(0, _circle.tool)(), (0, _line.tool)(), (0, _parabola.tool)(), (0, _point.tool)(), (0, _polygon.tool)(), (0, _ray.tool)(), (0, _segment.tool)(), (0, _sine.tool)(), (0, _vector.tool)(), (0, _absolute.tool)(), (0, _exponential.tool)(), labelTool];
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_point","require","_circle","_polygon","_sine","_parabola","_line","_segment","_ray","_vector","_absolute","_exponential","allTools","exports","labelTool","type","toolsArr","circle","line","parabola","point","polygon","ray","segment","sine","vector","absolute","exponential"],"sources":["../../src/tools/index.js"],"sourcesContent":["import { tool as point } from './point';\nimport { tool as circle } from './circle';\nimport { tool as polygon } from './polygon';\nimport { tool as sine } from './sine';\nimport { tool as parabola } from './parabola';\nimport { tool as line } from './line';\nimport { tool as segment } from './segment';\nimport { tool as ray } from './ray';\nimport { tool as vector } from './vector';\nimport { tool as absolute } from './absolute';\nimport { tool as exponential } from './exponential';\n\nconst allTools = [\n 'circle',\n 'line',\n 'label',\n 'parabola',\n 'point',\n 'polygon',\n 'ray',\n 'segment',\n 'sine',\n 'vector',\n 'absolute',\n 'exponential',\n];\n\n// need this because now we should treat label as other tools PD-3736\nconst labelTool = {\n type: 'label',\n};\n\nconst toolsArr = [\n circle(),\n line(),\n parabola(),\n point(),\n polygon(),\n ray(),\n segment(),\n sine(),\n vector(),\n absolute(),\n exponential(),\n labelTool,\n];\n\nexport { allTools, toolsArr, circle, line, point, parabola, polygon, ray, sine, vector, absolute, exponential };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AAEA,IAAMW,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,CACf,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,UAAU,EACV,aAAa,CACd;;AAED;AACA,IAAME,SAAS,GAAG;EAChBC,IAAI,EAAE;AACR,CAAC;AAED,IAAMC,QAAQ,GAAAH,OAAA,CAAAG,QAAA,GAAG,CACf,IAAAC,YAAM,EAAC,CAAC,EACR,IAAAC,UAAI,EAAC,CAAC,EACN,IAAAC,cAAQ,EAAC,CAAC,EACV,IAAAC,WAAK,EAAC,CAAC,EACP,IAAAC,aAAO,EAAC,CAAC,EACT,IAAAC,SAAG,EAAC,CAAC,EACL,IAAAC,aAAO,EAAC,CAAC,EACT,IAAAC,UAAI,EAAC,CAAC,EACN,IAAAC,YAAM,EAAC,CAAC,EACR,IAAAC,cAAQ,EAAC,CAAC,EACV,IAAAC,iBAAW,EAAC,CAAC,EACbb,SAAS,CACV","ignoreList":[]}