@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
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing-solution-set/src/tools/shared/point/index.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare const BasePoint: {
|
|
12
|
+
new (props: any): {
|
|
13
|
+
grid: any;
|
|
14
|
+
onStart: any;
|
|
15
|
+
position: any;
|
|
16
|
+
tiny: any;
|
|
17
|
+
getScaledBounds: any;
|
|
18
|
+
getClientPoint: any;
|
|
19
|
+
skipDragOutsideOfBounds: any;
|
|
20
|
+
onDrag: any;
|
|
21
|
+
getDelta: any;
|
|
22
|
+
applyDelta: any;
|
|
23
|
+
onStop: any;
|
|
24
|
+
render(): React.JSX.Element;
|
|
25
|
+
context: unknown;
|
|
26
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
27
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
28
|
+
readonly props: Readonly<{}>;
|
|
29
|
+
state: Readonly<{}>;
|
|
30
|
+
refs: {
|
|
31
|
+
[key: string]: React.ReactInstance;
|
|
32
|
+
};
|
|
33
|
+
componentDidMount?(): void;
|
|
34
|
+
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
35
|
+
componentWillUnmount?(): void;
|
|
36
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
37
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
38
|
+
componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
39
|
+
componentWillMount?(): void;
|
|
40
|
+
UNSAFE_componentWillMount?(): void;
|
|
41
|
+
componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
42
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
43
|
+
componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
44
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
45
|
+
};
|
|
46
|
+
propTypes: {
|
|
47
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
48
|
+
onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
49
|
+
onDrag: PropTypes.Requireable<(...args: any[]) => any>;
|
|
50
|
+
onDragStop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
52
|
+
onMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
54
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
55
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
56
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
57
|
+
}>>>;
|
|
58
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
59
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
60
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
61
|
+
}>>>;
|
|
62
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
63
|
+
min: PropTypes.Validator<number>;
|
|
64
|
+
max: PropTypes.Validator<number>;
|
|
65
|
+
step: PropTypes.Requireable<number>;
|
|
66
|
+
}>>>;
|
|
67
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
68
|
+
min: PropTypes.Validator<number>;
|
|
69
|
+
max: PropTypes.Validator<number>;
|
|
70
|
+
step: PropTypes.Requireable<number>;
|
|
71
|
+
}>>>;
|
|
72
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
73
|
+
width: PropTypes.Validator<number>;
|
|
74
|
+
height: PropTypes.Validator<number>;
|
|
75
|
+
}>>>;
|
|
76
|
+
}>>>;
|
|
77
|
+
};
|
|
78
|
+
contextType?: React.Context<any> | undefined;
|
|
79
|
+
};
|
|
80
|
+
export declare const ArrowPoint: {
|
|
81
|
+
new (props: any): {
|
|
82
|
+
grid: any;
|
|
83
|
+
onStart: any;
|
|
84
|
+
position: any;
|
|
85
|
+
tiny: any;
|
|
86
|
+
getScaledBounds: any;
|
|
87
|
+
getClientPoint: any;
|
|
88
|
+
skipDragOutsideOfBounds: any;
|
|
89
|
+
onDrag: any;
|
|
90
|
+
getDelta: any;
|
|
91
|
+
applyDelta: any;
|
|
92
|
+
onStop: any;
|
|
93
|
+
render(): React.JSX.Element;
|
|
94
|
+
context: unknown;
|
|
95
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
96
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
97
|
+
readonly props: Readonly<{}>;
|
|
98
|
+
state: Readonly<{}>;
|
|
99
|
+
refs: {
|
|
100
|
+
[key: string]: React.ReactInstance;
|
|
101
|
+
};
|
|
102
|
+
componentDidMount?(): void;
|
|
103
|
+
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
104
|
+
componentWillUnmount?(): void;
|
|
105
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
106
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
107
|
+
componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
108
|
+
componentWillMount?(): void;
|
|
109
|
+
UNSAFE_componentWillMount?(): void;
|
|
110
|
+
componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
111
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
112
|
+
componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
113
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
114
|
+
};
|
|
115
|
+
propTypes: {
|
|
116
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
117
|
+
onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
118
|
+
onDrag: PropTypes.Requireable<(...args: any[]) => any>;
|
|
119
|
+
onDragStop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
120
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
121
|
+
onMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
122
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
123
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
124
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
125
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
126
|
+
}>>>;
|
|
127
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
128
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
129
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
130
|
+
}>>>;
|
|
131
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
132
|
+
min: PropTypes.Validator<number>;
|
|
133
|
+
max: PropTypes.Validator<number>;
|
|
134
|
+
step: PropTypes.Requireable<number>;
|
|
135
|
+
}>>>;
|
|
136
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
137
|
+
min: PropTypes.Validator<number>;
|
|
138
|
+
max: PropTypes.Validator<number>;
|
|
139
|
+
step: PropTypes.Requireable<number>;
|
|
140
|
+
}>>>;
|
|
141
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
142
|
+
width: PropTypes.Validator<number>;
|
|
143
|
+
height: PropTypes.Validator<number>;
|
|
144
|
+
}>>>;
|
|
145
|
+
}>>>;
|
|
146
|
+
};
|
|
147
|
+
contextType?: React.Context<any> | undefined;
|
|
148
|
+
};
|
|
149
|
+
export declare const Arrow: {
|
|
150
|
+
new (props: any): {
|
|
151
|
+
grid: any;
|
|
152
|
+
onStart: any;
|
|
153
|
+
position: any;
|
|
154
|
+
tiny: any;
|
|
155
|
+
getScaledBounds: any;
|
|
156
|
+
getClientPoint: any;
|
|
157
|
+
skipDragOutsideOfBounds: any;
|
|
158
|
+
onDrag: any;
|
|
159
|
+
getDelta: any;
|
|
160
|
+
applyDelta: any;
|
|
161
|
+
onStop: any;
|
|
162
|
+
render(): React.JSX.Element;
|
|
163
|
+
context: unknown;
|
|
164
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
165
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
166
|
+
readonly props: Readonly<{}>;
|
|
167
|
+
state: Readonly<{}>;
|
|
168
|
+
refs: {
|
|
169
|
+
[key: string]: React.ReactInstance;
|
|
170
|
+
};
|
|
171
|
+
componentDidMount?(): void;
|
|
172
|
+
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
173
|
+
componentWillUnmount?(): void;
|
|
174
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
175
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
176
|
+
componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
177
|
+
componentWillMount?(): void;
|
|
178
|
+
UNSAFE_componentWillMount?(): void;
|
|
179
|
+
componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
180
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
181
|
+
componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
182
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
183
|
+
};
|
|
184
|
+
propTypes: {
|
|
185
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
186
|
+
onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
187
|
+
onDrag: PropTypes.Requireable<(...args: any[]) => any>;
|
|
188
|
+
onDragStop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
189
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
190
|
+
onMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
191
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
192
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
193
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
194
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
195
|
+
}>>>;
|
|
196
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
197
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
198
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
199
|
+
}>>>;
|
|
200
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
201
|
+
min: PropTypes.Validator<number>;
|
|
202
|
+
max: PropTypes.Validator<number>;
|
|
203
|
+
step: PropTypes.Requireable<number>;
|
|
204
|
+
}>>>;
|
|
205
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
206
|
+
min: PropTypes.Validator<number>;
|
|
207
|
+
max: PropTypes.Validator<number>;
|
|
208
|
+
step: PropTypes.Requireable<number>;
|
|
209
|
+
}>>>;
|
|
210
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
211
|
+
width: PropTypes.Validator<number>;
|
|
212
|
+
height: PropTypes.Validator<number>;
|
|
213
|
+
}>>>;
|
|
214
|
+
}>>>;
|
|
215
|
+
};
|
|
216
|
+
contextType?: React.Context<any> | undefined;
|
|
217
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { bounds as e, point as t } from "../../../utils.js";
|
|
2
|
+
import { correct as n, disabled as r, incorrect as i, missing as a } from "../styles.js";
|
|
3
|
+
import { RawBp as o } from "./base-point.js";
|
|
4
|
+
import { RawArrow as s } from "./arrow-point.js";
|
|
5
|
+
import c from "./arrow.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import l from "prop-types";
|
|
8
|
+
import { gridDraggable as u } from "@pie-lib/plot";
|
|
9
|
+
import { styled as d } from "@mui/material/styles";
|
|
10
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
11
|
+
import { color as p } from "@pie-lib/render-ui";
|
|
12
|
+
//#region src/tools/shared/point/index.tsx
|
|
13
|
+
var m = {
|
|
14
|
+
bounds: (t, { domain: n, range: r }) => {
|
|
15
|
+
let { x: i, y: a } = t;
|
|
16
|
+
return e({
|
|
17
|
+
left: i,
|
|
18
|
+
top: a,
|
|
19
|
+
bottom: a,
|
|
20
|
+
right: i
|
|
21
|
+
}, n, r);
|
|
22
|
+
},
|
|
23
|
+
anchorPoint: (e) => {
|
|
24
|
+
let { x: t, y: n } = e;
|
|
25
|
+
return {
|
|
26
|
+
x: t,
|
|
27
|
+
y: n
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
fromDelta: (e, n) => t(e).add(t(n))
|
|
31
|
+
}, h = d("g", { shouldForwardProp: (e) => !["disabled", "correctness"].includes(e) })(({ disabled: e, correctness: t }) => ({ "& circle, & polygon": {
|
|
32
|
+
cursor: "pointer",
|
|
33
|
+
fill: p.defaults.SECONDARY,
|
|
34
|
+
...e && r(),
|
|
35
|
+
...t === "correct" && n(),
|
|
36
|
+
...t === "incorrect" && i(),
|
|
37
|
+
...t === "missing" && a()
|
|
38
|
+
} })), g = (e) => {
|
|
39
|
+
let t = (t) => /* @__PURE__ */ f(h, {
|
|
40
|
+
disabled: t.disabled,
|
|
41
|
+
correctness: t.correctness,
|
|
42
|
+
children: /* @__PURE__ */ f(e, { ...t })
|
|
43
|
+
});
|
|
44
|
+
return t.displayName = `withStyledWrapper(${e.displayName || e.name || "Component"})`, t.propTypes = {
|
|
45
|
+
disabled: l.bool,
|
|
46
|
+
correctness: l.string
|
|
47
|
+
}, t;
|
|
48
|
+
}, _ = u(m)(g(o));
|
|
49
|
+
u(m)(g(s)), u(m)(g(c));
|
|
50
|
+
//#endregion
|
|
51
|
+
export { _ as BasePoint };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing-solution-set/src/tools/shared/styles.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const disabled: (key?: string) => {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
pointerEvents: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const correct: (key?: string) => {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
pointerEvents: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const incorrect: (key?: string) => {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
pointerEvents: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const missing: (key?: string) => {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
pointerEvents: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { color as e } from "@pie-lib/render-ui";
|
|
2
|
+
//#region src/tools/shared/styles.ts
|
|
3
|
+
var t = (t = "fill") => ({
|
|
4
|
+
[t]: e.disabled(),
|
|
5
|
+
pointerEvents: "none"
|
|
6
|
+
}), n = (t = "fill") => ({
|
|
7
|
+
[t]: e.correct(),
|
|
8
|
+
pointerEvents: "none"
|
|
9
|
+
}), r = (t = "fill") => ({
|
|
10
|
+
[t]: e.incorrect(),
|
|
11
|
+
pointerEvents: "none"
|
|
12
|
+
}), i = (t = "fill") => ({
|
|
13
|
+
[t]: e.missing(),
|
|
14
|
+
pointerEvents: "none"
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as correct, t as disabled, r as incorrect, i as missing };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing-solution-set/src/tools/shared/types.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
export declare const ToolPropTypeFields: {
|
|
11
|
+
mark: PropTypes.Requireable<any>;
|
|
12
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
|
+
onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
onDragStop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing-solution-set/src/undo-redo.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class UndoRedo extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
className: PropTypes.Requireable<string>;
|
|
14
|
+
onReset: PropTypes.Validator<(...args: any[]) => any>;
|
|
15
|
+
language: PropTypes.Requireable<string>;
|
|
16
|
+
};
|
|
17
|
+
static defaultProps: {};
|
|
18
|
+
render(): React.JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export default UndoRedo;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { styled as n } from "@mui/material/styles";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { color as i } from "@pie-lib/render-ui";
|
|
6
|
+
import a from "@mui/material/Button";
|
|
7
|
+
import o from "@pie-lib/translator";
|
|
8
|
+
//#region src/undo-redo.tsx
|
|
9
|
+
var { translator: s } = o, c = n(a)(({ theme: e }) => ({
|
|
10
|
+
color: i.text(),
|
|
11
|
+
fontWeight: "bold",
|
|
12
|
+
marginBottom: e.spacing(.5),
|
|
13
|
+
"&:not(:last-of-type)": { marginRight: e.spacing(.5) }
|
|
14
|
+
})), l = class extends e.Component {
|
|
15
|
+
static propTypes = {
|
|
16
|
+
className: t.string,
|
|
17
|
+
onReset: t.func.isRequired,
|
|
18
|
+
language: t.string
|
|
19
|
+
};
|
|
20
|
+
static defaultProps = {};
|
|
21
|
+
render() {
|
|
22
|
+
let { className: e, onReset: t = !1, language: n } = this.props;
|
|
23
|
+
return /* @__PURE__ */ r("div", {
|
|
24
|
+
className: e,
|
|
25
|
+
children: /* @__PURE__ */ r(c, {
|
|
26
|
+
onClick: () => t(),
|
|
27
|
+
children: s.t("graphing.reset", { lng: n })
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { l as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing-solution-set/src/use-debounce.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useDebounce: (value: any, delay: any) => any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
//#region src/use-debounce.ts
|
|
3
|
+
var n = (n, r) => {
|
|
4
|
+
let [i, a] = t(n);
|
|
5
|
+
return e(() => {
|
|
6
|
+
let e = setTimeout(() => {
|
|
7
|
+
a(n);
|
|
8
|
+
}, r);
|
|
9
|
+
return () => clearTimeout(e);
|
|
10
|
+
}, [n]), i;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as useDebounce };
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/graphing-solution-set/src/utils.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const bounds: (area: any, domain: any, range: any) => {
|
|
10
|
+
left: number;
|
|
11
|
+
right: number;
|
|
12
|
+
top: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const point: (o: any) => import("@mapbox/point-geometry").default;
|
|
16
|
+
export declare const getAngleDeg: () => number;
|
|
17
|
+
export declare const arrowDimensions: () => number;
|
|
18
|
+
export declare const getTickValues: (prop: any) => number[];
|
|
19
|
+
export declare const countWords: (label: any) => any;
|
|
20
|
+
export declare const findLongestWord: (label: any) => any;
|
|
21
|
+
export declare const amountToIncreaseWidth: (longestWord: any) => number;
|
|
22
|
+
export declare const polygonToArea: (points: any) => unknown;
|
|
23
|
+
export declare const lineToArea: (from: any, to: any) => {
|
|
24
|
+
left: number;
|
|
25
|
+
top: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
right: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const pointsToArea: (a: any, b: any) => {
|
|
30
|
+
left: number;
|
|
31
|
+
top: number;
|
|
32
|
+
bottom: number;
|
|
33
|
+
right: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const getRightestPoints: (points: any) => {
|
|
36
|
+
a: any;
|
|
37
|
+
b: any;
|
|
38
|
+
};
|
|
39
|
+
export declare const getMiddleOfTwoPoints: (a: any, b: any) => {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
export declare const roundNumber: (number: any) => number;
|
|
44
|
+
export declare const sameAxes: (p1: any, p2: any) => any;
|
|
45
|
+
export declare const equalPoints: (p1: any, p2: any) => any;
|
|
46
|
+
export declare const thinnerShapesNeeded: (graphProps: any) => boolean;
|
|
47
|
+
export declare const getAdjustedGraphLimits: (graphProps: any) => {
|
|
48
|
+
domain: {
|
|
49
|
+
min: number;
|
|
50
|
+
max: any;
|
|
51
|
+
};
|
|
52
|
+
range: {
|
|
53
|
+
min: number;
|
|
54
|
+
max: any;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare const isDuplicatedMark: (mark: any, marks: any, oldMark: any) => boolean;
|
|
58
|
+
export declare const areArraysOfObjectsEqual: (array1: any, array2: any) => boolean;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_browser as e } from "./node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js";
|
|
3
|
+
import { cloneDeep as t, head as n, isEmpty as r, isEqual as i, tail as a } from "@pie-element/shared-lodash";
|
|
4
|
+
import { utils as o } from "@pie-lib/plot";
|
|
5
|
+
e();
|
|
6
|
+
var s = o.bounds, c = o.point, l = () => 0, u = () => 0, d = (e) => {
|
|
7
|
+
let t = [], n = 0;
|
|
8
|
+
for (; n >= e.min && t.indexOf(n) < 0;) t.push(n), n = Math.round((n - e.step) * 1e4) / 1e4;
|
|
9
|
+
for (n = Math.round(e.step * 1e4) / 1e4; n <= e.max && t.indexOf(n) < 0;) t.push(n), n = Math.round((n + e.step) * 1e4) / 1e4;
|
|
10
|
+
return t ? t.filter((t) => t >= e.min && t <= e.max) : [];
|
|
11
|
+
}, f = (e) => e == null || r(e) ? 1 : e.split(" ").length, p = (e) => (e || "").replace(/<[^>]+>/g, "").split(" ").sort((e, t) => t.length - e.length)[0].length, m = (e) => e ? e * 10 : 0, h = (e) => {
|
|
12
|
+
let t = n(e), r = {
|
|
13
|
+
left: t.x,
|
|
14
|
+
top: t.y,
|
|
15
|
+
bottom: t.y,
|
|
16
|
+
right: t.x
|
|
17
|
+
};
|
|
18
|
+
return a(e).reduce((e, t) => (e.left = Math.min(e.left, t.x), e.top = Math.max(e.top, t.y), e.bottom = Math.min(e.bottom, t.y), e.right = Math.max(e.right, t.x), e), r);
|
|
19
|
+
}, g = (e) => {
|
|
20
|
+
let n = t(e);
|
|
21
|
+
return n.sort((e, t) => t.x - e.x), {
|
|
22
|
+
a: n[0],
|
|
23
|
+
b: n[1]
|
|
24
|
+
};
|
|
25
|
+
}, _ = (e, t) => ({
|
|
26
|
+
x: (e.x + t.x) / 2,
|
|
27
|
+
y: (e.y + t.y) / 2
|
|
28
|
+
}), v = (e) => parseFloat(e.toFixed(4)), y = (e, t) => e && t && (v(e.x) === v(t.x) || v(e.y) === v(t.y)), b = (e, t) => e && t && i({
|
|
29
|
+
x: v(e.x),
|
|
30
|
+
y: v(e.y)
|
|
31
|
+
}, {
|
|
32
|
+
x: v(t.x),
|
|
33
|
+
y: v(t.y)
|
|
34
|
+
}), x = (e, t) => {
|
|
35
|
+
let { min: n, max: r, step: i } = e;
|
|
36
|
+
return t / ((r - n) / i);
|
|
37
|
+
}, S = (e) => {
|
|
38
|
+
let { domain: t, range: n, size: { width: r, height: i } } = e;
|
|
39
|
+
return x(t, r) < 14 || x(n, i) < 14;
|
|
40
|
+
}, C = (e) => {
|
|
41
|
+
let { domain: t, range: n, size: { width: r, height: i } } = e, a = x(t, r), o = x(n, i), s = t.step / (a / 15), c = n.step / (o / 15);
|
|
42
|
+
return {
|
|
43
|
+
domain: {
|
|
44
|
+
min: t.min - s,
|
|
45
|
+
max: t.max + s
|
|
46
|
+
},
|
|
47
|
+
range: {
|
|
48
|
+
min: n.min - c,
|
|
49
|
+
max: n.max + c
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}, w = (e) => (e || []).sort((e, t) => e.x - t.x || e.y - t.y), T = (e, t, n) => (e.x - t.x) * (n.y - t.y) === (n.x - t.x) * (e.y - t.y), E = (e, t) => T(e.from, t.from, t.to) && T(e.to, t.from, t.to), D = (e, n, r) => {
|
|
53
|
+
let { type: a, building: o } = e;
|
|
54
|
+
if (o) return !1;
|
|
55
|
+
let s = (n || []).filter((e) => e.type === a && !e.building), c = s.findIndex((e) => i(e, r));
|
|
56
|
+
return c !== -1 && s.splice(c, 1), !!s.find((n) => {
|
|
57
|
+
if (a === "line") {
|
|
58
|
+
let { from: t, to: r } = e;
|
|
59
|
+
return b(t, n.from) && b(r, n.to) || b(t, n.to) && b(r, n.from) || a === "line" && E(n, e);
|
|
60
|
+
} else if (a === "polygon") return i(w(t(e.points)), w(t(n.points)));
|
|
61
|
+
});
|
|
62
|
+
}, O = (e, t) => {
|
|
63
|
+
if (e.length !== t.length) return !1;
|
|
64
|
+
for (let n = 0; n < e.length; n++) {
|
|
65
|
+
let r = e[n], i = t[n];
|
|
66
|
+
if (Object.keys(r).length !== Object.keys(i).length) return !1;
|
|
67
|
+
for (let e in r) if (r[e] !== i[e]) return !1;
|
|
68
|
+
}
|
|
69
|
+
return !0;
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { m as amountToIncreaseWidth, O as areArraysOfObjectsEqual, u as arrowDimensions, s as bounds, f as countWords, b as equalPoints, p as findLongestWord, C as getAdjustedGraphLimits, l as getAngleDeg, _ as getMiddleOfTwoPoints, g as getRightestPoints, d as getTickValues, D as isDuplicatedMark, c as point, h as polygonToArea, v as roundNumber, y as sameAxes, S as thinnerShapesNeeded };
|
package/package.json
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/graphing-solution-set",
|
|
3
|
-
"
|
|
4
|
-
"access": "public"
|
|
5
|
-
},
|
|
6
|
-
"version": "4.0.4-next.3+0f77a8069",
|
|
3
|
+
"version": "4.0.4-next.30",
|
|
7
4
|
"description": "Graphing components",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"react",
|
|
10
|
-
"pie",
|
|
11
|
-
"graphing"
|
|
12
|
-
],
|
|
13
|
-
"main": "lib/index.js",
|
|
14
|
-
"module": "src/index.js",
|
|
15
|
-
"author": "",
|
|
16
|
-
"license": "ISC",
|
|
17
|
-
"repository": "pie-framework/pie-lib",
|
|
18
5
|
"dependencies": {
|
|
19
6
|
"@dnd-kit/sortable": "10.0.0",
|
|
20
7
|
"@emotion/react": "^11.14.0",
|
|
@@ -22,13 +9,13 @@
|
|
|
22
9
|
"@mapbox/point-geometry": "^1.1.0",
|
|
23
10
|
"@mui/icons-material": "^7.3.4",
|
|
24
11
|
"@mui/material": "^7.3.4",
|
|
25
|
-
"@pie-lib/drag": "
|
|
26
|
-
"@pie-lib/editable-html-tip-tap": "
|
|
27
|
-
"@pie-lib/graphing-utils": "
|
|
28
|
-
"@pie-lib/plot": "
|
|
29
|
-
"@pie-lib/render-ui": "
|
|
30
|
-
"@pie-lib/tools": "
|
|
31
|
-
"@pie-lib/translator": "
|
|
12
|
+
"@pie-lib/drag": "4.0.3-next.37",
|
|
13
|
+
"@pie-lib/editable-html-tip-tap": "2.1.2-next.30",
|
|
14
|
+
"@pie-lib/graphing-utils": "3.0.3-next.0",
|
|
15
|
+
"@pie-lib/plot": "4.0.4-next.30",
|
|
16
|
+
"@pie-lib/render-ui": "6.1.1-next.37",
|
|
17
|
+
"@pie-lib/tools": "2.0.3-next.0",
|
|
18
|
+
"@pie-lib/translator": "4.0.3-next.0",
|
|
32
19
|
"@visx/axis": "^3.0.0",
|
|
33
20
|
"@visx/clip-path": "^3.0.0",
|
|
34
21
|
"@visx/curve": "^3.0.0",
|
|
@@ -37,24 +24,49 @@
|
|
|
37
24
|
"@visx/group": "^3.0.0",
|
|
38
25
|
"@visx/point": "^3.0.0",
|
|
39
26
|
"@visx/shape": "^3.0.0",
|
|
40
|
-
"classnames": "^2.2.6",
|
|
41
27
|
"d3-scale": "^4.0.2",
|
|
42
28
|
"d3-selection": "^3.0.0",
|
|
43
29
|
"debug": "^4.1.1",
|
|
44
30
|
"invariant": "^2.2.4",
|
|
45
|
-
"lodash-es": "^4.17.23",
|
|
46
31
|
"prop-types": "^15.7.2",
|
|
47
|
-
"react": "^
|
|
48
|
-
"react-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
32
|
+
"react-draggable": "^4.6.0",
|
|
33
|
+
"react-redux": "^9.3.0",
|
|
34
|
+
"redux": "^5.0.1",
|
|
35
|
+
"redux-undo": "^1.1.0",
|
|
36
|
+
"@pie-element/shared-lodash": "0.1.1-next.0",
|
|
37
|
+
"clsx": "^2.1.1",
|
|
38
|
+
"@pie-lib/config-ui": "13.0.4-next.30",
|
|
39
|
+
"@dnd-kit/core": "^6.3.1",
|
|
40
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
41
|
+
"d3-shape": "^3.2.0"
|
|
54
42
|
},
|
|
55
|
-
"
|
|
56
|
-
|
|
43
|
+
"type": "module",
|
|
44
|
+
"main": "./dist/index.js",
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"exports": {
|
|
47
|
+
".": {
|
|
48
|
+
"types": "./dist/index.d.ts",
|
|
49
|
+
"default": "./dist/index.js"
|
|
50
|
+
}
|
|
57
51
|
},
|
|
58
|
-
"
|
|
59
|
-
|
|
52
|
+
"files": [
|
|
53
|
+
"dist"
|
|
54
|
+
],
|
|
55
|
+
"sideEffects": false,
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "bun x vite build && bun x tsc --emitDeclarationOnly",
|
|
58
|
+
"dev": "bun x vite",
|
|
59
|
+
"test": "bun x vitest run"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"vite": "^8.0.1",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
65
|
+
"@types/react": "^18.2.0",
|
|
66
|
+
"@types/react-dom": "^18.2.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"react": "^18.0.0",
|
|
70
|
+
"react-dom": "^18.0.0"
|
|
71
|
+
}
|
|
60
72
|
}
|
package/CHANGELOG.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[]
|