@pie-lib/graphing 4.0.5-next.29 → 4.0.5-next.30

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/dist/_virtual/_rolldown/runtime.js +23 -0
  2. package/dist/autosize-input.d.ts +10 -0
  3. package/dist/autosize-input.js +66 -0
  4. package/dist/axis/arrow.d.ts +13 -0
  5. package/dist/axis/arrow.js +34 -0
  6. package/dist/axis/axes.d.ts +132 -0
  7. package/dist/axis/axes.js +214 -0
  8. package/dist/axis/index.d.ts +10 -0
  9. package/dist/bg.d.ts +51 -0
  10. package/dist/bg.js +44 -0
  11. package/dist/container/actions.d.ts +15 -0
  12. package/dist/container/actions.js +7 -0
  13. package/dist/container/index.d.ts +58 -0
  14. package/dist/container/index.js +48 -0
  15. package/dist/container/marks.d.ts +10 -0
  16. package/dist/container/marks.js +11 -0
  17. package/dist/container/middleware.d.ts +10 -0
  18. package/dist/container/middleware.js +4 -0
  19. package/dist/container/reducer.d.ts +14 -0
  20. package/dist/container/reducer.js +7 -0
  21. package/dist/coordinates-label.d.ts +50 -0
  22. package/dist/coordinates-label.js +46 -0
  23. package/dist/graph-with-controls.d.ts +88 -0
  24. package/dist/graph-with-controls.js +154 -0
  25. package/dist/graph.d.ts +126 -0
  26. package/dist/graph.js +209 -0
  27. package/dist/grid-setup.d.ts +27 -0
  28. package/dist/grid-setup.js +307 -0
  29. package/dist/grid.d.ts +43 -0
  30. package/dist/grid.js +59 -0
  31. package/dist/index.d.ts +15 -0
  32. package/dist/index.js +7 -0
  33. package/dist/key-legend.d.ts +21 -0
  34. package/dist/key-legend.js +231 -0
  35. package/dist/label-svg-icon.d.ts +18 -0
  36. package/dist/label-svg-icon.js +42 -0
  37. package/dist/labels.d.ts +37 -0
  38. package/dist/labels.js +152 -0
  39. package/dist/mark-label.d.ts +58 -0
  40. package/dist/mark-label.js +171 -0
  41. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +101 -0
  42. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +63 -0
  43. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +44 -0
  44. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
  45. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
  46. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +21 -0
  47. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
  48. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
  49. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +15 -0
  50. package/dist/node_modules/.bun/@visx_curve@3.12.0/node_modules/@visx/curve/esm/index.js +2 -0
  51. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/Grid.js +79 -0
  52. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +79 -0
  53. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +79 -0
  54. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
  55. package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +50 -0
  56. package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +18 -0
  57. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +10 -0
  58. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +9 -0
  59. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
  60. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +47 -0
  61. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +50 -0
  62. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +9 -0
  63. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +6 -0
  64. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +53 -0
  65. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +57 -0
  66. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +91 -0
  67. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +21 -0
  68. package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +32 -0
  69. package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +33 -0
  70. package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +32 -0
  71. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  72. package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +28 -0
  73. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Hash.js +21 -0
  74. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_ListCache.js +21 -0
  75. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Map.js +10 -0
  76. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_MapCache.js +21 -0
  77. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Symbol.js +9 -0
  78. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +14 -0
  79. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +15 -0
  80. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +16 -0
  81. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_coreJsData.js +9 -0
  82. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +8 -0
  83. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getMapData.js +14 -0
  84. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getNative.js +15 -0
  85. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getRawTag.js +19 -0
  86. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getValue.js +11 -0
  87. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashClear.js +13 -0
  88. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashDelete.js +12 -0
  89. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashGet.js +18 -0
  90. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashHas.js +14 -0
  91. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashSet.js +14 -0
  92. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isKeyable.js +12 -0
  93. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isMasked.js +16 -0
  94. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +11 -0
  95. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +14 -0
  96. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +14 -0
  97. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +13 -0
  98. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +14 -0
  99. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +19 -0
  100. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +14 -0
  101. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +13 -0
  102. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +13 -0
  103. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +14 -0
  104. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +9 -0
  105. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_objectToString.js +12 -0
  106. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_root.js +10 -0
  107. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_toSource.js +20 -0
  108. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/eq.js +11 -0
  109. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isFunction.js +16 -0
  110. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isObject.js +12 -0
  111. package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/memoize.js +20 -0
  112. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +37 -0
  113. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +509 -0
  114. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +108 -0
  115. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +31 -0
  116. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +45 -0
  117. package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +471 -0
  118. package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +49 -0
  119. package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +34 -0
  120. package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +185 -0
  121. package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +198 -0
  122. 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 +53 -0
  123. 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 +51 -0
  124. package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/with-selector.js +10 -0
  125. package/dist/toggle-bar.d.ts +40 -0
  126. package/dist/toggle-bar.js +155 -0
  127. package/dist/tool-menu.d.ts +29 -0
  128. package/dist/tool-menu.js +41 -0
  129. package/dist/tools/absolute/component.d.ts +16 -0
  130. package/dist/tools/absolute/component.js +15 -0
  131. package/dist/tools/absolute/index.d.ts +20 -0
  132. package/dist/tools/absolute/index.js +32 -0
  133. package/dist/tools/circle/bg-circle.d.ts +116 -0
  134. package/dist/tools/circle/bg-circle.js +72 -0
  135. package/dist/tools/circle/component.d.ts +83 -0
  136. package/dist/tools/circle/component.js +195 -0
  137. package/dist/tools/circle/index.d.ts +20 -0
  138. package/dist/tools/circle/index.js +22 -0
  139. package/dist/tools/exponential/component.d.ts +16 -0
  140. package/dist/tools/exponential/component.js +14 -0
  141. package/dist/tools/exponential/index.d.ts +20 -0
  142. package/dist/tools/exponential/index.js +32 -0
  143. package/dist/tools/index.d.ts +27 -0
  144. package/dist/tools/index.js +55 -0
  145. package/dist/tools/line/component.d.ts +124 -0
  146. package/dist/tools/line/component.js +72 -0
  147. package/dist/tools/line/index.d.ts +13 -0
  148. package/dist/tools/line/index.js +6 -0
  149. package/dist/tools/parabola/component.d.ts +16 -0
  150. package/dist/tools/parabola/component.js +14 -0
  151. package/dist/tools/parabola/index.d.ts +20 -0
  152. package/dist/tools/parabola/index.js +32 -0
  153. package/dist/tools/point/component.d.ts +50 -0
  154. package/dist/tools/point/component.js +85 -0
  155. package/dist/tools/point/index.d.ts +15 -0
  156. package/dist/tools/point/index.js +13 -0
  157. package/dist/tools/polygon/component.d.ts +120 -0
  158. package/dist/tools/polygon/component.js +262 -0
  159. package/dist/tools/polygon/index.d.ts +19 -0
  160. package/dist/tools/polygon/index.js +55 -0
  161. package/dist/tools/polygon/line.d.ts +125 -0
  162. package/dist/tools/polygon/line.js +63 -0
  163. package/dist/tools/polygon/polygon.d.ts +122 -0
  164. package/dist/tools/polygon/polygon.js +74 -0
  165. package/dist/tools/ray/component.d.ts +101 -0
  166. package/dist/tools/ray/component.js +71 -0
  167. package/dist/tools/ray/index.d.ts +13 -0
  168. package/dist/tools/ray/index.js +6 -0
  169. package/dist/tools/segment/component.d.ts +100 -0
  170. package/dist/tools/segment/component.js +52 -0
  171. package/dist/tools/segment/index.d.ts +13 -0
  172. package/dist/tools/segment/index.js +6 -0
  173. package/dist/tools/shared/arrow-head.d.ts +51 -0
  174. package/dist/tools/shared/arrow-head.js +63 -0
  175. package/dist/tools/shared/icons/CorrectSVG.d.ts +26 -0
  176. package/dist/tools/shared/icons/CorrectSVG.js +29 -0
  177. package/dist/tools/shared/icons/IncorrectSVG.d.ts +26 -0
  178. package/dist/tools/shared/icons/IncorrectSVG.js +27 -0
  179. package/dist/tools/shared/icons/MissingSVG.d.ts +26 -0
  180. package/dist/tools/shared/icons/MissingSVG.js +28 -0
  181. package/dist/tools/shared/line/index.d.ts +245 -0
  182. package/dist/tools/shared/line/index.js +319 -0
  183. package/dist/tools/shared/line/line-path.d.ts +57 -0
  184. package/dist/tools/shared/line/line-path.js +71 -0
  185. package/dist/tools/shared/line/with-root-edge.d.ts +142 -0
  186. package/dist/tools/shared/line/with-root-edge.js +73 -0
  187. package/dist/tools/shared/point/arrow-point.d.ts +56 -0
  188. package/dist/tools/shared/point/arrow-point.js +41 -0
  189. package/dist/tools/shared/point/arrow.d.ts +45 -0
  190. package/dist/tools/shared/point/arrow.js +35 -0
  191. package/dist/tools/shared/point/base-point.d.ts +52 -0
  192. package/dist/tools/shared/point/base-point.js +103 -0
  193. package/dist/tools/shared/point/index.d.ts +216 -0
  194. package/dist/tools/shared/point/index.js +45 -0
  195. package/dist/tools/shared/styles.d.ts +29 -0
  196. package/dist/tools/shared/styles.js +20 -0
  197. package/dist/tools/shared/types.d.ts +21 -0
  198. package/dist/tools/shared/types.js +11 -0
  199. package/dist/tools/sine/component.d.ts +16 -0
  200. package/dist/tools/sine/component.js +22 -0
  201. package/dist/tools/sine/index.d.ts +20 -0
  202. package/dist/tools/sine/index.js +32 -0
  203. package/dist/tools/vector/component.d.ts +100 -0
  204. package/dist/tools/vector/component.js +44 -0
  205. package/dist/tools/vector/index.d.ts +13 -0
  206. package/dist/tools/vector/index.js +6 -0
  207. package/dist/undo-redo.d.ts +22 -0
  208. package/dist/undo-redo.js +47 -0
  209. package/dist/use-debounce.d.ts +9 -0
  210. package/dist/use-debounce.js +13 -0
  211. package/dist/utils.d.ts +61 -0
  212. package/dist/utils.js +75 -0
  213. package/package.json +45 -33
  214. package/CHANGELOG.json +0 -1
  215. package/CHANGELOG.md +0 -1469
  216. package/LICENSE.md +0 -5
  217. package/lib/axis/arrow.js +0 -79
  218. package/lib/axis/arrow.js.map +0 -1
  219. package/lib/axis/axes.js +0 -329
  220. package/lib/axis/axes.js.map +0 -1
  221. package/lib/axis/index.js +0 -21
  222. package/lib/axis/index.js.map +0 -1
  223. package/lib/bg.js +0 -114
  224. package/lib/bg.js.map +0 -1
  225. package/lib/container/actions.js +0 -18
  226. package/lib/container/actions.js.map +0 -1
  227. package/lib/container/index.js +0 -127
  228. package/lib/container/index.js.map +0 -1
  229. package/lib/container/marks.js +0 -22
  230. package/lib/container/marks.js.map +0 -1
  231. package/lib/container/middleware.js +0 -19
  232. package/lib/container/middleware.js.map +0 -1
  233. package/lib/container/reducer.js +0 -18
  234. package/lib/container/reducer.js.map +0 -1
  235. package/lib/coordinates-label.js +0 -79
  236. package/lib/coordinates-label.js.map +0 -1
  237. package/lib/graph-with-controls.js +0 -294
  238. package/lib/graph-with-controls.js.map +0 -1
  239. package/lib/graph.js +0 -327
  240. package/lib/graph.js.map +0 -1
  241. package/lib/grid-setup.js +0 -414
  242. package/lib/grid-setup.js.map +0 -1
  243. package/lib/grid.js +0 -131
  244. package/lib/grid.js.map +0 -1
  245. package/lib/index.js +0 -47
  246. package/lib/index.js.map +0 -1
  247. package/lib/key-legend.js +0 -201
  248. package/lib/key-legend.js.map +0 -1
  249. package/lib/label-svg-icon.js +0 -50
  250. package/lib/label-svg-icon.js.map +0 -1
  251. package/lib/labels.js +0 -243
  252. package/lib/labels.js.map +0 -1
  253. package/lib/mark-label.js +0 -285
  254. package/lib/mark-label.js.map +0 -1
  255. package/lib/toggle-bar.js +0 -252
  256. package/lib/toggle-bar.js.map +0 -1
  257. package/lib/tool-menu.js +0 -78
  258. package/lib/tool-menu.js.map +0 -1
  259. package/lib/tools/absolute/component.js +0 -29
  260. package/lib/tools/absolute/component.js.map +0 -1
  261. package/lib/tools/absolute/index.js +0 -50
  262. package/lib/tools/absolute/index.js.map +0 -1
  263. package/lib/tools/circle/bg-circle.js +0 -123
  264. package/lib/tools/circle/bg-circle.js.map +0 -1
  265. package/lib/tools/circle/component.js +0 -321
  266. package/lib/tools/circle/component.js.map +0 -1
  267. package/lib/tools/circle/index.js +0 -41
  268. package/lib/tools/circle/index.js.map +0 -1
  269. package/lib/tools/exponential/component.js +0 -28
  270. package/lib/tools/exponential/component.js.map +0 -1
  271. package/lib/tools/exponential/index.js +0 -56
  272. package/lib/tools/exponential/index.js.map +0 -1
  273. package/lib/tools/index.js +0 -86
  274. package/lib/tools/index.js.map +0 -1
  275. package/lib/tools/line/component.js +0 -97
  276. package/lib/tools/line/component.js.map +0 -1
  277. package/lib/tools/line/index.js +0 -11
  278. package/lib/tools/line/index.js.map +0 -1
  279. package/lib/tools/parabola/component.js +0 -28
  280. package/lib/tools/parabola/component.js.map +0 -1
  281. package/lib/tools/parabola/index.js +0 -50
  282. package/lib/tools/parabola/index.js.map +0 -1
  283. package/lib/tools/point/component.js +0 -148
  284. package/lib/tools/point/component.js.map +0 -1
  285. package/lib/tools/point/index.js +0 -24
  286. package/lib/tools/point/index.js.map +0 -1
  287. package/lib/tools/polygon/component.js +0 -437
  288. package/lib/tools/polygon/component.js.map +0 -1
  289. package/lib/tools/polygon/index.js +0 -89
  290. package/lib/tools/polygon/index.js.map +0 -1
  291. package/lib/tools/polygon/line.js +0 -112
  292. package/lib/tools/polygon/line.js.map +0 -1
  293. package/lib/tools/polygon/polygon.js +0 -130
  294. package/lib/tools/polygon/polygon.js.map +0 -1
  295. package/lib/tools/ray/component.js +0 -95
  296. package/lib/tools/ray/component.js.map +0 -1
  297. package/lib/tools/ray/index.js +0 -11
  298. package/lib/tools/ray/index.js.map +0 -1
  299. package/lib/tools/segment/component.js +0 -71
  300. package/lib/tools/segment/component.js.map +0 -1
  301. package/lib/tools/segment/index.js +0 -11
  302. package/lib/tools/segment/index.js.map +0 -1
  303. package/lib/tools/shared/arrow-head.js +0 -111
  304. package/lib/tools/shared/arrow-head.js.map +0 -1
  305. package/lib/tools/shared/icons/CorrectSVG.js +0 -40
  306. package/lib/tools/shared/icons/CorrectSVG.js.map +0 -1
  307. package/lib/tools/shared/icons/IncorrectSVG.js +0 -40
  308. package/lib/tools/shared/icons/IncorrectSVG.js.map +0 -1
  309. package/lib/tools/shared/icons/MissingSVG.js +0 -39
  310. package/lib/tools/shared/icons/MissingSVG.js.map +0 -1
  311. package/lib/tools/shared/line/index.js +0 -550
  312. package/lib/tools/shared/line/index.js.map +0 -1
  313. package/lib/tools/shared/line/line-path.js +0 -118
  314. package/lib/tools/shared/line/line-path.js.map +0 -1
  315. package/lib/tools/shared/line/with-root-edge.js +0 -121
  316. package/lib/tools/shared/line/with-root-edge.js.map +0 -1
  317. package/lib/tools/shared/point/arrow-point.js +0 -72
  318. package/lib/tools/shared/point/arrow-point.js.map +0 -1
  319. package/lib/tools/shared/point/arrow.js +0 -67
  320. package/lib/tools/shared/point/arrow.js.map +0 -1
  321. package/lib/tools/shared/point/base-point.js +0 -157
  322. package/lib/tools/shared/point/base-point.js.map +0 -1
  323. package/lib/tools/shared/point/index.js +0 -68
  324. package/lib/tools/shared/point/index.js.map +0 -1
  325. package/lib/tools/shared/styles.js +0 -33
  326. package/lib/tools/shared/styles.js.map +0 -1
  327. package/lib/tools/shared/types.js +0 -16
  328. package/lib/tools/shared/types.js.map +0 -1
  329. package/lib/tools/sine/component.js +0 -40
  330. package/lib/tools/sine/component.js.map +0 -1
  331. package/lib/tools/sine/index.js +0 -50
  332. package/lib/tools/sine/index.js.map +0 -1
  333. package/lib/tools/vector/component.js +0 -68
  334. package/lib/tools/vector/component.js.map +0 -1
  335. package/lib/tools/vector/index.js +0 -11
  336. package/lib/tools/vector/index.js.map +0 -1
  337. package/lib/undo-redo.js +0 -86
  338. package/lib/undo-redo.js.map +0 -1
  339. package/lib/use-debounce.js +0 -25
  340. package/lib/use-debounce.js.map +0 -1
  341. package/lib/utils.js +0 -229
  342. package/lib/utils.js.map +0 -1
  343. package/src/__tests__/bg.test.jsx +0 -250
  344. package/src/__tests__/coordinates-label.test.jsx +0 -243
  345. package/src/__tests__/graph-with-controls.test.jsx +0 -198
  346. package/src/__tests__/graph.test.jsx +0 -721
  347. package/src/__tests__/grid-setup.test.jsx +0 -645
  348. package/src/__tests__/grid.test.jsx +0 -22
  349. package/src/__tests__/key-legend.test.jsx +0 -260
  350. package/src/__tests__/label-svg-icon.test.jsx +0 -278
  351. package/src/__tests__/labels.test.jsx +0 -55
  352. package/src/__tests__/mark-label.test.jsx +0 -63
  353. package/src/__tests__/toggle-bar.test.jsx +0 -146
  354. package/src/__tests__/tool-menu.test.jsx +0 -115
  355. package/src/__tests__/undo-redo.test.jsx +0 -24
  356. package/src/__tests__/use-debounce.test.js +0 -21
  357. package/src/__tests__/utils.js +0 -41
  358. package/src/__tests__/utils.test.js +0 -105
  359. package/src/axis/__tests__/arrow.test.jsx +0 -38
  360. package/src/axis/__tests__/axes.test.jsx +0 -216
  361. package/src/axis/arrow.jsx +0 -57
  362. package/src/axis/axes.jsx +0 -285
  363. package/src/axis/index.js +0 -3
  364. package/src/bg.jsx +0 -96
  365. package/src/container/__tests__/actions.test.js +0 -105
  366. package/src/container/__tests__/index.test.jsx +0 -319
  367. package/src/container/__tests__/marks.test.js +0 -172
  368. package/src/container/__tests__/middleware.test.js +0 -235
  369. package/src/container/__tests__/reducer.test.js +0 -324
  370. package/src/container/actions.js +0 -8
  371. package/src/container/index.jsx +0 -91
  372. package/src/container/marks.js +0 -14
  373. package/src/container/middleware.js +0 -7
  374. package/src/container/reducer.js +0 -5
  375. package/src/coordinates-label.jsx +0 -63
  376. package/src/graph-with-controls.jsx +0 -239
  377. package/src/graph.jsx +0 -303
  378. package/src/grid-setup.jsx +0 -432
  379. package/src/grid.jsx +0 -133
  380. package/src/index.js +0 -7
  381. package/src/key-legend.jsx +0 -142
  382. package/src/label-svg-icon.jsx +0 -39
  383. package/src/labels.jsx +0 -207
  384. package/src/mark-label.jsx +0 -244
  385. package/src/toggle-bar.jsx +0 -224
  386. package/src/tool-menu.jsx +0 -49
  387. package/src/tools/absolute/__tests__/component.test.jsx +0 -53
  388. package/src/tools/absolute/component.jsx +0 -23
  389. package/src/tools/absolute/index.js +0 -31
  390. package/src/tools/circle/__tests__/bg-circle.test.jsx +0 -26
  391. package/src/tools/circle/__tests__/component.test.jsx +0 -494
  392. package/src/tools/circle/__tests__/index.test.js +0 -480
  393. package/src/tools/circle/bg-circle.jsx +0 -81
  394. package/src/tools/circle/component.jsx +0 -264
  395. package/src/tools/circle/index.js +0 -25
  396. package/src/tools/exponential/__tests__/component.test.jsx +0 -53
  397. package/src/tools/exponential/__tests__/index.test.js +0 -729
  398. package/src/tools/exponential/component.jsx +0 -23
  399. package/src/tools/exponential/index.js +0 -39
  400. package/src/tools/index.js +0 -48
  401. package/src/tools/line/__tests__/component.test.jsx +0 -37
  402. package/src/tools/line/component.jsx +0 -93
  403. package/src/tools/line/index.js +0 -4
  404. package/src/tools/parabola/__tests__/component.test.jsx +0 -48
  405. package/src/tools/parabola/__tests__/index.test.js +0 -470
  406. package/src/tools/parabola/component.jsx +0 -23
  407. package/src/tools/parabola/index.js +0 -31
  408. package/src/tools/point/__tests__/component.test.jsx +0 -349
  409. package/src/tools/point/__tests__/index.test.js +0 -241
  410. package/src/tools/point/component.jsx +0 -126
  411. package/src/tools/point/index.js +0 -11
  412. package/src/tools/polygon/__tests__/component.test.jsx +0 -471
  413. package/src/tools/polygon/__tests__/index.test.js +0 -294
  414. package/src/tools/polygon/__tests__/line.test.jsx +0 -35
  415. package/src/tools/polygon/__tests__/polygon.test.jsx +0 -61
  416. package/src/tools/polygon/component.jsx +0 -409
  417. package/src/tools/polygon/index.js +0 -52
  418. package/src/tools/polygon/line.jsx +0 -74
  419. package/src/tools/polygon/polygon.jsx +0 -110
  420. package/src/tools/ray/__tests__/component.test.jsx +0 -29
  421. package/src/tools/ray/component.jsx +0 -92
  422. package/src/tools/ray/index.js +0 -4
  423. package/src/tools/segment/__tests__/component.test.jsx +0 -28
  424. package/src/tools/segment/component.jsx +0 -65
  425. package/src/tools/segment/index.js +0 -4
  426. package/src/tools/shared/__tests__/arrow-head.test.jsx +0 -31
  427. package/src/tools/shared/arrow-head.jsx +0 -102
  428. package/src/tools/shared/icons/CorrectSVG.jsx +0 -32
  429. package/src/tools/shared/icons/IncorrectSVG.jsx +0 -30
  430. package/src/tools/shared/icons/MissingSVG.jsx +0 -31
  431. package/src/tools/shared/line/__tests__/index.test.jsx +0 -109
  432. package/src/tools/shared/line/__tests__/line-path.test.jsx +0 -53
  433. package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +0 -73
  434. package/src/tools/shared/line/index.jsx +0 -487
  435. package/src/tools/shared/line/line-path.jsx +0 -80
  436. package/src/tools/shared/line/with-root-edge.jsx +0 -97
  437. package/src/tools/shared/point/__tests__/arrow-point.test.jsx +0 -91
  438. package/src/tools/shared/point/__tests__/base-point.test.jsx +0 -87
  439. package/src/tools/shared/point/arrow-point.jsx +0 -46
  440. package/src/tools/shared/point/arrow.jsx +0 -37
  441. package/src/tools/shared/point/base-point.jsx +0 -121
  442. package/src/tools/shared/point/index.jsx +0 -54
  443. package/src/tools/shared/styles.js +0 -27
  444. package/src/tools/shared/types.js +0 -10
  445. package/src/tools/sine/__tests__/component.test.jsx +0 -51
  446. package/src/tools/sine/component.jsx +0 -32
  447. package/src/tools/sine/index.js +0 -33
  448. package/src/tools/vector/__tests__/component.test.jsx +0 -25
  449. package/src/tools/vector/component.jsx +0 -56
  450. package/src/tools/vector/index.js +0 -4
  451. package/src/undo-redo.jsx +0 -45
  452. package/src/use-debounce.js +0 -13
  453. package/src/utils.js +0 -224
@@ -1,321 +0,0 @@
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
@@ -1 +0,0 @@
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(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");
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
@@ -1 +0,0 @@
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,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,QAAAe,gBAAA,aAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAa,OAAA,WAAAd,CAAA,IAAAE,MAAA,CAAAgB,cAAA,CAAAnB,CAAA,EAAAC,CAAA,EAAAE,MAAA,CAAAK,wBAAA,CAAAN,CAAA,EAAAD,CAAA,iBAAAD,CAAA;AAEnC,IAAMoB,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,SAAPA,IAAIA,CAAA;EAAA,OAAU;IACzBE,IAAI,EAAE,QAAQ;IACdC,SAAS,EAAEC,qBAAM;IACjBC,KAAK,EAAE,SAAPA,KAAKA,CAAGC,KAAK,EAAEC,IAAI,EAAK;MACtB,OAAAf,aAAA,CAAAA,aAAA,KAAYe,IAAI;QAAEC,IAAI,EAAEF;MAAK;IAC/B,CAAC;IACDG,QAAQ,EAAE,SAAVA,QAAQA,CAAGH,KAAK,EAAEC,IAAI,EAAK;MACzB,IAAIA,IAAI,IAAI,IAAAG,kBAAW,EAACH,IAAI,CAACI,IAAI,EAAEL,KAAK,CAAC,EAAE;QACzC,OAAOC,IAAI;MACb;MAEA,IAAI,CAACA,IAAI,EAAE;QACT,OAAO;UACLL,IAAI,EAAE,QAAQ;UACdS,IAAI,EAAEL,KAAK;UACXM,QAAQ,EAAE;QACZ,CAAC;MACH,CAAC,MAAM;QACL,OAAApB,aAAA,CAAAA,aAAA,KAAYe,IAAI;UAAEC,IAAI,EAAEF,KAAK;UAAEM,QAAQ,EAAE;QAAK;MAChD;IACF;EACF,CAAC;AAAA,CAAC","ignoreList":[]}
@@ -1,28 +0,0 @@
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
@@ -1 +0,0 @@
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":[]}
@@ -1,56 +0,0 @@
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
@@ -1 +0,0 @@
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,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,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,QAAAe,gBAAA,aAAAhB,CAAA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AAI;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":[]}
@@ -1,86 +0,0 @@
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
@@ -1 +0,0 @@
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":[]}