@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
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { lineBase, lineToolComponent, styles } from '../shared/line';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { ArrowMarker, genUid } from '../shared/arrow-head';
|
|
5
|
-
import { trig, types } from '@pie-lib/plot';
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import { getAdjustedGraphLimits, thinnerShapesNeeded } from '../../utils';
|
|
8
|
-
import { styled } from '@mui/material/styles';
|
|
9
|
-
|
|
10
|
-
const StyledRayRoot = styled('g')(({ theme, disabled, correctness }) => ({
|
|
11
|
-
'& line:not(.hit-area)': {
|
|
12
|
-
...styles.line(theme),
|
|
13
|
-
...(disabled && styles.disabledSecondary(theme)),
|
|
14
|
-
...(correctness === 'correct' && styles.correct(theme, 'stroke')),
|
|
15
|
-
...(correctness === 'incorrect' && styles.incorrect(theme, 'stroke')),
|
|
16
|
-
...(correctness === 'missing' && styles.missing(theme, 'stroke')),
|
|
17
|
-
},
|
|
18
|
-
'& .enabledArrow': {
|
|
19
|
-
...styles.arrow(theme),
|
|
20
|
-
},
|
|
21
|
-
'& .disabledArrow': {
|
|
22
|
-
...styles.disabledArrow(theme),
|
|
23
|
-
},
|
|
24
|
-
'& .correctArrow': {
|
|
25
|
-
...styles.correct(theme),
|
|
26
|
-
},
|
|
27
|
-
'& .incorrectArrow': {
|
|
28
|
-
...styles.incorrect(theme),
|
|
29
|
-
},
|
|
30
|
-
'& .missingArrow': {
|
|
31
|
-
...styles.missing(theme),
|
|
32
|
-
},
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
export const RayLine = (props) => {
|
|
36
|
-
const markerId = genUid();
|
|
37
|
-
const { graphProps, from, to, disabled, correctness, className, markerId: propMarkerId, ...rest } = props;
|
|
38
|
-
const { scale } = graphProps;
|
|
39
|
-
const { domain, range } = getAdjustedGraphLimits(graphProps);
|
|
40
|
-
const [aToB] = trig.edges(domain, range)(from, to);
|
|
41
|
-
const suffix = correctness || (disabled && 'disabled') || 'enabled';
|
|
42
|
-
const finalMarkerId = propMarkerId || markerId;
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<StyledRayRoot disabled={disabled} correctness={correctness}>
|
|
46
|
-
<defs>
|
|
47
|
-
<ArrowMarker
|
|
48
|
-
size={thinnerShapesNeeded(graphProps) ? 4 : 5}
|
|
49
|
-
id={`${finalMarkerId}-${suffix}`}
|
|
50
|
-
className={classNames(
|
|
51
|
-
suffix === 'enabled' ? 'enabledArrow' : suffix === 'disabled' ? 'disabledArrow' : `${suffix}Arrow`,
|
|
52
|
-
)}
|
|
53
|
-
/>
|
|
54
|
-
</defs>
|
|
55
|
-
{/* Transparent wider line captures pointer events (+2px each side) */}
|
|
56
|
-
<line
|
|
57
|
-
x1={scale.x(from.x)}
|
|
58
|
-
y1={scale.y(from.y)}
|
|
59
|
-
x2={scale.x(aToB.x)}
|
|
60
|
-
y2={scale.y(aToB.y)}
|
|
61
|
-
className="hit-area"
|
|
62
|
-
stroke="transparent"
|
|
63
|
-
strokeWidth={7}
|
|
64
|
-
style={{ cursor: 'pointer', pointerEvents: 'stroke' }}
|
|
65
|
-
/>
|
|
66
|
-
<line
|
|
67
|
-
x1={scale.x(from.x)}
|
|
68
|
-
y1={scale.y(from.y)}
|
|
69
|
-
x2={scale.x(aToB.x)}
|
|
70
|
-
y2={scale.y(aToB.y)}
|
|
71
|
-
className={className}
|
|
72
|
-
markerEnd={`url(#${finalMarkerId}-${suffix})`}
|
|
73
|
-
{...rest}
|
|
74
|
-
/>
|
|
75
|
-
</StyledRayRoot>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
RayLine.propTypes = {
|
|
80
|
-
className: PropTypes.string,
|
|
81
|
-
disabled: PropTypes.bool,
|
|
82
|
-
correctness: PropTypes.string,
|
|
83
|
-
graphProps: PropTypes.any,
|
|
84
|
-
from: types.PointType,
|
|
85
|
-
to: types.PointType,
|
|
86
|
-
markerId: PropTypes.string,
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const Ray = lineBase(RayLine);
|
|
90
|
-
const Component = lineToolComponent(Ray);
|
|
91
|
-
|
|
92
|
-
export default Component;
|
package/src/tools/ray/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { render } from '@pie-lib/test-utils';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Line } from '../component';
|
|
4
|
-
import { graphProps as getGraphProps } from '../../../__tests__/utils';
|
|
5
|
-
import { utils } from '@pie-lib/plot';
|
|
6
|
-
|
|
7
|
-
const { xy } = utils;
|
|
8
|
-
describe('Line', () => {
|
|
9
|
-
let onChange = jest.fn();
|
|
10
|
-
const renderComponent = (extras) => {
|
|
11
|
-
const defaults = {
|
|
12
|
-
classes: {},
|
|
13
|
-
className: 'className',
|
|
14
|
-
onChange,
|
|
15
|
-
graphProps: getGraphProps(),
|
|
16
|
-
from: xy(0, 0),
|
|
17
|
-
to: xy(1, 1),
|
|
18
|
-
};
|
|
19
|
-
const props = { ...defaults, ...extras };
|
|
20
|
-
return render(<Line {...props} />);
|
|
21
|
-
};
|
|
22
|
-
describe('rendering', () => {
|
|
23
|
-
it('renders without crashing', () => {
|
|
24
|
-
const { container } = renderComponent();
|
|
25
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { lineBase, lineToolComponent, styles } from '../shared/line';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { types } from '@pie-lib/plot';
|
|
5
|
-
import { styled } from '@mui/material/styles';
|
|
6
|
-
|
|
7
|
-
const StyledLineRoot = styled('line')(({ theme, disabled, correctness }) => ({
|
|
8
|
-
...styles.line(theme),
|
|
9
|
-
...(disabled && {
|
|
10
|
-
...styles.disabled(theme),
|
|
11
|
-
...styles.disabledSecondary(theme),
|
|
12
|
-
}),
|
|
13
|
-
...(correctness === 'correct' && styles.correct(theme, 'stroke')),
|
|
14
|
-
...(correctness === 'incorrect' && styles.incorrect(theme, 'stroke')),
|
|
15
|
-
...(correctness === 'missing' && styles.missing(theme, 'stroke')),
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
export const Line = (props) => {
|
|
19
|
-
const { className, correctness, disabled, graphProps, from, to, ...rest } = props;
|
|
20
|
-
const { scale } = graphProps;
|
|
21
|
-
const x1 = scale.x(from.x);
|
|
22
|
-
const y1 = scale.y(from.y);
|
|
23
|
-
const x2 = scale.x(to.x);
|
|
24
|
-
const y2 = scale.y(to.y);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<g>
|
|
28
|
-
{/* Transparent wider line captures pointer events (+2px each side) */}
|
|
29
|
-
<line
|
|
30
|
-
className="hit-area"
|
|
31
|
-
x1={x1}
|
|
32
|
-
y1={y1}
|
|
33
|
-
x2={x2}
|
|
34
|
-
y2={y2}
|
|
35
|
-
stroke="transparent"
|
|
36
|
-
strokeWidth={7}
|
|
37
|
-
style={{ cursor: 'pointer', pointerEvents: 'stroke' }}
|
|
38
|
-
/>
|
|
39
|
-
<StyledLineRoot
|
|
40
|
-
x1={x1}
|
|
41
|
-
y1={y1}
|
|
42
|
-
x2={x2}
|
|
43
|
-
y2={y2}
|
|
44
|
-
className={className}
|
|
45
|
-
disabled={disabled}
|
|
46
|
-
correctness={correctness}
|
|
47
|
-
{...rest}
|
|
48
|
-
/>
|
|
49
|
-
</g>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
Line.propTypes = {
|
|
54
|
-
className: PropTypes.string,
|
|
55
|
-
correctness: PropTypes.string,
|
|
56
|
-
disabled: PropTypes.bool,
|
|
57
|
-
graphProps: PropTypes.any,
|
|
58
|
-
from: types.PointType,
|
|
59
|
-
to: types.PointType,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const Segment = lineBase(Line);
|
|
63
|
-
const Component = lineToolComponent(Segment);
|
|
64
|
-
|
|
65
|
-
export default Component;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { render } from '@pie-lib/test-utils';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ArrowHead, ArrowMarker } from '../arrow-head';
|
|
4
|
-
|
|
5
|
-
describe('ArrowHead', () => {
|
|
6
|
-
const renderComponent = (extras) => {
|
|
7
|
-
const defaults = { size: 10, transform: '' };
|
|
8
|
-
const props = { ...defaults, ...extras };
|
|
9
|
-
return render(<ArrowHead {...props} />);
|
|
10
|
-
};
|
|
11
|
-
describe('rendering', () => {
|
|
12
|
-
it('renders without crashing', () => {
|
|
13
|
-
const { container } = renderComponent();
|
|
14
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
describe('ArrowMarker', () => {
|
|
20
|
-
const renderComponent = (extras) => {
|
|
21
|
-
const defaults = { id: 'id', size: 10, className: 'className' };
|
|
22
|
-
const props = { ...defaults, ...extras };
|
|
23
|
-
return render(<ArrowMarker {...props} />);
|
|
24
|
-
};
|
|
25
|
-
describe('rendering', () => {
|
|
26
|
-
it('renders without crashing', () => {
|
|
27
|
-
const { container } = renderComponent();
|
|
28
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
4
|
-
import { color } from '@pie-lib/render-ui';
|
|
5
|
-
|
|
6
|
-
const StyledArrowHead = styled('polygon')(({ disabled, correctness }) => ({
|
|
7
|
-
fill: color.defaults.BLACK,
|
|
8
|
-
...(disabled && {
|
|
9
|
-
fill: color.disabledSecondary(),
|
|
10
|
-
}),
|
|
11
|
-
...(correctness === 'correct' && {
|
|
12
|
-
fill: color.correctWithIcon(),
|
|
13
|
-
}),
|
|
14
|
-
...(correctness === 'incorrect' && {
|
|
15
|
-
fill: color.incorrectWithIcon(),
|
|
16
|
-
}),
|
|
17
|
-
...(correctness === 'missing' && {
|
|
18
|
-
fill: color.missingWithIcon(),
|
|
19
|
-
}),
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
const StyledMarker = styled('marker')(({ disabled, correctness }) => ({
|
|
23
|
-
'& polygon': {
|
|
24
|
-
fill: color.defaults.BLACK,
|
|
25
|
-
...(disabled && {
|
|
26
|
-
fill: color.disabledSecondary(),
|
|
27
|
-
}),
|
|
28
|
-
...(correctness === 'correct' && {
|
|
29
|
-
fill: color.correctWithIcon(),
|
|
30
|
-
}),
|
|
31
|
-
...(correctness === 'incorrect' && {
|
|
32
|
-
fill: color.incorrectWithIcon(),
|
|
33
|
-
}),
|
|
34
|
-
...(correctness === 'missing' && {
|
|
35
|
-
fill: color.missingWithIcon(),
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
export const ArrowHead = ({ size, transform, points, disabled, correctness }) => (
|
|
41
|
-
<StyledArrowHead
|
|
42
|
-
points={points || `0,0 ${size},${size / 2} 0,${size}`}
|
|
43
|
-
transform={transform}
|
|
44
|
-
disabled={disabled}
|
|
45
|
-
correctness={correctness}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
ArrowHead.propTypes = {
|
|
49
|
-
points: PropTypes.string,
|
|
50
|
-
size: PropTypes.number,
|
|
51
|
-
transform: PropTypes.string,
|
|
52
|
-
disabled: PropTypes.bool,
|
|
53
|
-
correctness: PropTypes.string,
|
|
54
|
-
};
|
|
55
|
-
ArrowHead.defaultProps = {
|
|
56
|
-
points: '',
|
|
57
|
-
size: 10,
|
|
58
|
-
transform: '',
|
|
59
|
-
};
|
|
60
|
-
export const genUid = () => {
|
|
61
|
-
const v = (Math.random() * 1000).toFixed(0);
|
|
62
|
-
return `arrow-${v}`;
|
|
63
|
-
};
|
|
64
|
-
export const ArrowMarker = ({ id, size, className, disabled, correctness }) => {
|
|
65
|
-
// Parse styling info from className if provided (for backward compatibility)
|
|
66
|
-
const isDisabled = disabled || className?.includes('disabled');
|
|
67
|
-
const parsedCorrectness =
|
|
68
|
-
correctness ||
|
|
69
|
-
(className?.includes('incorrect')
|
|
70
|
-
? 'incorrect'
|
|
71
|
-
: className?.includes('correct')
|
|
72
|
-
? 'correct'
|
|
73
|
-
: className?.includes('missing')
|
|
74
|
-
? 'missing'
|
|
75
|
-
: null);
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<StyledMarker
|
|
79
|
-
id={id}
|
|
80
|
-
viewBox={`0 0 ${size} ${size}`}
|
|
81
|
-
refX={size / 2}
|
|
82
|
-
refY={size / 2}
|
|
83
|
-
markerWidth={size}
|
|
84
|
-
markerHeight={size}
|
|
85
|
-
orient="auto-start-reverse"
|
|
86
|
-
disabled={isDisabled}
|
|
87
|
-
correctness={parsedCorrectness}
|
|
88
|
-
>
|
|
89
|
-
<ArrowHead size={size} disabled={isDisabled} correctness={parsedCorrectness} />
|
|
90
|
-
</StyledMarker>
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
ArrowMarker.propTypes = {
|
|
94
|
-
id: PropTypes.string,
|
|
95
|
-
size: PropTypes.number,
|
|
96
|
-
className: PropTypes.string,
|
|
97
|
-
disabled: PropTypes.bool,
|
|
98
|
-
correctness: PropTypes.string,
|
|
99
|
-
};
|
|
100
|
-
ArrowMarker.defaultProps = {
|
|
101
|
-
size: 5,
|
|
102
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
const CorrectSVG = ({ scale, x, y }) => (
|
|
5
|
-
<svg
|
|
6
|
-
width="11"
|
|
7
|
-
height="13"
|
|
8
|
-
viewBox="0 0 14 14"
|
|
9
|
-
fill="none"
|
|
10
|
-
stroke="#ffffff"
|
|
11
|
-
x={scale.x(x) - 5}
|
|
12
|
-
y={scale.y(y) - 6}
|
|
13
|
-
style={{ pointerEvents: 'none' }}
|
|
14
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
-
>
|
|
16
|
-
<path
|
|
17
|
-
d="M10.1953 2.46875C10.3125 2.35156 10.5 2.35156 10.5938 2.46875L11.2734 3.125C11.3672 3.24219 11.3672 3.42969 11.2734 3.52344L4.24219 10.5547C4.125 10.6719 3.96094 10.6719 3.84375 10.5547L0.703125 7.4375C0.609375 7.32031 0.609375 7.13281 0.703125 7.03906L1.38281 6.35938C1.47656 6.26562 1.66406 6.26562 1.78125 6.35938L4.03125 8.63281L10.1953 2.46875Z"
|
|
18
|
-
fill="white"
|
|
19
|
-
/>
|
|
20
|
-
</svg>
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
CorrectSVG.propTypes = {
|
|
24
|
-
scale: PropTypes.shape({
|
|
25
|
-
x: PropTypes.func,
|
|
26
|
-
y: PropTypes.func,
|
|
27
|
-
}),
|
|
28
|
-
x: PropTypes.number,
|
|
29
|
-
y: PropTypes.number,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default CorrectSVG;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
const IncorrectSVG = ({ scale, x, y }) => (
|
|
5
|
-
<svg
|
|
6
|
-
width="14px"
|
|
7
|
-
height="14px"
|
|
8
|
-
viewBox="0 0 24 24"
|
|
9
|
-
fill="none"
|
|
10
|
-
stroke="#ffffff"
|
|
11
|
-
strokeWidth="2"
|
|
12
|
-
x={scale.x(x) - 7}
|
|
13
|
-
y={scale.y(y) - 7}
|
|
14
|
-
style={{ pointerEvents: 'none' }}
|
|
15
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
-
>
|
|
17
|
-
<path d="M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"></path>
|
|
18
|
-
</svg>
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
IncorrectSVG.propTypes = {
|
|
22
|
-
scale: PropTypes.shape({
|
|
23
|
-
x: PropTypes.func,
|
|
24
|
-
y: PropTypes.func,
|
|
25
|
-
}),
|
|
26
|
-
x: PropTypes.number,
|
|
27
|
-
y: PropTypes.number,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default IncorrectSVG;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
const MissingSVG = ({ scale, x, y }) => (
|
|
5
|
-
<svg
|
|
6
|
-
width="9"
|
|
7
|
-
height="10"
|
|
8
|
-
viewBox="0 0 9 10"
|
|
9
|
-
fill="none"
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
x={scale.x(x) - 4.5}
|
|
12
|
-
y={scale.y(y) - 5}
|
|
13
|
-
style={{ pointerEvents: 'none' }}
|
|
14
|
-
>
|
|
15
|
-
<path
|
|
16
|
-
d="M0.125 3.76562V1.34375C0.125 1.08984 0.320312 0.875 0.59375 0.875H3.01562C3.13281 0.875 3.25 0.992188 3.25 1.10938V1.89062C3.25 2.02734 3.13281 2.125 3.01562 2.125H1.375V3.76562C1.375 3.90234 1.25781 4 1.14062 4H0.359375C0.222656 4 0.125 3.90234 0.125 3.76562ZM5.75 1.10938C5.75 0.992188 5.84766 0.875 5.98438 0.875H8.40625C8.66016 0.875 8.875 1.08984 8.875 1.34375V3.76562C8.875 3.90234 8.75781 4 8.64062 4H7.85938C7.72266 4 7.625 3.90234 7.625 3.76562V2.125H5.98438C5.84766 2.125 5.75 2.02734 5.75 1.89062V1.10938ZM8.64062 6.5C8.75781 6.5 8.875 6.61719 8.875 6.73438V9.15625C8.875 9.42969 8.66016 9.625 8.40625 9.625H5.98438C5.84766 9.625 5.75 9.52734 5.75 9.39062V8.60938C5.75 8.49219 5.84766 8.375 5.98438 8.375H7.625V6.73438C7.625 6.61719 7.72266 6.5 7.85938 6.5H8.64062ZM3.25 9.39062C3.25 9.52734 3.13281 9.625 3.01562 9.625H0.59375C0.320312 9.625 0.125 9.42969 0.125 9.15625V6.73438C0.125 6.61719 0.222656 6.5 0.359375 6.5H1.14062C1.25781 6.5 1.375 6.61719 1.375 6.73438V8.375H3.01562C3.13281 8.375 3.25 8.49219 3.25 8.60938V9.39062Z"
|
|
17
|
-
fill="white"
|
|
18
|
-
/>
|
|
19
|
-
</svg>
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
MissingSVG.propTypes = {
|
|
23
|
-
scale: PropTypes.shape({
|
|
24
|
-
x: PropTypes.func,
|
|
25
|
-
y: PropTypes.func,
|
|
26
|
-
}),
|
|
27
|
-
x: PropTypes.number,
|
|
28
|
-
y: PropTypes.number,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default MissingSVG;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { lineBase, lineTool, lineToolComponent } from '../index';
|
|
2
|
-
import { utils } from '@pie-lib/plot';
|
|
3
|
-
import { render } from '@pie-lib/test-utils';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { graphProps as getGraphProps } from '../../../../__tests__/utils';
|
|
6
|
-
|
|
7
|
-
const { xy } = utils;
|
|
8
|
-
const xyLabel = (x, y, label) => ({ x, y, label });
|
|
9
|
-
|
|
10
|
-
describe('lineTool', () => {
|
|
11
|
-
describe('addPoint', () => {
|
|
12
|
-
let toolbar;
|
|
13
|
-
beforeEach(() => {
|
|
14
|
-
toolbar = lineTool('lineType', () => <div />)();
|
|
15
|
-
});
|
|
16
|
-
it('returns a building mark', () => {
|
|
17
|
-
const result = toolbar.addPoint(xy(1, 1));
|
|
18
|
-
expect(result).toEqual({
|
|
19
|
-
type: 'lineType',
|
|
20
|
-
building: true,
|
|
21
|
-
from: xy(1, 1),
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('returns a complete mark', () => {
|
|
26
|
-
const result = toolbar.addPoint(xy(1, 1), { from: xy(0, 0) });
|
|
27
|
-
expect(result).toEqual({
|
|
28
|
-
building: false,
|
|
29
|
-
from: xy(0, 0),
|
|
30
|
-
to: xy(1, 1),
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('lineToolComponent', () => {
|
|
37
|
-
let Comp;
|
|
38
|
-
let mark;
|
|
39
|
-
let onChange;
|
|
40
|
-
const renderComponent = (extras) => {
|
|
41
|
-
const defaults = {
|
|
42
|
-
mark,
|
|
43
|
-
onChange: jest.fn(),
|
|
44
|
-
graphProps: getGraphProps(),
|
|
45
|
-
};
|
|
46
|
-
const props = { ...defaults, ...extras };
|
|
47
|
-
|
|
48
|
-
return render(<Comp {...props} />);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
beforeEach(() => {
|
|
52
|
-
Comp = lineToolComponent(() => <text />);
|
|
53
|
-
mark = { from: xy(0, 0), to: xy(1, 1) };
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
describe('rendering', () => {
|
|
57
|
-
it('renders without crashing', () => {
|
|
58
|
-
const { container } = renderComponent();
|
|
59
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe('lineBase', () => {
|
|
65
|
-
let Comp;
|
|
66
|
-
let onChange = jest.fn();
|
|
67
|
-
let changeMarkProps = jest.fn();
|
|
68
|
-
|
|
69
|
-
beforeEach(() => {
|
|
70
|
-
Comp = lineBase(() => <text />);
|
|
71
|
-
onChange.mockClear();
|
|
72
|
-
changeMarkProps.mockClear();
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
const renderComponent = (extras) => {
|
|
76
|
-
const defaults = {
|
|
77
|
-
onChange,
|
|
78
|
-
changeMarkProps,
|
|
79
|
-
graphProps: getGraphProps(),
|
|
80
|
-
from: xy(0, 0),
|
|
81
|
-
to: xy(1, 1),
|
|
82
|
-
};
|
|
83
|
-
const props = { ...defaults, ...extras };
|
|
84
|
-
|
|
85
|
-
return render(<Comp {...props} />);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// used to test items that have labels attached to points
|
|
89
|
-
const labelNode = document.createElement('foreignObject');
|
|
90
|
-
const renderWithLabels = (extras = {}) =>
|
|
91
|
-
renderComponent({
|
|
92
|
-
...extras,
|
|
93
|
-
labelNode: labelNode,
|
|
94
|
-
from: xyLabel(0, 0, 'A'),
|
|
95
|
-
to: xyLabel(1, 1, 'B'),
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
describe('rendering', () => {
|
|
99
|
-
it('renders without crashing', () => {
|
|
100
|
-
const { container } = renderComponent();
|
|
101
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('renders with labels', () => {
|
|
105
|
-
const { container } = renderWithLabels();
|
|
106
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { render } from '@pie-lib/test-utils';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { graphProps as getGraphProps } from '../../../../__tests__/utils';
|
|
4
|
-
import { utils } from '@pie-lib/plot';
|
|
5
|
-
import * as lineUtils from '../../../../utils';
|
|
6
|
-
|
|
7
|
-
const { xy } = utils;
|
|
8
|
-
|
|
9
|
-
const { bounds, pointsToArea } = lineUtils;
|
|
10
|
-
jest.mock('../../../../utils', () => {
|
|
11
|
-
const a = jest.requireActual('../../../../utils');
|
|
12
|
-
return {
|
|
13
|
-
pointsToArea: jest.fn().mockReturnValue({}),
|
|
14
|
-
bounds: jest.fn().mockReturnValue({}),
|
|
15
|
-
point: a.point,
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
jest.mock('@pie-lib/plot', () => {
|
|
20
|
-
const a = jest.requireActual('@pie-lib/plot');
|
|
21
|
-
return {
|
|
22
|
-
gridDraggable: jest.fn((opts) => jest.fn()),
|
|
23
|
-
types: a.types,
|
|
24
|
-
utils: a.utils,
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('LinePath', () => {
|
|
29
|
-
let LinePath;
|
|
30
|
-
let onChange = jest.fn();
|
|
31
|
-
beforeEach(() => {
|
|
32
|
-
LinePath = require('../line-path').LinePath;
|
|
33
|
-
});
|
|
34
|
-
const renderComponent = (extras) => {
|
|
35
|
-
const defaults = {
|
|
36
|
-
classes: {},
|
|
37
|
-
className: 'className',
|
|
38
|
-
onChange,
|
|
39
|
-
graphProps: getGraphProps(),
|
|
40
|
-
from: xy(0, 0, 0),
|
|
41
|
-
to: xy(1, 1, 0),
|
|
42
|
-
data: [xy(0, 0, 0), xy(1, 1, 0)],
|
|
43
|
-
};
|
|
44
|
-
const props = { ...defaults, ...extras };
|
|
45
|
-
return render(<LinePath {...props} />);
|
|
46
|
-
};
|
|
47
|
-
describe('rendering', () => {
|
|
48
|
-
it('renders without crashing', () => {
|
|
49
|
-
const { container } = renderComponent();
|
|
50
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { render } from '@pie-lib/test-utils';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { rootEdgeComponent, rootEdgeToFromToWrapper } from '../with-root-edge';
|
|
4
|
-
import { graphProps as getGraphProps } from '../../../../__tests__/utils';
|
|
5
|
-
import { utils } from '@pie-lib/plot';
|
|
6
|
-
|
|
7
|
-
const { xy } = utils;
|
|
8
|
-
jest.mock('../index', () => {
|
|
9
|
-
const out = {
|
|
10
|
-
lineBase: jest.fn().mockReturnValue(() => <div />),
|
|
11
|
-
lineToolComponent: jest.fn().mockReturnValue(() => <div />),
|
|
12
|
-
};
|
|
13
|
-
return out;
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
describe('rootEdgeToToFromWrapper', () => {
|
|
17
|
-
let Comp;
|
|
18
|
-
let onChange = jest.fn();
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
Comp = rootEdgeToFromToWrapper(() => <div />);
|
|
21
|
-
});
|
|
22
|
-
const renderComponent = (extras) => {
|
|
23
|
-
const defaults = {
|
|
24
|
-
mark: { root: xy(1, 1), edge: xy(2, 2) },
|
|
25
|
-
onChange,
|
|
26
|
-
};
|
|
27
|
-
const props = { ...defaults, ...extras };
|
|
28
|
-
return render(<Comp {...props} />);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
it('renders without crashing', () => {
|
|
32
|
-
const { container } = renderComponent();
|
|
33
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('passes mark as from/to', () => {
|
|
37
|
-
const { container } = renderComponent();
|
|
38
|
-
// Component transforms root/edge to from/to internally
|
|
39
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('handles onChange with root/edge transformation', () => {
|
|
43
|
-
renderComponent();
|
|
44
|
-
// onChange transformation is tested through component behavior
|
|
45
|
-
expect(onChange).toBeDefined();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe('rootEdgeComponent', () => {
|
|
50
|
-
let onChange = jest.fn();
|
|
51
|
-
let Comp;
|
|
52
|
-
let mark;
|
|
53
|
-
beforeEach(() => {
|
|
54
|
-
mark = { root: xy(0, 0), edge: xy(1, 1) };
|
|
55
|
-
Comp = rootEdgeComponent(() => <text />);
|
|
56
|
-
});
|
|
57
|
-
const renderComponent = (extras) => {
|
|
58
|
-
const defaults = {
|
|
59
|
-
mark,
|
|
60
|
-
graphProps: getGraphProps(),
|
|
61
|
-
onChange,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const props = { ...defaults, ...extras };
|
|
65
|
-
return render(<Comp {...props} />);
|
|
66
|
-
};
|
|
67
|
-
describe('rendering', () => {
|
|
68
|
-
it('renders without crashing', () => {
|
|
69
|
-
const { container } = renderComponent();
|
|
70
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|