@pie-lib/graphing-solution-set 0.1.0

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 (257) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +23 -0
  2. package/dist/axis/arrow.d.ts +14 -0
  3. package/dist/axis/arrow.d.ts.map +1 -0
  4. package/dist/axis/arrow.js +34 -0
  5. package/dist/axis/axes.d.ts +133 -0
  6. package/dist/axis/axes.d.ts.map +1 -0
  7. package/dist/axis/axes.js +214 -0
  8. package/dist/axis/index.d.ts +11 -0
  9. package/dist/axis/index.d.ts.map +1 -0
  10. package/dist/bg.d.ts +52 -0
  11. package/dist/bg.d.ts.map +1 -0
  12. package/dist/bg.js +44 -0
  13. package/dist/container/actions.d.ts +16 -0
  14. package/dist/container/actions.d.ts.map +1 -0
  15. package/dist/container/actions.js +7 -0
  16. package/dist/container/index.d.ts +27 -0
  17. package/dist/container/index.d.ts.map +1 -0
  18. package/dist/container/index.js +48 -0
  19. package/dist/container/marks.d.ts +11 -0
  20. package/dist/container/marks.d.ts.map +1 -0
  21. package/dist/container/marks.js +11 -0
  22. package/dist/container/middleware.d.ts +11 -0
  23. package/dist/container/middleware.d.ts.map +1 -0
  24. package/dist/container/middleware.js +4 -0
  25. package/dist/container/reducer.d.ts +13 -0
  26. package/dist/container/reducer.d.ts.map +1 -0
  27. package/dist/container/reducer.js +7 -0
  28. package/dist/coordinates-label.d.ts +50 -0
  29. package/dist/coordinates-label.d.ts.map +1 -0
  30. package/dist/coordinates-label.js +46 -0
  31. package/dist/graph-with-controls.d.ts +86 -0
  32. package/dist/graph-with-controls.d.ts.map +1 -0
  33. package/dist/graph-with-controls.js +155 -0
  34. package/dist/graph.d.ts +120 -0
  35. package/dist/graph.d.ts.map +1 -0
  36. package/dist/graph.js +221 -0
  37. package/dist/grid-setup.d.ts +27 -0
  38. package/dist/grid-setup.d.ts.map +1 -0
  39. package/dist/grid-setup.js +307 -0
  40. package/dist/grid.d.ts +44 -0
  41. package/dist/grid.d.ts.map +1 -0
  42. package/dist/grid.js +59 -0
  43. package/dist/index.d.ts +15 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +6 -0
  46. package/dist/labels.d.ts +74 -0
  47. package/dist/labels.d.ts.map +1 -0
  48. package/dist/labels.js +134 -0
  49. package/dist/mark-label.d.ts +50 -0
  50. package/dist/mark-label.d.ts.map +1 -0
  51. package/dist/mark-label.js +84 -0
  52. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +7 -0
  53. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
  54. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  55. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +7 -0
  56. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +25 -0
  57. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  58. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
  59. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
  60. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
  61. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
  62. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +100 -0
  63. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +61 -0
  64. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +42 -0
  65. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
  66. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
  67. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +21 -0
  68. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
  69. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
  70. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +15 -0
  71. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/Grid.js +78 -0
  72. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +79 -0
  73. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +79 -0
  74. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
  75. package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +49 -0
  76. package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +18 -0
  77. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +10 -0
  78. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +9 -0
  79. package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
  80. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +46 -0
  81. package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +52 -0
  82. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +57 -0
  83. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +91 -0
  84. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +21 -0
  85. package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +32 -0
  86. package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +33 -0
  87. package/dist/node_modules/.bun/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +68 -0
  88. package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +28 -0
  89. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js +21 -0
  90. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js +21 -0
  91. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js +10 -0
  92. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js +21 -0
  93. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js +9 -0
  94. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +14 -0
  95. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +15 -0
  96. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +16 -0
  97. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js +9 -0
  98. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +8 -0
  99. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js +14 -0
  100. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js +15 -0
  101. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js +19 -0
  102. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js +11 -0
  103. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js +13 -0
  104. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js +12 -0
  105. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js +18 -0
  106. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js +14 -0
  107. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js +14 -0
  108. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js +12 -0
  109. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js +16 -0
  110. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +11 -0
  111. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +14 -0
  112. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +14 -0
  113. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +13 -0
  114. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +14 -0
  115. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +19 -0
  116. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +14 -0
  117. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +13 -0
  118. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +13 -0
  119. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +14 -0
  120. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +9 -0
  121. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js +12 -0
  122. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js +10 -0
  123. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js +20 -0
  124. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js +11 -0
  125. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js +16 -0
  126. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js +12 -0
  127. package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/memoize.js +20 -0
  128. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +37 -0
  129. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +509 -0
  130. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +108 -0
  131. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +31 -0
  132. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +45 -0
  133. package/dist/node_modules/.bun/react-input-autosize@2.2.2_f4eacebf2041cd4f/node_modules/react-input-autosize/lib/AutosizeInput.js +216 -0
  134. package/dist/node_modules/.bun/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +82 -0
  135. package/dist/node_modules/.bun/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +62 -0
  136. package/dist/node_modules/.bun/react-is@16.13.1/node_modules/react-is/index.js +10 -0
  137. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/components/Context.js +5 -0
  138. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/components/Provider.js +47 -0
  139. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/components/connectAdvanced.js +95 -0
  140. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/connect/connect.js +52 -0
  141. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/connect/mapDispatchToProps.js +23 -0
  142. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/connect/mapStateToProps.js +13 -0
  143. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/connect/mergeProps.js +26 -0
  144. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/connect/selectorFactory.js +41 -0
  145. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/connect/verifySubselectors.js +11 -0
  146. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/connect/wrapMapToProps.js +28 -0
  147. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/index.js +4 -0
  148. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/utils/isPlainObject.js +10 -0
  149. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/utils/shallowEqual.js +15 -0
  150. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/utils/verifyPlainObject.js +8 -0
  151. package/dist/node_modules/.bun/react-redux@6.0.1_926323a638b43722/node_modules/react-redux/es/utils/warning.js +9 -0
  152. package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +49 -0
  153. package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +34 -0
  154. package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +185 -0
  155. package/dist/node_modules/.bun/redux@4.2.1/node_modules/redux/es/redux.js +225 -0
  156. package/dist/toggle-bar.d.ts +41 -0
  157. package/dist/toggle-bar.d.ts.map +1 -0
  158. package/dist/tool-menu.d.ts +22 -0
  159. package/dist/tool-menu.d.ts.map +1 -0
  160. package/dist/tool-menu.js +188 -0
  161. package/dist/tools/index.d.ts +18 -0
  162. package/dist/tools/index.d.ts.map +1 -0
  163. package/dist/tools/index.js +12 -0
  164. package/dist/tools/line/component.d.ts +92 -0
  165. package/dist/tools/line/component.d.ts.map +1 -0
  166. package/dist/tools/line/component.js +58 -0
  167. package/dist/tools/line/index.d.ts +14 -0
  168. package/dist/tools/line/index.d.ts.map +1 -0
  169. package/dist/tools/line/index.js +6 -0
  170. package/dist/tools/polygon/component.d.ts +115 -0
  171. package/dist/tools/polygon/component.d.ts.map +1 -0
  172. package/dist/tools/polygon/component.js +194 -0
  173. package/dist/tools/polygon/index.d.ts +20 -0
  174. package/dist/tools/polygon/index.d.ts.map +1 -0
  175. package/dist/tools/polygon/index.js +55 -0
  176. package/dist/tools/polygon/line.d.ts +105 -0
  177. package/dist/tools/polygon/line.d.ts.map +1 -0
  178. package/dist/tools/polygon/polygon.d.ts +102 -0
  179. package/dist/tools/polygon/polygon.d.ts.map +1 -0
  180. package/dist/tools/polygon/polygon.js +62 -0
  181. package/dist/tools/shared/arrow-head.d.ts +43 -0
  182. package/dist/tools/shared/arrow-head.d.ts.map +1 -0
  183. package/dist/tools/shared/arrow-head.js +37 -0
  184. package/dist/tools/shared/line/index.d.ts +165 -0
  185. package/dist/tools/shared/line/index.d.ts.map +1 -0
  186. package/dist/tools/shared/line/index.js +320 -0
  187. package/dist/tools/shared/line/line-path.d.ts +58 -0
  188. package/dist/tools/shared/line/line-path.d.ts.map +1 -0
  189. package/dist/tools/shared/line/with-root-edge.d.ts +89 -0
  190. package/dist/tools/shared/line/with-root-edge.d.ts.map +1 -0
  191. package/dist/tools/shared/point/arrow-point.d.ts +58 -0
  192. package/dist/tools/shared/point/arrow-point.d.ts.map +1 -0
  193. package/dist/tools/shared/point/arrow-point.js +47 -0
  194. package/dist/tools/shared/point/arrow.d.ts +47 -0
  195. package/dist/tools/shared/point/arrow.d.ts.map +1 -0
  196. package/dist/tools/shared/point/arrow.js +36 -0
  197. package/dist/tools/shared/point/base-point.d.ts +51 -0
  198. package/dist/tools/shared/point/base-point.d.ts.map +1 -0
  199. package/dist/tools/shared/point/base-point.js +88 -0
  200. package/dist/tools/shared/point/index.d.ts +154 -0
  201. package/dist/tools/shared/point/index.d.ts.map +1 -0
  202. package/dist/tools/shared/point/index.js +51 -0
  203. package/dist/tools/shared/styles.d.ts +25 -0
  204. package/dist/tools/shared/styles.d.ts.map +1 -0
  205. package/dist/tools/shared/styles.js +17 -0
  206. package/dist/tools/shared/types.d.ts +16 -0
  207. package/dist/tools/shared/types.d.ts.map +1 -0
  208. package/dist/tools/shared/types.js +10 -0
  209. package/dist/undo-redo.d.ts +21 -0
  210. package/dist/undo-redo.d.ts.map +1 -0
  211. package/dist/undo-redo.js +33 -0
  212. package/dist/use-debounce.d.ts +10 -0
  213. package/dist/use-debounce.d.ts.map +1 -0
  214. package/dist/use-debounce.js +13 -0
  215. package/dist/utils.d.ts +59 -0
  216. package/dist/utils.d.ts.map +1 -0
  217. package/dist/utils.js +72 -0
  218. package/package.json +64 -0
  219. package/src/axis/arrow.tsx +67 -0
  220. package/src/axis/axes.tsx +321 -0
  221. package/src/axis/index.ts +13 -0
  222. package/src/bg.tsx +106 -0
  223. package/src/container/actions.ts +18 -0
  224. package/src/container/index.tsx +95 -0
  225. package/src/container/marks.ts +24 -0
  226. package/src/container/middleware.ts +17 -0
  227. package/src/container/reducer.ts +15 -0
  228. package/src/coordinates-label.tsx +72 -0
  229. package/src/graph-with-controls.tsx +252 -0
  230. package/src/graph.tsx +343 -0
  231. package/src/grid-setup.tsx +470 -0
  232. package/src/grid.tsx +143 -0
  233. package/src/index.ts +17 -0
  234. package/src/labels.tsx +211 -0
  235. package/src/mark-label.tsx +135 -0
  236. package/src/toggle-bar.tsx +231 -0
  237. package/src/tool-menu.tsx +245 -0
  238. package/src/tools/index.ts +18 -0
  239. package/src/tools/line/component.tsx +87 -0
  240. package/src/tools/line/index.ts +14 -0
  241. package/src/tools/polygon/component.tsx +334 -0
  242. package/src/tools/polygon/index.ts +62 -0
  243. package/src/tools/polygon/line.tsx +90 -0
  244. package/src/tools/polygon/polygon.tsx +103 -0
  245. package/src/tools/shared/arrow-head.tsx +56 -0
  246. package/src/tools/shared/line/index.tsx +481 -0
  247. package/src/tools/shared/line/line-path.tsx +95 -0
  248. package/src/tools/shared/line/with-root-edge.tsx +107 -0
  249. package/src/tools/shared/point/arrow-point.tsx +70 -0
  250. package/src/tools/shared/point/arrow.tsx +50 -0
  251. package/src/tools/shared/point/base-point.tsx +123 -0
  252. package/src/tools/shared/point/index.tsx +68 -0
  253. package/src/tools/shared/styles.ts +30 -0
  254. package/src/tools/shared/types.ts +18 -0
  255. package/src/undo-redo.tsx +47 -0
  256. package/src/use-debounce.ts +23 -0
  257. package/src/utils.ts +240 -0
@@ -0,0 +1,470 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-lib/packages/graphing-solution-set/src/grid-setup.jsx
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import React from 'react';
12
+ import PropTypes from 'prop-types';
13
+ import { color, InputContainer as InputContainerImport } from '@pie-lib/render-ui';
14
+
15
+ function isRenderableReactInteropType(value: any) {
16
+ return (
17
+ typeof value === 'function' ||
18
+ (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')
19
+ );
20
+ }
21
+
22
+ function unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {
23
+ if (!maybeSymbol) return maybeSymbol;
24
+ if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;
25
+ if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;
26
+ if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {
27
+ return maybeSymbol[namedExport];
28
+ }
29
+ if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {
30
+ return maybeSymbol[namedExport].default;
31
+ }
32
+ return maybeSymbol;
33
+ }
34
+ const InputContainer = unwrapReactInteropSymbol(InputContainerImport, 'InputContainer') || unwrapReactInteropSymbol(renderUi.InputContainer, 'InputContainer');
35
+ import * as RenderUiNamespace from '@pie-lib/render-ui';
36
+ const renderUiNamespaceAny = RenderUiNamespace as any;
37
+ const renderUiDefaultMaybe = renderUiNamespaceAny['default'];
38
+ const renderUi =
39
+ renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'
40
+ ? renderUiDefaultMaybe
41
+ : renderUiNamespaceAny;
42
+ import { Accordion, AccordionDetails, AccordionSummary, Typography } from '@mui/material';
43
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
44
+ import { NumberTextFieldCustom, Toggle } from '@pie-lib/config-ui';
45
+ import EditableHTML from '@pie-lib/editable-html-tip-tap';
46
+ import { styled } from '@mui/material/styles';
47
+
48
+ const Wrapper: any = styled('div')(() => ({
49
+ width: '450px',
50
+ }));
51
+
52
+ const Content: any = styled('div')(() => ({
53
+ display: 'flex',
54
+ flexDirection: 'column',
55
+ width: '100%',
56
+ }));
57
+
58
+ const ColumnView: any = styled('div')(() => ({
59
+ display: 'flex',
60
+ flexDirection: 'column',
61
+ alignItems: 'center',
62
+ }));
63
+
64
+ const RowView: any = styled('div')(() => ({
65
+ display: 'flex',
66
+ justifyContent: 'space-around',
67
+ alignItems: 'center',
68
+ }));
69
+
70
+ const TextFieldSmall: any = styled('div')(({ theme }) => ({
71
+ width: '130px',
72
+ margin: `${theme.spacing(1)} ${theme.spacing(0.5)}`,
73
+ }));
74
+
75
+ const TextFieldMedium: any = styled('div')(({ theme }) => ({
76
+ width: '160px',
77
+ margin: `${theme.spacing(1)} ${theme.spacing(0.5)}`,
78
+ '& .MuiFormControl-root': {
79
+ width: '100%',
80
+ },
81
+ }));
82
+
83
+ const TextFieldLarge: any = styled('div')(({ theme }) => ({
84
+ width: '230px',
85
+ margin: `${theme.spacing(1)} ${theme.spacing(0.5)}`,
86
+ '& .MuiFormControl-root': {
87
+ width: '100%',
88
+ },
89
+ }));
90
+
91
+ const ItalicText: any = styled(Typography)(({ theme }) => ({
92
+ fontStyle: 'italic',
93
+ margin: `${theme.spacing(1)} 0`,
94
+ }));
95
+
96
+ const Dimensions: any = styled('div')(() => ({
97
+ display: 'flex',
98
+ justifyContent: 'space-between',
99
+ alignItems: 'center',
100
+ }));
101
+
102
+ const DisabledText: any = styled(Typography)(() => ({
103
+ color: color.disabled(),
104
+ }));
105
+
106
+ const AxisLabel: any = styled('div')(({ theme }) => ({
107
+ paddingTop: theme.spacing(2),
108
+ }));
109
+
110
+ const GridConfig = (props) => {
111
+ const { disabled, displayedFields, labelValue, labelValues, gridValue, gridValues, onChange } = props;
112
+ const { labelStep = {}, step = {} } = displayedFields;
113
+
114
+ return (
115
+ <ColumnView>
116
+ {step && step.enabled && (
117
+ <TextFieldMedium>
118
+ <NumberTextFieldCustom
119
+ label={step.label || ''}
120
+ value={gridValue}
121
+ customValues={gridValues}
122
+ variant="outlined"
123
+ disabled={disabled}
124
+ onChange={(e, v) => onChange('step', v)}
125
+ />
126
+ </TextFieldMedium>
127
+ )}
128
+ {labelStep && labelStep.enabled && (
129
+ <TextFieldMedium>
130
+ <NumberTextFieldCustom
131
+ label={labelStep.label || ''}
132
+ value={labelValue}
133
+ customValues={labelValues}
134
+ variant="outlined"
135
+ disabled={disabled}
136
+ onChange={(e, v) => onChange('labelStep', v)}
137
+ />
138
+ </TextFieldMedium>
139
+ )}
140
+ </ColumnView>
141
+ );
142
+ };
143
+
144
+ GridConfig.propTypes = {
145
+ disabled: PropTypes.bool,
146
+ displayedFields: PropTypes.object,
147
+ labelValue: PropTypes.number,
148
+ labelValues: PropTypes.array,
149
+ gridValue: PropTypes.number,
150
+ gridValues: PropTypes.array,
151
+ onChange: PropTypes.func,
152
+ };
153
+
154
+ const AxisConfig = (props) => {
155
+ const { disabled, displayedFields, displayHeader, label, maxValue, minValue, onChange, type } = props;
156
+ const { axisLabel = {}, min = {}, max = {} } = displayedFields;
157
+ const activePlugins = ['bold', 'italic', 'underline', 'strikethrough'];
158
+
159
+ const onKeyDown = (event) => {
160
+ if (event.key === 'Enter') {
161
+ // prevent adding new lines - cancelling event
162
+ return true;
163
+ }
164
+
165
+ return false;
166
+ };
167
+
168
+ return (
169
+ <ColumnView>
170
+ {displayHeader && (
171
+ <Typography variant="subtitle2">
172
+ <i>{type === 'domain' ? 'x' : 'y'}</i>-axis
173
+ </Typography>
174
+ )}
175
+ {min && min.enabled && (
176
+ <TextFieldMedium>
177
+ <NumberTextFieldCustom
178
+ label={min.label || ''}
179
+ value={minValue}
180
+ min={-10000}
181
+ max={maxValue - 0.05}
182
+ variant="outlined"
183
+ disabled={disabled}
184
+ onChange={(e, v) => onChange('min', v)}
185
+ />
186
+ </TextFieldMedium>
187
+ )}
188
+ {max && max.enabled && (
189
+ <TextFieldMedium>
190
+ <NumberTextFieldCustom
191
+ label={max.label || ''}
192
+ value={maxValue}
193
+ min={minValue + 0.05}
194
+ max={10000}
195
+ variant="outlined"
196
+ disabled={disabled}
197
+ onChange={(e, v) => onChange('max', v)}
198
+ />
199
+ </TextFieldMedium>
200
+ )}
201
+ {axisLabel && axisLabel.enabled && (
202
+ <TextFieldMedium>
203
+ <InputContainer label={axisLabel.label || ''}>
204
+ <AxisLabel>
205
+ <EditableHTML
206
+ onChange={(value) => onChange('axisLabel', value)}
207
+ markup={label || ''}
208
+ charactersLimit={5}
209
+ onKeyDown={onKeyDown}
210
+ activePlugins={activePlugins}
211
+ />
212
+ </AxisLabel>
213
+ </InputContainer>
214
+ </TextFieldMedium>
215
+ )}
216
+ </ColumnView>
217
+ );
218
+ };
219
+
220
+ AxisConfig.propTypes = {
221
+ disabled: PropTypes.bool,
222
+ displayedFields: PropTypes.object,
223
+ displayHeader: PropTypes.bool,
224
+ label: PropTypes.string,
225
+ maxValue: PropTypes.number,
226
+ minValue: PropTypes.number,
227
+ type: PropTypes.string,
228
+ onChange: PropTypes.func,
229
+ };
230
+
231
+ const GridSetup = (props) => {
232
+ const {
233
+ domain,
234
+ displayedFields = {},
235
+ gridValues = {},
236
+ includeAxes,
237
+ labelValues = {},
238
+ onChange,
239
+ onChangeView,
240
+ range,
241
+ size,
242
+ sizeConstraints,
243
+ standardGrid,
244
+ } = props;
245
+
246
+ const gridProps = { min: 2, max: 41 };
247
+ const {
248
+ axisLabel = {},
249
+ dimensionsEnabled,
250
+ includeAxesEnabled,
251
+ labelStep = {},
252
+ min = {},
253
+ max = {},
254
+ standardGridEnabled,
255
+ step = {},
256
+ } = displayedFields || {};
257
+
258
+ const displayAxisType = min.enabled || max.enabled || axisLabel.enabled || step.enabled || labelStep.enabled;
259
+ const gridConfigFields = { step, labelStep };
260
+ const axisConfigFields = { min, max, axisLabel };
261
+
262
+ const onIncludeAxes = (includeAxes) => {
263
+ const noAxesConfig = (type) => {
264
+ const axis = type === 'domain' ? domain : range;
265
+ return {
266
+ min: 1,
267
+ max: axis.max < gridProps.min || axis.max > gridProps.max ? 16 : axis.max,
268
+ step: 1,
269
+ labelStep: 0,
270
+ };
271
+ };
272
+
273
+ const updatedRange = {
274
+ ...range,
275
+ ...(includeAxes ? { labelStep: 1 } : noAxesConfig('range')),
276
+ };
277
+ const updatedDomain = {
278
+ ...domain,
279
+ ...(includeAxes ? { labelStep: 1 } : noAxesConfig('domain')),
280
+ };
281
+
282
+ onChange({ includeAxes, range: updatedRange, domain: updatedDomain });
283
+ };
284
+
285
+ const onStandardGridChanged = (value) => {
286
+ onChange({
287
+ standardGrid: value,
288
+ range: {
289
+ ...domain,
290
+ axisLabel: range.axisLabel,
291
+ },
292
+ graph: {
293
+ ...size,
294
+ height: size.width,
295
+ },
296
+ });
297
+ };
298
+
299
+ const onSizeChanged = (key, value) => {
300
+ const graph = { ...size, [key]: value };
301
+ if (standardGrid) graph.height = value;
302
+ onChange({ graph });
303
+ };
304
+
305
+ const onDomainChanged = (key, value) => {
306
+ domain[key] = value;
307
+ if (standardGrid && key !== 'axisLabel') range[key] = value;
308
+ onChange({ domain, range });
309
+ };
310
+
311
+ const onRangeChanged = (key, value) => {
312
+ range[key] = value;
313
+ onChange({ range });
314
+ };
315
+
316
+ const axesConfig = (
317
+ <>
318
+ <RowView>
319
+ <AxisConfig
320
+ displayedFields={axisConfigFields}
321
+ displayHeader={displayAxisType}
322
+ type="domain"
323
+ minValue={domain.min}
324
+ maxValue={domain.max}
325
+ label={domain.axisLabel}
326
+ includeAxes={includeAxes}
327
+ onChange={onDomainChanged}
328
+ />
329
+ <AxisConfig
330
+ displayedFields={axisConfigFields}
331
+ displayHeader={displayAxisType}
332
+ type="range"
333
+ minValue={range.min}
334
+ maxValue={range.max}
335
+ label={range.axisLabel}
336
+ disabled={standardGrid}
337
+ includeAxes={includeAxes}
338
+ onChange={onRangeChanged}
339
+ />
340
+ </RowView>
341
+ {(min.enabled || max.enabled) && (
342
+ <ItalicText>
343
+ If you want the axis to be visible, use a zero or negative Min Value, and a positive Max Value
344
+ </ItalicText>
345
+ )}
346
+ {(step.enabled || labelStep.enabled) && (
347
+ <RowView>
348
+ <GridConfig
349
+ displayedFields={gridConfigFields}
350
+ gridValue={domain.step}
351
+ labelValue={domain.labelStep}
352
+ gridValues={gridValues.domain || []}
353
+ labelValues={labelValues.domain || []}
354
+ onChange={onDomainChanged}
355
+ />
356
+ <GridConfig
357
+ disabled={standardGrid}
358
+ displayedFields={gridConfigFields}
359
+ gridValue={range.step}
360
+ labelValue={range.labelStep}
361
+ gridValues={gridValues.range || []}
362
+ labelValues={labelValues.range || []}
363
+ onChange={onRangeChanged}
364
+ />
365
+ </RowView>
366
+ )}
367
+ {labelStep.enabled && <ItalicText>For unnumbered gridlines, enter a label interval of 0</ItalicText>}
368
+ </>
369
+ );
370
+
371
+ const gridlinesConfig = max.enabled ? (
372
+ <ColumnView>
373
+ <TextFieldLarge>
374
+ <NumberTextFieldCustom
375
+ label="Number of Vertical Gridlines"
376
+ value={domain.max}
377
+ min={!includeAxes && gridProps.min}
378
+ max={!includeAxes && gridProps.max}
379
+ variant="outlined"
380
+ onChange={(e, v) => onDomainChanged('max', v)}
381
+ />
382
+ </TextFieldLarge>
383
+ <TextFieldLarge>
384
+ <NumberTextFieldCustom
385
+ label="Number of Horizontal Gridlines"
386
+ value={range.max}
387
+ min={!includeAxes && gridProps.min}
388
+ max={!includeAxes && gridProps.max}
389
+ variant="outlined"
390
+ disabled={standardGrid}
391
+ onChange={(e, v) => onRangeChanged('max', v)}
392
+ />
393
+ </TextFieldLarge>
394
+ </ColumnView>
395
+ ) : null;
396
+
397
+ return (
398
+ <Wrapper>
399
+ <Accordion onChange={onChangeView} TransitionProps={{ timeout: { enter: 225, exit: 195 } }}>
400
+ <AccordionSummary expandIcon={<ExpandMoreIcon />}>
401
+ <Typography variant="subtitle1">Customize Grid Setup</Typography>
402
+ </AccordionSummary>
403
+ <AccordionDetails>
404
+ <Content>
405
+ {includeAxesEnabled && (
406
+ <Toggle label="Include axes and labels?" toggle={onIncludeAxes} checked={includeAxes} />
407
+ )}
408
+ {standardGridEnabled && (
409
+ <Toggle
410
+ label="Constrain to standard coordinate grid?"
411
+ toggle={onStandardGridChanged}
412
+ checked={standardGrid}
413
+ />
414
+ )}
415
+ {includeAxes ? axesConfig : gridlinesConfig}
416
+ {dimensionsEnabled && (
417
+ <Dimensions>
418
+ <div>
419
+ <Typography>Dimensions(px)</Typography>
420
+ <DisabledText>
421
+ Min {sizeConstraints.min}, Max {sizeConstraints.max}
422
+ </DisabledText>
423
+ </div>
424
+ <TextFieldSmall>
425
+ <NumberTextFieldCustom
426
+ label="Width"
427
+ value={size.width}
428
+ min={sizeConstraints.min}
429
+ max={sizeConstraints.max}
430
+ step={sizeConstraints.step}
431
+ variant="outlined"
432
+ onChange={(e, v) => onSizeChanged('width', v)}
433
+ />
434
+ </TextFieldSmall>
435
+ <TextFieldSmall>
436
+ <NumberTextFieldCustom
437
+ label="Height"
438
+ value={size.height}
439
+ min={sizeConstraints.min}
440
+ max={sizeConstraints.max}
441
+ step={sizeConstraints.step}
442
+ variant="outlined"
443
+ disabled={standardGrid}
444
+ onChange={(e, v) => onSizeChanged('height', v)}
445
+ />
446
+ </TextFieldSmall>
447
+ </Dimensions>
448
+ )}
449
+ </Content>
450
+ </AccordionDetails>
451
+ </Accordion>
452
+ </Wrapper>
453
+ );
454
+ };
455
+
456
+ GridSetup.propTypes = {
457
+ domain: PropTypes.object,
458
+ displayedFields: PropTypes.object,
459
+ gridValues: PropTypes.object,
460
+ includeAxes: PropTypes.bool,
461
+ labelValues: PropTypes.object,
462
+ onChange: PropTypes.func,
463
+ onChangeView: PropTypes.func,
464
+ range: PropTypes.object,
465
+ size: PropTypes.object,
466
+ sizeConstraints: PropTypes.object,
467
+ standardGrid: PropTypes.bool,
468
+ };
469
+
470
+ export default GridSetup;
package/src/grid.tsx ADDED
@@ -0,0 +1,143 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-lib/packages/graphing-solution-set/src/grid.jsx
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import React from 'react';
12
+ import PropTypes from 'prop-types';
13
+ import * as vx from '@visx/grid';
14
+ import { types } from '@pie-lib/plot';
15
+ import { getTickValues } from './utils.js';
16
+
17
+ export class Grid extends React.Component {
18
+ static propTypes = {
19
+ disabled: PropTypes.bool,
20
+ disabledAdditionalGrid: PropTypes.bool,
21
+ graphProps: types.GraphPropsType.isRequired,
22
+ };
23
+
24
+ getAdditionalGridProps: any = (rowTickValues, columnTickValues) => {
25
+ const {
26
+ graphProps: {
27
+ scale,
28
+ size: { width, height },
29
+ domain,
30
+ range,
31
+ },
32
+ } = this.props;
33
+ const rowTickLabelValues = getTickValues({
34
+ ...range,
35
+ step: range.labelStep,
36
+ }).filter((value) => rowTickValues.includes(value));
37
+ const columnTickLabelValues = getTickValues({
38
+ ...domain,
39
+ step: domain.labelStep,
40
+ }).filter((value) => columnTickValues.includes(value));
41
+
42
+ const minValueLength =
43
+ (rowTickLabelValues.length &&
44
+ Math.min(...rowTickLabelValues)
45
+ .toString()
46
+ .replace(/[.-]/g, '').length) ||
47
+ 1;
48
+ const maxValueLength =
49
+ (rowTickLabelValues.length &&
50
+ Math.max(...rowTickLabelValues)
51
+ .toString()
52
+ .replace(/[.-]/g, '').length) ||
53
+ 1;
54
+
55
+ const rowLabelLength = Math.max(minValueLength, maxValueLength) * 9 + 22;
56
+ const horizontalDistanceToZero = scale.x(0);
57
+ const verticalDistanceToZero = scale.y(0);
58
+ const columnLabelLength = 28;
59
+ const rowStrokeDasharray = `${horizontalDistanceToZero - rowLabelLength} ${rowLabelLength} ${width}`;
60
+ const columnStrokeDasharray = `${verticalDistanceToZero} ${columnLabelLength} ${height}`;
61
+
62
+ const displayAdditionalGrid =
63
+ domain.labelStep > 0 &&
64
+ range.labelStep > 0 &&
65
+ rowTickLabelValues &&
66
+ columnTickLabelValues &&
67
+ rowTickLabelValues.length > 1 &&
68
+ columnTickLabelValues.length > 1 &&
69
+ (rowTickLabelValues.length !== rowTickValues.length || columnTickLabelValues.length !== columnTickValues.length);
70
+
71
+ const filteredColumnValues = columnTickLabelValues.filter(
72
+ (value) => value >= 0 || horizontalDistanceToZero - scale.x(value) > rowLabelLength,
73
+ );
74
+ const filteredRowValues = rowTickLabelValues.filter(
75
+ (value) => value >= 0 || scale.y(value) - verticalDistanceToZero > columnLabelLength,
76
+ );
77
+
78
+ return {
79
+ rowTickLabelValues: filteredRowValues,
80
+ columnTickLabelValues: filteredColumnValues,
81
+ rowStrokeDasharray,
82
+ columnStrokeDasharray,
83
+ displayAdditionalGrid,
84
+ };
85
+ };
86
+
87
+ render() {
88
+ const { graphProps } = this.props;
89
+ const {
90
+ scale,
91
+ size: { height, width },
92
+ domain,
93
+ range,
94
+ } = graphProps;
95
+ const rowTickValues = getTickValues(range);
96
+ const columnTickValues = getTickValues(domain);
97
+ const {
98
+ rowTickLabelValues,
99
+ columnTickLabelValues,
100
+ rowStrokeDasharray,
101
+ columnStrokeDasharray,
102
+ displayAdditionalGrid,
103
+ } = this.getAdditionalGridProps(rowTickValues, columnTickValues);
104
+
105
+ const additionalGridStroke =
106
+ domain.labelStep * 2 === domain.step || range.labelStep * 2 === range.step ? '#9FA8DA' : '#7985CB';
107
+
108
+ return (
109
+ <>
110
+ <vx.Grid
111
+ innerRef={(r) => (this.grid = r)}
112
+ xScale={scale.x}
113
+ yScale={scale.y}
114
+ width={width}
115
+ height={height}
116
+ stroke="#D3D3D3"
117
+ rowTickValues={rowTickValues}
118
+ columnTickValues={columnTickValues}
119
+ />
120
+ {displayAdditionalGrid && (
121
+ <>
122
+ <vx.GridRows
123
+ scale={scale.y}
124
+ width={width}
125
+ tickValues={rowTickLabelValues}
126
+ stroke={additionalGridStroke}
127
+ strokeDasharray={rowStrokeDasharray}
128
+ />
129
+ <vx.GridColumns
130
+ scale={scale.x}
131
+ height={height}
132
+ tickValues={columnTickLabelValues}
133
+ stroke={additionalGridStroke}
134
+ strokeDasharray={columnStrokeDasharray}
135
+ />
136
+ </>
137
+ )}
138
+ </>
139
+ );
140
+ }
141
+ }
142
+
143
+ export default Grid;
package/src/index.ts ADDED
@@ -0,0 +1,17 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-lib/packages/graphing-solution-set/src/index.js
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import Graph from './graph.js';
12
+ import GraphContainer from './container/index.js';
13
+ import GridSetup from './grid-setup.js';
14
+ import * as tools from './tools/index.js';
15
+ import ToolMenu from './tool-menu.js';
16
+
17
+ export { Graph, GraphContainer, GridSetup, ToolMenu, tools };