@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
package/lib/container/actions.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.changeMarks = exports.addMark = void 0;
|
|
7
|
-
var addMark = exports.addMark = function addMark() {
|
|
8
|
-
return {
|
|
9
|
-
type: 'ADD_MARK'
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
var changeMarks = exports.changeMarks = function changeMarks(marks) {
|
|
13
|
-
return {
|
|
14
|
-
type: 'CHANGE_MARKS',
|
|
15
|
-
marks: marks
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","names":["addMark","exports","type","changeMarks","marks"],"sources":["../../src/container/actions.js"],"sourcesContent":["export const addMark = () => ({\n type: 'ADD_MARK',\n});\n\nexport const changeMarks = (marks) => ({\n type: 'CHANGE_MARKS',\n marks,\n});\n"],"mappings":";;;;;;AAAO,IAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAVA,OAAOA,CAAA;EAAA,OAAU;IAC5BE,IAAI,EAAE;EACR,CAAC;AAAA,CAAC;AAEK,IAAMC,WAAW,GAAAF,OAAA,CAAAE,WAAA,GAAG,SAAdA,WAAWA,CAAIC,KAAK;EAAA,OAAM;IACrCF,IAAI,EAAE,cAAc;IACpBE,KAAK,EAALA;EACF,CAAC;AAAA,CAAC","ignoreList":[]}
|
package/lib/container/index.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.GraphContainer = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _reactRedux = require("react-redux");
|
|
17
|
-
var _react = _interopRequireDefault(require("react"));
|
|
18
|
-
var _redux = require("redux");
|
|
19
|
-
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
20
|
-
var _actions = require("./actions");
|
|
21
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
|
-
var _lodashEs = require("lodash-es");
|
|
23
|
-
var _reduxUndo = require("redux-undo");
|
|
24
|
-
var _graphWithControls = _interopRequireDefault(require("../graph-with-controls"));
|
|
25
|
-
var _middleware = require("./middleware");
|
|
26
|
-
var _excluded = ["onChangeMarks", "marks"];
|
|
27
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
29
|
-
var mapStateToProps = function mapStateToProps(s) {
|
|
30
|
-
return {
|
|
31
|
-
marks: s.marks.present
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
35
|
-
return {
|
|
36
|
-
onChangeMarks: function onChangeMarks(m) {
|
|
37
|
-
return dispatch((0, _actions.changeMarks)(m));
|
|
38
|
-
},
|
|
39
|
-
onUndo: function onUndo() {
|
|
40
|
-
return dispatch(_reduxUndo.ActionCreators.undo());
|
|
41
|
-
},
|
|
42
|
-
onRedo: function onRedo() {
|
|
43
|
-
return dispatch(_reduxUndo.ActionCreators.redo());
|
|
44
|
-
},
|
|
45
|
-
onReset: function onReset() {
|
|
46
|
-
return dispatch((0, _actions.changeMarks)([]));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
var GraphContainer = exports.GraphContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_graphWithControls["default"]);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The graph component entry point with undo/redo
|
|
54
|
-
* Redux is an implementation detail, hide it in the react component.
|
|
55
|
-
*/
|
|
56
|
-
var Root = /*#__PURE__*/function (_React$Component) {
|
|
57
|
-
function Root(props) {
|
|
58
|
-
var _this;
|
|
59
|
-
(0, _classCallCheck2["default"])(this, Root);
|
|
60
|
-
_this = _callSuper(this, Root, [props]);
|
|
61
|
-
(0, _defineProperty2["default"])(_this, "onStoreChange", function () {
|
|
62
|
-
var _this$props = _this.props,
|
|
63
|
-
marks = _this$props.marks,
|
|
64
|
-
onChangeMarks = _this$props.onChangeMarks;
|
|
65
|
-
var storeState = _this.store.getState();
|
|
66
|
-
if (!(0, _lodashEs.isEqual)(storeState.marks.present, marks)) {
|
|
67
|
-
onChangeMarks(storeState.marks.present);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
var r = (0, _reducer["default"])();
|
|
71
|
-
_this.store = (0, _redux.createStore)(r, {
|
|
72
|
-
marks: props.marks
|
|
73
|
-
}, (0, _redux.applyMiddleware)(_middleware.lastActionMiddleware));
|
|
74
|
-
_this.store.subscribe(_this.onStoreChange);
|
|
75
|
-
return _this;
|
|
76
|
-
}
|
|
77
|
-
(0, _inherits2["default"])(Root, _React$Component);
|
|
78
|
-
return (0, _createClass2["default"])(Root, [{
|
|
79
|
-
key: "componentDidUpdate",
|
|
80
|
-
value: function componentDidUpdate(prevProps) {
|
|
81
|
-
var marks = this.props.marks;
|
|
82
|
-
var storeState = this.store.getState();
|
|
83
|
-
if ((0, _lodashEs.isEqual)(storeState.marks.present, marks)) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (!(0, _lodashEs.isEqual)(prevProps.marks, marks)) {
|
|
87
|
-
this.store.dispatch((0, _actions.changeMarks)(marks));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: "render",
|
|
92
|
-
value: function render() {
|
|
93
|
-
// eslint-disable-next-line no-unused-vars
|
|
94
|
-
var _this$props2 = this.props,
|
|
95
|
-
onChangeMarks = _this$props2.onChangeMarks,
|
|
96
|
-
marks = _this$props2.marks,
|
|
97
|
-
rest = (0, _objectWithoutProperties2["default"])(_this$props2, _excluded);
|
|
98
|
-
var correctnessSet = marks && marks.find(function (m) {
|
|
99
|
-
return m.correctness;
|
|
100
|
-
});
|
|
101
|
-
if (correctnessSet) {
|
|
102
|
-
return /*#__PURE__*/_react["default"].createElement(_graphWithControls["default"], (0, _extends2["default"])({}, rest, {
|
|
103
|
-
marks: marks,
|
|
104
|
-
disabled: correctnessSet
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
return /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
|
|
108
|
-
store: this.store
|
|
109
|
-
}, /*#__PURE__*/_react["default"].createElement(GraphContainer, rest));
|
|
110
|
-
}
|
|
111
|
-
}]);
|
|
112
|
-
}(_react["default"].Component);
|
|
113
|
-
(0, _defineProperty2["default"])(Root, "propTypes", {
|
|
114
|
-
onChangeMarks: _propTypes["default"].func,
|
|
115
|
-
marks: _propTypes["default"].array
|
|
116
|
-
});
|
|
117
|
-
var _default = exports["default"] = Root;
|
|
118
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_reactRedux","require","_react","_interopRequireDefault","_redux","_reducer","_actions","_propTypes","_lodashEs","_reduxUndo","_graphWithControls","_middleware","_excluded","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","mapStateToProps","s","marks","present","mapDispatchToProps","dispatch","onChangeMarks","m","changeMarks","onUndo","ActionCreators","undo","onRedo","redo","onReset","GraphContainer","exports","connect","GraphWithControls","Root","_React$Component","props","_this","_classCallCheck2","_defineProperty2","_this$props","storeState","store","getState","isEqual","r","reducer","createStore","applyMiddleware","lastActionMiddleware","subscribe","onStoreChange","_inherits2","_createClass2","key","value","componentDidUpdate","prevProps","render","_this$props2","rest","_objectWithoutProperties2","correctnessSet","find","correctness","createElement","_extends2","disabled","Provider","React","Component","PropTypes","func","array","_default"],"sources":["../../src/container/index.jsx"],"sourcesContent":["import { connect, Provider } from 'react-redux';\nimport React from 'react';\nimport { applyMiddleware, createStore } from 'redux';\nimport reducer from './reducer';\nimport { changeMarks } from './actions';\nimport PropTypes from 'prop-types';\nimport { isEqual } from 'lodash-es';\nimport { ActionCreators } from 'redux-undo';\nimport GraphWithControls from '../graph-with-controls';\nimport { lastActionMiddleware } from './middleware';\n\nconst mapStateToProps = (s) => ({\n marks: s.marks.present,\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n onChangeMarks: (m) => dispatch(changeMarks(m)),\n onUndo: () => dispatch(ActionCreators.undo()),\n onRedo: () => dispatch(ActionCreators.redo()),\n onReset: () => dispatch(changeMarks([])),\n});\n\nexport const GraphContainer = connect(mapStateToProps, mapDispatchToProps)(GraphWithControls);\n\n/**\n * The graph component entry point with undo/redo\n * Redux is an implementation detail, hide it in the react component.\n */\nclass Root extends React.Component {\n static propTypes = {\n onChangeMarks: PropTypes.func,\n marks: PropTypes.array,\n };\n\n constructor(props) {\n super(props);\n\n const r = reducer();\n this.store = createStore(r, { marks: props.marks }, applyMiddleware(lastActionMiddleware));\n\n this.store.subscribe(this.onStoreChange);\n }\n\n componentDidUpdate(prevProps) {\n const { marks } = this.props;\n const storeState = this.store.getState();\n\n if (isEqual(storeState.marks.present, marks)) {\n return;\n }\n\n if (!isEqual(prevProps.marks, marks)) {\n this.store.dispatch(changeMarks(marks));\n }\n }\n\n onStoreChange = () => {\n const { marks, onChangeMarks } = this.props;\n const storeState = this.store.getState();\n\n if (!isEqual(storeState.marks.present, marks)) {\n onChangeMarks(storeState.marks.present);\n }\n };\n\n render() {\n // eslint-disable-next-line no-unused-vars\n const { onChangeMarks, marks, ...rest } = this.props;\n const correctnessSet = marks && marks.find((m) => m.correctness);\n\n if (correctnessSet) {\n return <GraphWithControls {...rest} marks={marks} disabled={correctnessSet} />;\n }\n\n return (\n <Provider store={this.store}>\n <GraphContainer {...rest} />\n </Provider>\n );\n }\n}\n\nexport default Root;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAAoD,IAAAW,SAAA;AAAA,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBA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|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var marks = function marks() {
|
|
8
|
-
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9
|
-
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
10
|
-
switch (action.type) {
|
|
11
|
-
case 'CHANGE_MARKS':
|
|
12
|
-
if (Array.isArray(action.marks)) {
|
|
13
|
-
return action.marks;
|
|
14
|
-
} else {
|
|
15
|
-
throw new Error('marks must be an array');
|
|
16
|
-
}
|
|
17
|
-
default:
|
|
18
|
-
return state;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
var _default = exports["default"] = marks;
|
|
22
|
-
//# sourceMappingURL=marks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marks.js","names":["marks","state","arguments","length","undefined","action","type","Array","isArray","Error","_default","exports"],"sources":["../../src/container/marks.js"],"sourcesContent":["const marks = (state = [], action) => {\n switch (action.type) {\n case 'CHANGE_MARKS':\n if (Array.isArray(action.marks)) {\n return action.marks;\n } else {\n throw new Error('marks must be an array');\n }\n default:\n return state;\n }\n};\n\nexport default marks;\n"],"mappings":";;;;;;AAAA,IAAMA,KAAK,GAAG,SAARA,KAAKA,CAAA,EAA2B;EAAA,IAAvBC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IAAEG,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAC/B,QAAQC,MAAM,CAACC,IAAI;IACjB,KAAK,cAAc;MACjB,IAAIC,KAAK,CAACC,OAAO,CAACH,MAAM,CAACL,KAAK,CAAC,EAAE;QAC/B,OAAOK,MAAM,CAACL,KAAK;MACrB,CAAC,MAAM;QACL,MAAM,IAAIS,KAAK,CAAC,wBAAwB,CAAC;MAC3C;IACF;MACE,OAAOR,KAAK;EAChB;AACF,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,cAEaX,KAAK","ignoreList":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.lastActionMiddleware = exports.getLastAction = void 0;
|
|
7
|
-
var lastAction = null;
|
|
8
|
-
var getLastAction = exports.getLastAction = function getLastAction() {
|
|
9
|
-
return lastAction;
|
|
10
|
-
};
|
|
11
|
-
var lastActionMiddleware = exports.lastActionMiddleware = function lastActionMiddleware() {
|
|
12
|
-
return function (next) {
|
|
13
|
-
return function (action) {
|
|
14
|
-
lastAction = action;
|
|
15
|
-
return next(action);
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=middleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","names":["lastAction","getLastAction","exports","lastActionMiddleware","next","action"],"sources":["../../src/container/middleware.js"],"sourcesContent":["let lastAction = null;\nexport const getLastAction = () => lastAction;\n\nexport const lastActionMiddleware = () => (next) => (action) => {\n lastAction = action;\n return next(action);\n};\n"],"mappings":";;;;;;AAAA,IAAIA,UAAU,GAAG,IAAI;AACd,IAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAAhBA,aAAaA,CAAA;EAAA,OAASD,UAAU;AAAA;AAEtC,IAAMG,oBAAoB,GAAAD,OAAA,CAAAC,oBAAA,GAAG,SAAvBA,oBAAoBA,CAAA;EAAA,OAAS,UAACC,IAAI;IAAA,OAAK,UAACC,MAAM,EAAK;MAC9DL,UAAU,GAAGK,MAAM;MACnB,OAAOD,IAAI,CAACC,MAAM,CAAC;IACrB,CAAC;EAAA;AAAA","ignoreList":[]}
|
package/lib/container/reducer.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _redux = require("redux");
|
|
9
|
-
var _marks = _interopRequireDefault(require("./marks"));
|
|
10
|
-
var _reduxUndo = _interopRequireDefault(require("redux-undo"));
|
|
11
|
-
var _default = exports["default"] = function _default() {
|
|
12
|
-
return (0, _redux.combineReducers)({
|
|
13
|
-
marks: (0, _reduxUndo["default"])(_marks["default"], {
|
|
14
|
-
debug: false
|
|
15
|
-
})
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.js","names":["_redux","require","_marks","_interopRequireDefault","_reduxUndo","_default","exports","combineReducers","marks","undoable","debug"],"sources":["../../src/container/reducer.js"],"sourcesContent":["import { combineReducers } from 'redux';\nimport marks from './marks';\nimport undoable from 'redux-undo';\n\nexport default () => combineReducers({ marks: undoable(marks, { debug: false }) });\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAkC,IAAAI,QAAA,GAAAC,OAAA,cAEnB,SAAAD,SAAA;EAAA,OAAM,IAAAE,sBAAe,EAAC;IAAEC,KAAK,EAAE,IAAAC,qBAAQ,EAACD,iBAAK,EAAE;MAAEE,KAAK,EAAE;IAAM,CAAC;EAAE,CAAC,CAAC;AAAA","ignoreList":[]}
|
package/lib/coordinates-label.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getLabelPosition = exports["default"] = exports.CoordinatesLabel = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _plot = require("@pie-lib/plot");
|
|
12
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
13
|
-
var _styles = require("@mui/material/styles");
|
|
14
|
-
var _InputBase = _interopRequireDefault(require("@mui/material/InputBase"));
|
|
15
|
-
var _utils = require("./utils");
|
|
16
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
-
var StyledInputBase = (0, _styles.styled)(_InputBase["default"])(function (_ref) {
|
|
19
|
-
var theme = _ref.theme;
|
|
20
|
-
return {
|
|
21
|
-
fontFamily: theme.typography.fontFamily,
|
|
22
|
-
fontSize: theme.typography.fontSize,
|
|
23
|
-
borderRadius: '8px',
|
|
24
|
-
background: theme.palette.common.white,
|
|
25
|
-
color: _renderUi.color.defaults.PRIMARY_DARK,
|
|
26
|
-
'& .MuiInputBase-input': {
|
|
27
|
-
padding: 0
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line react/prop-types
|
|
33
|
-
var getLabelPosition = exports.getLabelPosition = function getLabelPosition(graphProps, x, y, labelLength) {
|
|
34
|
-
var scale = graphProps.scale,
|
|
35
|
-
domain = graphProps.domain,
|
|
36
|
-
range = graphProps.range;
|
|
37
|
-
// treat corner cases for maximum and minimum
|
|
38
|
-
var topShift = y === range.min ? 16 : y === range.max ? 0 : 8;
|
|
39
|
-
var leftShift = 10;
|
|
40
|
-
var rightEdge = scale.x(x) + labelLength + leftShift;
|
|
41
|
-
if (rightEdge >= scale.x(domain.max)) {
|
|
42
|
-
return {
|
|
43
|
-
left: scale.x(x) - leftShift - labelLength,
|
|
44
|
-
top: scale.y(y) - topShift
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
left: scale.x(x) + leftShift,
|
|
49
|
-
top: scale.y(y) - topShift
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
var CoordinatesLabel = exports.CoordinatesLabel = function CoordinatesLabel(_ref2) {
|
|
53
|
-
var x = _ref2.x,
|
|
54
|
-
y = _ref2.y,
|
|
55
|
-
graphProps = _ref2.graphProps;
|
|
56
|
-
var label = "(".concat((0, _utils.roundNumber)(x), ", ").concat((0, _utils.roundNumber)(y), ")");
|
|
57
|
-
var labelLength = (label.length || 0) * 6;
|
|
58
|
-
var labelPosition = getLabelPosition(graphProps, x, y, labelLength);
|
|
59
|
-
var style = _objectSpread({
|
|
60
|
-
position: 'absolute',
|
|
61
|
-
pointerEvents: 'auto',
|
|
62
|
-
width: labelLength,
|
|
63
|
-
padding: 0
|
|
64
|
-
}, labelPosition);
|
|
65
|
-
return /*#__PURE__*/_react["default"].createElement(StyledInputBase, {
|
|
66
|
-
style: style,
|
|
67
|
-
value: label,
|
|
68
|
-
inputProps: {
|
|
69
|
-
ariaLabel: 'naked'
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
CoordinatesLabel.propTypes = {
|
|
74
|
-
graphProps: _plot.types.GraphPropsType,
|
|
75
|
-
x: _propTypes["default"].number,
|
|
76
|
-
y: _propTypes["default"].number
|
|
77
|
-
};
|
|
78
|
-
var _default = exports["default"] = CoordinatesLabel;
|
|
79
|
-
//# sourceMappingURL=coordinates-label.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coordinates-label.js","names":["_react","_interopRequireDefault","require","_propTypes","_plot","_renderUi","_styles","_InputBase","_utils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","StyledInputBase","styled","InputBase","_ref","theme","fontFamily","typography","fontSize","borderRadius","background","palette","common","white","color","defaults","PRIMARY_DARK","padding","getLabelPosition","exports","graphProps","x","y","labelLength","scale","domain","range","topShift","min","max","leftShift","rightEdge","left","top","CoordinatesLabel","_ref2","label","concat","roundNumber","labelPosition","style","position","pointerEvents","width","createElement","value","inputProps","ariaLabel","propTypes","types","GraphPropsType","PropTypes","number","_default"],"sources":["../src/coordinates-label.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport { color } from '@pie-lib/render-ui';\nimport { styled } from '@mui/material/styles';\nimport InputBase from '@mui/material/InputBase';\nimport { roundNumber } from './utils';\n\nconst StyledInputBase = styled(InputBase)(({ theme }) => ({\n fontFamily: theme.typography.fontFamily,\n fontSize: theme.typography.fontSize,\n borderRadius: '8px',\n background: theme.palette.common.white,\n color: color.defaults.PRIMARY_DARK,\n '& .MuiInputBase-input': {\n padding: 0,\n },\n}));\n\n// eslint-disable-next-line react/prop-types\nexport const getLabelPosition = (graphProps, x, y, labelLength) => {\n const { scale, domain, range } = graphProps;\n // treat corner cases for maximum and minimum\n const topShift = y === range.min ? 16 : y === range.max ? 0 : 8;\n const leftShift = 10;\n const rightEdge = scale.x(x) + labelLength + leftShift;\n\n if (rightEdge >= scale.x(domain.max)) {\n return {\n left: scale.x(x) - leftShift - labelLength,\n top: scale.y(y) - topShift,\n };\n }\n\n return {\n left: scale.x(x) + leftShift,\n top: scale.y(y) - topShift,\n };\n};\n\nexport const CoordinatesLabel = ({ x, y, graphProps }) => {\n const label = `(${roundNumber(x)}, ${roundNumber(y)})`;\n const labelLength = (label.length || 0) * 6;\n const labelPosition = getLabelPosition(graphProps, x, y, labelLength);\n\n const style = {\n position: 'absolute',\n pointerEvents: 'auto',\n width: labelLength,\n padding: 0,\n ...labelPosition,\n };\n\n return <StyledInputBase style={style} value={label} inputProps={{ ariaLabel: 'naked' }} />;\n};\n\nCoordinatesLabel.propTypes = {\n graphProps: types.GraphPropsType,\n x: PropTypes.number,\n y: PropTypes.number,\n};\n\nexport default CoordinatesLabel;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAsC,SAAAO,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ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UAAU,EAAEC,CAAC,EAAEC,CAAC,EAAEC,WAAW,CAAC;EAErE,IAAMiB,KAAK,GAAA/C,aAAA;IACTgD,QAAQ,EAAE,UAAU;IACpBC,aAAa,EAAE,MAAM;IACrBC,KAAK,EAAEpB,WAAW;IAClBN,OAAO,EAAE;EAAC,GACPsB,aAAa,CACjB;EAED,oBAAOpE,MAAA,YAAAyE,aAAA,CAAC3C,eAAe;IAACuC,KAAK,EAAEA,KAAM;IAACK,KAAK,EAAET,KAAM;IAACU,UAAU,EAAE;MAAEC,SAAS,EAAE;IAAQ;EAAE,CAAE,CAAC;AAC5F,CAAC;AAEDb,gBAAgB,CAACc,SAAS,GAAG;EAC3B5B,UAAU,EAAE6B,WAAK,CAACC,cAAc;EAChC7B,CAAC,EAAE8B,qBAAS,CAACC,MAAM;EACnB9B,CAAC,EAAE6B,qBAAS,CAACC;AACf,CAAC;AAAC,IAAAC,QAAA,GAAAlC,OAAA,cAEae,gBAAgB","ignoreList":[]}
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.toolIsAvailable = exports.setToolbarAvailability = exports.getAvailableTool = exports.filterByVisibleToolTypes = exports.filterByValidToolTypes = exports["default"] = exports.GraphWithControls = void 0;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
var _styles = require("@mui/material/styles");
|
|
18
|
-
var _lodashEs = require("lodash-es");
|
|
19
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
20
|
-
var _toolMenu = _interopRequireDefault(require("./tool-menu"));
|
|
21
|
-
var _graph = _interopRequireWildcard(require("./graph"));
|
|
22
|
-
var _undoRedo = _interopRequireDefault(require("./undo-redo"));
|
|
23
|
-
var _tools = require("./tools");
|
|
24
|
-
var _material = require("@mui/material");
|
|
25
|
-
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
26
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
27
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
29
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
|
-
var StyledGraphContainer = (0, _styles.styled)('div')({
|
|
32
|
-
display: 'flex',
|
|
33
|
-
flexDirection: 'column',
|
|
34
|
-
width: 'min-content'
|
|
35
|
-
});
|
|
36
|
-
var StyledControls = (0, _styles.styled)('div')(function (_ref) {
|
|
37
|
-
var theme = _ref.theme;
|
|
38
|
-
return {
|
|
39
|
-
display: 'flex',
|
|
40
|
-
justifyContent: 'space-between',
|
|
41
|
-
padding: theme.spacing(1),
|
|
42
|
-
color: _renderUi.color.text(),
|
|
43
|
-
backgroundColor: _renderUi.color.primaryLight(),
|
|
44
|
-
'& button': {
|
|
45
|
-
fontSize: theme.typography.fontSize
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
var StyledAccordion = (0, _styles.styled)(_material.Accordion)({
|
|
50
|
-
backgroundColor: _renderUi.color.primaryLight(),
|
|
51
|
-
width: '100%'
|
|
52
|
-
});
|
|
53
|
-
var StyledAccordionSummary = (0, _styles.styled)(_material.AccordionSummary)(function (_ref2) {
|
|
54
|
-
var theme = _ref2.theme;
|
|
55
|
-
return {
|
|
56
|
-
padding: "0 ".concat(theme.spacing(1)),
|
|
57
|
-
minHeight: '32px !important',
|
|
58
|
-
'& .MuiAccordionSummary-content': {
|
|
59
|
-
margin: '4px 0 !important'
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
var StyledAccordionDetails = (0, _styles.styled)(_material.AccordionDetails)(function (_ref3) {
|
|
64
|
-
var theme = _ref3.theme;
|
|
65
|
-
return {
|
|
66
|
-
padding: 0,
|
|
67
|
-
marginTop: theme.spacing(1),
|
|
68
|
-
display: 'flex',
|
|
69
|
-
justifyContent: 'space-between'
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
var setToolbarAvailability = exports.setToolbarAvailability = function setToolbarAvailability(toolbarTools) {
|
|
73
|
-
return _tools.toolsArr.map(function (tA) {
|
|
74
|
-
return _objectSpread(_objectSpread({}, tA), {}, {
|
|
75
|
-
toolbar: !!toolbarTools.find(function (t) {
|
|
76
|
-
return t === tA.type;
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
}) || [];
|
|
80
|
-
};
|
|
81
|
-
var toolIsAvailable = exports.toolIsAvailable = function toolIsAvailable(tools, currentTool) {
|
|
82
|
-
return currentTool && tools && (tools.find(function (tool) {
|
|
83
|
-
return tool.type === currentTool.type;
|
|
84
|
-
}) || {}).toolbar;
|
|
85
|
-
};
|
|
86
|
-
var getAvailableTool = exports.getAvailableTool = function getAvailableTool(tools) {
|
|
87
|
-
return tools.find(function (tool) {
|
|
88
|
-
return tool.toolbar;
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
var filterByValidToolTypes = exports.filterByValidToolTypes = function filterByValidToolTypes(backgroundMarks) {
|
|
92
|
-
return backgroundMarks.filter(function (bM) {
|
|
93
|
-
return !!_tools.allTools.find(function (tool) {
|
|
94
|
-
return tool === bM.type;
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
var filterByVisibleToolTypes = exports.filterByVisibleToolTypes = function filterByVisibleToolTypes(toolbarTools, marks) {
|
|
99
|
-
return marks.filter(function (bM) {
|
|
100
|
-
return !!toolbarTools.find(function (tool) {
|
|
101
|
-
return tool === bM.type;
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
var getDefaultCurrentTool = function getDefaultCurrentTool(toolType) {
|
|
106
|
-
return _tools.toolsArr.find(function (tool) {
|
|
107
|
-
return tool.type === toolType;
|
|
108
|
-
}) || null;
|
|
109
|
-
};
|
|
110
|
-
var Collapsible = function Collapsible(_ref4) {
|
|
111
|
-
var children = _ref4.children,
|
|
112
|
-
title = _ref4.title;
|
|
113
|
-
return /*#__PURE__*/_react["default"].createElement(StyledAccordion, {
|
|
114
|
-
elevation: 0,
|
|
115
|
-
disableGutters: true,
|
|
116
|
-
square: true,
|
|
117
|
-
TransitionProps: {
|
|
118
|
-
timeout: {
|
|
119
|
-
enter: 225,
|
|
120
|
-
exit: 195
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledAccordionSummary, {
|
|
124
|
-
expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null)
|
|
125
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
|
|
126
|
-
variant: "subheading"
|
|
127
|
-
}, title)), /*#__PURE__*/_react["default"].createElement(StyledAccordionDetails, null, children));
|
|
128
|
-
};
|
|
129
|
-
Collapsible.propTypes = {
|
|
130
|
-
children: _propTypes["default"].array,
|
|
131
|
-
title: _propTypes["default"].string
|
|
132
|
-
};
|
|
133
|
-
var GraphWithControls = exports.GraphWithControls = /*#__PURE__*/function (_React$Component) {
|
|
134
|
-
function GraphWithControls(props) {
|
|
135
|
-
var _this;
|
|
136
|
-
(0, _classCallCheck2["default"])(this, GraphWithControls);
|
|
137
|
-
_this = _callSuper(this, GraphWithControls, [props]);
|
|
138
|
-
(0, _defineProperty2["default"])(_this, "changeCurrentTool", function (tool, tools) {
|
|
139
|
-
return _this.setState({
|
|
140
|
-
currentTool: tools.find(function (t) {
|
|
141
|
-
return t.type === tool;
|
|
142
|
-
}),
|
|
143
|
-
labelModeEnabled: tool === 'label'
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
_this.state = {
|
|
147
|
-
currentTool: getDefaultCurrentTool(props.defaultTool),
|
|
148
|
-
labelModeEnabled: false
|
|
149
|
-
};
|
|
150
|
-
return _this;
|
|
151
|
-
}
|
|
152
|
-
(0, _inherits2["default"])(GraphWithControls, _React$Component);
|
|
153
|
-
return (0, _createClass2["default"])(GraphWithControls, [{
|
|
154
|
-
key: "componentDidUpdate",
|
|
155
|
-
value: function componentDidUpdate(prevProps) {
|
|
156
|
-
var defaultTool = this.props.defaultTool;
|
|
157
|
-
if (prevProps.defaultTool !== defaultTool) {
|
|
158
|
-
var currentTool = getDefaultCurrentTool(defaultTool);
|
|
159
|
-
this.setState({
|
|
160
|
-
currentTool: currentTool
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}, {
|
|
165
|
-
key: "render",
|
|
166
|
-
value: function render() {
|
|
167
|
-
var _this2 = this;
|
|
168
|
-
var _this$state = this.state,
|
|
169
|
-
currentTool = _this$state.currentTool,
|
|
170
|
-
labelModeEnabled = _this$state.labelModeEnabled;
|
|
171
|
-
var _this$props = this.props,
|
|
172
|
-
axesSettings = _this$props.axesSettings,
|
|
173
|
-
className = _this$props.className,
|
|
174
|
-
coordinatesOnHover = _this$props.coordinatesOnHover,
|
|
175
|
-
collapsibleToolbar = _this$props.collapsibleToolbar,
|
|
176
|
-
collapsibleToolbarTitle = _this$props.collapsibleToolbarTitle,
|
|
177
|
-
disabled = _this$props.disabled,
|
|
178
|
-
disabledLabels = _this$props.disabledLabels,
|
|
179
|
-
disabledTitle = _this$props.disabledTitle,
|
|
180
|
-
domain = _this$props.domain,
|
|
181
|
-
draggableTools = _this$props.draggableTools,
|
|
182
|
-
labels = _this$props.labels,
|
|
183
|
-
labelsPlaceholders = _this$props.labelsPlaceholders,
|
|
184
|
-
onChangeLabels = _this$props.onChangeLabels,
|
|
185
|
-
onChangeMarks = _this$props.onChangeMarks,
|
|
186
|
-
onChangeTitle = _this$props.onChangeTitle,
|
|
187
|
-
onChangeTools = _this$props.onChangeTools,
|
|
188
|
-
onUndo = _this$props.onUndo,
|
|
189
|
-
onRedo = _this$props.onRedo,
|
|
190
|
-
onReset = _this$props.onReset,
|
|
191
|
-
range = _this$props.range,
|
|
192
|
-
size = _this$props.size,
|
|
193
|
-
showLabels = _this$props.showLabels,
|
|
194
|
-
showPixelGuides = _this$props.showPixelGuides,
|
|
195
|
-
showTitle = _this$props.showTitle,
|
|
196
|
-
title = _this$props.title,
|
|
197
|
-
titlePlaceholder = _this$props.titlePlaceholder,
|
|
198
|
-
language = _this$props.language,
|
|
199
|
-
removeIncompleteTool = _this$props.removeIncompleteTool,
|
|
200
|
-
limitLabeling = _this$props.limitLabeling;
|
|
201
|
-
var _this$props2 = this.props,
|
|
202
|
-
backgroundMarks = _this$props2.backgroundMarks,
|
|
203
|
-
marks = _this$props2.marks,
|
|
204
|
-
toolbarTools = _this$props2.toolbarTools;
|
|
205
|
-
|
|
206
|
-
// make sure only valid tool types are kept (string) and without duplicates
|
|
207
|
-
toolbarTools = (0, _lodashEs.uniq)(toolbarTools || []).filter(function (tT) {
|
|
208
|
-
return !!(0, _lodashEs.isString)(tT);
|
|
209
|
-
}) || [];
|
|
210
|
-
|
|
211
|
-
// keep only the backgroundMarks that have valid types
|
|
212
|
-
backgroundMarks = filterByValidToolTypes(backgroundMarks || []);
|
|
213
|
-
|
|
214
|
-
// keep only the marks that have types which appear in toolbar
|
|
215
|
-
marks = filterByVisibleToolTypes(toolbarTools, marks || []);
|
|
216
|
-
var tools = setToolbarAvailability(toolbarTools);
|
|
217
|
-
|
|
218
|
-
// set current tool if there's no current tool or if the existing one is no longer available
|
|
219
|
-
if (!currentTool || !toolIsAvailable(tools, currentTool)) {
|
|
220
|
-
currentTool = getAvailableTool(tools);
|
|
221
|
-
}
|
|
222
|
-
var graphActions = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_toolMenu["default"], {
|
|
223
|
-
currentToolType: currentTool && currentTool.type,
|
|
224
|
-
disabled: !!disabled,
|
|
225
|
-
draggableTools: draggableTools,
|
|
226
|
-
labelModeEnabled: labelModeEnabled,
|
|
227
|
-
onChange: function onChange(tool) {
|
|
228
|
-
return _this2.changeCurrentTool(tool, tools);
|
|
229
|
-
},
|
|
230
|
-
toolbarTools: toolbarTools,
|
|
231
|
-
onChangeTools: onChangeTools,
|
|
232
|
-
language: language
|
|
233
|
-
}), !disabled && /*#__PURE__*/_react["default"].createElement(_undoRedo["default"], {
|
|
234
|
-
onUndo: onUndo,
|
|
235
|
-
onRedo: onRedo,
|
|
236
|
-
onReset: onReset,
|
|
237
|
-
language: language
|
|
238
|
-
}));
|
|
239
|
-
return /*#__PURE__*/_react["default"].createElement(StyledGraphContainer, {
|
|
240
|
-
className: className
|
|
241
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledControls, null, collapsibleToolbar ? /*#__PURE__*/_react["default"].createElement(Collapsible, {
|
|
242
|
-
title: collapsibleToolbarTitle
|
|
243
|
-
}, graphActions) : graphActions), /*#__PURE__*/_react["default"].createElement("div", {
|
|
244
|
-
ref: function ref(r) {
|
|
245
|
-
return _this2.labelNode = r;
|
|
246
|
-
}
|
|
247
|
-
}), /*#__PURE__*/_react["default"].createElement(_graph["default"], {
|
|
248
|
-
axesSettings: axesSettings,
|
|
249
|
-
backgroundMarks: backgroundMarks,
|
|
250
|
-
coordinatesOnHover: coordinatesOnHover,
|
|
251
|
-
currentTool: currentTool,
|
|
252
|
-
disabledLabels: disabledLabels,
|
|
253
|
-
disabledTitle: disabledTitle,
|
|
254
|
-
domain: domain,
|
|
255
|
-
labels: labels,
|
|
256
|
-
labelModeEnabled: labelModeEnabled,
|
|
257
|
-
labelsPlaceholders: labelsPlaceholders,
|
|
258
|
-
marks: marks,
|
|
259
|
-
onChangeMarks: !disabled ? onChangeMarks : undefined,
|
|
260
|
-
onChangeLabels: onChangeLabels,
|
|
261
|
-
onChangeTitle: onChangeTitle,
|
|
262
|
-
range: range,
|
|
263
|
-
size: size,
|
|
264
|
-
showLabels: showLabels,
|
|
265
|
-
showPixelGuides: showPixelGuides,
|
|
266
|
-
showTitle: showTitle,
|
|
267
|
-
title: title,
|
|
268
|
-
titlePlaceholder: titlePlaceholder,
|
|
269
|
-
tools: tools,
|
|
270
|
-
removeIncompleteTool: removeIncompleteTool,
|
|
271
|
-
limitLabeling: limitLabeling
|
|
272
|
-
}));
|
|
273
|
-
}
|
|
274
|
-
}]);
|
|
275
|
-
}(_react["default"].Component);
|
|
276
|
-
(0, _defineProperty2["default"])(GraphWithControls, "propTypes", _objectSpread(_objectSpread({}, _graph.graphPropTypes), {}, {
|
|
277
|
-
onUndo: _propTypes["default"].func,
|
|
278
|
-
onRedo: _propTypes["default"].func,
|
|
279
|
-
onReset: _propTypes["default"].func,
|
|
280
|
-
toolbarTools: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
281
|
-
// array of tool types that have to be displayed in the toolbar, same shape as 'allTools'
|
|
282
|
-
language: _propTypes["default"].string
|
|
283
|
-
}));
|
|
284
|
-
(0, _defineProperty2["default"])(GraphWithControls, "defaultProps", {
|
|
285
|
-
collapsibleToolbar: false,
|
|
286
|
-
collapsibleToolbarTitle: '',
|
|
287
|
-
disabledLabels: false,
|
|
288
|
-
disabledTitle: false,
|
|
289
|
-
showLabels: true,
|
|
290
|
-
showTitle: true,
|
|
291
|
-
toolbarTools: []
|
|
292
|
-
});
|
|
293
|
-
var _default = exports["default"] = GraphWithControls;
|
|
294
|
-
//# sourceMappingURL=graph-with-controls.js.map
|