@pie-lib/graphing 4.0.5-next.3 → 4.0.5-next.31
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.
- package/dist/_virtual/_rolldown/runtime.js +23 -0
- package/dist/autosize-input.d.ts +10 -0
- package/dist/autosize-input.js +66 -0
- package/dist/axis/arrow.d.ts +13 -0
- package/dist/axis/arrow.js +34 -0
- package/dist/axis/axes.d.ts +132 -0
- package/dist/axis/axes.js +214 -0
- package/dist/axis/index.d.ts +10 -0
- package/dist/bg.d.ts +51 -0
- package/dist/bg.js +44 -0
- package/dist/container/actions.d.ts +15 -0
- package/dist/container/actions.js +7 -0
- package/dist/container/index.d.ts +58 -0
- package/dist/container/index.js +48 -0
- package/dist/container/marks.d.ts +10 -0
- package/dist/container/marks.js +11 -0
- package/dist/container/middleware.d.ts +10 -0
- package/dist/container/middleware.js +4 -0
- package/dist/container/reducer.d.ts +14 -0
- package/dist/container/reducer.js +7 -0
- package/dist/coordinates-label.d.ts +50 -0
- package/dist/coordinates-label.js +46 -0
- package/dist/graph-with-controls.d.ts +88 -0
- package/dist/graph-with-controls.js +154 -0
- package/dist/graph.d.ts +126 -0
- package/dist/graph.js +209 -0
- package/dist/grid-setup.d.ts +27 -0
- package/dist/grid-setup.js +307 -0
- package/dist/grid.d.ts +43 -0
- package/dist/grid.js +59 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +7 -0
- package/dist/key-legend.d.ts +21 -0
- package/dist/key-legend.js +231 -0
- package/dist/label-svg-icon.d.ts +18 -0
- package/dist/label-svg-icon.js +42 -0
- package/dist/labels.d.ts +37 -0
- package/dist/labels.js +152 -0
- package/dist/mark-label.d.ts +58 -0
- package/dist/mark-label.js +171 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +101 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +63 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +44 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +21 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +15 -0
- package/dist/node_modules/.bun/@visx_curve@3.12.0/node_modules/@visx/curve/esm/index.js +2 -0
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/Grid.js +79 -0
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +79 -0
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +79 -0
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
- package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +50 -0
- package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +18 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +10 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +9 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +47 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +50 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +9 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +6 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +53 -0
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +57 -0
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +91 -0
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +21 -0
- package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +32 -0
- package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +33 -0
- package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +32 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +28 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js +21 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js +21 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js +10 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js +21 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js +9 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +15 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +16 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js +9 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +8 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js +15 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js +19 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js +11 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js +18 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js +16 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +11 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +19 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +9 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js +10 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js +20 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js +11 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js +16 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/memoize.js +20 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +37 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +509 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +108 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +31 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +45 -0
- package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +471 -0
- package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +49 -0
- package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +34 -0
- package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +185 -0
- package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +198 -0
- 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
- 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
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/with-selector.js +10 -0
- package/dist/toggle-bar.d.ts +40 -0
- package/dist/toggle-bar.js +155 -0
- package/dist/tool-menu.d.ts +29 -0
- package/dist/tool-menu.js +41 -0
- package/dist/tools/absolute/component.d.ts +16 -0
- package/dist/tools/absolute/component.js +15 -0
- package/dist/tools/absolute/index.d.ts +20 -0
- package/dist/tools/absolute/index.js +32 -0
- package/dist/tools/circle/bg-circle.d.ts +116 -0
- package/dist/tools/circle/bg-circle.js +72 -0
- package/dist/tools/circle/component.d.ts +83 -0
- package/dist/tools/circle/component.js +195 -0
- package/dist/tools/circle/index.d.ts +20 -0
- package/dist/tools/circle/index.js +22 -0
- package/dist/tools/exponential/component.d.ts +16 -0
- package/dist/tools/exponential/component.js +14 -0
- package/dist/tools/exponential/index.d.ts +20 -0
- package/dist/tools/exponential/index.js +32 -0
- package/dist/tools/index.d.ts +27 -0
- package/dist/tools/index.js +55 -0
- package/dist/tools/line/component.d.ts +124 -0
- package/dist/tools/line/component.js +72 -0
- package/dist/tools/line/index.d.ts +13 -0
- package/dist/tools/line/index.js +6 -0
- package/dist/tools/parabola/component.d.ts +16 -0
- package/dist/tools/parabola/component.js +14 -0
- package/dist/tools/parabola/index.d.ts +20 -0
- package/dist/tools/parabola/index.js +32 -0
- package/dist/tools/point/component.d.ts +50 -0
- package/dist/tools/point/component.js +85 -0
- package/dist/tools/point/index.d.ts +15 -0
- package/dist/tools/point/index.js +13 -0
- package/dist/tools/polygon/component.d.ts +120 -0
- package/dist/tools/polygon/component.js +262 -0
- package/dist/tools/polygon/index.d.ts +19 -0
- package/dist/tools/polygon/index.js +55 -0
- package/dist/tools/polygon/line.d.ts +125 -0
- package/dist/tools/polygon/line.js +63 -0
- package/dist/tools/polygon/polygon.d.ts +122 -0
- package/dist/tools/polygon/polygon.js +74 -0
- package/dist/tools/ray/component.d.ts +101 -0
- package/dist/tools/ray/component.js +71 -0
- package/dist/tools/ray/index.d.ts +13 -0
- package/dist/tools/ray/index.js +6 -0
- package/dist/tools/segment/component.d.ts +100 -0
- package/dist/tools/segment/component.js +52 -0
- package/dist/tools/segment/index.d.ts +13 -0
- package/dist/tools/segment/index.js +6 -0
- package/dist/tools/shared/arrow-head.d.ts +51 -0
- package/dist/tools/shared/arrow-head.js +63 -0
- package/dist/tools/shared/icons/CorrectSVG.d.ts +26 -0
- package/dist/tools/shared/icons/CorrectSVG.js +29 -0
- package/dist/tools/shared/icons/IncorrectSVG.d.ts +26 -0
- package/dist/tools/shared/icons/IncorrectSVG.js +27 -0
- package/dist/tools/shared/icons/MissingSVG.d.ts +26 -0
- package/dist/tools/shared/icons/MissingSVG.js +28 -0
- package/dist/tools/shared/line/index.d.ts +245 -0
- package/dist/tools/shared/line/index.js +319 -0
- package/dist/tools/shared/line/line-path.d.ts +57 -0
- package/dist/tools/shared/line/line-path.js +71 -0
- package/dist/tools/shared/line/with-root-edge.d.ts +142 -0
- package/dist/tools/shared/line/with-root-edge.js +73 -0
- package/dist/tools/shared/point/arrow-point.d.ts +56 -0
- package/dist/tools/shared/point/arrow-point.js +41 -0
- package/dist/tools/shared/point/arrow.d.ts +45 -0
- package/dist/tools/shared/point/arrow.js +35 -0
- package/dist/tools/shared/point/base-point.d.ts +52 -0
- package/dist/tools/shared/point/base-point.js +103 -0
- package/dist/tools/shared/point/index.d.ts +216 -0
- package/dist/tools/shared/point/index.js +45 -0
- package/dist/tools/shared/styles.d.ts +29 -0
- package/dist/tools/shared/styles.js +20 -0
- package/dist/tools/shared/types.d.ts +21 -0
- package/dist/tools/shared/types.js +11 -0
- package/dist/tools/sine/component.d.ts +16 -0
- package/dist/tools/sine/component.js +22 -0
- package/dist/tools/sine/index.d.ts +20 -0
- package/dist/tools/sine/index.js +32 -0
- package/dist/tools/vector/component.d.ts +100 -0
- package/dist/tools/vector/component.js +44 -0
- package/dist/tools/vector/index.d.ts +13 -0
- package/dist/tools/vector/index.js +6 -0
- package/dist/undo-redo.d.ts +22 -0
- package/dist/undo-redo.js +47 -0
- package/dist/use-debounce.d.ts +9 -0
- package/dist/use-debounce.js +13 -0
- package/dist/utils.d.ts +61 -0
- package/dist/utils.js +75 -0
- package/package.json +45 -33
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -1469
- package/LICENSE.md +0 -5
- package/lib/axis/arrow.js +0 -79
- package/lib/axis/arrow.js.map +0 -1
- package/lib/axis/axes.js +0 -329
- package/lib/axis/axes.js.map +0 -1
- package/lib/axis/index.js +0 -21
- package/lib/axis/index.js.map +0 -1
- package/lib/bg.js +0 -114
- package/lib/bg.js.map +0 -1
- package/lib/container/actions.js +0 -18
- package/lib/container/actions.js.map +0 -1
- package/lib/container/index.js +0 -118
- package/lib/container/index.js.map +0 -1
- package/lib/container/marks.js +0 -22
- package/lib/container/marks.js.map +0 -1
- package/lib/container/middleware.js +0 -19
- package/lib/container/middleware.js.map +0 -1
- package/lib/container/reducer.js +0 -18
- package/lib/container/reducer.js.map +0 -1
- package/lib/coordinates-label.js +0 -79
- package/lib/coordinates-label.js.map +0 -1
- package/lib/graph-with-controls.js +0 -294
- package/lib/graph-with-controls.js.map +0 -1
- package/lib/graph.js +0 -327
- package/lib/graph.js.map +0 -1
- package/lib/grid-setup.js +0 -414
- package/lib/grid-setup.js.map +0 -1
- package/lib/grid.js +0 -131
- package/lib/grid.js.map +0 -1
- package/lib/index.js +0 -47
- package/lib/index.js.map +0 -1
- package/lib/key-legend.js +0 -201
- package/lib/key-legend.js.map +0 -1
- package/lib/label-svg-icon.js +0 -50
- package/lib/label-svg-icon.js.map +0 -1
- package/lib/labels.js +0 -243
- package/lib/labels.js.map +0 -1
- package/lib/mark-label.js +0 -285
- package/lib/mark-label.js.map +0 -1
- package/lib/toggle-bar.js +0 -252
- package/lib/toggle-bar.js.map +0 -1
- package/lib/tool-menu.js +0 -78
- package/lib/tool-menu.js.map +0 -1
- package/lib/tools/absolute/component.js +0 -29
- package/lib/tools/absolute/component.js.map +0 -1
- package/lib/tools/absolute/index.js +0 -50
- package/lib/tools/absolute/index.js.map +0 -1
- package/lib/tools/circle/bg-circle.js +0 -123
- package/lib/tools/circle/bg-circle.js.map +0 -1
- package/lib/tools/circle/component.js +0 -321
- package/lib/tools/circle/component.js.map +0 -1
- package/lib/tools/circle/index.js +0 -41
- package/lib/tools/circle/index.js.map +0 -1
- package/lib/tools/exponential/component.js +0 -28
- package/lib/tools/exponential/component.js.map +0 -1
- package/lib/tools/exponential/index.js +0 -56
- package/lib/tools/exponential/index.js.map +0 -1
- package/lib/tools/index.js +0 -86
- package/lib/tools/index.js.map +0 -1
- package/lib/tools/line/component.js +0 -97
- package/lib/tools/line/component.js.map +0 -1
- package/lib/tools/line/index.js +0 -11
- package/lib/tools/line/index.js.map +0 -1
- package/lib/tools/parabola/component.js +0 -28
- package/lib/tools/parabola/component.js.map +0 -1
- package/lib/tools/parabola/index.js +0 -50
- package/lib/tools/parabola/index.js.map +0 -1
- package/lib/tools/point/component.js +0 -148
- package/lib/tools/point/component.js.map +0 -1
- package/lib/tools/point/index.js +0 -24
- package/lib/tools/point/index.js.map +0 -1
- package/lib/tools/polygon/component.js +0 -437
- package/lib/tools/polygon/component.js.map +0 -1
- package/lib/tools/polygon/index.js +0 -89
- package/lib/tools/polygon/index.js.map +0 -1
- package/lib/tools/polygon/line.js +0 -112
- package/lib/tools/polygon/line.js.map +0 -1
- package/lib/tools/polygon/polygon.js +0 -130
- package/lib/tools/polygon/polygon.js.map +0 -1
- package/lib/tools/ray/component.js +0 -95
- package/lib/tools/ray/component.js.map +0 -1
- package/lib/tools/ray/index.js +0 -11
- package/lib/tools/ray/index.js.map +0 -1
- package/lib/tools/segment/component.js +0 -71
- package/lib/tools/segment/component.js.map +0 -1
- package/lib/tools/segment/index.js +0 -11
- package/lib/tools/segment/index.js.map +0 -1
- package/lib/tools/shared/arrow-head.js +0 -111
- package/lib/tools/shared/arrow-head.js.map +0 -1
- package/lib/tools/shared/icons/CorrectSVG.js +0 -40
- package/lib/tools/shared/icons/CorrectSVG.js.map +0 -1
- package/lib/tools/shared/icons/IncorrectSVG.js +0 -40
- package/lib/tools/shared/icons/IncorrectSVG.js.map +0 -1
- package/lib/tools/shared/icons/MissingSVG.js +0 -39
- package/lib/tools/shared/icons/MissingSVG.js.map +0 -1
- package/lib/tools/shared/line/index.js +0 -550
- package/lib/tools/shared/line/index.js.map +0 -1
- package/lib/tools/shared/line/line-path.js +0 -118
- package/lib/tools/shared/line/line-path.js.map +0 -1
- package/lib/tools/shared/line/with-root-edge.js +0 -121
- package/lib/tools/shared/line/with-root-edge.js.map +0 -1
- package/lib/tools/shared/point/arrow-point.js +0 -72
- package/lib/tools/shared/point/arrow-point.js.map +0 -1
- package/lib/tools/shared/point/arrow.js +0 -67
- package/lib/tools/shared/point/arrow.js.map +0 -1
- package/lib/tools/shared/point/base-point.js +0 -157
- package/lib/tools/shared/point/base-point.js.map +0 -1
- package/lib/tools/shared/point/index.js +0 -68
- package/lib/tools/shared/point/index.js.map +0 -1
- package/lib/tools/shared/styles.js +0 -33
- package/lib/tools/shared/styles.js.map +0 -1
- package/lib/tools/shared/types.js +0 -16
- package/lib/tools/shared/types.js.map +0 -1
- package/lib/tools/sine/component.js +0 -40
- package/lib/tools/sine/component.js.map +0 -1
- package/lib/tools/sine/index.js +0 -50
- package/lib/tools/sine/index.js.map +0 -1
- package/lib/tools/vector/component.js +0 -68
- package/lib/tools/vector/component.js.map +0 -1
- package/lib/tools/vector/index.js +0 -11
- package/lib/tools/vector/index.js.map +0 -1
- package/lib/undo-redo.js +0 -86
- package/lib/undo-redo.js.map +0 -1
- package/lib/use-debounce.js +0 -25
- package/lib/use-debounce.js.map +0 -1
- package/lib/utils.js +0 -229
- package/lib/utils.js.map +0 -1
- package/src/__tests__/bg.test.jsx +0 -250
- package/src/__tests__/coordinates-label.test.jsx +0 -243
- package/src/__tests__/graph-with-controls.test.jsx +0 -198
- package/src/__tests__/graph.test.jsx +0 -721
- package/src/__tests__/grid-setup.test.jsx +0 -645
- package/src/__tests__/grid.test.jsx +0 -22
- package/src/__tests__/key-legend.test.jsx +0 -260
- package/src/__tests__/label-svg-icon.test.jsx +0 -278
- package/src/__tests__/labels.test.jsx +0 -55
- package/src/__tests__/mark-label.test.jsx +0 -63
- package/src/__tests__/toggle-bar.test.jsx +0 -146
- package/src/__tests__/tool-menu.test.jsx +0 -115
- package/src/__tests__/undo-redo.test.jsx +0 -24
- package/src/__tests__/use-debounce.test.js +0 -21
- package/src/__tests__/utils.js +0 -41
- package/src/__tests__/utils.test.js +0 -105
- package/src/axis/__tests__/arrow.test.jsx +0 -38
- package/src/axis/__tests__/axes.test.jsx +0 -216
- package/src/axis/arrow.jsx +0 -57
- package/src/axis/axes.jsx +0 -285
- package/src/axis/index.js +0 -3
- package/src/bg.jsx +0 -96
- package/src/container/__tests__/actions.test.js +0 -105
- package/src/container/__tests__/index.test.jsx +0 -319
- package/src/container/__tests__/marks.test.js +0 -172
- package/src/container/__tests__/middleware.test.js +0 -235
- package/src/container/__tests__/reducer.test.js +0 -324
- package/src/container/actions.js +0 -8
- package/src/container/index.jsx +0 -83
- package/src/container/marks.js +0 -14
- package/src/container/middleware.js +0 -7
- package/src/container/reducer.js +0 -5
- package/src/coordinates-label.jsx +0 -63
- package/src/graph-with-controls.jsx +0 -239
- package/src/graph.jsx +0 -303
- package/src/grid-setup.jsx +0 -432
- package/src/grid.jsx +0 -133
- package/src/index.js +0 -7
- package/src/key-legend.jsx +0 -142
- package/src/label-svg-icon.jsx +0 -39
- package/src/labels.jsx +0 -207
- package/src/mark-label.jsx +0 -244
- package/src/toggle-bar.jsx +0 -224
- package/src/tool-menu.jsx +0 -49
- package/src/tools/absolute/__tests__/component.test.jsx +0 -53
- package/src/tools/absolute/component.jsx +0 -23
- package/src/tools/absolute/index.js +0 -31
- package/src/tools/circle/__tests__/bg-circle.test.jsx +0 -26
- package/src/tools/circle/__tests__/component.test.jsx +0 -494
- package/src/tools/circle/__tests__/index.test.js +0 -480
- package/src/tools/circle/bg-circle.jsx +0 -81
- package/src/tools/circle/component.jsx +0 -264
- package/src/tools/circle/index.js +0 -25
- package/src/tools/exponential/__tests__/component.test.jsx +0 -53
- package/src/tools/exponential/__tests__/index.test.js +0 -729
- package/src/tools/exponential/component.jsx +0 -23
- package/src/tools/exponential/index.js +0 -39
- package/src/tools/index.js +0 -48
- package/src/tools/line/__tests__/component.test.jsx +0 -37
- package/src/tools/line/component.jsx +0 -93
- package/src/tools/line/index.js +0 -4
- package/src/tools/parabola/__tests__/component.test.jsx +0 -48
- package/src/tools/parabola/__tests__/index.test.js +0 -470
- package/src/tools/parabola/component.jsx +0 -23
- package/src/tools/parabola/index.js +0 -31
- package/src/tools/point/__tests__/component.test.jsx +0 -349
- package/src/tools/point/__tests__/index.test.js +0 -241
- package/src/tools/point/component.jsx +0 -126
- package/src/tools/point/index.js +0 -11
- package/src/tools/polygon/__tests__/component.test.jsx +0 -471
- package/src/tools/polygon/__tests__/index.test.js +0 -294
- package/src/tools/polygon/__tests__/line.test.jsx +0 -35
- package/src/tools/polygon/__tests__/polygon.test.jsx +0 -61
- package/src/tools/polygon/component.jsx +0 -409
- package/src/tools/polygon/index.js +0 -52
- package/src/tools/polygon/line.jsx +0 -74
- package/src/tools/polygon/polygon.jsx +0 -110
- package/src/tools/ray/__tests__/component.test.jsx +0 -29
- package/src/tools/ray/component.jsx +0 -92
- package/src/tools/ray/index.js +0 -4
- package/src/tools/segment/__tests__/component.test.jsx +0 -28
- package/src/tools/segment/component.jsx +0 -65
- package/src/tools/segment/index.js +0 -4
- package/src/tools/shared/__tests__/arrow-head.test.jsx +0 -31
- package/src/tools/shared/arrow-head.jsx +0 -102
- package/src/tools/shared/icons/CorrectSVG.jsx +0 -32
- package/src/tools/shared/icons/IncorrectSVG.jsx +0 -30
- package/src/tools/shared/icons/MissingSVG.jsx +0 -31
- package/src/tools/shared/line/__tests__/index.test.jsx +0 -109
- package/src/tools/shared/line/__tests__/line-path.test.jsx +0 -53
- package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +0 -73
- package/src/tools/shared/line/index.jsx +0 -487
- package/src/tools/shared/line/line-path.jsx +0 -80
- package/src/tools/shared/line/with-root-edge.jsx +0 -97
- package/src/tools/shared/point/__tests__/arrow-point.test.jsx +0 -91
- package/src/tools/shared/point/__tests__/base-point.test.jsx +0 -87
- package/src/tools/shared/point/arrow-point.jsx +0 -46
- package/src/tools/shared/point/arrow.jsx +0 -37
- package/src/tools/shared/point/base-point.jsx +0 -121
- package/src/tools/shared/point/index.jsx +0 -54
- package/src/tools/shared/styles.js +0 -27
- package/src/tools/shared/types.js +0 -10
- package/src/tools/sine/__tests__/component.test.jsx +0 -51
- package/src/tools/sine/component.jsx +0 -32
- package/src/tools/sine/index.js +0 -33
- package/src/tools/vector/__tests__/component.test.jsx +0 -25
- package/src/tools/vector/component.jsx +0 -56
- package/src/tools/vector/index.js +0 -4
- package/src/undo-redo.jsx +0 -45
- package/src/use-debounce.js +0 -13
- package/src/utils.js +0 -224
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing/src/container/index.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
import GraphWithControls from '../graph-with-controls.js';
|
|
12
|
+
export declare const GraphContainer: import("react-redux").ConnectedComponent<React.ComponentType<import("react-redux").Matching<{
|
|
13
|
+
marks: any;
|
|
14
|
+
} & {
|
|
15
|
+
onChangeMarks: (m: any) => any;
|
|
16
|
+
onUndo: () => any;
|
|
17
|
+
onRedo: () => any;
|
|
18
|
+
onReset: () => any;
|
|
19
|
+
}, React.ClassAttributes<GraphWithControls>>>, {
|
|
20
|
+
ref?: React.LegacyRef<GraphWithControls> | undefined;
|
|
21
|
+
key?: React.Key | null | undefined;
|
|
22
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
|
|
23
|
+
store?: import("redux").Store | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
ref?: ((string | ((instance: React.Component<import("react-redux").Matching<{
|
|
26
|
+
marks: any;
|
|
27
|
+
} & {
|
|
28
|
+
onChangeMarks: (m: any) => any;
|
|
29
|
+
onUndo: () => any;
|
|
30
|
+
onRedo: () => any;
|
|
31
|
+
onReset: () => any;
|
|
32
|
+
}, React.ClassAttributes<GraphWithControls>>, any, any> | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<React.Component<import("react-redux").Matching<{
|
|
33
|
+
marks: any;
|
|
34
|
+
} & {
|
|
35
|
+
onChangeMarks: (m: any) => any;
|
|
36
|
+
onUndo: () => any;
|
|
37
|
+
onRedo: () => any;
|
|
38
|
+
onReset: () => any;
|
|
39
|
+
}, React.ClassAttributes<GraphWithControls>>, any, any>>) & (string | ((instance: GraphWithControls | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<GraphWithControls>)) | null | undefined;
|
|
40
|
+
key?: React.Key | null | undefined;
|
|
41
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
|
|
42
|
+
store?: import("redux").Store | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* The graph component entry point with undo/redo
|
|
46
|
+
* Redux is an implementation detail, hide it in the react component.
|
|
47
|
+
*/
|
|
48
|
+
declare class Root extends React.Component {
|
|
49
|
+
static propTypes: {
|
|
50
|
+
onChangeMarks: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
|
+
marks: PropTypes.Requireable<any[]>;
|
|
52
|
+
};
|
|
53
|
+
constructor(props: any);
|
|
54
|
+
componentDidUpdate(prevProps: any): void;
|
|
55
|
+
onStoreChange: any;
|
|
56
|
+
render(): React.JSX.Element;
|
|
57
|
+
}
|
|
58
|
+
export default Root;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Provider_default as e, connect as t } from "../node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js";
|
|
2
|
+
import { applyMiddleware as n, createStore as r } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
|
|
3
|
+
import { M as i } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
|
|
4
|
+
import a from "./reducer.js";
|
|
5
|
+
import { changeMarks as o } from "./actions.js";
|
|
6
|
+
import s from "../graph-with-controls.js";
|
|
7
|
+
import { lastActionMiddleware as c } from "./middleware.js";
|
|
8
|
+
import l from "react";
|
|
9
|
+
import u from "prop-types";
|
|
10
|
+
import { isEqual as d } from "@pie-element/shared-lodash";
|
|
11
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
12
|
+
var p = t((e) => ({ marks: e.marks.present }), (e) => ({
|
|
13
|
+
onChangeMarks: (t) => e(o(t)),
|
|
14
|
+
onUndo: () => e(i.undo()),
|
|
15
|
+
onRedo: () => e(i.redo()),
|
|
16
|
+
onReset: () => e(o([]))
|
|
17
|
+
}))(s), m = class extends l.Component {
|
|
18
|
+
static propTypes = {
|
|
19
|
+
onChangeMarks: u.func,
|
|
20
|
+
marks: u.array
|
|
21
|
+
};
|
|
22
|
+
constructor(e) {
|
|
23
|
+
super(e);
|
|
24
|
+
let t = a();
|
|
25
|
+
this.store = r(t, { marks: e.marks }, n(c)), this.store.subscribe(this.onStoreChange);
|
|
26
|
+
}
|
|
27
|
+
componentDidUpdate(e) {
|
|
28
|
+
let { marks: t } = this.props;
|
|
29
|
+
d(this.store.getState().marks.present, t) || d(e.marks, t) || t && t.find((e) => e.correctness) || this.store.dispatch(o(t));
|
|
30
|
+
}
|
|
31
|
+
onStoreChange = () => {
|
|
32
|
+
let { marks: e, onChangeMarks: t } = this.props, n = this.store.getState();
|
|
33
|
+
d(n.marks.present, e) || t(n.marks.present);
|
|
34
|
+
};
|
|
35
|
+
render() {
|
|
36
|
+
let { onChangeMarks: t, marks: n, ...r } = this.props, i = n && n.find((e) => e.correctness);
|
|
37
|
+
return i ? /* @__PURE__ */ f(s, {
|
|
38
|
+
...r,
|
|
39
|
+
marks: n,
|
|
40
|
+
disabled: i
|
|
41
|
+
}) : /* @__PURE__ */ f(e, {
|
|
42
|
+
store: this.store,
|
|
43
|
+
children: /* @__PURE__ */ f(p, { ...r })
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { m as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing/src/container/marks.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
declare const marks: (state: never[] | undefined, action: any) => any;
|
|
10
|
+
export default marks;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/container/marks.ts
|
|
2
|
+
var e = (e = [], t) => {
|
|
3
|
+
switch (t.type) {
|
|
4
|
+
case "CHANGE_MARKS":
|
|
5
|
+
if (Array.isArray(t.marks)) return t.marks;
|
|
6
|
+
throw Error("marks must be an array");
|
|
7
|
+
default: return e;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing/src/container/middleware.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getLastAction: () => any;
|
|
10
|
+
export declare const lastActionMiddleware: () => (next: any) => (action: any) => any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing/src/container/reducer.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: () => import("redux").Reducer<{
|
|
10
|
+
marks: import("redux-undo").StateWithHistory<never[]>;
|
|
11
|
+
}, import("redux").UnknownAction, Partial<{
|
|
12
|
+
marks: import("redux-undo").StateWithHistory<never[]> | undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { combineReducers as e } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
|
|
2
|
+
import t from "./marks.js";
|
|
3
|
+
import { C as n } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
|
|
4
|
+
//#region src/container/reducer.ts
|
|
5
|
+
var r = () => e({ marks: n(t, { debug: !1 }) });
|
|
6
|
+
//#endregion
|
|
7
|
+
export { r as default };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing/src/coordinates-label.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare const getLabelPosition: (graphProps: any, x: any, y: any, labelLength: any) => {
|
|
12
|
+
left: any;
|
|
13
|
+
top: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const CoordinatesLabel: {
|
|
16
|
+
({ x, y, graphProps }: {
|
|
17
|
+
x: any;
|
|
18
|
+
y: any;
|
|
19
|
+
graphProps: any;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
propTypes: {
|
|
22
|
+
graphProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
23
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
24
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
25
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
26
|
+
}>>>;
|
|
27
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
28
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
29
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
30
|
+
}>>>;
|
|
31
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
32
|
+
min: PropTypes.Validator<number>;
|
|
33
|
+
max: PropTypes.Validator<number>;
|
|
34
|
+
step: PropTypes.Requireable<number>;
|
|
35
|
+
}>>>;
|
|
36
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
37
|
+
min: PropTypes.Validator<number>;
|
|
38
|
+
max: PropTypes.Validator<number>;
|
|
39
|
+
step: PropTypes.Requireable<number>;
|
|
40
|
+
}>>>;
|
|
41
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
42
|
+
width: PropTypes.Validator<number>;
|
|
43
|
+
height: PropTypes.Validator<number>;
|
|
44
|
+
}>>>;
|
|
45
|
+
}>>;
|
|
46
|
+
x: PropTypes.Requireable<number>;
|
|
47
|
+
y: PropTypes.Requireable<number>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export default CoordinatesLabel;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { roundNumber as e } from "./utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import t from "prop-types";
|
|
4
|
+
import { types as n } from "@pie-lib/plot";
|
|
5
|
+
import { styled as r } from "@mui/material/styles";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
import { color as a } from "@pie-lib/render-ui";
|
|
8
|
+
import o from "@mui/material/InputBase";
|
|
9
|
+
//#region src/coordinates-label.tsx
|
|
10
|
+
var s = r(o)(({ theme: e }) => ({
|
|
11
|
+
fontFamily: e.typography.fontFamily,
|
|
12
|
+
fontSize: e.typography.fontSize,
|
|
13
|
+
borderRadius: "8px",
|
|
14
|
+
background: e.palette.common.white,
|
|
15
|
+
color: a.defaults.PRIMARY_DARK,
|
|
16
|
+
"& .MuiInputBase-input": { padding: 0 }
|
|
17
|
+
})), c = (e, t, n, r) => {
|
|
18
|
+
let { scale: i, domain: a, range: o } = e, s = n === o.min ? 16 : n === o.max ? 0 : 8;
|
|
19
|
+
return i.x(t) + r + 10 >= i.x(a.max) ? {
|
|
20
|
+
left: i.x(t) - 10 - r,
|
|
21
|
+
top: i.y(n) - s
|
|
22
|
+
} : {
|
|
23
|
+
left: i.x(t) + 10,
|
|
24
|
+
top: i.y(n) - s
|
|
25
|
+
};
|
|
26
|
+
}, l = ({ x: t, y: n, graphProps: r }) => {
|
|
27
|
+
let a = `(${e(t)}, ${e(n)})`, o = (a.length || 0) * 6;
|
|
28
|
+
return /* @__PURE__ */ i(s, {
|
|
29
|
+
style: {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
pointerEvents: "auto",
|
|
32
|
+
width: o,
|
|
33
|
+
padding: 0,
|
|
34
|
+
...c(r, t, n, o)
|
|
35
|
+
},
|
|
36
|
+
value: a,
|
|
37
|
+
inputProps: { ariaLabel: "naked" }
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
l.propTypes = {
|
|
41
|
+
graphProps: n.GraphPropsType,
|
|
42
|
+
x: t.number,
|
|
43
|
+
y: t.number
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { l as default };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing/src/graph-with-controls.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare const setToolbarAvailability: (toolbarTools: any) => ({
|
|
12
|
+
toolbar: boolean;
|
|
13
|
+
type: any;
|
|
14
|
+
Component: any;
|
|
15
|
+
addPoint: (point: any, mark: any) => any;
|
|
16
|
+
} | {
|
|
17
|
+
toolbar: boolean;
|
|
18
|
+
type: string;
|
|
19
|
+
})[];
|
|
20
|
+
export declare const toolIsAvailable: (tools: any, currentTool: any) => any;
|
|
21
|
+
export declare const getAvailableTool: (tools: any) => any;
|
|
22
|
+
export declare const filterByValidToolTypes: (backgroundMarks: any) => any;
|
|
23
|
+
export declare const filterByVisibleToolTypes: (toolbarTools: any, marks: any) => any;
|
|
24
|
+
export declare class GraphWithControls extends React.Component {
|
|
25
|
+
static propTypes: {
|
|
26
|
+
onUndo: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
onRedo: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
+
onReset: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
+
toolbarTools: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
30
|
+
language: PropTypes.Requireable<string>;
|
|
31
|
+
axesSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
32
|
+
includeArrows: PropTypes.Requireable<object>;
|
|
33
|
+
graphProps: PropTypes.Requireable<object>;
|
|
34
|
+
}>>;
|
|
35
|
+
backgroundMarks: PropTypes.Requireable<any[]>;
|
|
36
|
+
className: PropTypes.Requireable<string>;
|
|
37
|
+
collapsibleToolbar: PropTypes.Requireable<boolean>;
|
|
38
|
+
collapsibleToolbarTitle: PropTypes.Requireable<string>;
|
|
39
|
+
disabledLabels: PropTypes.Requireable<boolean>;
|
|
40
|
+
disabledTitle: PropTypes.Requireable<boolean>;
|
|
41
|
+
domain: PropTypes.Requireable<PropTypes.InferProps<{
|
|
42
|
+
min: PropTypes.Validator<number>;
|
|
43
|
+
max: PropTypes.Validator<number>;
|
|
44
|
+
step: PropTypes.Requireable<number>;
|
|
45
|
+
}>>;
|
|
46
|
+
labels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
47
|
+
left: PropTypes.Requireable<string>;
|
|
48
|
+
top: PropTypes.Requireable<string>;
|
|
49
|
+
bottom: PropTypes.Requireable<string>;
|
|
50
|
+
right: PropTypes.Requireable<string>;
|
|
51
|
+
}>>;
|
|
52
|
+
labelModeEnabled: PropTypes.Requireable<boolean>;
|
|
53
|
+
coordinatesOnHover: PropTypes.Requireable<boolean>;
|
|
54
|
+
marks: PropTypes.Requireable<any[]>;
|
|
55
|
+
onChangeLabels: PropTypes.Requireable<(...args: any[]) => any>;
|
|
56
|
+
onChangeMarks: PropTypes.Requireable<(...args: any[]) => any>;
|
|
57
|
+
onChangeTitle: PropTypes.Requireable<(...args: any[]) => any>;
|
|
58
|
+
range: PropTypes.Requireable<PropTypes.InferProps<{
|
|
59
|
+
min: PropTypes.Validator<number>;
|
|
60
|
+
max: PropTypes.Validator<number>;
|
|
61
|
+
step: PropTypes.Requireable<number>;
|
|
62
|
+
}>>;
|
|
63
|
+
size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
64
|
+
width: PropTypes.Validator<number>;
|
|
65
|
+
height: PropTypes.Validator<number>;
|
|
66
|
+
}>>;
|
|
67
|
+
showLabels: PropTypes.Requireable<boolean>;
|
|
68
|
+
showPixelGuides: PropTypes.Requireable<boolean>;
|
|
69
|
+
showTitle: PropTypes.Requireable<boolean>;
|
|
70
|
+
title: PropTypes.Requireable<string>;
|
|
71
|
+
tools: PropTypes.Requireable<any[]>;
|
|
72
|
+
limitLabeling: PropTypes.Requireable<boolean>;
|
|
73
|
+
};
|
|
74
|
+
static defaultProps: {
|
|
75
|
+
collapsibleToolbar: boolean;
|
|
76
|
+
collapsibleToolbarTitle: string;
|
|
77
|
+
disabledLabels: boolean;
|
|
78
|
+
disabledTitle: boolean;
|
|
79
|
+
showLabels: boolean;
|
|
80
|
+
showTitle: boolean;
|
|
81
|
+
toolbarTools: never[];
|
|
82
|
+
};
|
|
83
|
+
constructor(props: any);
|
|
84
|
+
componentDidUpdate(prevProps: any): void;
|
|
85
|
+
changeCurrentTool: (tool: any, tools: any) => void;
|
|
86
|
+
render(): React.JSX.Element;
|
|
87
|
+
}
|
|
88
|
+
export default GraphWithControls;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import e, { graphPropTypes as t } from "./graph.js";
|
|
2
|
+
import { allTools as n, toolsArr as r } from "./tools/index.js";
|
|
3
|
+
import i from "./tool-menu.js";
|
|
4
|
+
import a from "./undo-redo.js";
|
|
5
|
+
import o from "react";
|
|
6
|
+
import s from "prop-types";
|
|
7
|
+
import { isString as c, uniq as l } from "@pie-element/shared-lodash";
|
|
8
|
+
import { styled as u } from "@mui/material/styles";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
import { color as p } from "@pie-lib/render-ui";
|
|
11
|
+
import { Accordion as m, AccordionDetails as h, AccordionSummary as g, Typography as _ } from "@mui/material";
|
|
12
|
+
import v from "@mui/icons-material/ExpandMore";
|
|
13
|
+
//#region src/graph-with-controls.tsx
|
|
14
|
+
var y = u("div")({
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
width: "min-content"
|
|
18
|
+
}), b = u("div")(({ theme: e }) => ({
|
|
19
|
+
display: "flex",
|
|
20
|
+
justifyContent: "space-between",
|
|
21
|
+
padding: e.spacing(1),
|
|
22
|
+
color: p.text(),
|
|
23
|
+
backgroundColor: p.primaryLight(),
|
|
24
|
+
"& button": { fontSize: e.typography.fontSize }
|
|
25
|
+
})), x = u(m)({
|
|
26
|
+
backgroundColor: p.primaryLight(),
|
|
27
|
+
width: "100%"
|
|
28
|
+
}), S = u(g)(({ theme: e }) => ({
|
|
29
|
+
padding: `0 ${e.spacing(1)}`,
|
|
30
|
+
minHeight: "32px !important",
|
|
31
|
+
"& .MuiAccordionSummary-content": { margin: "4px 0 !important" }
|
|
32
|
+
})), C = u(h)(({ theme: e }) => ({
|
|
33
|
+
padding: 0,
|
|
34
|
+
marginTop: e.spacing(1),
|
|
35
|
+
display: "flex",
|
|
36
|
+
justifyContent: "space-between"
|
|
37
|
+
})), w = (e) => r.map((t) => ({
|
|
38
|
+
...t,
|
|
39
|
+
toolbar: !!e.find((e) => e === t.type)
|
|
40
|
+
})) || [], T = (e, t) => t && e && (e.find((e) => e.type === t.type) || {}).toolbar, E = (e) => e.find((e) => e.toolbar), D = (e) => e.filter((e) => !!n.find((t) => t === e.type)), O = (e, t) => t.filter((t) => !!e.find((e) => e === t.type)), k = (e) => r.find((t) => t.type === e) || null, A = ({ children: e, title: t }) => /* @__PURE__ */ f(x, {
|
|
41
|
+
elevation: 0,
|
|
42
|
+
disableGutters: !0,
|
|
43
|
+
square: !0,
|
|
44
|
+
TransitionProps: { timeout: {
|
|
45
|
+
enter: 225,
|
|
46
|
+
exit: 195
|
|
47
|
+
} },
|
|
48
|
+
children: [/* @__PURE__ */ d(S, {
|
|
49
|
+
expandIcon: /* @__PURE__ */ d(v, {}),
|
|
50
|
+
children: /* @__PURE__ */ d(_, {
|
|
51
|
+
variant: "subheading",
|
|
52
|
+
children: t
|
|
53
|
+
})
|
|
54
|
+
}), /* @__PURE__ */ d(C, { children: e })]
|
|
55
|
+
});
|
|
56
|
+
A.propTypes = {
|
|
57
|
+
children: s.array,
|
|
58
|
+
title: s.string
|
|
59
|
+
};
|
|
60
|
+
var j = class extends o.Component {
|
|
61
|
+
static propTypes = {
|
|
62
|
+
...t,
|
|
63
|
+
onUndo: s.func,
|
|
64
|
+
onRedo: s.func,
|
|
65
|
+
onReset: s.func,
|
|
66
|
+
toolbarTools: s.arrayOf(s.string),
|
|
67
|
+
language: s.string
|
|
68
|
+
};
|
|
69
|
+
static defaultProps = {
|
|
70
|
+
collapsibleToolbar: !1,
|
|
71
|
+
collapsibleToolbarTitle: "",
|
|
72
|
+
disabledLabels: !1,
|
|
73
|
+
disabledTitle: !1,
|
|
74
|
+
showLabels: !0,
|
|
75
|
+
showTitle: !0,
|
|
76
|
+
toolbarTools: []
|
|
77
|
+
};
|
|
78
|
+
constructor(e) {
|
|
79
|
+
super(e), this.state = {
|
|
80
|
+
currentTool: k(e.defaultTool),
|
|
81
|
+
labelModeEnabled: !1
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
componentDidUpdate(e) {
|
|
85
|
+
let { defaultTool: t } = this.props;
|
|
86
|
+
if (e.defaultTool !== t) {
|
|
87
|
+
let e = k(t);
|
|
88
|
+
this.setState({ currentTool: e });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
changeCurrentTool = (e, t) => this.setState({
|
|
92
|
+
currentTool: t.find((t) => t.type === e),
|
|
93
|
+
labelModeEnabled: e === "label"
|
|
94
|
+
});
|
|
95
|
+
render() {
|
|
96
|
+
let { currentTool: t, labelModeEnabled: n } = this.state, { axesSettings: r, className: s, coordinatesOnHover: u, collapsibleToolbar: p, collapsibleToolbarTitle: m, disabled: h, disabledLabels: g, disabledTitle: _, domain: v, draggableTools: x, labels: S, labelsPlaceholders: C, onChangeLabels: k, onChangeMarks: j, onChangeTitle: M, onChangeTools: N, onUndo: P, onRedo: F, onReset: I, range: L, size: R, showLabels: z, showPixelGuides: B, showTitle: V, title: H, titlePlaceholder: U, language: W, removeIncompleteTool: G, limitLabeling: K } = this.props, { backgroundMarks: q, marks: J, toolbarTools: Y } = this.props;
|
|
97
|
+
Y = l(Y || []).filter((e) => !!c(e)) || [], q = D(q || []), J = O(Y, J || []);
|
|
98
|
+
let X = w(Y);
|
|
99
|
+
(!t || !T(X, t)) && (t = E(X));
|
|
100
|
+
let Z = /* @__PURE__ */ f(o.Fragment, { children: [/* @__PURE__ */ d(i, {
|
|
101
|
+
currentToolType: t && t.type,
|
|
102
|
+
disabled: !!h,
|
|
103
|
+
draggableTools: x,
|
|
104
|
+
labelModeEnabled: n,
|
|
105
|
+
onChange: (e) => this.changeCurrentTool(e, X),
|
|
106
|
+
toolbarTools: Y,
|
|
107
|
+
onChangeTools: N,
|
|
108
|
+
language: W
|
|
109
|
+
}), !h && /* @__PURE__ */ d(a, {
|
|
110
|
+
onUndo: P,
|
|
111
|
+
onRedo: F,
|
|
112
|
+
onReset: I,
|
|
113
|
+
language: W
|
|
114
|
+
})] });
|
|
115
|
+
return /* @__PURE__ */ f(y, {
|
|
116
|
+
className: s,
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ d(b, { children: p ? /* @__PURE__ */ d(A, {
|
|
119
|
+
title: m,
|
|
120
|
+
children: Z
|
|
121
|
+
}) : Z }),
|
|
122
|
+
/* @__PURE__ */ d("div", { ref: (e) => this.labelNode = e }),
|
|
123
|
+
/* @__PURE__ */ d(e, {
|
|
124
|
+
axesSettings: r,
|
|
125
|
+
backgroundMarks: q,
|
|
126
|
+
coordinatesOnHover: u,
|
|
127
|
+
currentTool: t,
|
|
128
|
+
disabledLabels: g,
|
|
129
|
+
disabledTitle: _,
|
|
130
|
+
domain: v,
|
|
131
|
+
labels: S,
|
|
132
|
+
labelModeEnabled: n,
|
|
133
|
+
labelsPlaceholders: C,
|
|
134
|
+
marks: J,
|
|
135
|
+
onChangeMarks: h ? void 0 : j,
|
|
136
|
+
onChangeLabels: k,
|
|
137
|
+
onChangeTitle: M,
|
|
138
|
+
range: L,
|
|
139
|
+
size: R,
|
|
140
|
+
showLabels: z,
|
|
141
|
+
showPixelGuides: B,
|
|
142
|
+
showTitle: V,
|
|
143
|
+
title: H,
|
|
144
|
+
titlePlaceholder: U,
|
|
145
|
+
tools: X,
|
|
146
|
+
removeIncompleteTool: G,
|
|
147
|
+
limitLabeling: K
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
//#endregion
|
|
154
|
+
export { j as default };
|
package/dist/graph.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing/src/graph.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare const graphPropTypes: {
|
|
12
|
+
axesSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
+
includeArrows: PropTypes.Requireable<object>;
|
|
14
|
+
graphProps: PropTypes.Requireable<object>;
|
|
15
|
+
}>>;
|
|
16
|
+
backgroundMarks: PropTypes.Requireable<any[]>;
|
|
17
|
+
className: PropTypes.Requireable<string>;
|
|
18
|
+
collapsibleToolbar: PropTypes.Requireable<boolean>;
|
|
19
|
+
collapsibleToolbarTitle: PropTypes.Requireable<string>;
|
|
20
|
+
disabledLabels: PropTypes.Requireable<boolean>;
|
|
21
|
+
disabledTitle: PropTypes.Requireable<boolean>;
|
|
22
|
+
domain: PropTypes.Requireable<PropTypes.InferProps<{
|
|
23
|
+
min: PropTypes.Validator<number>;
|
|
24
|
+
max: PropTypes.Validator<number>;
|
|
25
|
+
step: PropTypes.Requireable<number>;
|
|
26
|
+
}>>;
|
|
27
|
+
labels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
28
|
+
left: PropTypes.Requireable<string>;
|
|
29
|
+
top: PropTypes.Requireable<string>;
|
|
30
|
+
bottom: PropTypes.Requireable<string>;
|
|
31
|
+
right: PropTypes.Requireable<string>;
|
|
32
|
+
}>>;
|
|
33
|
+
labelModeEnabled: PropTypes.Requireable<boolean>;
|
|
34
|
+
coordinatesOnHover: PropTypes.Requireable<boolean>;
|
|
35
|
+
marks: PropTypes.Requireable<any[]>;
|
|
36
|
+
onChangeLabels: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
+
onChangeMarks: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
|
+
onChangeTitle: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
range: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
|
+
min: PropTypes.Validator<number>;
|
|
41
|
+
max: PropTypes.Validator<number>;
|
|
42
|
+
step: PropTypes.Requireable<number>;
|
|
43
|
+
}>>;
|
|
44
|
+
size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
45
|
+
width: PropTypes.Validator<number>;
|
|
46
|
+
height: PropTypes.Validator<number>;
|
|
47
|
+
}>>;
|
|
48
|
+
showLabels: PropTypes.Requireable<boolean>;
|
|
49
|
+
showPixelGuides: PropTypes.Requireable<boolean>;
|
|
50
|
+
showTitle: PropTypes.Requireable<boolean>;
|
|
51
|
+
title: PropTypes.Requireable<string>;
|
|
52
|
+
tools: PropTypes.Requireable<any[]>;
|
|
53
|
+
limitLabeling: PropTypes.Requireable<boolean>;
|
|
54
|
+
};
|
|
55
|
+
export declare const removeBuildingToolIfCurrentToolDiffers: ({ marks, currentTool, onChangeMarks, removeIncompleteTool }: {
|
|
56
|
+
marks: any;
|
|
57
|
+
currentTool: any;
|
|
58
|
+
onChangeMarks: any;
|
|
59
|
+
removeIncompleteTool: any;
|
|
60
|
+
}) => any;
|
|
61
|
+
export declare class Graph extends React.Component {
|
|
62
|
+
constructor(props: any);
|
|
63
|
+
static propTypes: {
|
|
64
|
+
currentTool: PropTypes.Requireable<object>;
|
|
65
|
+
axesSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
66
|
+
includeArrows: PropTypes.Requireable<object>;
|
|
67
|
+
graphProps: PropTypes.Requireable<object>;
|
|
68
|
+
}>>;
|
|
69
|
+
backgroundMarks: PropTypes.Requireable<any[]>;
|
|
70
|
+
className: PropTypes.Requireable<string>;
|
|
71
|
+
collapsibleToolbar: PropTypes.Requireable<boolean>;
|
|
72
|
+
collapsibleToolbarTitle: PropTypes.Requireable<string>;
|
|
73
|
+
disabledLabels: PropTypes.Requireable<boolean>;
|
|
74
|
+
disabledTitle: PropTypes.Requireable<boolean>;
|
|
75
|
+
domain: PropTypes.Requireable<PropTypes.InferProps<{
|
|
76
|
+
min: PropTypes.Validator<number>;
|
|
77
|
+
max: PropTypes.Validator<number>;
|
|
78
|
+
step: PropTypes.Requireable<number>;
|
|
79
|
+
}>>;
|
|
80
|
+
labels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
81
|
+
left: PropTypes.Requireable<string>;
|
|
82
|
+
top: PropTypes.Requireable<string>;
|
|
83
|
+
bottom: PropTypes.Requireable<string>;
|
|
84
|
+
right: PropTypes.Requireable<string>;
|
|
85
|
+
}>>;
|
|
86
|
+
labelModeEnabled: PropTypes.Requireable<boolean>;
|
|
87
|
+
coordinatesOnHover: PropTypes.Requireable<boolean>;
|
|
88
|
+
marks: PropTypes.Requireable<any[]>;
|
|
89
|
+
onChangeLabels: PropTypes.Requireable<(...args: any[]) => any>;
|
|
90
|
+
onChangeMarks: PropTypes.Requireable<(...args: any[]) => any>;
|
|
91
|
+
onChangeTitle: PropTypes.Requireable<(...args: any[]) => any>;
|
|
92
|
+
range: PropTypes.Requireable<PropTypes.InferProps<{
|
|
93
|
+
min: PropTypes.Validator<number>;
|
|
94
|
+
max: PropTypes.Validator<number>;
|
|
95
|
+
step: PropTypes.Requireable<number>;
|
|
96
|
+
}>>;
|
|
97
|
+
size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
98
|
+
width: PropTypes.Validator<number>;
|
|
99
|
+
height: PropTypes.Validator<number>;
|
|
100
|
+
}>>;
|
|
101
|
+
showLabels: PropTypes.Requireable<boolean>;
|
|
102
|
+
showPixelGuides: PropTypes.Requireable<boolean>;
|
|
103
|
+
showTitle: PropTypes.Requireable<boolean>;
|
|
104
|
+
title: PropTypes.Requireable<string>;
|
|
105
|
+
tools: PropTypes.Requireable<any[]>;
|
|
106
|
+
limitLabeling: PropTypes.Requireable<boolean>;
|
|
107
|
+
};
|
|
108
|
+
static defaultProps: {
|
|
109
|
+
onChangeMarks: () => void;
|
|
110
|
+
disabledLabels: boolean;
|
|
111
|
+
disabledTitle: boolean;
|
|
112
|
+
};
|
|
113
|
+
state: {};
|
|
114
|
+
_justDragged: boolean;
|
|
115
|
+
startDrag: any;
|
|
116
|
+
stopDrag: any;
|
|
117
|
+
generateMaskId(): string;
|
|
118
|
+
componentDidMount: () => void;
|
|
119
|
+
changeMark: any;
|
|
120
|
+
completeMark: any;
|
|
121
|
+
updateMarks: any;
|
|
122
|
+
getComponent: any;
|
|
123
|
+
onBgClick: any;
|
|
124
|
+
render(): React.JSX.Element;
|
|
125
|
+
}
|
|
126
|
+
export default Graph;
|