@pie-lib/graphing 4.1.0-beta.7 → 5.0.0-next.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +20 -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 +156 -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 +60 -0
- package/dist/mark-label.js +222 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Axis.js +67 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +66 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Ticks.js +39 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +13 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickPosition.js +14 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/Grid.js +43 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridColumns.js +46 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridRows.js +46 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
- package/dist/node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js +17 -0
- package/dist/node_modules/.bun/@visx_point@4.0.0/node_modules/@visx/point/esm/Point.js +20 -0
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +10 -0
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/getTicks.js +7 -0
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Line.js +27 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/LinePath.js +24 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +9 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +6 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/Text.js +27 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/hooks/useText.js +68 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/getStringWidth.js +19 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/memoize.js +13 -0
- package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-shape.js +8 -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/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/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/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 +88 -0
- package/dist/tools/circle/component.js +208 -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 +52 -0
- package/dist/tools/point/component.js +91 -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 +125 -0
- package/dist/tools/polygon/component.js +271 -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 +251 -0
- package/dist/tools/shared/line/index.js +332 -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 +148 -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 +51 -41
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -1469
- package/lib/__tests__/bg.test.js +0 -282
- package/lib/__tests__/bg.test.js.map +0 -1
- package/lib/__tests__/coordinates-label.test.js +0 -276
- package/lib/__tests__/coordinates-label.test.js.map +0 -1
- package/lib/__tests__/graph-with-controls.test.js +0 -275
- package/lib/__tests__/graph-with-controls.test.js.map +0 -1
- package/lib/__tests__/graph.test.js +0 -927
- package/lib/__tests__/graph.test.js.map +0 -1
- package/lib/__tests__/grid-setup.test.js +0 -729
- package/lib/__tests__/grid-setup.test.js.map +0 -1
- package/lib/__tests__/grid.test.js +0 -29
- package/lib/__tests__/grid.test.js.map +0 -1
- package/lib/__tests__/key-legend.test.js +0 -321
- package/lib/__tests__/key-legend.test.js.map +0 -1
- package/lib/__tests__/label-svg-icon.test.js +0 -373
- package/lib/__tests__/label-svg-icon.test.js.map +0 -1
- package/lib/__tests__/labels.test.js +0 -61
- package/lib/__tests__/labels.test.js.map +0 -1
- package/lib/__tests__/mark-label.test.js +0 -133
- package/lib/__tests__/mark-label.test.js.map +0 -1
- package/lib/__tests__/toggle-bar.test.js +0 -197
- package/lib/__tests__/toggle-bar.test.js.map +0 -1
- package/lib/__tests__/tool-menu.test.js +0 -151
- package/lib/__tests__/tool-menu.test.js.map +0 -1
- package/lib/__tests__/undo-redo.test.js +0 -31
- package/lib/__tests__/undo-redo.test.js.map +0 -1
- package/lib/__tests__/use-debounce.test.js +0 -24
- package/lib/__tests__/use-debounce.test.js.map +0 -1
- package/lib/__tests__/utils.js +0 -70
- package/lib/__tests__/utils.js.map +0 -1
- package/lib/__tests__/utils.test.js +0 -123
- package/lib/__tests__/utils.test.js.map +0 -1
- package/lib/axis/__tests__/arrow.test.js +0 -60
- package/lib/axis/__tests__/arrow.test.js.map +0 -1
- package/lib/axis/__tests__/axes.test.js +0 -195
- package/lib/axis/__tests__/axes.test.js.map +0 -1
- 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/__tests__/actions.test.js +0 -108
- package/lib/container/__tests__/actions.test.js.map +0 -1
- package/lib/container/__tests__/index.test.js +0 -503
- package/lib/container/__tests__/index.test.js.map +0 -1
- package/lib/container/__tests__/marks.test.js +0 -259
- package/lib/container/__tests__/marks.test.js.map +0 -1
- package/lib/container/__tests__/middleware.test.js +0 -244
- package/lib/container/__tests__/middleware.test.js.map +0 -1
- package/lib/container/__tests__/reducer.test.js +0 -450
- package/lib/container/__tests__/reducer.test.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 -127
- 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/__tests__/component.test.js +0 -65
- package/lib/tools/absolute/__tests__/component.test.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/__tests__/bg-circle.test.js +0 -33
- package/lib/tools/circle/__tests__/bg-circle.test.js.map +0 -1
- package/lib/tools/circle/__tests__/component.test.js +0 -615
- package/lib/tools/circle/__tests__/component.test.js.map +0 -1
- package/lib/tools/circle/__tests__/index.test.js +0 -576
- package/lib/tools/circle/__tests__/index.test.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/__tests__/component.test.js +0 -64
- package/lib/tools/exponential/__tests__/component.test.js.map +0 -1
- package/lib/tools/exponential/__tests__/index.test.js +0 -828
- package/lib/tools/exponential/__tests__/index.test.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/__tests__/component.test.js +0 -45
- package/lib/tools/line/__tests__/component.test.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/__tests__/component.test.js +0 -64
- package/lib/tools/parabola/__tests__/component.test.js.map +0 -1
- package/lib/tools/parabola/__tests__/index.test.js +0 -564
- package/lib/tools/parabola/__tests__/index.test.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/__tests__/component.test.js +0 -434
- package/lib/tools/point/__tests__/component.test.js.map +0 -1
- package/lib/tools/point/__tests__/index.test.js +0 -262
- package/lib/tools/point/__tests__/index.test.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/__tests__/component.test.js +0 -485
- package/lib/tools/polygon/__tests__/component.test.js.map +0 -1
- package/lib/tools/polygon/__tests__/index.test.js +0 -303
- package/lib/tools/polygon/__tests__/index.test.js.map +0 -1
- package/lib/tools/polygon/__tests__/line.test.js +0 -50
- package/lib/tools/polygon/__tests__/line.test.js.map +0 -1
- package/lib/tools/polygon/__tests__/polygon.test.js +0 -85
- package/lib/tools/polygon/__tests__/polygon.test.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/__tests__/component.test.js +0 -35
- package/lib/tools/ray/__tests__/component.test.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/__tests__/component.test.js +0 -35
- package/lib/tools/segment/__tests__/component.test.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/__tests__/arrow-head.test.js +0 -45
- package/lib/tools/shared/__tests__/arrow-head.test.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/__tests__/index.test.js +0 -124
- package/lib/tools/shared/line/__tests__/index.test.js.map +0 -1
- package/lib/tools/shared/line/__tests__/line-path.test.js +0 -62
- package/lib/tools/shared/line/__tests__/line-path.test.js.map +0 -1
- package/lib/tools/shared/line/__tests__/with-root-edge.test.js +0 -90
- package/lib/tools/shared/line/__tests__/with-root-edge.test.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/__tests__/arrow-point.test.js +0 -127
- package/lib/tools/shared/point/__tests__/arrow-point.test.js.map +0 -1
- package/lib/tools/shared/point/__tests__/base-point.test.js +0 -122
- package/lib/tools/shared/point/__tests__/base-point.test.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/__tests__/component.test.js +0 -72
- package/lib/tools/sine/__tests__/component.test.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/__tests__/component.test.js +0 -32
- package/lib/tools/vector/__tests__/component.test.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 -91
- 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,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
5
|
-
var _testUtils = require("@pie-lib/test-utils");
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
var _withRootEdge = require("../with-root-edge");
|
|
8
|
-
var _utils = require("../../../../__tests__/utils");
|
|
9
|
-
var _plot = require("@pie-lib/plot");
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
var xy = _plot.utils.xy;
|
|
13
|
-
jest.mock('../index', function () {
|
|
14
|
-
var out = {
|
|
15
|
-
lineBase: jest.fn().mockReturnValue(function () {
|
|
16
|
-
return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
17
|
-
}),
|
|
18
|
-
lineToolComponent: jest.fn().mockReturnValue(function () {
|
|
19
|
-
return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
20
|
-
})
|
|
21
|
-
};
|
|
22
|
-
return out;
|
|
23
|
-
});
|
|
24
|
-
describe('rootEdgeToToFromWrapper', function () {
|
|
25
|
-
var Comp;
|
|
26
|
-
var onChange = jest.fn();
|
|
27
|
-
beforeEach(function () {
|
|
28
|
-
Comp = (0, _withRootEdge.rootEdgeToFromToWrapper)(function () {
|
|
29
|
-
return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
var renderComponent = function renderComponent(extras) {
|
|
33
|
-
var defaults = {
|
|
34
|
-
mark: {
|
|
35
|
-
root: xy(1, 1),
|
|
36
|
-
edge: xy(2, 2)
|
|
37
|
-
},
|
|
38
|
-
onChange: onChange
|
|
39
|
-
};
|
|
40
|
-
var props = _objectSpread(_objectSpread({}, defaults), extras);
|
|
41
|
-
return (0, _testUtils.render)(/*#__PURE__*/_react["default"].createElement(Comp, props));
|
|
42
|
-
};
|
|
43
|
-
it('renders without crashing', function () {
|
|
44
|
-
var _renderComponent = renderComponent(),
|
|
45
|
-
container = _renderComponent.container;
|
|
46
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
47
|
-
});
|
|
48
|
-
it('passes mark as from/to', function () {
|
|
49
|
-
var _renderComponent2 = renderComponent(),
|
|
50
|
-
container = _renderComponent2.container;
|
|
51
|
-
// Component transforms root/edge to from/to internally
|
|
52
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
53
|
-
});
|
|
54
|
-
it('handles onChange with root/edge transformation', function () {
|
|
55
|
-
renderComponent();
|
|
56
|
-
// onChange transformation is tested through component behavior
|
|
57
|
-
expect(onChange).toBeDefined();
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
describe('rootEdgeComponent', function () {
|
|
61
|
-
var onChange = jest.fn();
|
|
62
|
-
var Comp;
|
|
63
|
-
var mark;
|
|
64
|
-
beforeEach(function () {
|
|
65
|
-
mark = {
|
|
66
|
-
root: xy(0, 0),
|
|
67
|
-
edge: xy(1, 1)
|
|
68
|
-
};
|
|
69
|
-
Comp = (0, _withRootEdge.rootEdgeComponent)(function () {
|
|
70
|
-
return /*#__PURE__*/_react["default"].createElement("text", null);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
var renderComponent = function renderComponent(extras) {
|
|
74
|
-
var defaults = {
|
|
75
|
-
mark: mark,
|
|
76
|
-
graphProps: (0, _utils.graphProps)(),
|
|
77
|
-
onChange: onChange
|
|
78
|
-
};
|
|
79
|
-
var props = _objectSpread(_objectSpread({}, defaults), extras);
|
|
80
|
-
return (0, _testUtils.render)(/*#__PURE__*/_react["default"].createElement(Comp, props));
|
|
81
|
-
};
|
|
82
|
-
describe('rendering', function () {
|
|
83
|
-
it('renders without crashing', function () {
|
|
84
|
-
var _renderComponent3 = renderComponent(),
|
|
85
|
-
container = _renderComponent3.container;
|
|
86
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
//# sourceMappingURL=with-root-edge.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-root-edge.test.js","names":["_testUtils","require","_react","_interopRequireDefault","_withRootEdge","_utils","_plot","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","xy","utils","jest","mock","out","lineBase","fn","mockReturnValue","createElement","lineToolComponent","describe","Comp","onChange","beforeEach","rootEdgeToFromToWrapper","renderComponent","extras","defaults","mark","root","edge","props","render","it","_renderComponent","container","expect","firstChild","toBeInTheDocument","_renderComponent2","toBeDefined","rootEdgeComponent","graphProps","getGraphProps","_renderComponent3"],"sources":["../../../../../src/tools/shared/line/__tests__/with-root-edge.test.jsx"],"sourcesContent":["import { render } from '@pie-lib/test-utils';\nimport React from 'react';\nimport { rootEdgeComponent, rootEdgeToFromToWrapper } from '../with-root-edge';\nimport { graphProps as getGraphProps } from '../../../../__tests__/utils';\nimport { utils } from '@pie-lib/plot';\n\nconst { xy } = utils;\njest.mock('../index', () => {\n const out = {\n lineBase: jest.fn().mockReturnValue(() => <div />),\n lineToolComponent: jest.fn().mockReturnValue(() => <div />),\n };\n return out;\n});\n\ndescribe('rootEdgeToToFromWrapper', () => {\n let Comp;\n let onChange = jest.fn();\n beforeEach(() => {\n Comp = rootEdgeToFromToWrapper(() => <div />);\n });\n const renderComponent = (extras) => {\n const defaults = {\n mark: { root: xy(1, 1), edge: xy(2, 2) },\n onChange,\n };\n const props = { ...defaults, ...extras };\n return render(<Comp {...props} />);\n };\n\n it('renders without crashing', () => {\n const { container } = renderComponent();\n expect(container.firstChild).toBeInTheDocument();\n });\n\n it('passes mark as from/to', () => {\n const { container } = renderComponent();\n // Component transforms root/edge to from/to internally\n expect(container.firstChild).toBeInTheDocument();\n });\n\n it('handles onChange with root/edge transformation', () => {\n renderComponent();\n // onChange transformation is tested through component behavior\n expect(onChange).toBeDefined();\n });\n});\n\ndescribe('rootEdgeComponent', () => {\n let onChange = jest.fn();\n let Comp;\n let mark;\n beforeEach(() => {\n mark = { root: xy(0, 0), edge: xy(1, 1) };\n Comp = rootEdgeComponent(() => <text />);\n });\n const renderComponent = (extras) => {\n const defaults = {\n mark,\n graphProps: getGraphProps(),\n onChange,\n };\n\n const props = { ...defaults, ...extras };\n return render(<Comp {...props} />);\n };\n describe('rendering', () => {\n it('renders without crashing', () => {\n const { container } = renderComponent();\n expect(container.firstChild).toBeInTheDocument();\n });\n });\n});\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,550 +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.styles = exports.lineToolComponent = exports.lineTool = exports.lineBase = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
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 _lodashEs = require("lodash-es");
|
|
17
|
-
var _point = require("../point");
|
|
18
|
-
var _plot = require("@pie-lib/plot");
|
|
19
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
20
|
-
var _styles = require("../styles");
|
|
21
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
22
|
-
var _markLabel = _interopRequireDefault(require("../../../mark-label"));
|
|
23
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
24
|
-
var _utils = require("../../../utils");
|
|
25
|
-
var _styles2 = require("@mui/material/styles");
|
|
26
|
-
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)); }
|
|
27
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
|
-
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; }
|
|
29
|
-
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; }
|
|
30
|
-
var StyledLineGroup = (0, _styles2.styled)('g')(function (_ref) {
|
|
31
|
-
var disabled = _ref.disabled,
|
|
32
|
-
correctness = _ref.correctness;
|
|
33
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
34
|
-
'& line:not(.hit-area)': {
|
|
35
|
-
fill: 'transparent',
|
|
36
|
-
stroke: _renderUi.color.defaults.BLACK,
|
|
37
|
-
strokeWidth: 3,
|
|
38
|
-
transition: 'stroke 200ms ease-in, stroke-width 200ms ease-in',
|
|
39
|
-
'&:hover': {
|
|
40
|
-
strokeWidth: 6,
|
|
41
|
-
stroke: _renderUi.color.defaults.PRIMARY_DARK
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, disabled && {
|
|
45
|
-
'& line:not(.hit-area)': _objectSpread(_objectSpread({}, (0, _styles.disabledSecondary)('stroke')), {}, {
|
|
46
|
-
strokeWidth: 2
|
|
47
|
-
})
|
|
48
|
-
}), correctness === 'correct' && {
|
|
49
|
-
'& line:not(.hit-area)': _objectSpread({}, (0, _styles.correct)('stroke'))
|
|
50
|
-
}), correctness === 'incorrect' && {
|
|
51
|
-
'& line:not(.hit-area)': _objectSpread({}, (0, _styles.incorrect)('stroke'))
|
|
52
|
-
}), correctness === 'missing' && {
|
|
53
|
-
'& line:not(.hit-area)': _objectSpread(_objectSpread({}, (0, _styles.missing)('stroke')), {}, {
|
|
54
|
-
strokeWidth: 1,
|
|
55
|
-
strokeDasharray: '4 3'
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
var lineTool = exports.lineTool = function lineTool(type, Component) {
|
|
60
|
-
return function () {
|
|
61
|
-
return {
|
|
62
|
-
type: type,
|
|
63
|
-
Component: Component,
|
|
64
|
-
addPoint: function addPoint(point, mark) {
|
|
65
|
-
if (mark && (0, _utils.equalPoints)(mark.root, point)) {
|
|
66
|
-
return mark;
|
|
67
|
-
}
|
|
68
|
-
if (!mark) {
|
|
69
|
-
return {
|
|
70
|
-
type: type,
|
|
71
|
-
building: true,
|
|
72
|
-
from: point
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
if ((0, _utils.equalPoints)(point, mark.from)) {
|
|
76
|
-
return _objectSpread({}, mark);
|
|
77
|
-
}
|
|
78
|
-
return _objectSpread(_objectSpread({}, mark), {}, {
|
|
79
|
-
building: false,
|
|
80
|
-
to: point
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
var lineToolComponent = exports.lineToolComponent = function lineToolComponent(Component) {
|
|
87
|
-
var _LineToolComponent;
|
|
88
|
-
return _LineToolComponent = /*#__PURE__*/function (_React$Component) {
|
|
89
|
-
function LineToolComponent(props) {
|
|
90
|
-
var _this;
|
|
91
|
-
(0, _classCallCheck2["default"])(this, LineToolComponent);
|
|
92
|
-
_this = _callSuper(this, LineToolComponent, [props]);
|
|
93
|
-
(0, _defineProperty2["default"])(_this, "startDrag", function () {
|
|
94
|
-
var onDragStart = _this.props.onDragStart;
|
|
95
|
-
_this.setState({
|
|
96
|
-
mark: _objectSpread({}, _this.props.mark)
|
|
97
|
-
});
|
|
98
|
-
if (onDragStart) onDragStart();
|
|
99
|
-
});
|
|
100
|
-
(0, _defineProperty2["default"])(_this, "stopDrag", function () {
|
|
101
|
-
var _this$props = _this.props,
|
|
102
|
-
onChange = _this$props.onChange,
|
|
103
|
-
mark = _this$props.mark,
|
|
104
|
-
onDragStop = _this$props.onDragStop;
|
|
105
|
-
var update = _objectSpread({}, _this.state.mark);
|
|
106
|
-
_this.setState({
|
|
107
|
-
mark: undefined
|
|
108
|
-
}, function () {
|
|
109
|
-
var type = update.type;
|
|
110
|
-
var shouldNotChange = type && (type === 'parabola' || type === 'sine' || type === 'absolute' || type === 'exponential') && (0, _utils.sameAxes)(update.from, update.to);
|
|
111
|
-
if (!shouldNotChange && type && type === 'exponential' && update.from && update.to) {
|
|
112
|
-
shouldNotChange = update.from.y === 0 || update.to.y === 0 || update.from.y * update.to.y < 0;
|
|
113
|
-
}
|
|
114
|
-
if (!(0, _lodashEs.isEqual)(mark, update) && !shouldNotChange) {
|
|
115
|
-
onChange(mark, update);
|
|
116
|
-
}
|
|
117
|
-
if (onDragStop) onDragStop();
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
(0, _defineProperty2["default"])(_this, "changeMark", function (_ref2) {
|
|
121
|
-
var from = _ref2.from,
|
|
122
|
-
to = _ref2.to,
|
|
123
|
-
middle = _ref2.middle;
|
|
124
|
-
var mark = _objectSpread(_objectSpread({}, _this.state.mark), {}, {
|
|
125
|
-
from: from,
|
|
126
|
-
to: to
|
|
127
|
-
});
|
|
128
|
-
if (middle) {
|
|
129
|
-
mark = _objectSpread(_objectSpread({}, mark), {}, {
|
|
130
|
-
middle: middle
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
_this.setState({
|
|
134
|
-
mark: mark
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
(0, _defineProperty2["default"])(_this, "changeMarkProps", function (_ref3) {
|
|
138
|
-
var from = _ref3.from,
|
|
139
|
-
to = _ref3.to,
|
|
140
|
-
middle = _ref3.middle;
|
|
141
|
-
var _this$props2 = _this.props,
|
|
142
|
-
onChange = _this$props2.onChange,
|
|
143
|
-
mark = _this$props2.mark;
|
|
144
|
-
var update = _objectSpread(_objectSpread({}, mark), _this.state.mark);
|
|
145
|
-
if (from) {
|
|
146
|
-
update = _objectSpread(_objectSpread({}, update), {}, {
|
|
147
|
-
from: from
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
if (to) {
|
|
151
|
-
update = _objectSpread(_objectSpread({}, update), {}, {
|
|
152
|
-
to: to
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (middle) {
|
|
156
|
-
update = _objectSpread(_objectSpread({}, update), {}, {
|
|
157
|
-
middle: middle
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
if (!(0, _lodashEs.isEqual)(mark, update)) {
|
|
161
|
-
onChange(mark, update);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
_this.state = {};
|
|
165
|
-
return _this;
|
|
166
|
-
}
|
|
167
|
-
(0, _inherits2["default"])(LineToolComponent, _React$Component);
|
|
168
|
-
return (0, _createClass2["default"])(LineToolComponent, [{
|
|
169
|
-
key: "render",
|
|
170
|
-
value: function render() {
|
|
171
|
-
var _this$props3 = this.props,
|
|
172
|
-
graphProps = _this$props3.graphProps,
|
|
173
|
-
onClick = _this$props3.onClick,
|
|
174
|
-
labelNode = _this$props3.labelNode,
|
|
175
|
-
labelModeEnabled = _this$props3.labelModeEnabled,
|
|
176
|
-
coordinatesOnHover = _this$props3.coordinatesOnHover,
|
|
177
|
-
limitLabeling = _this$props3.limitLabeling;
|
|
178
|
-
var mark = this.state.mark ? this.state.mark : this.props.mark;
|
|
179
|
-
var from = (0, _lodashEs.cloneDeep)(mark.from);
|
|
180
|
-
var to = (0, _lodashEs.cloneDeep)(mark.to);
|
|
181
|
-
var middle = (0, _lodashEs.cloneDeep)(mark.middle);
|
|
182
|
-
|
|
183
|
-
// SET DISABLED
|
|
184
|
-
// if it's a background mark, we need to force disable it
|
|
185
|
-
if (from && mark.isBackground) {
|
|
186
|
-
from.disabled = true;
|
|
187
|
-
}
|
|
188
|
-
if (to && mark.isBackground) {
|
|
189
|
-
to.disabled = true;
|
|
190
|
-
}
|
|
191
|
-
if (middle && mark.isBackground) {
|
|
192
|
-
middle.disabled = true;
|
|
193
|
-
}
|
|
194
|
-
return /*#__PURE__*/_react["default"].createElement(Component, {
|
|
195
|
-
disabled: mark.disabled,
|
|
196
|
-
coordinatesOnHover: coordinatesOnHover,
|
|
197
|
-
correctness: mark.correctness,
|
|
198
|
-
from: from,
|
|
199
|
-
to: to,
|
|
200
|
-
middle: middle,
|
|
201
|
-
graphProps: graphProps,
|
|
202
|
-
onChange: this.changeMark,
|
|
203
|
-
changeMarkProps: this.changeMarkProps,
|
|
204
|
-
onClick: onClick,
|
|
205
|
-
onDragStart: this.startDrag,
|
|
206
|
-
onDragStop: this.stopDrag,
|
|
207
|
-
labelNode: labelNode,
|
|
208
|
-
labelModeEnabled: labelModeEnabled,
|
|
209
|
-
limitLabeling: limitLabeling
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}]);
|
|
213
|
-
}(_react["default"].Component), (0, _defineProperty2["default"])(_LineToolComponent, "propTypes", _objectSpread(_objectSpread({}, _plot.types.ToolPropTypeFields), {}, {
|
|
214
|
-
graphProps: _plot.types.GraphPropsType.isRequired,
|
|
215
|
-
limitLabeling: _propTypes["default"].bool,
|
|
216
|
-
changeMarkProps: _propTypes["default"].func,
|
|
217
|
-
disabled: _propTypes["default"].bool,
|
|
218
|
-
from: _plot.types.PointType,
|
|
219
|
-
to: _plot.types.PointType,
|
|
220
|
-
labelModeEnabled: _propTypes["default"].bool,
|
|
221
|
-
onClick: _propTypes["default"].func
|
|
222
|
-
})), _LineToolComponent;
|
|
223
|
-
};
|
|
224
|
-
var dragOpts = function dragOpts() {
|
|
225
|
-
return {
|
|
226
|
-
bounds: function bounds(props, _ref4) {
|
|
227
|
-
var domain = _ref4.domain,
|
|
228
|
-
range = _ref4.range;
|
|
229
|
-
var area = _plot.utils.lineToArea(props.from, props.to);
|
|
230
|
-
return _plot.utils.bounds(area, domain, range);
|
|
231
|
-
},
|
|
232
|
-
anchorPoint: function anchorPoint(props) {
|
|
233
|
-
var from = props.from;
|
|
234
|
-
return from;
|
|
235
|
-
},
|
|
236
|
-
fromDelta: function fromDelta(props, delta) {
|
|
237
|
-
var from = props.from,
|
|
238
|
-
to = props.to;
|
|
239
|
-
return {
|
|
240
|
-
from: _plot.utils.point(from).add(_plot.utils.point(delta)),
|
|
241
|
-
to: _plot.utils.point(to).add(_plot.utils.point(delta))
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
};
|
|
246
|
-
var lineBase = exports.lineBase = function lineBase(Comp, opts) {
|
|
247
|
-
var DraggableComp = (0, _plot.gridDraggable)(dragOpts())(Comp);
|
|
248
|
-
var FromPoint = opts && opts.from ? opts.from : _point.BasePoint;
|
|
249
|
-
var ToPoint = opts && opts.to ? opts.to : _point.BasePoint;
|
|
250
|
-
var LineBase = /*#__PURE__*/function (_React$Component2) {
|
|
251
|
-
function LineBase() {
|
|
252
|
-
var _this2;
|
|
253
|
-
(0, _classCallCheck2["default"])(this, LineBase);
|
|
254
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
255
|
-
args[_key] = arguments[_key];
|
|
256
|
-
}
|
|
257
|
-
_this2 = _callSuper(this, LineBase, [].concat(args));
|
|
258
|
-
(0, _defineProperty2["default"])(_this2, "onChangePoint", function (point) {
|
|
259
|
-
var _this2$props = _this2.props,
|
|
260
|
-
middle = _this2$props.middle,
|
|
261
|
-
onChange = _this2$props.onChange;
|
|
262
|
-
var from = point.from,
|
|
263
|
-
to = point.to;
|
|
264
|
-
|
|
265
|
-
// because point.from.label and point.to.label can be different
|
|
266
|
-
if (!(0, _utils.equalPoints)(from, to)) {
|
|
267
|
-
if (middle) {
|
|
268
|
-
point.middle = _objectSpread(_objectSpread({}, middle), (0, _utils.getMiddleOfTwoPoints)(from, to));
|
|
269
|
-
}
|
|
270
|
-
onChange(point);
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
(0, _defineProperty2["default"])(_this2, "dragComp", function (_ref5) {
|
|
274
|
-
var draggedFrom = _ref5.from,
|
|
275
|
-
draggedTo = _ref5.to;
|
|
276
|
-
var _this2$props2 = _this2.props,
|
|
277
|
-
from = _this2$props2.from,
|
|
278
|
-
to = _this2$props2.to,
|
|
279
|
-
onChange = _this2$props2.onChange,
|
|
280
|
-
middle = _this2$props2.middle;
|
|
281
|
-
if (from.label) {
|
|
282
|
-
draggedFrom.label = from.label;
|
|
283
|
-
}
|
|
284
|
-
if (to.label) {
|
|
285
|
-
draggedTo.label = to.label;
|
|
286
|
-
}
|
|
287
|
-
var updated = {
|
|
288
|
-
from: draggedFrom,
|
|
289
|
-
to: draggedTo
|
|
290
|
-
};
|
|
291
|
-
if (middle) {
|
|
292
|
-
updated.middle = _objectSpread(_objectSpread({}, middle), (0, _utils.getMiddleOfTwoPoints)(draggedFrom, draggedTo));
|
|
293
|
-
}
|
|
294
|
-
onChange(updated);
|
|
295
|
-
});
|
|
296
|
-
(0, _defineProperty2["default"])(_this2, "dragFrom", function (draggedFrom) {
|
|
297
|
-
var _this2$props3 = _this2.props,
|
|
298
|
-
from = _this2$props3.from,
|
|
299
|
-
to = _this2$props3.to;
|
|
300
|
-
if (from.label) {
|
|
301
|
-
draggedFrom.label = from.label;
|
|
302
|
-
}
|
|
303
|
-
if (!(0, _utils.equalPoints)(draggedFrom, to)) {
|
|
304
|
-
_this2.onChangePoint({
|
|
305
|
-
from: draggedFrom,
|
|
306
|
-
to: to
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
(0, _defineProperty2["default"])(_this2, "dragTo", function (draggedTo) {
|
|
311
|
-
var _this2$props4 = _this2.props,
|
|
312
|
-
from = _this2$props4.from,
|
|
313
|
-
to = _this2$props4.to;
|
|
314
|
-
if (to.label) {
|
|
315
|
-
draggedTo.label = to.label;
|
|
316
|
-
}
|
|
317
|
-
if (!(0, _utils.equalPoints)(from, draggedTo)) {
|
|
318
|
-
_this2.onChangePoint({
|
|
319
|
-
from: from,
|
|
320
|
-
to: draggedTo
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
(0, _defineProperty2["default"])(_this2, "labelChange", function (point, type) {
|
|
325
|
-
var changeMarkProps = _this2.props.changeMarkProps;
|
|
326
|
-
var update = _objectSpread({}, point);
|
|
327
|
-
if (!point.label || (0, _lodashEs.isEmpty)(point.label)) {
|
|
328
|
-
delete update.label;
|
|
329
|
-
}
|
|
330
|
-
changeMarkProps((0, _defineProperty2["default"])({}, type, update));
|
|
331
|
-
});
|
|
332
|
-
(0, _defineProperty2["default"])(_this2, "clickPoint", function (point, type, data) {
|
|
333
|
-
var _this2$props5 = _this2.props,
|
|
334
|
-
changeMarkProps = _this2$props5.changeMarkProps,
|
|
335
|
-
disabled = _this2$props5.disabled,
|
|
336
|
-
from = _this2$props5.from,
|
|
337
|
-
to = _this2$props5.to,
|
|
338
|
-
middle = _this2$props5.middle,
|
|
339
|
-
labelModeEnabled = _this2$props5.labelModeEnabled,
|
|
340
|
-
limitLabeling = _this2$props5.limitLabeling,
|
|
341
|
-
onClick = _this2$props5.onClick;
|
|
342
|
-
if (!labelModeEnabled) {
|
|
343
|
-
onClick(point || data);
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
if (disabled) {
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// limit labeling the points of the line
|
|
351
|
-
if (limitLabeling) {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
if (type === 'middle' && !point && from && to) {
|
|
355
|
-
point = _objectSpread(_objectSpread({}, point), (0, _utils.getMiddleOfTwoPoints)(from, to));
|
|
356
|
-
}
|
|
357
|
-
changeMarkProps((0, _defineProperty2["default"])({
|
|
358
|
-
from: (0, _utils.stripEmptyLabel)(from),
|
|
359
|
-
to: (0, _utils.stripEmptyLabel)(to),
|
|
360
|
-
middle: (0, _utils.stripEmptyLabel)(middle)
|
|
361
|
-
}, type, _objectSpread({
|
|
362
|
-
label: ''
|
|
363
|
-
}, point)));
|
|
364
|
-
if (_this2.input[type]) {
|
|
365
|
-
_this2.input[type].focus();
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
// IMPORTANT, do not remove
|
|
369
|
-
(0, _defineProperty2["default"])(_this2, "input", {});
|
|
370
|
-
return _this2;
|
|
371
|
-
}
|
|
372
|
-
(0, _inherits2["default"])(LineBase, _React$Component2);
|
|
373
|
-
return (0, _createClass2["default"])(LineBase, [{
|
|
374
|
-
key: "render",
|
|
375
|
-
value: function render() {
|
|
376
|
-
var _this3 = this;
|
|
377
|
-
var _this$props4 = this.props,
|
|
378
|
-
coordinatesOnHover = _this$props4.coordinatesOnHover,
|
|
379
|
-
graphProps = _this$props4.graphProps,
|
|
380
|
-
onDragStart = _this$props4.onDragStart,
|
|
381
|
-
onDragStop = _this$props4.onDragStop,
|
|
382
|
-
from = _this$props4.from,
|
|
383
|
-
to = _this$props4.to,
|
|
384
|
-
middle = _this$props4.middle,
|
|
385
|
-
disabled = _this$props4.disabled,
|
|
386
|
-
correctness = _this$props4.correctness,
|
|
387
|
-
onClick = _this$props4.onClick,
|
|
388
|
-
labelNode = _this$props4.labelNode,
|
|
389
|
-
labelModeEnabled = _this$props4.labelModeEnabled;
|
|
390
|
-
var common = {
|
|
391
|
-
graphProps: graphProps,
|
|
392
|
-
onDragStart: onDragStart,
|
|
393
|
-
onDragStop: onDragStop,
|
|
394
|
-
disabled: disabled,
|
|
395
|
-
correctness: correctness,
|
|
396
|
-
onClick: onClick
|
|
397
|
-
};
|
|
398
|
-
var angle = to ? _plot.trig.toDegrees(_plot.trig.angle(from, to)) : 0;
|
|
399
|
-
var fromLabelNode = null;
|
|
400
|
-
var toLabelNode = null;
|
|
401
|
-
var lineLabelNode = null;
|
|
402
|
-
if (labelNode) {
|
|
403
|
-
if (from && Object.prototype.hasOwnProperty.call(from, 'label')) {
|
|
404
|
-
fromLabelNode = /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/_react["default"].createElement(_markLabel["default"], {
|
|
405
|
-
inputRef: function inputRef(r) {
|
|
406
|
-
return _this3.input.from = r;
|
|
407
|
-
},
|
|
408
|
-
disabled: !labelModeEnabled,
|
|
409
|
-
mark: from,
|
|
410
|
-
graphProps: graphProps,
|
|
411
|
-
onChange: function onChange(label) {
|
|
412
|
-
return _this3.labelChange(_objectSpread(_objectSpread({}, from), {}, {
|
|
413
|
-
label: label
|
|
414
|
-
}), 'from');
|
|
415
|
-
}
|
|
416
|
-
}), labelNode);
|
|
417
|
-
}
|
|
418
|
-
if (to && Object.prototype.hasOwnProperty.call(to, 'label')) {
|
|
419
|
-
toLabelNode = /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/_react["default"].createElement(_markLabel["default"], {
|
|
420
|
-
inputRef: function inputRef(r) {
|
|
421
|
-
return _this3.input.to = r;
|
|
422
|
-
},
|
|
423
|
-
disabled: !labelModeEnabled,
|
|
424
|
-
mark: to,
|
|
425
|
-
graphProps: graphProps,
|
|
426
|
-
onChange: function onChange(label) {
|
|
427
|
-
return _this3.labelChange(_objectSpread(_objectSpread({}, to), {}, {
|
|
428
|
-
label: label
|
|
429
|
-
}), 'to');
|
|
430
|
-
}
|
|
431
|
-
}), labelNode);
|
|
432
|
-
}
|
|
433
|
-
if (middle && Object.prototype.hasOwnProperty.call(middle, 'label')) {
|
|
434
|
-
lineLabelNode = /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/_react["default"].createElement(_markLabel["default"], {
|
|
435
|
-
inputRef: function inputRef(r) {
|
|
436
|
-
return _this3.input.middle = r;
|
|
437
|
-
},
|
|
438
|
-
disabled: !labelModeEnabled,
|
|
439
|
-
mark: middle,
|
|
440
|
-
graphProps: graphProps,
|
|
441
|
-
onChange: function onChange(label) {
|
|
442
|
-
return _this3.labelChange(_objectSpread(_objectSpread({}, middle), {}, {
|
|
443
|
-
label: label
|
|
444
|
-
}), 'middle');
|
|
445
|
-
}
|
|
446
|
-
}), labelNode);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
return /*#__PURE__*/_react["default"].createElement(StyledLineGroup, {
|
|
450
|
-
disabled: disabled,
|
|
451
|
-
correctness: correctness
|
|
452
|
-
}, to && /*#__PURE__*/_react["default"].createElement(DraggableComp, (0, _extends2["default"])({
|
|
453
|
-
from: from,
|
|
454
|
-
to: to,
|
|
455
|
-
middle: middle,
|
|
456
|
-
onDrag: this.dragComp
|
|
457
|
-
}, common, {
|
|
458
|
-
onClick: function onClick(data) {
|
|
459
|
-
return _this3.clickPoint(middle, 'middle', data);
|
|
460
|
-
}
|
|
461
|
-
})), lineLabelNode, /*#__PURE__*/_react["default"].createElement(FromPoint, (0, _extends2["default"])({
|
|
462
|
-
x: from.x,
|
|
463
|
-
y: from.y,
|
|
464
|
-
labelNode: labelNode,
|
|
465
|
-
coordinatesOnHover: coordinatesOnHover,
|
|
466
|
-
onDrag: this.dragFrom
|
|
467
|
-
}, common, {
|
|
468
|
-
onClick: function onClick(data) {
|
|
469
|
-
return _this3.clickPoint(from, 'from', data);
|
|
470
|
-
}
|
|
471
|
-
})), fromLabelNode, to && /*#__PURE__*/_react["default"].createElement(ToPoint, (0, _extends2["default"])({
|
|
472
|
-
x: to.x,
|
|
473
|
-
y: to.y,
|
|
474
|
-
angle: angle //angle + 45}
|
|
475
|
-
,
|
|
476
|
-
labelNode: labelNode,
|
|
477
|
-
coordinatesOnHover: coordinatesOnHover,
|
|
478
|
-
onDrag: this.dragTo
|
|
479
|
-
}, common, {
|
|
480
|
-
onClick: function onClick(data) {
|
|
481
|
-
return _this3.clickPoint(to, 'to', data);
|
|
482
|
-
}
|
|
483
|
-
})), toLabelNode);
|
|
484
|
-
}
|
|
485
|
-
}]);
|
|
486
|
-
}(_react["default"].Component);
|
|
487
|
-
(0, _defineProperty2["default"])(LineBase, "propTypes", {
|
|
488
|
-
coordinatesOnHover: _propTypes["default"].bool,
|
|
489
|
-
graphProps: _plot.types.GraphPropsType,
|
|
490
|
-
from: _plot.types.PointType,
|
|
491
|
-
to: _plot.types.PointType,
|
|
492
|
-
middle: _plot.types.PointType,
|
|
493
|
-
onChange: _propTypes["default"].func,
|
|
494
|
-
onDragStart: _propTypes["default"].func,
|
|
495
|
-
onDragStop: _propTypes["default"].func,
|
|
496
|
-
onClick: _propTypes["default"].func,
|
|
497
|
-
correctness: _propTypes["default"].string,
|
|
498
|
-
disabled: _propTypes["default"].bool,
|
|
499
|
-
limitLabeling: _propTypes["default"].bool,
|
|
500
|
-
changeMarkProps: _propTypes["default"].func,
|
|
501
|
-
labelModeEnabled: _propTypes["default"].bool,
|
|
502
|
-
labelNode: _propTypes["default"].object
|
|
503
|
-
});
|
|
504
|
-
return LineBase;
|
|
505
|
-
};
|
|
506
|
-
var styles = exports.styles = {
|
|
507
|
-
line: function line() {
|
|
508
|
-
return {
|
|
509
|
-
fill: 'transparent',
|
|
510
|
-
stroke: _renderUi.color.defaults.BLACK,
|
|
511
|
-
strokeWidth: 3,
|
|
512
|
-
transition: 'stroke 200ms ease-in, stroke-width 200ms ease-in',
|
|
513
|
-
'&:hover': {
|
|
514
|
-
strokeWidth: 6,
|
|
515
|
-
stroke: _renderUi.color.defaults.PRIMARY_DARK
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
},
|
|
519
|
-
arrow: function arrow() {
|
|
520
|
-
return {
|
|
521
|
-
fill: _renderUi.color.defaults.BLACK
|
|
522
|
-
};
|
|
523
|
-
},
|
|
524
|
-
disabledArrow: function disabledArrow() {
|
|
525
|
-
return _objectSpread({}, (0, _styles.disabledSecondary)());
|
|
526
|
-
},
|
|
527
|
-
disabledSecondary: function disabledSecondary() {
|
|
528
|
-
return _objectSpread(_objectSpread({}, (0, _styles.disabledSecondary)('stroke')), {}, {
|
|
529
|
-
strokeWidth: 2
|
|
530
|
-
});
|
|
531
|
-
},
|
|
532
|
-
disabled: function disabled() {
|
|
533
|
-
return _objectSpread(_objectSpread({}, (0, _styles.disabled)('stroke')), {}, {
|
|
534
|
-
strokeWidth: 2
|
|
535
|
-
});
|
|
536
|
-
},
|
|
537
|
-
correct: function correct(theme, key) {
|
|
538
|
-
return _objectSpread({}, (0, _styles.correct)(key));
|
|
539
|
-
},
|
|
540
|
-
incorrect: function incorrect(theme, key) {
|
|
541
|
-
return _objectSpread({}, (0, _styles.incorrect)(key));
|
|
542
|
-
},
|
|
543
|
-
missing: function missing(theme, key) {
|
|
544
|
-
return _objectSpread(_objectSpread({}, (0, _styles.missing)(key)), {}, {
|
|
545
|
-
strokeWidth: 1,
|
|
546
|
-
strokeDasharray: '4 3'
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
};
|
|
550
|
-
//# sourceMappingURL=index.js.map
|