@pie-lib/graphing 4.0.5-next.31 → 4.0.5-next.36
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/CHANGELOG.json +1 -0
- package/CHANGELOG.md +1469 -0
- package/LICENSE.md +5 -0
- package/lib/axis/arrow.js +79 -0
- package/lib/axis/arrow.js.map +1 -0
- package/lib/axis/axes.js +329 -0
- package/lib/axis/axes.js.map +1 -0
- package/lib/axis/index.js +21 -0
- package/lib/axis/index.js.map +1 -0
- package/lib/bg.js +114 -0
- package/lib/bg.js.map +1 -0
- package/lib/container/actions.js +18 -0
- package/lib/container/actions.js.map +1 -0
- package/lib/container/index.js +127 -0
- package/lib/container/index.js.map +1 -0
- package/lib/container/marks.js +22 -0
- package/lib/container/marks.js.map +1 -0
- package/lib/container/middleware.js +19 -0
- package/lib/container/middleware.js.map +1 -0
- package/lib/container/reducer.js +18 -0
- package/lib/container/reducer.js.map +1 -0
- package/lib/coordinates-label.js +79 -0
- package/lib/coordinates-label.js.map +1 -0
- package/lib/graph-with-controls.js +294 -0
- package/lib/graph-with-controls.js.map +1 -0
- package/lib/graph.js +327 -0
- package/lib/graph.js.map +1 -0
- package/lib/grid-setup.js +414 -0
- package/lib/grid-setup.js.map +1 -0
- package/lib/grid.js +131 -0
- package/lib/grid.js.map +1 -0
- package/lib/index.js +47 -0
- package/lib/index.js.map +1 -0
- package/lib/key-legend.js +201 -0
- package/lib/key-legend.js.map +1 -0
- package/lib/label-svg-icon.js +50 -0
- package/lib/label-svg-icon.js.map +1 -0
- package/lib/labels.js +243 -0
- package/lib/labels.js.map +1 -0
- package/lib/mark-label.js +285 -0
- package/lib/mark-label.js.map +1 -0
- package/lib/toggle-bar.js +252 -0
- package/lib/toggle-bar.js.map +1 -0
- package/lib/tool-menu.js +78 -0
- package/lib/tool-menu.js.map +1 -0
- package/lib/tools/absolute/component.js +29 -0
- package/lib/tools/absolute/component.js.map +1 -0
- package/lib/tools/absolute/index.js +50 -0
- package/lib/tools/absolute/index.js.map +1 -0
- package/lib/tools/circle/bg-circle.js +123 -0
- package/lib/tools/circle/bg-circle.js.map +1 -0
- package/lib/tools/circle/component.js +321 -0
- package/lib/tools/circle/component.js.map +1 -0
- package/lib/tools/circle/index.js +41 -0
- package/lib/tools/circle/index.js.map +1 -0
- package/lib/tools/exponential/component.js +28 -0
- package/lib/tools/exponential/component.js.map +1 -0
- package/lib/tools/exponential/index.js +56 -0
- package/lib/tools/exponential/index.js.map +1 -0
- package/lib/tools/index.js +86 -0
- package/lib/tools/index.js.map +1 -0
- package/lib/tools/line/component.js +97 -0
- package/lib/tools/line/component.js.map +1 -0
- package/lib/tools/line/index.js +11 -0
- package/lib/tools/line/index.js.map +1 -0
- package/lib/tools/parabola/component.js +28 -0
- package/lib/tools/parabola/component.js.map +1 -0
- package/lib/tools/parabola/index.js +50 -0
- package/lib/tools/parabola/index.js.map +1 -0
- package/lib/tools/point/component.js +148 -0
- package/lib/tools/point/component.js.map +1 -0
- package/lib/tools/point/index.js +24 -0
- package/lib/tools/point/index.js.map +1 -0
- package/lib/tools/polygon/component.js +437 -0
- package/lib/tools/polygon/component.js.map +1 -0
- package/lib/tools/polygon/index.js +89 -0
- package/lib/tools/polygon/index.js.map +1 -0
- package/lib/tools/polygon/line.js +112 -0
- package/lib/tools/polygon/line.js.map +1 -0
- package/lib/tools/polygon/polygon.js +130 -0
- package/lib/tools/polygon/polygon.js.map +1 -0
- package/lib/tools/ray/component.js +95 -0
- package/lib/tools/ray/component.js.map +1 -0
- package/lib/tools/ray/index.js +11 -0
- package/lib/tools/ray/index.js.map +1 -0
- package/lib/tools/segment/component.js +71 -0
- package/lib/tools/segment/component.js.map +1 -0
- package/lib/tools/segment/index.js +11 -0
- package/lib/tools/segment/index.js.map +1 -0
- package/lib/tools/shared/arrow-head.js +111 -0
- package/lib/tools/shared/arrow-head.js.map +1 -0
- package/lib/tools/shared/icons/CorrectSVG.js +40 -0
- package/lib/tools/shared/icons/CorrectSVG.js.map +1 -0
- package/lib/tools/shared/icons/IncorrectSVG.js +40 -0
- package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -0
- package/lib/tools/shared/icons/MissingSVG.js +39 -0
- package/lib/tools/shared/icons/MissingSVG.js.map +1 -0
- package/lib/tools/shared/line/index.js +550 -0
- package/lib/tools/shared/line/index.js.map +1 -0
- package/lib/tools/shared/line/line-path.js +118 -0
- package/lib/tools/shared/line/line-path.js.map +1 -0
- package/lib/tools/shared/line/with-root-edge.js +121 -0
- package/lib/tools/shared/line/with-root-edge.js.map +1 -0
- package/lib/tools/shared/point/arrow-point.js +72 -0
- package/lib/tools/shared/point/arrow-point.js.map +1 -0
- package/lib/tools/shared/point/arrow.js +67 -0
- package/lib/tools/shared/point/arrow.js.map +1 -0
- package/lib/tools/shared/point/base-point.js +157 -0
- package/lib/tools/shared/point/base-point.js.map +1 -0
- package/lib/tools/shared/point/index.js +68 -0
- package/lib/tools/shared/point/index.js.map +1 -0
- package/lib/tools/shared/styles.js +33 -0
- package/lib/tools/shared/styles.js.map +1 -0
- package/lib/tools/shared/types.js +16 -0
- package/lib/tools/shared/types.js.map +1 -0
- package/lib/tools/sine/component.js +40 -0
- package/lib/tools/sine/component.js.map +1 -0
- package/lib/tools/sine/index.js +50 -0
- package/lib/tools/sine/index.js.map +1 -0
- package/lib/tools/vector/component.js +68 -0
- package/lib/tools/vector/component.js.map +1 -0
- package/lib/tools/vector/index.js +11 -0
- package/lib/tools/vector/index.js.map +1 -0
- package/lib/undo-redo.js +86 -0
- package/lib/undo-redo.js.map +1 -0
- package/lib/use-debounce.js +25 -0
- package/lib/use-debounce.js.map +1 -0
- package/lib/utils.js +229 -0
- package/lib/utils.js.map +1 -0
- package/package.json +33 -45
- package/src/__tests__/bg.test.jsx +250 -0
- package/src/__tests__/coordinates-label.test.jsx +243 -0
- package/src/__tests__/graph-with-controls.test.jsx +198 -0
- package/src/__tests__/graph.test.jsx +721 -0
- package/src/__tests__/grid-setup.test.jsx +645 -0
- package/src/__tests__/grid.test.jsx +22 -0
- package/src/__tests__/key-legend.test.jsx +260 -0
- package/src/__tests__/label-svg-icon.test.jsx +278 -0
- package/src/__tests__/labels.test.jsx +55 -0
- package/src/__tests__/mark-label.test.jsx +63 -0
- package/src/__tests__/toggle-bar.test.jsx +146 -0
- package/src/__tests__/tool-menu.test.jsx +115 -0
- package/src/__tests__/undo-redo.test.jsx +24 -0
- package/src/__tests__/use-debounce.test.js +21 -0
- package/src/__tests__/utils.js +41 -0
- package/src/__tests__/utils.test.js +105 -0
- package/src/axis/__tests__/arrow.test.jsx +38 -0
- package/src/axis/__tests__/axes.test.jsx +216 -0
- package/src/axis/arrow.jsx +57 -0
- package/src/axis/axes.jsx +285 -0
- package/src/axis/index.js +3 -0
- package/src/bg.jsx +96 -0
- package/src/container/__tests__/actions.test.js +105 -0
- package/src/container/__tests__/index.test.jsx +319 -0
- package/src/container/__tests__/marks.test.js +172 -0
- package/src/container/__tests__/middleware.test.js +235 -0
- package/src/container/__tests__/reducer.test.js +324 -0
- package/src/container/actions.js +8 -0
- package/src/container/index.jsx +91 -0
- package/src/container/marks.js +14 -0
- package/src/container/middleware.js +7 -0
- package/src/container/reducer.js +5 -0
- package/src/coordinates-label.jsx +63 -0
- package/src/graph-with-controls.jsx +239 -0
- package/src/graph.jsx +303 -0
- package/src/grid-setup.jsx +432 -0
- package/src/grid.jsx +133 -0
- package/src/index.js +7 -0
- package/src/key-legend.jsx +142 -0
- package/src/label-svg-icon.jsx +39 -0
- package/src/labels.jsx +207 -0
- package/src/mark-label.jsx +244 -0
- package/src/toggle-bar.jsx +224 -0
- package/src/tool-menu.jsx +49 -0
- package/src/tools/absolute/__tests__/component.test.jsx +53 -0
- package/src/tools/absolute/component.jsx +23 -0
- package/src/tools/absolute/index.js +31 -0
- package/src/tools/circle/__tests__/bg-circle.test.jsx +26 -0
- package/src/tools/circle/__tests__/component.test.jsx +494 -0
- package/src/tools/circle/__tests__/index.test.js +480 -0
- package/src/tools/circle/bg-circle.jsx +81 -0
- package/src/tools/circle/component.jsx +264 -0
- package/src/tools/circle/index.js +25 -0
- package/src/tools/exponential/__tests__/component.test.jsx +53 -0
- package/src/tools/exponential/__tests__/index.test.js +729 -0
- package/src/tools/exponential/component.jsx +23 -0
- package/src/tools/exponential/index.js +39 -0
- package/src/tools/index.js +48 -0
- package/src/tools/line/__tests__/component.test.jsx +37 -0
- package/src/tools/line/component.jsx +93 -0
- package/src/tools/line/index.js +4 -0
- package/src/tools/parabola/__tests__/component.test.jsx +48 -0
- package/src/tools/parabola/__tests__/index.test.js +470 -0
- package/src/tools/parabola/component.jsx +23 -0
- package/src/tools/parabola/index.js +31 -0
- package/src/tools/point/__tests__/component.test.jsx +349 -0
- package/src/tools/point/__tests__/index.test.js +241 -0
- package/src/tools/point/component.jsx +126 -0
- package/src/tools/point/index.js +11 -0
- package/src/tools/polygon/__tests__/component.test.jsx +471 -0
- package/src/tools/polygon/__tests__/index.test.js +294 -0
- package/src/tools/polygon/__tests__/line.test.jsx +35 -0
- package/src/tools/polygon/__tests__/polygon.test.jsx +61 -0
- package/src/tools/polygon/component.jsx +409 -0
- package/src/tools/polygon/index.js +52 -0
- package/src/tools/polygon/line.jsx +74 -0
- package/src/tools/polygon/polygon.jsx +110 -0
- package/src/tools/ray/__tests__/component.test.jsx +29 -0
- package/src/tools/ray/component.jsx +92 -0
- package/src/tools/ray/index.js +4 -0
- package/src/tools/segment/__tests__/component.test.jsx +28 -0
- package/src/tools/segment/component.jsx +65 -0
- package/src/tools/segment/index.js +4 -0
- package/src/tools/shared/__tests__/arrow-head.test.jsx +31 -0
- package/src/tools/shared/arrow-head.jsx +102 -0
- package/src/tools/shared/icons/CorrectSVG.jsx +32 -0
- package/src/tools/shared/icons/IncorrectSVG.jsx +30 -0
- package/src/tools/shared/icons/MissingSVG.jsx +31 -0
- package/src/tools/shared/line/__tests__/index.test.jsx +109 -0
- package/src/tools/shared/line/__tests__/line-path.test.jsx +53 -0
- package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +73 -0
- package/src/tools/shared/line/index.jsx +487 -0
- package/src/tools/shared/line/line-path.jsx +80 -0
- package/src/tools/shared/line/with-root-edge.jsx +97 -0
- package/src/tools/shared/point/__tests__/arrow-point.test.jsx +91 -0
- package/src/tools/shared/point/__tests__/base-point.test.jsx +87 -0
- package/src/tools/shared/point/arrow-point.jsx +46 -0
- package/src/tools/shared/point/arrow.jsx +37 -0
- package/src/tools/shared/point/base-point.jsx +121 -0
- package/src/tools/shared/point/index.jsx +54 -0
- package/src/tools/shared/styles.js +27 -0
- package/src/tools/shared/types.js +10 -0
- package/src/tools/sine/__tests__/component.test.jsx +51 -0
- package/src/tools/sine/component.jsx +32 -0
- package/src/tools/sine/index.js +33 -0
- package/src/tools/vector/__tests__/component.test.jsx +25 -0
- package/src/tools/vector/component.jsx +56 -0
- package/src/tools/vector/index.js +4 -0
- package/src/undo-redo.jsx +45 -0
- package/src/use-debounce.js +13 -0
- package/src/utils.js +224 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -23
- package/dist/autosize-input.d.ts +0 -10
- package/dist/autosize-input.js +0 -66
- package/dist/axis/arrow.d.ts +0 -13
- package/dist/axis/arrow.js +0 -34
- package/dist/axis/axes.d.ts +0 -132
- package/dist/axis/axes.js +0 -214
- package/dist/axis/index.d.ts +0 -10
- package/dist/bg.d.ts +0 -51
- package/dist/bg.js +0 -44
- package/dist/container/actions.d.ts +0 -15
- package/dist/container/actions.js +0 -7
- package/dist/container/index.d.ts +0 -58
- package/dist/container/index.js +0 -48
- package/dist/container/marks.d.ts +0 -10
- package/dist/container/marks.js +0 -11
- package/dist/container/middleware.d.ts +0 -10
- package/dist/container/middleware.js +0 -4
- package/dist/container/reducer.d.ts +0 -14
- package/dist/container/reducer.js +0 -7
- package/dist/coordinates-label.d.ts +0 -50
- package/dist/coordinates-label.js +0 -46
- package/dist/graph-with-controls.d.ts +0 -88
- package/dist/graph-with-controls.js +0 -154
- package/dist/graph.d.ts +0 -126
- package/dist/graph.js +0 -209
- package/dist/grid-setup.d.ts +0 -27
- package/dist/grid-setup.js +0 -307
- package/dist/grid.d.ts +0 -43
- package/dist/grid.js +0 -59
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -7
- package/dist/key-legend.d.ts +0 -21
- package/dist/key-legend.js +0 -231
- package/dist/label-svg-icon.d.ts +0 -18
- package/dist/label-svg-icon.js +0 -42
- package/dist/labels.d.ts +0 -37
- package/dist/labels.js +0 -152
- package/dist/mark-label.d.ts +0 -58
- package/dist/mark-label.js +0 -171
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +0 -101
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +0 -63
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +0 -44
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +0 -9
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +0 -14
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +0 -21
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +0 -16
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +0 -8
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +0 -15
- package/dist/node_modules/.bun/@visx_curve@3.12.0/node_modules/@visx/curve/esm/index.js +0 -2
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/Grid.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +0 -6
- package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +0 -50
- package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +0 -18
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +0 -10
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +0 -9
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +0 -6
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +0 -47
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +0 -50
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +0 -9
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +0 -6
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +0 -53
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +0 -57
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +0 -91
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +0 -21
- package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +0 -32
- package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +0 -33
- package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +0 -32
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +0 -28
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js +0 -21
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js +0 -10
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js +0 -9
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +0 -15
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +0 -16
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js +0 -9
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +0 -8
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js +0 -15
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js +0 -19
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js +0 -11
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js +0 -18
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js +0 -16
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +0 -11
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +0 -19
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +0 -9
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js +0 -10
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js +0 -20
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js +0 -11
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js +0 -16
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/memoize.js +0 -20
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +0 -37
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +0 -509
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +0 -108
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +0 -31
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +0 -45
- package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +0 -471
- package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +0 -49
- package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +0 -34
- package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +0 -185
- package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +0 -198
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +0 -53
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +0 -51
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/with-selector.js +0 -10
- package/dist/toggle-bar.d.ts +0 -40
- package/dist/toggle-bar.js +0 -155
- package/dist/tool-menu.d.ts +0 -29
- package/dist/tool-menu.js +0 -41
- package/dist/tools/absolute/component.d.ts +0 -16
- package/dist/tools/absolute/component.js +0 -15
- package/dist/tools/absolute/index.d.ts +0 -20
- package/dist/tools/absolute/index.js +0 -32
- package/dist/tools/circle/bg-circle.d.ts +0 -116
- package/dist/tools/circle/bg-circle.js +0 -72
- package/dist/tools/circle/component.d.ts +0 -83
- package/dist/tools/circle/component.js +0 -195
- package/dist/tools/circle/index.d.ts +0 -20
- package/dist/tools/circle/index.js +0 -22
- package/dist/tools/exponential/component.d.ts +0 -16
- package/dist/tools/exponential/component.js +0 -14
- package/dist/tools/exponential/index.d.ts +0 -20
- package/dist/tools/exponential/index.js +0 -32
- package/dist/tools/index.d.ts +0 -27
- package/dist/tools/index.js +0 -55
- package/dist/tools/line/component.d.ts +0 -124
- package/dist/tools/line/component.js +0 -72
- package/dist/tools/line/index.d.ts +0 -13
- package/dist/tools/line/index.js +0 -6
- package/dist/tools/parabola/component.d.ts +0 -16
- package/dist/tools/parabola/component.js +0 -14
- package/dist/tools/parabola/index.d.ts +0 -20
- package/dist/tools/parabola/index.js +0 -32
- package/dist/tools/point/component.d.ts +0 -50
- package/dist/tools/point/component.js +0 -85
- package/dist/tools/point/index.d.ts +0 -15
- package/dist/tools/point/index.js +0 -13
- package/dist/tools/polygon/component.d.ts +0 -120
- package/dist/tools/polygon/component.js +0 -262
- package/dist/tools/polygon/index.d.ts +0 -19
- package/dist/tools/polygon/index.js +0 -55
- package/dist/tools/polygon/line.d.ts +0 -125
- package/dist/tools/polygon/line.js +0 -63
- package/dist/tools/polygon/polygon.d.ts +0 -122
- package/dist/tools/polygon/polygon.js +0 -74
- package/dist/tools/ray/component.d.ts +0 -101
- package/dist/tools/ray/component.js +0 -71
- package/dist/tools/ray/index.d.ts +0 -13
- package/dist/tools/ray/index.js +0 -6
- package/dist/tools/segment/component.d.ts +0 -100
- package/dist/tools/segment/component.js +0 -52
- package/dist/tools/segment/index.d.ts +0 -13
- package/dist/tools/segment/index.js +0 -6
- package/dist/tools/shared/arrow-head.d.ts +0 -51
- package/dist/tools/shared/arrow-head.js +0 -63
- package/dist/tools/shared/icons/CorrectSVG.d.ts +0 -26
- package/dist/tools/shared/icons/CorrectSVG.js +0 -29
- package/dist/tools/shared/icons/IncorrectSVG.d.ts +0 -26
- package/dist/tools/shared/icons/IncorrectSVG.js +0 -27
- package/dist/tools/shared/icons/MissingSVG.d.ts +0 -26
- package/dist/tools/shared/icons/MissingSVG.js +0 -28
- package/dist/tools/shared/line/index.d.ts +0 -245
- package/dist/tools/shared/line/index.js +0 -319
- package/dist/tools/shared/line/line-path.d.ts +0 -57
- package/dist/tools/shared/line/line-path.js +0 -71
- package/dist/tools/shared/line/with-root-edge.d.ts +0 -142
- package/dist/tools/shared/line/with-root-edge.js +0 -73
- package/dist/tools/shared/point/arrow-point.d.ts +0 -56
- package/dist/tools/shared/point/arrow-point.js +0 -41
- package/dist/tools/shared/point/arrow.d.ts +0 -45
- package/dist/tools/shared/point/arrow.js +0 -35
- package/dist/tools/shared/point/base-point.d.ts +0 -52
- package/dist/tools/shared/point/base-point.js +0 -103
- package/dist/tools/shared/point/index.d.ts +0 -216
- package/dist/tools/shared/point/index.js +0 -45
- package/dist/tools/shared/styles.d.ts +0 -29
- package/dist/tools/shared/styles.js +0 -20
- package/dist/tools/shared/types.d.ts +0 -21
- package/dist/tools/shared/types.js +0 -11
- package/dist/tools/sine/component.d.ts +0 -16
- package/dist/tools/sine/component.js +0 -22
- package/dist/tools/sine/index.d.ts +0 -20
- package/dist/tools/sine/index.js +0 -32
- package/dist/tools/vector/component.d.ts +0 -100
- package/dist/tools/vector/component.js +0 -44
- package/dist/tools/vector/index.d.ts +0 -13
- package/dist/tools/vector/index.js +0 -6
- package/dist/undo-redo.d.ts +0 -22
- package/dist/undo-redo.js +0 -47
- package/dist/use-debounce.d.ts +0 -9
- package/dist/use-debounce.js +0 -13
- package/dist/utils.d.ts +0 -61
- package/dist/utils.js +0 -75
|
@@ -1,88 +0,0 @@
|
|
|
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;
|
|
@@ -1,154 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
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;
|
package/dist/graph.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { isDuplicatedMark as e } from "./utils.js";
|
|
2
|
-
import t, { AxisPropTypes as n } from "./axis/axes.js";
|
|
3
|
-
import r from "./grid.js";
|
|
4
|
-
import { LabelType as i } from "./labels.js";
|
|
5
|
-
import a from "./bg.js";
|
|
6
|
-
import o from "react";
|
|
7
|
-
import s from "prop-types";
|
|
8
|
-
import { cloneDeep as c, isEqual as l } from "@pie-element/shared-lodash";
|
|
9
|
-
import { Root as u, createGraphProps as d, types as f } from "@pie-lib/plot";
|
|
10
|
-
import p from "debug";
|
|
11
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
-
//#region src/graph.tsx
|
|
13
|
-
var g = p("pie-lib:graphing:graph"), _ = {
|
|
14
|
-
axesSettings: s.shape(n),
|
|
15
|
-
backgroundMarks: s.array,
|
|
16
|
-
className: s.string,
|
|
17
|
-
collapsibleToolbar: s.bool,
|
|
18
|
-
collapsibleToolbarTitle: s.string,
|
|
19
|
-
disabledLabels: s.bool,
|
|
20
|
-
disabledTitle: s.bool,
|
|
21
|
-
domain: f.DomainType,
|
|
22
|
-
labels: s.shape(i),
|
|
23
|
-
labelModeEnabled: s.bool,
|
|
24
|
-
coordinatesOnHover: s.bool,
|
|
25
|
-
marks: s.array,
|
|
26
|
-
onChangeLabels: s.func,
|
|
27
|
-
onChangeMarks: s.func,
|
|
28
|
-
onChangeTitle: s.func,
|
|
29
|
-
range: f.DomainType,
|
|
30
|
-
size: s.shape({
|
|
31
|
-
width: s.number.isRequired,
|
|
32
|
-
height: s.number.isRequired
|
|
33
|
-
}),
|
|
34
|
-
showLabels: s.bool,
|
|
35
|
-
showPixelGuides: s.bool,
|
|
36
|
-
showTitle: s.bool,
|
|
37
|
-
title: s.string,
|
|
38
|
-
tools: s.array,
|
|
39
|
-
limitLabeling: s.bool
|
|
40
|
-
}, v = (e) => ({
|
|
41
|
-
x: -23,
|
|
42
|
-
y: -23,
|
|
43
|
-
width: e.width + 46,
|
|
44
|
-
height: e.height + 46
|
|
45
|
-
}), y = ({ marks: e, currentTool: t, onChangeMarks: n, removeIncompleteTool: r }) => {
|
|
46
|
-
let i = e.filter((e) => e.building)[0], a = c(e);
|
|
47
|
-
if (i && t && i.type !== t.type) {
|
|
48
|
-
let e = a.findIndex((e) => l(e, i));
|
|
49
|
-
e >= 0 && a.splice(e, 1);
|
|
50
|
-
}
|
|
51
|
-
return r && !l(a, e) && n(a), a;
|
|
52
|
-
}, b = class extends o.Component {
|
|
53
|
-
constructor(e) {
|
|
54
|
-
super(e), this.maskUid = this.generateMaskId();
|
|
55
|
-
}
|
|
56
|
-
static propTypes = {
|
|
57
|
-
..._,
|
|
58
|
-
currentTool: s.object
|
|
59
|
-
};
|
|
60
|
-
static defaultProps = {
|
|
61
|
-
onChangeMarks: () => {},
|
|
62
|
-
disabledLabels: !1,
|
|
63
|
-
disabledTitle: !1
|
|
64
|
-
};
|
|
65
|
-
state = {};
|
|
66
|
-
_justDragged = !1;
|
|
67
|
-
startDrag = () => {
|
|
68
|
-
this._justDragged = !1;
|
|
69
|
-
};
|
|
70
|
-
stopDrag = () => {
|
|
71
|
-
this._justDragged = !0, setTimeout(() => {
|
|
72
|
-
this._justDragged = !1;
|
|
73
|
-
}, 300);
|
|
74
|
-
};
|
|
75
|
-
generateMaskId() {
|
|
76
|
-
return "graph-" + (Math.random() * 1e4).toFixed();
|
|
77
|
-
}
|
|
78
|
-
componentDidMount = () => this.setState({ labelNode: this.labelNode });
|
|
79
|
-
changeMark = (t, n) => {
|
|
80
|
-
let { onChangeMarks: r, marks: i } = this.props, a = c(i), o = a.findIndex((e) => l(e, t));
|
|
81
|
-
o >= 0 && !e(n, i, t) && (a.splice(o, 1, n), r(a));
|
|
82
|
-
};
|
|
83
|
-
completeMark = (e) => {
|
|
84
|
-
let { currentTool: t, marks: n } = this.props, r = n.filter((e) => e.building)[0];
|
|
85
|
-
if (!r || !t) return;
|
|
86
|
-
let i = t.complete(r, e);
|
|
87
|
-
this.updateMarks(r, i);
|
|
88
|
-
};
|
|
89
|
-
updateMarks = (t, n, r = !1) => {
|
|
90
|
-
let { onChangeMarks: i, marks: a } = this.props, o = c(a);
|
|
91
|
-
if (!n || !n.building && e(n, a)) return;
|
|
92
|
-
let s = o.findIndex((e) => l(e, t));
|
|
93
|
-
s >= 0 ? (o.splice(s, 1, n), i(o)) : r && i([...o, n]);
|
|
94
|
-
};
|
|
95
|
-
getComponent = (e) => {
|
|
96
|
-
if (!e) return null;
|
|
97
|
-
let t = (this.props.tools || []).find((t) => t.type === e.type);
|
|
98
|
-
return t && t.Component || null;
|
|
99
|
-
};
|
|
100
|
-
onBgClick = (e) => {
|
|
101
|
-
let { x: t, y: n } = e || {}, { labelModeEnabled: r, currentTool: i, marks: a } = this.props;
|
|
102
|
-
if (this._justDragged || r || !i || [null, void 0].includes(t) || [null, void 0].includes(n)) return;
|
|
103
|
-
g("[onBgClick] x,y: ", t, n);
|
|
104
|
-
let o = a.filter((e) => e.building)[0], s;
|
|
105
|
-
s = o && i && o.type === i.type ? i.addPoint({
|
|
106
|
-
x: t,
|
|
107
|
-
y: n
|
|
108
|
-
}, { ...o }) : i.addPoint({
|
|
109
|
-
x: t,
|
|
110
|
-
y: n
|
|
111
|
-
}, void 0), this.updateMarks(o, s, !0);
|
|
112
|
-
};
|
|
113
|
-
render() {
|
|
114
|
-
let { axesSettings: e, currentTool: n, coordinatesOnHover: i, size: o, disabledLabels: s, disabledTitle: c, domain: l, backgroundMarks: f, range: p, title: g, labels: _, labelModeEnabled: b, labelsPlaceholders: x, limitLabeling: S, showLabels: C, showPixelGuides: w, showTitle: T, titlePlaceholder: E, onChangeLabels: D, onChangeTitle: O, mathMlOptions: k = {}, onChangeMarks: A, removeIncompleteTool: j } = this.props, { marks: M } = this.props, N = d(l, p, o, () => this.rootNode), P = v(o), F = {
|
|
115
|
-
graphProps: N,
|
|
116
|
-
labelModeEnabled: b,
|
|
117
|
-
limitLabeling: S
|
|
118
|
-
};
|
|
119
|
-
return M = y({
|
|
120
|
-
marks: M || [],
|
|
121
|
-
currentTool: n,
|
|
122
|
-
onChangeMarks: A,
|
|
123
|
-
removeIncompleteTool: j
|
|
124
|
-
}), /* @__PURE__ */ m(u, {
|
|
125
|
-
rootRef: (e) => this.rootNode = e,
|
|
126
|
-
disabledTitle: c,
|
|
127
|
-
disabledLabels: s,
|
|
128
|
-
labels: _,
|
|
129
|
-
labelsPlaceholders: x || {},
|
|
130
|
-
showPixelGuides: w,
|
|
131
|
-
showLabels: C,
|
|
132
|
-
showTitle: T,
|
|
133
|
-
title: g,
|
|
134
|
-
titlePlaceholder: E,
|
|
135
|
-
onChangeTitle: O,
|
|
136
|
-
onChangeLabels: D,
|
|
137
|
-
mathMlOptions: k,
|
|
138
|
-
...F,
|
|
139
|
-
children: /* @__PURE__ */ h("g", {
|
|
140
|
-
transform: l && l.padding && l.range ? `translate(${l.padding}, ${p.padding})` : void 0,
|
|
141
|
-
children: [
|
|
142
|
-
/* @__PURE__ */ m(r, { ...F }),
|
|
143
|
-
/* @__PURE__ */ m(t, {
|
|
144
|
-
...e,
|
|
145
|
-
...F
|
|
146
|
-
}),
|
|
147
|
-
/* @__PURE__ */ m(a, {
|
|
148
|
-
...o,
|
|
149
|
-
onClick: this.onBgClick,
|
|
150
|
-
...F
|
|
151
|
-
}),
|
|
152
|
-
/* @__PURE__ */ h("mask", {
|
|
153
|
-
id: `${this.maskUid}`,
|
|
154
|
-
children: [/* @__PURE__ */ m("rect", {
|
|
155
|
-
...P,
|
|
156
|
-
fill: "white"
|
|
157
|
-
}), " "]
|
|
158
|
-
}),
|
|
159
|
-
/* @__PURE__ */ h("g", {
|
|
160
|
-
id: "marks",
|
|
161
|
-
mask: `url('#${this.maskUid}')`,
|
|
162
|
-
children: [
|
|
163
|
-
(f || []).map((e, t) => {
|
|
164
|
-
let n = this.getComponent(e), r = e.type;
|
|
165
|
-
return /* @__PURE__ */ m(n, {
|
|
166
|
-
mark: {
|
|
167
|
-
...e,
|
|
168
|
-
disabled: !0,
|
|
169
|
-
isBackground: !0
|
|
170
|
-
},
|
|
171
|
-
labelNode: this.state.labelNode,
|
|
172
|
-
onClick: this.onBgClick,
|
|
173
|
-
...F
|
|
174
|
-
}, `${r}-${t}-bg`);
|
|
175
|
-
}),
|
|
176
|
-
M.map((e, t) => {
|
|
177
|
-
let r = this.getComponent(e), a = e.type;
|
|
178
|
-
return /* @__PURE__ */ m(r, {
|
|
179
|
-
mark: e,
|
|
180
|
-
coordinatesOnHover: i,
|
|
181
|
-
onChange: this.changeMark,
|
|
182
|
-
onComplete: this.completeMark,
|
|
183
|
-
onClick: this.onBgClick,
|
|
184
|
-
onDragStart: this.startDrag,
|
|
185
|
-
onDragStop: this.stopDrag,
|
|
186
|
-
labelNode: this.state.labelNode,
|
|
187
|
-
isToolActive: n && a === n.type,
|
|
188
|
-
...F
|
|
189
|
-
}, `${a}-${t}`);
|
|
190
|
-
}),
|
|
191
|
-
/* @__PURE__ */ m("foreignObject", {
|
|
192
|
-
ref: (e) => this.labelNode = e,
|
|
193
|
-
x: "0",
|
|
194
|
-
y: "0",
|
|
195
|
-
...o,
|
|
196
|
-
style: {
|
|
197
|
-
pointerEvents: "none",
|
|
198
|
-
fontSize: "14px"
|
|
199
|
-
}
|
|
200
|
-
})
|
|
201
|
-
]
|
|
202
|
-
})
|
|
203
|
-
]
|
|
204
|
-
})
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
//#endregion
|
|
209
|
-
export { b as default, _ as graphPropTypes };
|
package/dist/grid-setup.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/graphing/src/grid-setup.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
declare const GridSetup: {
|
|
12
|
-
(props: any): React.JSX.Element;
|
|
13
|
-
propTypes: {
|
|
14
|
-
domain: PropTypes.Requireable<object>;
|
|
15
|
-
displayedFields: PropTypes.Requireable<object>;
|
|
16
|
-
gridValues: PropTypes.Requireable<object>;
|
|
17
|
-
includeAxes: PropTypes.Requireable<boolean>;
|
|
18
|
-
labelValues: PropTypes.Requireable<object>;
|
|
19
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
-
onChangeView: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
-
range: PropTypes.Requireable<object>;
|
|
22
|
-
size: PropTypes.Requireable<object>;
|
|
23
|
-
sizeConstraints: PropTypes.Requireable<object>;
|
|
24
|
-
standardGrid: PropTypes.Requireable<boolean>;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export default GridSetup;
|