@pie-lib/graphing-solution-set 4.0.4-next.3 → 4.0.4-next.30
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 +85 -0
- package/dist/graph-with-controls.js +155 -0
- package/dist/graph.d.ts +119 -0
- package/dist/graph.js +221 -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 +14 -0
- package/dist/index.js +6 -0
- package/dist/labels.d.ts +73 -0
- package/dist/labels.js +134 -0
- package/dist/mark-label.d.ts +50 -0
- package/dist/mark-label.js +84 -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_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/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.18.1/node_modules/lodash/_Hash.js +21 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_ListCache.js +21 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Map.js +10 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_MapCache.js +21 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Symbol.js +9 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +15 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +16 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_coreJsData.js +9 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +8 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getMapData.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getNative.js +15 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getRawTag.js +19 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getValue.js +11 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashClear.js +13 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashDelete.js +12 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashGet.js +18 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashHas.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isKeyable.js +12 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isMasked.js +16 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +11 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +13 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +19 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +13 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +13 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +9 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_objectToString.js +12 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_root.js +10 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_toSource.js +20 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/eq.js +11 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isFunction.js +16 -0
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isObject.js +12 -0
- package/dist/node_modules/.bun/lodash@4.18.1/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/tool-menu.d.ts +21 -0
- package/dist/tool-menu.js +188 -0
- package/dist/tools/index.d.ts +17 -0
- package/dist/tools/index.js +12 -0
- package/dist/tools/line/component.d.ts +113 -0
- package/dist/tools/line/component.js +58 -0
- package/dist/tools/line/index.d.ts +13 -0
- package/dist/tools/line/index.js +6 -0
- package/dist/tools/polygon/component.d.ts +117 -0
- package/dist/tools/polygon/component.js +194 -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/polygon.d.ts +122 -0
- package/dist/tools/polygon/polygon.js +62 -0
- package/dist/tools/shared/arrow-head.d.ts +43 -0
- package/dist/tools/shared/arrow-head.js +37 -0
- package/dist/tools/shared/line/index.d.ts +240 -0
- package/dist/tools/shared/line/index.js +320 -0
- package/dist/tools/shared/line/line-path.d.ts +57 -0
- package/dist/tools/shared/line/with-root-edge.d.ts +143 -0
- package/dist/tools/shared/point/arrow-point.d.ts +57 -0
- package/dist/tools/shared/point/arrow-point.js +47 -0
- package/dist/tools/shared/point/arrow.d.ts +46 -0
- package/dist/tools/shared/point/arrow.js +36 -0
- package/dist/tools/shared/point/base-point.d.ts +50 -0
- package/dist/tools/shared/point/base-point.js +88 -0
- package/dist/tools/shared/point/index.d.ts +217 -0
- package/dist/tools/shared/point/index.js +51 -0
- package/dist/tools/shared/styles.d.ts +24 -0
- package/dist/tools/shared/styles.js +17 -0
- package/dist/tools/shared/types.d.ts +15 -0
- package/dist/tools/shared/types.js +10 -0
- package/dist/undo-redo.d.ts +20 -0
- package/dist/undo-redo.js +33 -0
- package/dist/use-debounce.d.ts +9 -0
- package/dist/use-debounce.js +13 -0
- package/dist/utils.d.ts +58 -0
- package/dist/utils.js +72 -0
- package/package.json +46 -34
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -449
- 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 -327
- 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 -120
- 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 -77
- package/lib/coordinates-label.js.map +0 -1
- package/lib/graph-with-controls.js +0 -297
- package/lib/graph-with-controls.js.map +0 -1
- package/lib/graph.js +0 -353
- 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 -40
- package/lib/index.js.map +0 -1
- package/lib/labels.js +0 -199
- package/lib/labels.js.map +0 -1
- package/lib/mark-label.js +0 -159
- package/lib/mark-label.js.map +0 -1
- package/lib/toggle-bar.js +0 -248
- package/lib/toggle-bar.js.map +0 -1
- package/lib/tool-menu.js +0 -218
- package/lib/tool-menu.js.map +0 -1
- package/lib/tools/index.js +0 -24
- package/lib/tools/index.js.map +0 -1
- package/lib/tools/line/component.js +0 -92
- 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/polygon/component.js +0 -358
- 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 -114
- package/lib/tools/polygon/line.js.map +0 -1
- package/lib/tools/polygon/polygon.js +0 -128
- package/lib/tools/polygon/polygon.js.map +0 -1
- package/lib/tools/shared/arrow-head.js +0 -62
- package/lib/tools/shared/arrow-head.js.map +0 -1
- package/lib/tools/shared/line/index.js +0 -539
- package/lib/tools/shared/line/index.js.map +0 -1
- package/lib/tools/shared/line/line-path.js +0 -121
- 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 -86
- package/lib/tools/shared/point/arrow-point.js.map +0 -1
- package/lib/tools/shared/point/arrow.js +0 -70
- package/lib/tools/shared/point/arrow.js.map +0 -1
- package/lib/tools/shared/point/base-point.js +0 -137
- package/lib/tools/shared/point/base-point.js.map +0 -1
- package/lib/tools/shared/point/index.js +0 -80
- package/lib/tools/shared/point/index.js.map +0 -1
- package/lib/tools/shared/styles.js +0 -26
- package/lib/tools/shared/styles.js.map +0 -1
- package/lib/tools/shared/types.js +0 -15
- package/lib/tools/shared/types.js.map +0 -1
- package/lib/undo-redo.js +0 -67
- 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 -235
- 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 -184
- package/src/__tests__/graph.test.jsx +0 -93
- package/src/__tests__/grid-setup.test.jsx +0 -645
- package/src/__tests__/grid.test.jsx +0 -23
- package/src/__tests__/labels.test.jsx +0 -41
- package/src/__tests__/mark-label.test.jsx +0 -66
- package/src/__tests__/toggle-bar.test.jsx +0 -106
- package/src/__tests__/tool-menu.test.jsx +0 -453
- package/src/__tests__/undo-redo.test.jsx +0 -26
- 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 -43
- package/src/axis/__tests__/axes.test.jsx +0 -182
- package/src/axis/arrow.jsx +0 -57
- package/src/axis/axes.jsx +0 -284
- 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 -227
- 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 -85
- 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 -62
- package/src/graph-with-controls.jsx +0 -242
- package/src/graph.jsx +0 -333
- package/src/grid-setup.jsx +0 -432
- package/src/grid.jsx +0 -133
- package/src/index.js +0 -7
- package/src/labels.jsx +0 -173
- package/src/mark-label.jsx +0 -125
- package/src/toggle-bar.jsx +0 -221
- package/src/tool-menu.jsx +0 -235
- package/src/tools/index.js +0 -8
- package/src/tools/line/__tests__/component.test.jsx +0 -37
- package/src/tools/line/component.jsx +0 -77
- package/src/tools/line/index.js +0 -4
- package/src/tools/polygon/__tests__/component.test.jsx +0 -487
- package/src/tools/polygon/__tests__/index.test.js +0 -65
- package/src/tools/polygon/__tests__/line.test.jsx +0 -23
- package/src/tools/polygon/__tests__/polygon.test.jsx +0 -44
- package/src/tools/polygon/component.jsx +0 -324
- package/src/tools/polygon/index.js +0 -52
- package/src/tools/polygon/line.jsx +0 -80
- package/src/tools/polygon/polygon.jsx +0 -93
- package/src/tools/shared/__tests__/arrow-head.test.jsx +0 -33
- package/src/tools/shared/arrow-head.jsx +0 -46
- package/src/tools/shared/line/__tests__/index.test.jsx +0 -553
- package/src/tools/shared/line/__tests__/line-path.test.jsx +0 -56
- package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +0 -488
- package/src/tools/shared/line/index.jsx +0 -471
- package/src/tools/shared/line/line-path.jsx +0 -85
- 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__/arrow.test.jsx +0 -469
- package/src/tools/shared/point/__tests__/base-point.test.jsx +0 -87
- package/src/tools/shared/point/arrow-point.jsx +0 -60
- package/src/tools/shared/point/arrow.jsx +0 -40
- package/src/tools/shared/point/base-point.jsx +0 -113
- package/src/tools/shared/point/index.jsx +0 -58
- package/src/tools/shared/styles.js +0 -20
- package/src/tools/shared/types.js +0 -8
- package/src/undo-redo.jsx +0 -37
- package/src/use-debounce.js +0 -13
- package/src/utils.js +0 -230
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-point.js","names":["_react","_interopRequireDefault","require","_propTypes","_plot","_coordinatesLabel","_reactDom","_utils","_renderUi","_styles","_styles2","_excluded","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","ownKeys","r","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","StyledPointGroup","styled","_ref","disabled","correctness","cursor","fill","disabledStyle","correct","incorrect","missing","RawBp","exports","_React$Component","props","_this","_classCallCheck2","state","showCoordinates","_inherits2","_createClass2","key","value","render","_this2","_this$props","className","coordinatesOnHover","x","y","graphProps","labelNode","style","onClick","onTouchStart","onTouchEnd","rest","_objectWithoutProperties2","scale","thinnerShapesNeeded","createElement","Fragment","pointerEvents","cx","cy","onMouseEnter","setState","onMouseLeave","_extends2","color","defaults","BLACK","ReactDOM","createPortal","React","Component","PropTypes","string","bool","object","number","types","GraphPropsType","isRequired","func"],"sources":["../../../../src/tools/shared/point/base-point.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport CoordinatesLabel from '../../../coordinates-label';\nimport ReactDOM from 'react-dom';\nimport { thinnerShapesNeeded } from '../../../utils';\nimport { color } from '@pie-lib/render-ui';\nimport { styled } from '@mui/material/styles';\nimport { correct, disabled as disabledStyle, incorrect, missing } from '../styles';\n\nconst StyledPointGroup = styled('g')(({ disabled, correctness }) => ({\n cursor: 'pointer',\n '& circle': {\n fill: 'currentColor',\n },\n ...(disabled && {\n ...disabledStyle('fill'),\n ...disabledStyle('color'),\n }),\n ...(correctness === 'correct' && {\n ...correct('fill'),\n ...correct('color'),\n }),\n ...(correctness === 'incorrect' && {\n ...incorrect('fill'),\n ...incorrect('color'),\n }),\n ...(correctness === 'missing' && {\n ...missing('fill'),\n ...missing('color'),\n }),\n}));\n\nexport class RawBp extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n coordinatesOnHover: PropTypes.bool,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n labelNode: PropTypes.object,\n x: PropTypes.number,\n y: PropTypes.number,\n graphProps: types.GraphPropsType.isRequired,\n onClick: PropTypes.func,\n onTouchStart: PropTypes.func,\n onTouchEnd: PropTypes.func,\n };\n\n constructor(props) {\n super(props);\n this.state = { showCoordinates: false };\n }\n\n render() {\n const {\n className,\n coordinatesOnHover,\n x,\n y,\n disabled,\n correctness,\n graphProps,\n labelNode,\n // we need to remove style from props\n // eslint-disable-next-line no-unused-vars,react/prop-types\n style,\n onClick,\n // Refactored RawBp component by isolating onTouchStart and onTouchEnd handlers to the outer circle, resolving erratic touch event behavior.\n // Remaining props are now applied only to the inner circle for improved event handling consistency.\n onTouchStart,\n onTouchEnd,\n ...rest\n } = this.props;\n const { showCoordinates } = this.state;\n const { scale } = graphProps;\n const r = thinnerShapesNeeded(graphProps) ? 5 : 7;\n\n return (\n <>\n <circle\n style={{ fill: 'transparent', cursor: 'pointer', pointerEvents: 'all' }}\n r={r * 3}\n cx={scale.x(x)}\n cy={scale.y(y)}\n onMouseEnter={() => this.setState({ showCoordinates: true })}\n onMouseLeave={() => this.setState({ showCoordinates: false })}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onClick={onClick}\n />\n <StyledPointGroup\n disabled={disabled}\n correctness={correctness}\n className={className}\n onMouseEnter={() => this.setState({ showCoordinates: true })}\n onMouseLeave={() => this.setState({ showCoordinates: false })}\n >\n <circle\n {...rest}\n style={{ fill: color.defaults.BLACK, cursor: 'pointer' }}\n r={r}\n cx={scale.x(x)}\n cy={scale.y(y)}\n />\n {labelNode &&\n coordinatesOnHover &&\n showCoordinates &&\n ReactDOM.createPortal(<CoordinatesLabel graphProps={graphProps} x={x} y={y} />, labelNode)}\n </StyledPointGroup>\n </>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAAmF,IAAAS,SAAA;AAAA,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAA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;AAAA,EA9EwBuB,iBAAK,CAACC,SAAS;AAAA,IAAA3D,gBAAA,aAA7Be,KAAK,eACG;EACjBe,SAAS,EAAE8B,qBAAS,CAACC,MAAM;EAC3B9B,kBAAkB,EAAE6B,qBAAS,CAACE,IAAI;EAClCtD,WAAW,EAAEoD,qBAAS,CAACC,MAAM;EAC7BtD,QAAQ,EAAEqD,qBAAS,CAACE,IAAI;EACxB3B,SAAS,EAAEyB,qBAAS,CAACG,MAAM;EAC3B/B,CAAC,EAAE4B,qBAAS,CAACI,MAAM;EACnB/B,CAAC,EAAE2B,qBAAS,CAACI,MAAM;EACnB9B,UAAU,EAAE+B,WAAK,CAACC,cAAc,CAACC,UAAU;EAC3C9B,OAAO,EAAEuB,qBAAS,CAACQ,IAAI;EACvB9B,YAAY,EAAEsB,qBAAS,CAACQ,IAAI;EAC5B7B,UAAU,EAAEqB,qBAAS,CAACQ;AACxB,CAAC","ignoreList":[]}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.BasePoint = exports.ArrowPoint = exports.Arrow = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _styles = require("@mui/material/styles");
|
|
13
|
-
var _plot = require("@pie-lib/plot");
|
|
14
|
-
var utils = _interopRequireWildcard(require("../../../utils"));
|
|
15
|
-
var _styles2 = require("../styles");
|
|
16
|
-
var _basePoint = require("./base-point");
|
|
17
|
-
var _arrowPoint = require("./arrow-point");
|
|
18
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
19
|
-
var _arrow = _interopRequireDefault(require("./arrow"));
|
|
20
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
|
-
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; }
|
|
22
|
-
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; }
|
|
23
|
-
var opts = {
|
|
24
|
-
bounds: function bounds(props, _ref) {
|
|
25
|
-
var domain = _ref.domain,
|
|
26
|
-
range = _ref.range;
|
|
27
|
-
var x = props.x,
|
|
28
|
-
y = props.y;
|
|
29
|
-
var area = {
|
|
30
|
-
left: x,
|
|
31
|
-
top: y,
|
|
32
|
-
bottom: y,
|
|
33
|
-
right: x
|
|
34
|
-
};
|
|
35
|
-
return utils.bounds(area, domain, range);
|
|
36
|
-
},
|
|
37
|
-
anchorPoint: function anchorPoint(props) {
|
|
38
|
-
var x = props.x,
|
|
39
|
-
y = props.y;
|
|
40
|
-
return {
|
|
41
|
-
x: x,
|
|
42
|
-
y: y
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
fromDelta: function fromDelta(props, delta) {
|
|
46
|
-
return utils.point(props).add(utils.point(delta));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var StyledPointWrapper = (0, _styles.styled)('g', {
|
|
50
|
-
shouldForwardProp: function shouldForwardProp(prop) {
|
|
51
|
-
return !['disabled', 'correctness'].includes(prop);
|
|
52
|
-
}
|
|
53
|
-
})(function (_ref2) {
|
|
54
|
-
var isDisabled = _ref2.disabled,
|
|
55
|
-
correctness = _ref2.correctness;
|
|
56
|
-
return {
|
|
57
|
-
'& circle, & polygon': _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
58
|
-
cursor: 'pointer',
|
|
59
|
-
fill: _renderUi.color.defaults.SECONDARY
|
|
60
|
-
}, isDisabled && (0, _styles2.disabled)()), correctness === 'correct' && (0, _styles2.correct)()), correctness === 'incorrect' && (0, _styles2.incorrect)()), correctness === 'missing' && (0, _styles2.missing)())
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
var withStyledWrapper = function withStyledWrapper(WrappedComponent) {
|
|
64
|
-
var WrappedComponentWithStyles = function WrappedComponentWithStyles(props) {
|
|
65
|
-
return /*#__PURE__*/_react["default"].createElement(StyledPointWrapper, {
|
|
66
|
-
disabled: props.disabled,
|
|
67
|
-
correctness: props.correctness
|
|
68
|
-
}, /*#__PURE__*/_react["default"].createElement(WrappedComponent, props));
|
|
69
|
-
};
|
|
70
|
-
WrappedComponentWithStyles.displayName = "withStyledWrapper(".concat(WrappedComponent.displayName || WrappedComponent.name || 'Component', ")");
|
|
71
|
-
WrappedComponentWithStyles.propTypes = {
|
|
72
|
-
disabled: _propTypes["default"].bool,
|
|
73
|
-
correctness: _propTypes["default"].string
|
|
74
|
-
};
|
|
75
|
-
return WrappedComponentWithStyles;
|
|
76
|
-
};
|
|
77
|
-
var BasePoint = exports.BasePoint = (0, _plot.gridDraggable)(opts)(withStyledWrapper(_basePoint.RawBp));
|
|
78
|
-
var ArrowPoint = exports.ArrowPoint = (0, _plot.gridDraggable)(opts)(withStyledWrapper(_arrowPoint.RawArrow));
|
|
79
|
-
var Arrow = exports.Arrow = (0, _plot.gridDraggable)(opts)(withStyledWrapper(_arrow["default"]));
|
|
80
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_plot","utils","_interopRequireWildcard","_styles2","_basePoint","_arrowPoint","_renderUi","_arrow","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","opts","bounds","props","_ref","domain","range","x","y","area","left","top","bottom","right","anchorPoint","fromDelta","delta","point","add","StyledPointWrapper","styled","shouldForwardProp","prop","includes","_ref2","isDisabled","disabled","correctness","cursor","fill","color","defaults","SECONDARY","correct","incorrect","missing","withStyledWrapper","WrappedComponent","WrappedComponentWithStyles","createElement","displayName","concat","name","propTypes","PropTypes","bool","string","BasePoint","exports","gridDraggable","RawBp","ArrowPoint","RawArrow","Arrow","BaseArrow"],"sources":["../../../../src/tools/shared/point/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { gridDraggable } from '@pie-lib/plot';\nimport * as utils from '../../../utils';\nimport { correct, disabled, incorrect, missing } from '../styles';\nimport { RawBp } from './base-point';\nimport { RawArrow } from './arrow-point';\nimport { color } from '@pie-lib/render-ui';\nimport BaseArrow from './arrow';\n\nconst opts = {\n bounds: (props, { domain, range }) => {\n const { x, y } = props;\n const area = { left: x, top: y, bottom: y, right: x };\n\n return utils.bounds(area, domain, range);\n },\n anchorPoint: (props) => {\n const { x, y } = props;\n\n return { x, y };\n },\n fromDelta: (props, delta) => {\n return utils.point(props).add(utils.point(delta));\n },\n};\n\nconst StyledPointWrapper = styled('g', {\n shouldForwardProp: (prop) => !['disabled', 'correctness'].includes(prop),\n})(({ disabled: isDisabled, correctness }) => ({\n '& circle, & polygon': {\n cursor: 'pointer',\n fill: color.defaults.SECONDARY,\n ...(isDisabled && disabled()),\n ...(correctness === 'correct' && correct()),\n ...(correctness === 'incorrect' && incorrect()),\n ...(correctness === 'missing' && missing()),\n },\n}));\n\nconst withStyledWrapper = (WrappedComponent) => {\n const WrappedComponentWithStyles = (props) => (\n <StyledPointWrapper disabled={props.disabled} correctness={props.correctness}>\n <WrappedComponent {...props} />\n </StyledPointWrapper>\n );\n WrappedComponentWithStyles.displayName = `withStyledWrapper(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n WrappedComponentWithStyles.propTypes = {\n disabled: PropTypes.bool,\n correctness: PropTypes.string,\n };\n return WrappedComponentWithStyles;\n};\n\nexport const BasePoint = gridDraggable(opts)(withStyledWrapper(RawBp));\nexport const ArrowPoint = gridDraggable(opts)(withStyledWrapper(RawArrow));\nexport const Arrow = gridDraggable(opts)(withStyledWrapper(BaseArrow));\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAX,sBAAA,CAAAC,OAAA;AAAgC,SAAAK,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC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0BA,CAAInC,KAAK;IAAA,oBACvCjD,MAAA,YAAAqF,aAAA,CAACpB,kBAAkB;MAACO,QAAQ,EAAEvB,KAAK,CAACuB,QAAS;MAACC,WAAW,EAAExB,KAAK,CAACwB;IAAY,gBAC3EzE,MAAA,YAAAqF,aAAA,CAACF,gBAAgB,EAAKlC,KAAQ,CACZ,CAAC;EAAA,CACtB;EACDmC,0BAA0B,CAACE,WAAW,wBAAAC,MAAA,CAAwBJ,gBAAgB,CAACG,WAAW,IAAIH,gBAAgB,CAACK,IAAI,IAAI,WAAW,MAAG;EACrIJ,0BAA0B,CAACK,SAAS,GAAG;IACrCjB,QAAQ,EAAEkB,qBAAS,CAACC,IAAI;IACxBlB,WAAW,EAAEiB,qBAAS,CAACE;EACzB,CAAC;EACD,OAAOR,0BAA0B;AACnC,CAAC;AAEM,IAAMS,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,mBAAa,EAAChD,IAAI,CAAC,CAACmC,iBAAiB,CAACc,gBAAK,CAAC,CAAC;AAC/D,IAAMC,UAAU,GAAAH,OAAA,CAAAG,UAAA,GAAG,IAAAF,mBAAa,EAAChD,IAAI,CAAC,CAACmC,iBAAiB,CAACgB,oBAAQ,CAAC,CAAC;AACnE,IAAMC,KAAK,GAAAL,OAAA,CAAAK,KAAA,GAAG,IAAAJ,mBAAa,EAAChD,IAAI,CAAC,CAACmC,iBAAiB,CAACkB,iBAAS,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,26 +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.missing = exports.incorrect = exports.disabled = exports.correct = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
10
|
-
var disabled = exports.disabled = function disabled() {
|
|
11
|
-
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fill';
|
|
12
|
-
return (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, key, _renderUi.color.disabled()), "pointerEvents", 'none');
|
|
13
|
-
};
|
|
14
|
-
var correct = exports.correct = function correct() {
|
|
15
|
-
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fill';
|
|
16
|
-
return (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, key, _renderUi.color.correct()), "pointerEvents", 'none');
|
|
17
|
-
};
|
|
18
|
-
var incorrect = exports.incorrect = function incorrect() {
|
|
19
|
-
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fill';
|
|
20
|
-
return (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, key, _renderUi.color.incorrect()), "pointerEvents", 'none');
|
|
21
|
-
};
|
|
22
|
-
var missing = exports.missing = function missing() {
|
|
23
|
-
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fill';
|
|
24
|
-
return (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, key, _renderUi.color.missing()), "pointerEvents", 'none');
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["_renderUi","require","disabled","exports","key","arguments","length","undefined","_defineProperty2","color","correct","incorrect","missing"],"sources":["../../../src/tools/shared/styles.js"],"sourcesContent":["import { color } from '@pie-lib/render-ui';\n\nexport const disabled = (key = 'fill') => ({\n [key]: color.disabled(),\n pointerEvents: 'none',\n});\n\nexport const correct = (key = 'fill') => ({\n [key]: color.correct(),\n pointerEvents: 'none',\n});\nexport const incorrect = (key = 'fill') => ({\n [key]: color.incorrect(),\n pointerEvents: 'none',\n});\n\nexport const missing = (key = 'fill') => ({\n [key]: color.missing(),\n pointerEvents: 'none',\n});\n"],"mappings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";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ToolPropTypeFields = void 0;
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var ToolPropTypeFields = exports.ToolPropTypeFields = {
|
|
10
|
-
mark: _propTypes["default"].any,
|
|
11
|
-
onChange: _propTypes["default"].func,
|
|
12
|
-
onDragStart: _propTypes["default"].func,
|
|
13
|
-
onDragStop: _propTypes["default"].func
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["_propTypes","_interopRequireDefault","require","ToolPropTypeFields","exports","mark","PropTypes","any","onChange","func","onDragStart","onDragStop"],"sources":["../../../src/tools/shared/types.js"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const ToolPropTypeFields = {\n mark: PropTypes.any,\n onChange: PropTypes.func,\n onDragStart: PropTypes.func,\n onDragStop: PropTypes.func,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,IAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,IAAI,EAAEC,qBAAS,CAACC,GAAG;EACnBC,QAAQ,EAAEF,qBAAS,CAACG,IAAI;EACxBC,WAAW,EAAEJ,qBAAS,CAACG,IAAI;EAC3BE,UAAU,EAAEL,qBAAS,CAACG;AACxB,CAAC","ignoreList":[]}
|
package/lib/undo-redo.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.UndoRedo = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
-
var _styles = require("@mui/material/styles");
|
|
17
|
-
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
18
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
19
|
-
var _translator = _interopRequireDefault(require("@pie-lib/translator"));
|
|
20
|
-
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)); }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
var translator = _translator["default"].translator;
|
|
23
|
-
var StyledButton = (0, _styles.styled)(_Button["default"])(function (_ref) {
|
|
24
|
-
var theme = _ref.theme;
|
|
25
|
-
return {
|
|
26
|
-
color: _renderUi.color.text(),
|
|
27
|
-
fontWeight: 'bold',
|
|
28
|
-
marginBottom: theme.spacing(0.5),
|
|
29
|
-
'&:not(:last-of-type)': {
|
|
30
|
-
marginRight: theme.spacing(0.5)
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
var UndoRedo = exports.UndoRedo = /*#__PURE__*/function (_React$Component) {
|
|
35
|
-
function UndoRedo() {
|
|
36
|
-
(0, _classCallCheck2["default"])(this, UndoRedo);
|
|
37
|
-
return _callSuper(this, UndoRedo, arguments);
|
|
38
|
-
}
|
|
39
|
-
(0, _inherits2["default"])(UndoRedo, _React$Component);
|
|
40
|
-
return (0, _createClass2["default"])(UndoRedo, [{
|
|
41
|
-
key: "render",
|
|
42
|
-
value: function render() {
|
|
43
|
-
var _this$props = this.props,
|
|
44
|
-
className = _this$props.className,
|
|
45
|
-
_this$props$onReset = _this$props.onReset,
|
|
46
|
-
onReset = _this$props$onReset === void 0 ? false : _this$props$onReset,
|
|
47
|
-
language = _this$props.language;
|
|
48
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
49
|
-
className: className
|
|
50
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledButton, {
|
|
51
|
-
onClick: function onClick() {
|
|
52
|
-
return onReset();
|
|
53
|
-
}
|
|
54
|
-
}, translator.t('graphing.reset', {
|
|
55
|
-
lng: language
|
|
56
|
-
})));
|
|
57
|
-
}
|
|
58
|
-
}]);
|
|
59
|
-
}(_react["default"].Component);
|
|
60
|
-
(0, _defineProperty2["default"])(UndoRedo, "propTypes", {
|
|
61
|
-
className: _propTypes["default"].string,
|
|
62
|
-
onReset: _propTypes["default"].func.isRequired,
|
|
63
|
-
language: _propTypes["default"].string
|
|
64
|
-
});
|
|
65
|
-
(0, _defineProperty2["default"])(UndoRedo, "defaultProps", {});
|
|
66
|
-
var _default = exports["default"] = UndoRedo;
|
|
67
|
-
//# sourceMappingURL=undo-redo.js.map
|
package/lib/undo-redo.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"undo-redo.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_Button","_renderUi","_translator","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","translator","Translator","StyledButton","styled","Button","_ref","theme","color","text","fontWeight","marginBottom","spacing","marginRight","UndoRedo","exports","_React$Component","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","render","_this$props","props","className","_this$props$onReset","onReset","language","createElement","onClick","lng","React","Component","_defineProperty2","PropTypes","string","func","isRequired","_default"],"sources":["../src/undo-redo.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Button from '@mui/material/Button';\nimport { color } from '@pie-lib/render-ui';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nconst StyledButton = styled(Button)(({ theme }) => ({\n color: color.text(),\n fontWeight: 'bold',\n marginBottom: theme.spacing(0.5),\n '&:not(:last-of-type)': {\n marginRight: theme.spacing(0.5),\n },\n}));\n\nexport class UndoRedo extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n onReset: PropTypes.func.isRequired,\n language: PropTypes.string,\n };\n static defaultProps = {};\n\n render() {\n const { className, onReset = false, language } = this.props;\n return (\n <div className={className}>\n <StyledButton onClick={() => onReset()}>{translator.t('graphing.reset', { lng: language })}</StyledButton>\n </div>\n );\n }\n}\n\nexport default UndoRedo;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA6C,SAAAM,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC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AA;QAAEE,QAAQ,GAAAL,WAAA,CAARK,QAAQ;MAC5C,oBACEnD,MAAA,YAAAoD,aAAA;QAAKJ,SAAS,EAAEA;MAAU,gBACxBhD,MAAA,YAAAoD,aAAA,CAAC3B,YAAY;QAAC4B,OAAO,EAAE,SAATA,OAAOA,CAAA;UAAA,OAAQH,OAAO,CAAC,CAAC;QAAA;MAAC,GAAE3B,UAAU,CAACd,CAAC,CAAC,gBAAgB,EAAE;QAAE6C,GAAG,EAAEH;MAAS,CAAC,CAAgB,CACtG,CAAC;IAEV;EAAC;AAAA,EAf2BI,iBAAK,CAACC,SAAS;AAAA,IAAAC,gBAAA,aAAhCrB,QAAQ,eACA;EACjBY,SAAS,EAAEU,qBAAS,CAACC,MAAM;EAC3BT,OAAO,EAAEQ,qBAAS,CAACE,IAAI,CAACC,UAAU;EAClCV,QAAQ,EAAEO,qBAAS,CAACC;AACtB,CAAC;AAAA,IAAAF,gBAAA,aALUrB,QAAQ,kBAMG,CAAC,CAAC;AAAA,IAAA0B,QAAA,GAAAzB,OAAA,cAYXD,QAAQ","ignoreList":[]}
|
package/lib/use-debounce.js
DELETED
|
@@ -1,25 +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.useDebounce = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var useDebounce = exports.useDebounce = function useDebounce(value, delay) {
|
|
11
|
-
var _useState = (0, _react.useState)(value),
|
|
12
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
13
|
-
debouncedValue = _useState2[0],
|
|
14
|
-
setDebouncedValue = _useState2[1];
|
|
15
|
-
(0, _react.useEffect)(function () {
|
|
16
|
-
var handler = setTimeout(function () {
|
|
17
|
-
setDebouncedValue(value);
|
|
18
|
-
}, delay);
|
|
19
|
-
return function () {
|
|
20
|
-
return clearTimeout(handler);
|
|
21
|
-
};
|
|
22
|
-
}, [value]);
|
|
23
|
-
return debouncedValue;
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=use-debounce.js.map
|
package/lib/use-debounce.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-debounce.js","names":["_react","require","useDebounce","exports","value","delay","_useState","useState","_useState2","_slicedToArray2","debouncedValue","setDebouncedValue","useEffect","handler","setTimeout","clearTimeout"],"sources":["../src/use-debounce.js"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport const useDebounce = (value, delay) => {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n return () => clearTimeout(handler);\n }, [value]);\n return debouncedValue;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,IAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,SAAdA,WAAWA,CAAIE,KAAK,EAAEC,KAAK,EAAK;EAC3C,IAAAC,SAAA,GAA4C,IAAAC,eAAQ,EAACH,KAAK,CAAC;IAAAI,UAAA,OAAAC,eAAA,aAAAH,SAAA;IAApDI,cAAc,GAAAF,UAAA;IAAEG,iBAAiB,GAAAH,UAAA;EAExC,IAAAI,gBAAS,EAAC,YAAM;IACd,IAAMC,OAAO,GAAGC,UAAU,CAAC,YAAM;MAC/BH,iBAAiB,CAACP,KAAK,CAAC;IAC1B,CAAC,EAAEC,KAAK,CAAC;IACT,OAAO;MAAA,OAAMU,YAAY,CAACF,OAAO,CAAC;IAAA;EACpC,CAAC,EAAE,CAACT,KAAK,CAAC,CAAC;EACX,OAAOM,cAAc;AACvB,CAAC","ignoreList":[]}
|
package/lib/utils.js
DELETED
|
@@ -1,235 +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.thinnerShapesNeeded = exports.sameAxes = exports.roundNumber = exports.polygonToArea = exports.pointsToArea = exports.point = exports.lineToArea = exports.isDuplicatedMark = exports.getTickValues = exports.getRightestPoints = exports.getMiddleOfTwoPoints = exports.getAngleDeg = exports.getAdjustedGraphLimits = exports.findLongestWord = exports.equalPoints = exports.countWords = exports.bounds = exports.arrowDimensions = exports.areArraysOfObjectsEqual = exports.amountToIncreaseWidth = void 0;
|
|
8
|
-
var _lodashEs = require("lodash-es");
|
|
9
|
-
var _plot = require("@pie-lib/plot");
|
|
10
|
-
var _invariant = _interopRequireDefault(require("invariant"));
|
|
11
|
-
var bounds = exports.bounds = _plot.utils.bounds;
|
|
12
|
-
var point = exports.point = _plot.utils.point;
|
|
13
|
-
|
|
14
|
-
//TODO: This can be removed?
|
|
15
|
-
var getAngleDeg = exports.getAngleDeg = function getAngleDeg() {
|
|
16
|
-
return 0;
|
|
17
|
-
};
|
|
18
|
-
//TODO: This can be removed?
|
|
19
|
-
var arrowDimensions = exports.arrowDimensions = function arrowDimensions() {
|
|
20
|
-
return 0;
|
|
21
|
-
};
|
|
22
|
-
var getTickValues = exports.getTickValues = function getTickValues(prop) {
|
|
23
|
-
var tickValues = [];
|
|
24
|
-
var tickVal = 0;
|
|
25
|
-
while (tickVal >= prop.min && tickValues.indexOf(tickVal) < 0) {
|
|
26
|
-
tickValues.push(tickVal);
|
|
27
|
-
tickVal = Math.round((tickVal - prop.step) * 10000) / 10000;
|
|
28
|
-
}
|
|
29
|
-
tickVal = Math.round(prop.step * 10000) / 10000;
|
|
30
|
-
while (tickVal <= prop.max && tickValues.indexOf(tickVal) < 0) {
|
|
31
|
-
tickValues.push(tickVal);
|
|
32
|
-
tickVal = Math.round((tickVal + prop.step) * 10000) / 10000;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// return only ticks that are inside the min-max interval
|
|
36
|
-
if (tickValues) {
|
|
37
|
-
return tickValues.filter(function (tV) {
|
|
38
|
-
return tV >= prop.min && tV <= prop.max;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
return [];
|
|
42
|
-
};
|
|
43
|
-
var countWords = exports.countWords = function countWords(label) {
|
|
44
|
-
if (label == null || (0, _lodashEs.isEmpty)(label)) {
|
|
45
|
-
return 1;
|
|
46
|
-
}
|
|
47
|
-
var words = label.split(' ');
|
|
48
|
-
return words.length;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// findLongestWord is also used in plot
|
|
52
|
-
var findLongestWord = exports.findLongestWord = function findLongestWord(label) {
|
|
53
|
-
var longestWord = (label || '').replace(/<[^>]+>/g, '').split(' ').sort(function (a, b) {
|
|
54
|
-
return b.length - a.length;
|
|
55
|
-
});
|
|
56
|
-
return longestWord[0].length;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// amountToIncreaseWidth is also used in plot
|
|
60
|
-
var amountToIncreaseWidth = exports.amountToIncreaseWidth = function amountToIncreaseWidth(longestWord) {
|
|
61
|
-
if (!longestWord) {
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
return longestWord * 10;
|
|
65
|
-
};
|
|
66
|
-
var polygonToArea = exports.polygonToArea = function polygonToArea(points) {
|
|
67
|
-
var h = (0, _lodashEs.head)(points);
|
|
68
|
-
var area = {
|
|
69
|
-
left: h.x,
|
|
70
|
-
top: h.y,
|
|
71
|
-
bottom: h.y,
|
|
72
|
-
right: h.x
|
|
73
|
-
};
|
|
74
|
-
return (0, _lodashEs.tail)(points).reduce(function (a, p) {
|
|
75
|
-
a.left = Math.min(a.left, p.x);
|
|
76
|
-
a.top = Math.max(a.top, p.y);
|
|
77
|
-
a.bottom = Math.min(a.bottom, p.y);
|
|
78
|
-
a.right = Math.max(a.right, p.x);
|
|
79
|
-
return a;
|
|
80
|
-
}, area);
|
|
81
|
-
};
|
|
82
|
-
var lineToArea = exports.lineToArea = function lineToArea(from, to) {
|
|
83
|
-
return pointsToArea(from, to);
|
|
84
|
-
};
|
|
85
|
-
var pointsToArea = exports.pointsToArea = function pointsToArea(a, b) {
|
|
86
|
-
(0, _invariant["default"])(!!a && !!b, 'a or b is undefined');
|
|
87
|
-
var left = Math.min(a.x, b.x);
|
|
88
|
-
var top = Math.max(a.y, b.y);
|
|
89
|
-
var bottom = Math.min(a.y, b.y);
|
|
90
|
-
var right = Math.max(a.x, b.x);
|
|
91
|
-
return {
|
|
92
|
-
left: left,
|
|
93
|
-
top: top,
|
|
94
|
-
bottom: bottom,
|
|
95
|
-
right: right
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
var getRightestPoints = exports.getRightestPoints = function getRightestPoints(points) {
|
|
99
|
-
var sortedPoints = (0, _lodashEs.cloneDeep)(points);
|
|
100
|
-
sortedPoints.sort(function (a, b) {
|
|
101
|
-
return b.x - a.x;
|
|
102
|
-
});
|
|
103
|
-
return {
|
|
104
|
-
a: sortedPoints[0],
|
|
105
|
-
b: sortedPoints[1]
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
var getMiddleOfTwoPoints = exports.getMiddleOfTwoPoints = function getMiddleOfTwoPoints(a, b) {
|
|
109
|
-
return {
|
|
110
|
-
x: (a.x + b.x) / 2,
|
|
111
|
-
y: (a.y + b.y) / 2
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
var roundNumber = exports.roundNumber = function roundNumber(number) {
|
|
115
|
-
return parseFloat(number.toFixed(4));
|
|
116
|
-
};
|
|
117
|
-
var sameAxes = exports.sameAxes = function sameAxes(p1, p2) {
|
|
118
|
-
return p1 && p2 && (roundNumber(p1.x) === roundNumber(p2.x) || roundNumber(p1.y) === roundNumber(p2.y));
|
|
119
|
-
};
|
|
120
|
-
var equalPoints = exports.equalPoints = function equalPoints(p1, p2) {
|
|
121
|
-
return p1 && p2 && (0, _lodashEs.isEqual)({
|
|
122
|
-
x: roundNumber(p1.x),
|
|
123
|
-
y: roundNumber(p1.y)
|
|
124
|
-
}, {
|
|
125
|
-
x: roundNumber(p2.x),
|
|
126
|
-
y: roundNumber(p2.y)
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
var getDistanceBetweenTicks = function getDistanceBetweenTicks(axis, size) {
|
|
130
|
-
var min = axis.min,
|
|
131
|
-
max = axis.max,
|
|
132
|
-
step = axis.step;
|
|
133
|
-
var nbOfTicks = (max - min) / step;
|
|
134
|
-
return size / nbOfTicks;
|
|
135
|
-
};
|
|
136
|
-
var thinnerShapesNeeded = exports.thinnerShapesNeeded = function thinnerShapesNeeded(graphProps) {
|
|
137
|
-
var domain = graphProps.domain,
|
|
138
|
-
range = graphProps.range,
|
|
139
|
-
_graphProps$size = graphProps.size,
|
|
140
|
-
width = _graphProps$size.width,
|
|
141
|
-
height = _graphProps$size.height;
|
|
142
|
-
|
|
143
|
-
// 14 is the default width of a point
|
|
144
|
-
return getDistanceBetweenTicks(domain, width) < 14 || getDistanceBetweenTicks(range, height) < 14;
|
|
145
|
-
};
|
|
146
|
-
var getAdjustedGraphLimits = exports.getAdjustedGraphLimits = function getAdjustedGraphLimits(graphProps) {
|
|
147
|
-
var domain = graphProps.domain,
|
|
148
|
-
range = graphProps.range,
|
|
149
|
-
_graphProps$size2 = graphProps.size,
|
|
150
|
-
width = _graphProps$size2.width,
|
|
151
|
-
height = _graphProps$size2.height;
|
|
152
|
-
var domainTicksDistance = getDistanceBetweenTicks(domain, width);
|
|
153
|
-
var rangeTicksDistance = getDistanceBetweenTicks(range, height);
|
|
154
|
-
|
|
155
|
-
// 15 is the distance required for the arrow to extend the graph
|
|
156
|
-
var domainPadding = domain.step / (domainTicksDistance / 15);
|
|
157
|
-
var rangePadding = range.step / (rangeTicksDistance / 15);
|
|
158
|
-
return {
|
|
159
|
-
domain: {
|
|
160
|
-
min: domain.min - domainPadding,
|
|
161
|
-
max: domain.max + domainPadding
|
|
162
|
-
},
|
|
163
|
-
range: {
|
|
164
|
-
min: range.min - rangePadding,
|
|
165
|
-
max: range.max + rangePadding
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
var sortPoints = function sortPoints(array) {
|
|
170
|
-
return (array || []).sort(function (a, b) {
|
|
171
|
-
return a.x - b.x || a.y - b.y;
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
// check colliniarity of 3 points (source: https://www.geeksforgeeks.org/program-check-three-points-collinear/)
|
|
176
|
-
var checkCollinearity = function checkCollinearity(a, b, c) {
|
|
177
|
-
return (a.x - b.x) * (c.y - b.y) === (c.x - b.x) * (a.y - b.y);
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
// 2 lines are overlapping if all 4 points are collinear
|
|
181
|
-
var isSameLine = function isSameLine(markA, markB) {
|
|
182
|
-
return checkCollinearity(markA.from, markB.from, markB.to) && checkCollinearity(markA.to, markB.from, markB.to);
|
|
183
|
-
};
|
|
184
|
-
var isDuplicatedMark = exports.isDuplicatedMark = function isDuplicatedMark(mark, marks, oldMark) {
|
|
185
|
-
var type = mark.type,
|
|
186
|
-
building = mark.building;
|
|
187
|
-
if (building) {
|
|
188
|
-
return false;
|
|
189
|
-
}
|
|
190
|
-
var filteredMarks = (marks || []).filter(function (m) {
|
|
191
|
-
return m.type === type && !m.building;
|
|
192
|
-
});
|
|
193
|
-
var index = filteredMarks.findIndex(function (m) {
|
|
194
|
-
return (0, _lodashEs.isEqual)(m, oldMark);
|
|
195
|
-
});
|
|
196
|
-
if (index !== -1) {
|
|
197
|
-
filteredMarks.splice(index, 1);
|
|
198
|
-
}
|
|
199
|
-
var duplicated = filteredMarks.find(function (m) {
|
|
200
|
-
if (type === 'line') {
|
|
201
|
-
var from = mark.from,
|
|
202
|
-
to = mark.to;
|
|
203
|
-
return equalPoints(from, m.from) && equalPoints(to, m.to) || equalPoints(from, m.to) && equalPoints(to, m.from) || type === 'line' && isSameLine(m, mark);
|
|
204
|
-
} else if (type === 'polygon') {
|
|
205
|
-
return (0, _lodashEs.isEqual)(sortPoints((0, _lodashEs.cloneDeep)(mark.points)), sortPoints((0, _lodashEs.cloneDeep)(m.points)));
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
return !!duplicated;
|
|
209
|
-
};
|
|
210
|
-
var areArraysOfObjectsEqual = exports.areArraysOfObjectsEqual = function areArraysOfObjectsEqual(array1, array2) {
|
|
211
|
-
// Check if both arrays have the same length
|
|
212
|
-
if (array1.length !== array2.length) {
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
// Iterate through each object in the arrays
|
|
216
|
-
for (var i = 0; i < array1.length; i++) {
|
|
217
|
-
// Get the current objects in both arrays
|
|
218
|
-
var obj1 = array1[i];
|
|
219
|
-
var obj2 = array2[i];
|
|
220
|
-
// Check if the objects have the same number of properties
|
|
221
|
-
if (Object.keys(obj1).length !== Object.keys(obj2).length) {
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
224
|
-
// Iterate through each property in the objects
|
|
225
|
-
for (var key in obj1) {
|
|
226
|
-
// Check if the properties and their values are equal
|
|
227
|
-
if (obj1[key] !== obj2[key]) {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
// If all objects are equal, the arrays are the same
|
|
233
|
-
return true;
|
|
234
|
-
};
|
|
235
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_lodashEs","require","_plot","_invariant","_interopRequireDefault","bounds","exports","utils","point","getAngleDeg","arrowDimensions","getTickValues","prop","tickValues","tickVal","min","indexOf","push","Math","round","step","max","filter","tV","countWords","label","isEmpty","words","split","length","findLongestWord","longestWord","replace","sort","a","b","amountToIncreaseWidth","polygonToArea","points","h","head","area","left","x","top","y","bottom","right","tail","reduce","p","lineToArea","from","to","pointsToArea","invariant","getRightestPoints","sortedPoints","cloneDeep","getMiddleOfTwoPoints","roundNumber","number","parseFloat","toFixed","sameAxes","p1","p2","equalPoints","isEqual","getDistanceBetweenTicks","axis","size","nbOfTicks","thinnerShapesNeeded","graphProps","domain","range","_graphProps$size","width","height","getAdjustedGraphLimits","_graphProps$size2","domainTicksDistance","rangeTicksDistance","domainPadding","rangePadding","sortPoints","array","checkCollinearity","c","isSameLine","markA","markB","isDuplicatedMark","mark","marks","oldMark","type","building","filteredMarks","m","index","findIndex","splice","duplicated","find","areArraysOfObjectsEqual","array1","array2","i","obj1","obj2","Object","keys","key"],"sources":["../src/utils.js"],"sourcesContent":["import { cloneDeep, head, isEmpty, isEqual, tail } from 'lodash-es';\nimport { utils } from '@pie-lib/plot';\nimport invariant from 'invariant';\n\nexport const bounds = utils.bounds;\nexport const point = utils.point;\n\n//TODO: This can be removed?\nexport const getAngleDeg = () => 0;\n//TODO: This can be removed?\nexport const arrowDimensions = () => 0;\n\nexport const getTickValues = (prop) => {\n const tickValues = [];\n let tickVal = 0;\n\n while (tickVal >= prop.min && tickValues.indexOf(tickVal) < 0) {\n tickValues.push(tickVal);\n tickVal = Math.round((tickVal - prop.step) * 10000) / 10000;\n }\n\n tickVal = Math.round(prop.step * 10000) / 10000;\n\n while (tickVal <= prop.max && tickValues.indexOf(tickVal) < 0) {\n tickValues.push(tickVal);\n tickVal = Math.round((tickVal + prop.step) * 10000) / 10000;\n }\n\n // return only ticks that are inside the min-max interval\n if (tickValues) {\n return tickValues.filter((tV) => tV >= prop.min && tV <= prop.max);\n }\n\n return [];\n};\n\nexport const countWords = (label) => {\n if (label == null || isEmpty(label)) {\n return 1;\n }\n\n const words = label.split(' ');\n return words.length;\n};\n\n// findLongestWord is also used in plot\nexport const findLongestWord = (label) => {\n let longestWord = (label || '')\n .replace(/<[^>]+>/g, '')\n .split(' ')\n .sort((a, b) => b.length - a.length);\n\n return longestWord[0].length;\n};\n\n// amountToIncreaseWidth is also used in plot\nexport const amountToIncreaseWidth = (longestWord) => {\n if (!longestWord) {\n return 0;\n }\n\n return longestWord * 10;\n};\n\nexport const polygonToArea = (points) => {\n const h = head(points);\n const area = {\n left: h.x,\n top: h.y,\n bottom: h.y,\n right: h.x,\n };\n return tail(points).reduce((a, p) => {\n a.left = Math.min(a.left, p.x);\n a.top = Math.max(a.top, p.y);\n a.bottom = Math.min(a.bottom, p.y);\n a.right = Math.max(a.right, p.x);\n return a;\n }, area);\n};\n\nexport const lineToArea = (from, to) => pointsToArea(from, to);\n\nexport const pointsToArea = (a, b) => {\n invariant(!!a && !!b, 'a or b is undefined');\n const left = Math.min(a.x, b.x);\n const top = Math.max(a.y, b.y);\n const bottom = Math.min(a.y, b.y);\n const right = Math.max(a.x, b.x);\n return { left, top, bottom, right };\n};\n\nexport const getRightestPoints = (points) => {\n const sortedPoints = cloneDeep(points);\n sortedPoints.sort((a, b) => b.x - a.x);\n\n return { a: sortedPoints[0], b: sortedPoints[1] };\n};\n\nexport const getMiddleOfTwoPoints = (a, b) => ({\n x: (a.x + b.x) / 2,\n y: (a.y + b.y) / 2,\n});\n\nexport const roundNumber = (number) => parseFloat(number.toFixed(4));\n\nexport const sameAxes = (p1, p2) =>\n p1 && p2 && (roundNumber(p1.x) === roundNumber(p2.x) || roundNumber(p1.y) === roundNumber(p2.y));\n\nexport const equalPoints = (p1, p2) =>\n p1 &&\n p2 &&\n isEqual(\n {\n x: roundNumber(p1.x),\n y: roundNumber(p1.y),\n },\n {\n x: roundNumber(p2.x),\n y: roundNumber(p2.y),\n },\n );\n\nconst getDistanceBetweenTicks = (axis, size) => {\n const { min, max, step } = axis;\n const nbOfTicks = (max - min) / step;\n\n return size / nbOfTicks;\n};\n\nexport const thinnerShapesNeeded = (graphProps) => {\n const {\n domain,\n range,\n size: { width, height },\n } = graphProps;\n\n // 14 is the default width of a point\n return getDistanceBetweenTicks(domain, width) < 14 || getDistanceBetweenTicks(range, height) < 14;\n};\n\nexport const getAdjustedGraphLimits = (graphProps) => {\n const {\n domain,\n range,\n size: { width, height },\n } = graphProps;\n const domainTicksDistance = getDistanceBetweenTicks(domain, width);\n const rangeTicksDistance = getDistanceBetweenTicks(range, height);\n\n // 15 is the distance required for the arrow to extend the graph\n const domainPadding = domain.step / (domainTicksDistance / 15);\n const rangePadding = range.step / (rangeTicksDistance / 15);\n\n return {\n domain: {\n min: domain.min - domainPadding,\n max: domain.max + domainPadding,\n },\n range: {\n min: range.min - rangePadding,\n max: range.max + rangePadding,\n },\n };\n};\n\nconst sortPoints = (array) => (array || []).sort((a, b) => a.x - b.x || a.y - b.y);\n\n// check colliniarity of 3 points (source: https://www.geeksforgeeks.org/program-check-three-points-collinear/)\nconst checkCollinearity = (a, b, c) => (a.x - b.x) * (c.y - b.y) === (c.x - b.x) * (a.y - b.y);\n\n// 2 lines are overlapping if all 4 points are collinear\nconst isSameLine = (markA, markB) =>\n checkCollinearity(markA.from, markB.from, markB.to) && checkCollinearity(markA.to, markB.from, markB.to);\n\nexport const isDuplicatedMark = (mark, marks, oldMark) => {\n const { type, building } = mark;\n\n if (building) {\n return false;\n }\n\n const filteredMarks = (marks || []).filter((m) => m.type === type && !m.building);\n const index = filteredMarks.findIndex((m) => isEqual(m, oldMark));\n\n if (index !== -1) {\n filteredMarks.splice(index, 1);\n }\n\n const duplicated = filteredMarks.find((m) => {\n if (type === 'line') {\n const { from, to } = mark;\n return (\n (equalPoints(from, m.from) && equalPoints(to, m.to)) ||\n (equalPoints(from, m.to) && equalPoints(to, m.from)) ||\n (type === 'line' && isSameLine(m, mark))\n );\n } else if (type === 'polygon') {\n return isEqual(sortPoints(cloneDeep(mark.points)), sortPoints(cloneDeep(m.points)));\n }\n });\n\n return !!duplicated;\n};\n\nexport const areArraysOfObjectsEqual = (array1, array2) => {\n // Check if both arrays have the same length\n if (array1.length !== array2.length) {\n return false;\n }\n // Iterate through each object in the arrays\n for (let i = 0; i < array1.length; i++) {\n // Get the current objects in both arrays\n const obj1 = array1[i];\n const obj2 = array2[i];\n // Check if the objects have the same number of properties\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n // Iterate through each property in the objects\n for (const key in obj1) {\n // Check if the properties and their values are equal\n if (obj1[key] !== obj2[key]) {\n return false;\n }\n }\n }\n // If all objects are equal, the arrays are the same\n return true;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEO,IAAMI,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,WAAK,CAACF,MAAM;AAC3B,IAAMG,KAAK,GAAAF,OAAA,CAAAE,KAAA,GAAGD,WAAK,CAACC,KAAK;;AAEhC;AACO,IAAMC,WAAW,GAAAH,OAAA,CAAAG,WAAA,GAAG,SAAdA,WAAWA,CAAA;EAAA,OAAS,CAAC;AAAA;AAClC;AACO,IAAMC,eAAe,GAAAJ,OAAA,CAAAI,eAAA,GAAG,SAAlBA,eAAeA,CAAA;EAAA,OAAS,CAAC;AAAA;AAE/B,IAAMC,aAAa,GAAAL,OAAA,CAAAK,aAAA,GAAG,SAAhBA,aAAaA,CAAIC,IAAI,EAAK;EACrC,IAAMC,UAAU,GAAG,EAAE;EACrB,IAAIC,OAAO,GAAG,CAAC;EAEf,OAAOA,OAAO,IAAIF,IAAI,CAACG,GAAG,IAAIF,UAAU,CAACG,OAAO,CAACF,OAAO,CAAC,GAAG,CAAC,EAAE;IAC7DD,UAAU,CAACI,IAAI,CAACH,OAAO,CAAC;IACxBA,OAAO,GAAGI,IAAI,CAACC,KAAK,CAAC,CAACL,OAAO,GAAGF,IAAI,CAACQ,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK;EAC7D;EAEAN,OAAO,GAAGI,IAAI,CAACC,KAAK,CAACP,IAAI,CAACQ,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK;EAE/C,OAAON,OAAO,IAAIF,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