@pie-lib/charting 7.0.3-next.3 → 7.0.4-next.0
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/actions-button.d.ts +26 -0
- package/dist/actions-button.js +84 -0
- package/dist/axes.d.ts +84 -0
- package/dist/axes.js +376 -0
- package/dist/bars/bar.d.ts +47 -0
- package/dist/bars/bar.js +27 -0
- package/dist/bars/common/bars.d.ts +98 -0
- package/dist/bars/common/bars.js +174 -0
- package/dist/bars/common/correct-check-icon.d.ts +18 -0
- package/dist/bars/common/correct-check-icon.js +50 -0
- package/dist/bars/histogram.d.ts +47 -0
- package/dist/bars/histogram.js +28 -0
- package/dist/chart-setup.d.ts +29 -0
- package/dist/chart-setup.js +231 -0
- package/dist/chart-type.d.ts +32 -0
- package/dist/chart-type.js +68 -0
- package/dist/chart-types.d.ts +41 -0
- package/dist/chart-types.js +17 -0
- package/dist/chart.d.ts +88 -0
- package/dist/chart.js +250 -0
- package/dist/common/correctness-indicators.d.ts +70 -0
- package/dist/common/correctness-indicators.js +106 -0
- package/dist/common/drag-handle.d.ts +129 -0
- package/dist/common/drag-handle.js +120 -0
- package/dist/common/drag-icon.d.ts +23 -0
- package/dist/common/drag-icon.js +45 -0
- package/dist/common/styles.d.ts +23 -0
- package/dist/common/styles.js +17 -0
- package/dist/grid.d.ts +45 -0
- package/dist/grid.js +56 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +6 -0
- package/dist/key-legend.d.ts +19 -0
- package/dist/key-legend.js +46 -0
- package/dist/line/common/drag-handle.d.ts +120 -0
- package/dist/line/common/drag-handle.js +92 -0
- package/dist/line/common/line.d.ts +96 -0
- package/dist/line/common/line.js +114 -0
- package/dist/line/line-cross.d.ts +47 -0
- package/dist/line/line-cross.js +133 -0
- package/dist/line/line-dot.d.ts +47 -0
- package/dist/line/line-dot.js +101 -0
- package/dist/mark-label.d.ts +55 -0
- package/dist/mark-label.js +139 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +100 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisBottom.js +45 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisLeft.js +46 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +61 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +42 -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/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 +49 -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/operators/align.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/base.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/clamp.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/constant.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/domain.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/exponent.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/interpolate.js +10 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/nice.js +37 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/padding.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/range.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/reverse.js +9 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/round.js +7 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/scaleOperator.js +58 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/unknown.js +6 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/zero.js +9 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/band.js +9 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/point.js +9 -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/createColorInterpolator.js +29 -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/isUtcScale.js +7 -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/Bar.js +28 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Circle.js +28 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +46 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +49 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +9 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +6 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +52 -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/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-interpolate.js +8 -0
- package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-scale.js +8 -0
- package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-time.js +8 -0
- package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +32 -0
- package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +33 -0
- package/dist/node_modules/.bun/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-input-autosize@2.2.2_f4eacebf2041cd4f/node_modules/react-input-autosize/lib/AutosizeInput.js +216 -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/plot/common/plot.d.ts +103 -0
- package/dist/plot/common/plot.js +227 -0
- package/dist/plot/dot.d.ts +47 -0
- package/dist/plot/dot.js +62 -0
- package/dist/plot/line.d.ts +47 -0
- package/dist/plot/line.js +84 -0
- package/dist/tool-menu.d.ts +31 -0
- package/dist/utils.d.ts +39 -0
- package/dist/utils.js +101 -0
- package/package.json +35 -25
- package/CHANGELOG.json +0 -17
- package/CHANGELOG.md +0 -1110
- package/LICENSE.md +0 -5
- package/lib/actions-button.js +0 -145
- package/lib/actions-button.js.map +0 -1
- package/lib/axes.js +0 -643
- package/lib/axes.js.map +0 -1
- package/lib/bars/bar.js +0 -58
- package/lib/bars/bar.js.map +0 -1
- package/lib/bars/common/bars.js +0 -277
- package/lib/bars/common/bars.js.map +0 -1
- package/lib/bars/common/correct-check-icon.js +0 -54
- package/lib/bars/common/correct-check-icon.js.map +0 -1
- package/lib/bars/histogram.js +0 -59
- package/lib/bars/histogram.js.map +0 -1
- package/lib/chart-setup.js +0 -382
- package/lib/chart-setup.js.map +0 -1
- package/lib/chart-type.js +0 -80
- package/lib/chart-type.js.map +0 -1
- package/lib/chart-types.js +0 -22
- package/lib/chart-types.js.map +0 -1
- package/lib/chart.js +0 -384
- package/lib/chart.js.map +0 -1
- package/lib/common/correctness-indicators.js +0 -156
- package/lib/common/correctness-indicators.js.map +0 -1
- package/lib/common/drag-handle.js +0 -160
- package/lib/common/drag-handle.js.map +0 -1
- package/lib/common/drag-icon.js +0 -52
- package/lib/common/drag-icon.js.map +0 -1
- package/lib/common/styles.js +0 -22
- package/lib/common/styles.js.map +0 -1
- package/lib/grid.js +0 -101
- package/lib/grid.js.map +0 -1
- package/lib/index.js +0 -42
- package/lib/index.js.map +0 -1
- package/lib/key-legend.js +0 -87
- package/lib/key-legend.js.map +0 -1
- package/lib/line/common/drag-handle.js +0 -146
- package/lib/line/common/drag-handle.js.map +0 -1
- package/lib/line/common/line.js +0 -214
- package/lib/line/common/line.js.map +0 -1
- package/lib/line/line-cross.js +0 -214
- package/lib/line/line-cross.js.map +0 -1
- package/lib/line/line-dot.js +0 -158
- package/lib/line/line-dot.js.map +0 -1
- package/lib/mark-label.js +0 -237
- package/lib/mark-label.js.map +0 -1
- package/lib/plot/common/plot.js +0 -349
- package/lib/plot/common/plot.js.map +0 -1
- package/lib/plot/dot.js +0 -110
- package/lib/plot/dot.js.map +0 -1
- package/lib/plot/line.js +0 -140
- package/lib/plot/line.js.map +0 -1
- package/lib/tool-menu.js +0 -106
- package/lib/tool-menu.js.map +0 -1
- package/lib/utils.js +0 -189
- package/lib/utils.js.map +0 -1
- package/src/__tests__/actions-button.test.jsx +0 -280
- package/src/__tests__/axes.test.jsx +0 -667
- package/src/__tests__/chart-setup.test.jsx +0 -532
- package/src/__tests__/chart-type.test.jsx +0 -23
- package/src/__tests__/chart.test.jsx +0 -86
- package/src/__tests__/grid.test.jsx +0 -37
- package/src/__tests__/key-legend.test.jsx +0 -223
- package/src/__tests__/mark-label.test.jsx +0 -33
- package/src/__tests__/tool-menu.test.jsx +0 -522
- package/src/__tests__/utils.js +0 -36
- package/src/__tests__/utils.test.js +0 -100
- package/src/actions-button.jsx +0 -115
- package/src/axes.jsx +0 -594
- package/src/bars/__tests__/bar.test.jsx +0 -45
- package/src/bars/__tests__/histogram.test.jsx +0 -45
- package/src/bars/__tests__/utils.js +0 -30
- package/src/bars/bar.js +0 -28
- package/src/bars/common/__tests__/bars.test.jsx +0 -68
- package/src/bars/common/__tests__/utils.js +0 -30
- package/src/bars/common/bars.jsx +0 -249
- package/src/bars/common/correct-check-icon.jsx +0 -25
- package/src/bars/histogram.js +0 -28
- package/src/chart-setup.jsx +0 -356
- package/src/chart-type.js +0 -59
- package/src/chart-types.js +0 -8
- package/src/chart.jsx +0 -357
- package/src/common/__tests__/correctness-indicators.test.jsx +0 -720
- package/src/common/__tests__/drag-handle.test.jsx +0 -58
- package/src/common/__tests__/utils.js +0 -30
- package/src/common/correctness-indicators.jsx +0 -128
- package/src/common/drag-handle.jsx +0 -125
- package/src/common/drag-icon.jsx +0 -36
- package/src/common/styles.js +0 -19
- package/src/grid.jsx +0 -68
- package/src/index.js +0 -7
- package/src/key-legend.jsx +0 -77
- package/src/line/__tests__/line-cross.test.jsx +0 -463
- package/src/line/__tests__/line-dot.test.jsx +0 -41
- package/src/line/__tests__/utils.js +0 -36
- package/src/line/common/__tests__/drag-handle.test.jsx +0 -62
- package/src/line/common/__tests__/line.test.jsx +0 -79
- package/src/line/common/__tests__/utils.js +0 -30
- package/src/line/common/drag-handle.jsx +0 -114
- package/src/line/common/line.jsx +0 -171
- package/src/line/line-cross.js +0 -144
- package/src/line/line-dot.js +0 -111
- package/src/mark-label.jsx +0 -238
- package/src/plot/__tests__/dot.test.jsx +0 -344
- package/src/plot/__tests__/line.test.jsx +0 -375
- package/src/plot/__tests__/utils.js +0 -30
- package/src/plot/common/__tests__/plot.test.jsx +0 -69
- package/src/plot/common/__tests__/utils.js +0 -30
- package/src/plot/common/plot.jsx +0 -358
- package/src/plot/dot.js +0 -74
- package/src/plot/line.js +0 -98
- package/src/tool-menu.jsx +0 -85
- package/src/utils.js +0 -201
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { disabled as e } from "../../common/styles.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { styled as r } from "@mui/material/styles";
|
|
5
|
+
import { gridDraggable as i, types as a, utils as o } from "@pie-lib/plot";
|
|
6
|
+
import s from "classnames";
|
|
7
|
+
import { color as c } from "@pie-lib/render-ui";
|
|
8
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
+
//#region src/line/common/drag-handle.tsx
|
|
10
|
+
var u = r("g")(({ theme: t }) => ({
|
|
11
|
+
color: "black",
|
|
12
|
+
"& .handle": {
|
|
13
|
+
transition: "fill 200ms linear, height 200ms linear",
|
|
14
|
+
"&.non-interactive": e("fill")
|
|
15
|
+
},
|
|
16
|
+
"& .transparentHandle": {
|
|
17
|
+
height: "20px",
|
|
18
|
+
fill: "transparent",
|
|
19
|
+
stroke: "transparent"
|
|
20
|
+
},
|
|
21
|
+
"& .line": {
|
|
22
|
+
stroke: c.defaults.TEXT,
|
|
23
|
+
transition: "fill 200ms linear, height 200ms linear",
|
|
24
|
+
"&.non-interactive": e("stroke")
|
|
25
|
+
},
|
|
26
|
+
"& .disabledPoint": {
|
|
27
|
+
fill: c.defaults.BLACK + " !important",
|
|
28
|
+
stroke: c.defaults.BLACK + " !important"
|
|
29
|
+
},
|
|
30
|
+
"& .correctIcon": { backgroundColor: c.correct() },
|
|
31
|
+
"& .incorrectIcon": { backgroundColor: c.incorrectWithIcon() },
|
|
32
|
+
"& .correctnessIcon": {
|
|
33
|
+
borderRadius: t.spacing(2),
|
|
34
|
+
color: c.defaults.WHITE,
|
|
35
|
+
fontSize: "16px",
|
|
36
|
+
width: "16px",
|
|
37
|
+
height: "16px",
|
|
38
|
+
padding: "2px",
|
|
39
|
+
border: `1px solid ${c.defaults.WHITE}`,
|
|
40
|
+
stroke: "initial",
|
|
41
|
+
boxSizing: "unset"
|
|
42
|
+
},
|
|
43
|
+
"& .smallIcon": {
|
|
44
|
+
fontSize: "10px",
|
|
45
|
+
width: "10px",
|
|
46
|
+
height: "10px"
|
|
47
|
+
}
|
|
48
|
+
})), d = class extends t.Component {
|
|
49
|
+
static propTypes = {
|
|
50
|
+
x: n.number.isRequired,
|
|
51
|
+
y: n.number.isRequired,
|
|
52
|
+
width: n.number,
|
|
53
|
+
graphProps: a.GraphPropsType.isRequired,
|
|
54
|
+
className: n.string,
|
|
55
|
+
interactive: n.bool,
|
|
56
|
+
CustomDraggableComponent: n.func,
|
|
57
|
+
correctness: n.shape({
|
|
58
|
+
value: n.string,
|
|
59
|
+
label: n.string
|
|
60
|
+
})
|
|
61
|
+
};
|
|
62
|
+
render() {
|
|
63
|
+
let { x: e, y: t, graphProps: n, className: r, interactive: i, CustomDraggableComponent: a, correctness: o, ...c } = this.props, { scale: d } = n;
|
|
64
|
+
return a ? /* @__PURE__ */ l(u, { children: /* @__PURE__ */ l(a, {
|
|
65
|
+
scale: d,
|
|
66
|
+
x: e,
|
|
67
|
+
y: t,
|
|
68
|
+
className: s(r, !i && "non-interactive"),
|
|
69
|
+
correctness: o,
|
|
70
|
+
interactive: i,
|
|
71
|
+
...c
|
|
72
|
+
}) }) : null;
|
|
73
|
+
}
|
|
74
|
+
}, f = i({
|
|
75
|
+
axis: "y",
|
|
76
|
+
fromDelta: (e, t) => (t.x = 0, o.point(e).add(o.point(t)).y),
|
|
77
|
+
bounds: (e, { domain: t, range: n }) => {
|
|
78
|
+
let r = {
|
|
79
|
+
left: 0,
|
|
80
|
+
top: e.y,
|
|
81
|
+
bottom: e.y,
|
|
82
|
+
right: 0
|
|
83
|
+
};
|
|
84
|
+
return o.bounds(r, t, n);
|
|
85
|
+
},
|
|
86
|
+
anchorPoint: (e) => ({
|
|
87
|
+
x: e.x,
|
|
88
|
+
y: e.y
|
|
89
|
+
})
|
|
90
|
+
})(d);
|
|
91
|
+
//#endregion
|
|
92
|
+
export { d as DragHandle, f as default };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/line/common/line.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 RawLine extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
value: PropTypes.Requireable<number>;
|
|
15
|
+
label: PropTypes.Requireable<string>;
|
|
16
|
+
xBand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
|
+
index: PropTypes.Validator<number>;
|
|
18
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
19
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
20
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
21
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
22
|
+
}>>>;
|
|
23
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
24
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
25
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
26
|
+
}>>>;
|
|
27
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
28
|
+
min: PropTypes.Validator<number>;
|
|
29
|
+
max: PropTypes.Validator<number>;
|
|
30
|
+
step: PropTypes.Requireable<number>;
|
|
31
|
+
}>>>;
|
|
32
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
33
|
+
min: PropTypes.Validator<number>;
|
|
34
|
+
max: PropTypes.Validator<number>;
|
|
35
|
+
step: PropTypes.Requireable<number>;
|
|
36
|
+
}>>>;
|
|
37
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
38
|
+
width: PropTypes.Validator<number>;
|
|
39
|
+
height: PropTypes.Validator<number>;
|
|
40
|
+
}>>>;
|
|
41
|
+
}>>>;
|
|
42
|
+
defineChart: PropTypes.Requireable<boolean>;
|
|
43
|
+
data: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
44
|
+
label: PropTypes.Requireable<string>;
|
|
45
|
+
value: PropTypes.Requireable<number>;
|
|
46
|
+
}> | null | undefined)[]>;
|
|
47
|
+
CustomDraggableComponent: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
+
correctData: PropTypes.Requireable<any[]>;
|
|
49
|
+
};
|
|
50
|
+
static defaultProps: {
|
|
51
|
+
index: number;
|
|
52
|
+
};
|
|
53
|
+
constructor(props: any);
|
|
54
|
+
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
55
|
+
setDragValue: (line: any) => void;
|
|
56
|
+
dragStop: any;
|
|
57
|
+
dragValue: any;
|
|
58
|
+
render(): React.JSX.Element;
|
|
59
|
+
}
|
|
60
|
+
export declare class Line extends React.Component {
|
|
61
|
+
static propTypes: {
|
|
62
|
+
data: PropTypes.Requireable<any[]>;
|
|
63
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
|
+
xBand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
66
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
67
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
68
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
69
|
+
}>>>;
|
|
70
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
71
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
72
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
73
|
+
}>>>;
|
|
74
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
75
|
+
min: PropTypes.Validator<number>;
|
|
76
|
+
max: PropTypes.Validator<number>;
|
|
77
|
+
step: PropTypes.Requireable<number>;
|
|
78
|
+
}>>>;
|
|
79
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
80
|
+
min: PropTypes.Validator<number>;
|
|
81
|
+
max: PropTypes.Validator<number>;
|
|
82
|
+
step: PropTypes.Requireable<number>;
|
|
83
|
+
}>>>;
|
|
84
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
85
|
+
width: PropTypes.Validator<number>;
|
|
86
|
+
height: PropTypes.Validator<number>;
|
|
87
|
+
}>>>;
|
|
88
|
+
}>>>;
|
|
89
|
+
CustomDraggableComponent: PropTypes.Requireable<(...args: any[]) => any>;
|
|
90
|
+
defineChart: PropTypes.Requireable<boolean>;
|
|
91
|
+
correctData: PropTypes.Requireable<any[]>;
|
|
92
|
+
};
|
|
93
|
+
changeLine: any;
|
|
94
|
+
render(): React.JSX.Element;
|
|
95
|
+
}
|
|
96
|
+
export default Line;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import e from "../../node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js";
|
|
2
|
+
import t from "../../node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js";
|
|
3
|
+
import n, { DragHandle as r } from "./drag-handle.js";
|
|
4
|
+
import i from "react";
|
|
5
|
+
import a from "prop-types";
|
|
6
|
+
import { styled as o } from "@mui/material/styles";
|
|
7
|
+
import { isEqual as s } from "lodash-es";
|
|
8
|
+
import { types as c } from "@pie-lib/plot";
|
|
9
|
+
import { color as l } from "@pie-lib/render-ui";
|
|
10
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
|
+
//#region src/line/common/line.tsx
|
|
12
|
+
var f = (e, t) => {
|
|
13
|
+
let { max: n } = t || {}, r = e.length;
|
|
14
|
+
return !n || !r ? [] : e.map((e, t) => ({
|
|
15
|
+
...e,
|
|
16
|
+
x: r > 1 ? t * (n / (r - 1)) : .5,
|
|
17
|
+
y: e.value
|
|
18
|
+
}));
|
|
19
|
+
}, p = o(t)(() => ({
|
|
20
|
+
fill: "transparent",
|
|
21
|
+
stroke: l.defaults.TERTIARY,
|
|
22
|
+
strokeWidth: 3,
|
|
23
|
+
transition: "stroke 200ms ease-in, stroke-width 200ms ease-in"
|
|
24
|
+
})), m = o(class extends i.Component {
|
|
25
|
+
static propTypes = {
|
|
26
|
+
onChange: a.func,
|
|
27
|
+
value: a.number,
|
|
28
|
+
label: a.string,
|
|
29
|
+
xBand: a.func,
|
|
30
|
+
index: a.number.isRequired,
|
|
31
|
+
graphProps: c.GraphPropsType.isRequired,
|
|
32
|
+
defineChart: a.bool,
|
|
33
|
+
data: a.arrayOf(a.shape({
|
|
34
|
+
label: a.string,
|
|
35
|
+
value: a.number
|
|
36
|
+
})),
|
|
37
|
+
CustomDraggableComponent: a.func,
|
|
38
|
+
correctData: a.array
|
|
39
|
+
};
|
|
40
|
+
static defaultProps = { index: 0 };
|
|
41
|
+
constructor(e) {
|
|
42
|
+
super(e), this.state = {
|
|
43
|
+
dragValue: void 0,
|
|
44
|
+
line: f(e.data, e.graphProps.domain)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
48
|
+
s(this.props.data, e.data) || this.setState({ line: f(e.data, e.graphProps.domain) });
|
|
49
|
+
}
|
|
50
|
+
setDragValue = (e) => this.setState({ line: e });
|
|
51
|
+
dragStop = (e) => {
|
|
52
|
+
let { onChange: t } = this.props;
|
|
53
|
+
this.setState({ dragging: !1 }, () => {
|
|
54
|
+
t(e, this.state.line[e]);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
dragValue = (e, t, n) => {
|
|
58
|
+
let r = [...this.state.line];
|
|
59
|
+
r[e].dragValue = n, this.setDragValue(r);
|
|
60
|
+
};
|
|
61
|
+
render() {
|
|
62
|
+
let { graphProps: e, data: t, CustomDraggableComponent: a, defineChart: o, correctData: s } = this.props, { line: c, dragging: l } = this.state, { scale: m } = e, h = l ? c : f(t, e.domain);
|
|
63
|
+
return /* @__PURE__ */ d(i.Fragment, { children: [/* @__PURE__ */ u(p, {
|
|
64
|
+
data: h,
|
|
65
|
+
x: (e) => m.x(e.x),
|
|
66
|
+
y: (e) => m.y(e.dragValue === void 0 ? e.y : e.dragValue),
|
|
67
|
+
className: "line"
|
|
68
|
+
}), h && h.map((t, i) => {
|
|
69
|
+
let c = o || t.interactive;
|
|
70
|
+
return /* @__PURE__ */ u(c ? n : r, {
|
|
71
|
+
x: t.x,
|
|
72
|
+
y: t.dragValue === void 0 ? t.y : t.dragValue,
|
|
73
|
+
interactive: c,
|
|
74
|
+
r: 6,
|
|
75
|
+
onDragStart: () => this.setState({ dragging: !0 }),
|
|
76
|
+
onDrag: (e) => this.dragValue(i, t.dragValue === void 0 ? t.y : t.dragValue, e),
|
|
77
|
+
onDragStop: () => this.dragStop(i),
|
|
78
|
+
graphProps: e,
|
|
79
|
+
CustomDraggableComponent: a,
|
|
80
|
+
correctness: t.correctness,
|
|
81
|
+
correctData: s,
|
|
82
|
+
label: t.label
|
|
83
|
+
}, `point-${t.x}-${i}`);
|
|
84
|
+
})] });
|
|
85
|
+
}
|
|
86
|
+
})(() => ({ "& .line": {
|
|
87
|
+
fill: "transparent",
|
|
88
|
+
stroke: l.defaults.TERTIARY,
|
|
89
|
+
strokeWidth: 3,
|
|
90
|
+
transition: "stroke 200ms ease-in, stroke-width 200ms ease-in"
|
|
91
|
+
} })), h = class extends i.Component {
|
|
92
|
+
static propTypes = {
|
|
93
|
+
data: a.array,
|
|
94
|
+
onChange: a.func,
|
|
95
|
+
xBand: a.func,
|
|
96
|
+
graphProps: c.GraphPropsType.isRequired,
|
|
97
|
+
CustomDraggableComponent: a.func,
|
|
98
|
+
defineChart: a.bool,
|
|
99
|
+
correctData: a.array
|
|
100
|
+
};
|
|
101
|
+
changeLine = (e, t) => {
|
|
102
|
+
let { onChange: n } = this.props, r = [...this.props.data], { dragValue: i, value: a } = t;
|
|
103
|
+
r[e].value = i >= 0 ? i : a, n(r);
|
|
104
|
+
};
|
|
105
|
+
render() {
|
|
106
|
+
let t = this.props;
|
|
107
|
+
return /* @__PURE__ */ u(e, { children: /* @__PURE__ */ u(m, {
|
|
108
|
+
...t,
|
|
109
|
+
onChange: this.changeLine
|
|
110
|
+
}) });
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
114
|
+
export { h as default };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/line/line-cross.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 React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class LineCross extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
data: PropTypes.Requireable<any[]>;
|
|
14
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
16
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
17
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
+
}>>>;
|
|
20
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
21
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
22
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
23
|
+
}>>>;
|
|
24
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
25
|
+
min: PropTypes.Validator<number>;
|
|
26
|
+
max: PropTypes.Validator<number>;
|
|
27
|
+
step: PropTypes.Requireable<number>;
|
|
28
|
+
}>>>;
|
|
29
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
30
|
+
min: PropTypes.Validator<number>;
|
|
31
|
+
max: PropTypes.Validator<number>;
|
|
32
|
+
step: PropTypes.Requireable<number>;
|
|
33
|
+
}>>>;
|
|
34
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
35
|
+
width: PropTypes.Validator<number>;
|
|
36
|
+
height: PropTypes.Validator<number>;
|
|
37
|
+
}>>>;
|
|
38
|
+
}>>>;
|
|
39
|
+
};
|
|
40
|
+
render(): React.JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
declare const _default: () => {
|
|
43
|
+
type: string;
|
|
44
|
+
Component: typeof LineCross;
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import e from "../node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js";
|
|
2
|
+
import t from "../node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js";
|
|
3
|
+
import { CorrectnessIndicator as n, SmallCorrectPointIndicator as r } from "../common/correctness-indicators.js";
|
|
4
|
+
import { dataToXBand as i } from "../utils.js";
|
|
5
|
+
import a from "./common/line.js";
|
|
6
|
+
import o, { useState as s } from "react";
|
|
7
|
+
import c from "prop-types";
|
|
8
|
+
import { styled as l } from "@mui/material/styles";
|
|
9
|
+
import { types as u } from "@pie-lib/plot";
|
|
10
|
+
import { color as d } from "@pie-lib/render-ui";
|
|
11
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
|
+
//#region src/line/line-cross.tsx
|
|
13
|
+
var m = l(t)(() => ({
|
|
14
|
+
stroke: d.defaults.TEXT,
|
|
15
|
+
transition: "fill 200ms linear, height 200ms linear",
|
|
16
|
+
"&.non-interactive": { stroke: d.disabled?.() || "#ccc" }
|
|
17
|
+
})), h = l(e)(({ correctness: e, interactive: t }) => ({
|
|
18
|
+
stroke: d.defaults.TEXT,
|
|
19
|
+
transition: "fill 200ms linear, height 200ms linear",
|
|
20
|
+
...e && !t && {
|
|
21
|
+
fill: `${d.defaults.BLACK} !important`,
|
|
22
|
+
stroke: `${d.defaults.BLACK} !important`
|
|
23
|
+
},
|
|
24
|
+
"&.non-interactive": { stroke: d.disabled?.() || "#ccc" }
|
|
25
|
+
})), g = l("circle")(() => ({
|
|
26
|
+
height: "20px",
|
|
27
|
+
fill: "transparent",
|
|
28
|
+
stroke: "transparent"
|
|
29
|
+
})), _ = (e) => {
|
|
30
|
+
let { className: t, scale: i, x: a, y: o, r: c, correctness: l, interactive: u, correctData: _, label: v, ...y } = e, [b, x] = s(!1), S = c * 4, C = S / 2, w = i.x(a), T = i.y(o);
|
|
31
|
+
return /* @__PURE__ */ p(h, {
|
|
32
|
+
className: t,
|
|
33
|
+
correctness: l,
|
|
34
|
+
interactive: u,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ f(m, {
|
|
37
|
+
data: [{
|
|
38
|
+
x: i.x(a) - c,
|
|
39
|
+
y: i.y(o) + c
|
|
40
|
+
}, {
|
|
41
|
+
x: i.x(a) + c,
|
|
42
|
+
y: i.y(o) - c
|
|
43
|
+
}],
|
|
44
|
+
x: (e) => e.x,
|
|
45
|
+
y: (e) => e.y,
|
|
46
|
+
strokeWidth: 5,
|
|
47
|
+
style: { pointerEvents: "none" }
|
|
48
|
+
}, `point-${a}-${o}-1`),
|
|
49
|
+
/* @__PURE__ */ f(m, {
|
|
50
|
+
data: [{
|
|
51
|
+
x: i.x(a) - c,
|
|
52
|
+
y: i.y(o) - c
|
|
53
|
+
}, {
|
|
54
|
+
x: i.x(a) + c,
|
|
55
|
+
y: i.y(o) + c
|
|
56
|
+
}],
|
|
57
|
+
x: (e) => e.x,
|
|
58
|
+
y: (e) => e.y,
|
|
59
|
+
strokeWidth: 5,
|
|
60
|
+
style: { pointerEvents: "none" }
|
|
61
|
+
}, `point-${a}-${o}-2`),
|
|
62
|
+
b && /* @__PURE__ */ f("rect", {
|
|
63
|
+
x: w - C,
|
|
64
|
+
y: T - C,
|
|
65
|
+
width: S,
|
|
66
|
+
height: S,
|
|
67
|
+
stroke: d.defaults.BORDER_GRAY,
|
|
68
|
+
fill: "none",
|
|
69
|
+
strokeWidth: 2,
|
|
70
|
+
pointerEvents: "none"
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ f(g, {
|
|
73
|
+
cx: w,
|
|
74
|
+
cy: T,
|
|
75
|
+
r: c * 2,
|
|
76
|
+
onMouseEnter: () => x(!0),
|
|
77
|
+
onMouseLeave: () => x(!1),
|
|
78
|
+
...y
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ f(n, {
|
|
81
|
+
scale: i,
|
|
82
|
+
x: a,
|
|
83
|
+
y: o,
|
|
84
|
+
r: c,
|
|
85
|
+
correctness: l,
|
|
86
|
+
interactive: u
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ f(r, {
|
|
89
|
+
scale: i,
|
|
90
|
+
x: a,
|
|
91
|
+
r: c,
|
|
92
|
+
correctness: l,
|
|
93
|
+
correctData: _,
|
|
94
|
+
label: v
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
_.propTypes = {
|
|
100
|
+
scale: c.object,
|
|
101
|
+
x: c.number,
|
|
102
|
+
y: c.number,
|
|
103
|
+
r: c.number,
|
|
104
|
+
className: c.string,
|
|
105
|
+
correctness: c.shape({
|
|
106
|
+
value: c.string,
|
|
107
|
+
label: c.string
|
|
108
|
+
}),
|
|
109
|
+
interactive: c.bool,
|
|
110
|
+
correctData: c.array,
|
|
111
|
+
label: c.string
|
|
112
|
+
};
|
|
113
|
+
var v = class extends o.Component {
|
|
114
|
+
static propTypes = {
|
|
115
|
+
data: c.array,
|
|
116
|
+
onChange: c.func,
|
|
117
|
+
graphProps: u.GraphPropsType.isRequired
|
|
118
|
+
};
|
|
119
|
+
render() {
|
|
120
|
+
let e = this.props, { data: t, graphProps: n } = e, { scale: r = {}, size: o = {} } = n || {}, s = i(r.x, t, o.width, "lineCross");
|
|
121
|
+
return /* @__PURE__ */ f(a, {
|
|
122
|
+
...e,
|
|
123
|
+
xBand: s,
|
|
124
|
+
CustomDraggableComponent: _
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}, y = () => ({
|
|
128
|
+
type: "lineCross",
|
|
129
|
+
Component: v,
|
|
130
|
+
name: "Line Cross"
|
|
131
|
+
});
|
|
132
|
+
//#endregion
|
|
133
|
+
export { y as default };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/line/line-dot.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 React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class LineDot extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
data: PropTypes.Requireable<any[]>;
|
|
14
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
16
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
17
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
+
}>>>;
|
|
20
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
21
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
22
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
23
|
+
}>>>;
|
|
24
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
25
|
+
min: PropTypes.Validator<number>;
|
|
26
|
+
max: PropTypes.Validator<number>;
|
|
27
|
+
step: PropTypes.Requireable<number>;
|
|
28
|
+
}>>>;
|
|
29
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
30
|
+
min: PropTypes.Validator<number>;
|
|
31
|
+
max: PropTypes.Validator<number>;
|
|
32
|
+
step: PropTypes.Requireable<number>;
|
|
33
|
+
}>>>;
|
|
34
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
35
|
+
width: PropTypes.Validator<number>;
|
|
36
|
+
height: PropTypes.Validator<number>;
|
|
37
|
+
}>>>;
|
|
38
|
+
}>>>;
|
|
39
|
+
};
|
|
40
|
+
render(): React.JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
declare const _default: () => {
|
|
43
|
+
type: string;
|
|
44
|
+
Component: typeof LineDot;
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CorrectnessIndicator as e, SmallCorrectPointIndicator as t } from "../common/correctness-indicators.js";
|
|
2
|
+
import { dataToXBand as n } from "../utils.js";
|
|
3
|
+
import r from "./common/line.js";
|
|
4
|
+
import i from "react";
|
|
5
|
+
import a from "prop-types";
|
|
6
|
+
import { styled as o } from "@mui/material/styles";
|
|
7
|
+
import { types as s } from "@pie-lib/plot";
|
|
8
|
+
import { color as c } from "@pie-lib/render-ui";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
//#region src/line/line-dot.tsx
|
|
11
|
+
var d = o("circle")(() => ({})), f = o("circle")(() => ({
|
|
12
|
+
height: "20px",
|
|
13
|
+
fill: "transparent",
|
|
14
|
+
stroke: "none",
|
|
15
|
+
pointerEvents: "auto"
|
|
16
|
+
})), p = ({ scale: n, x: r, y: a, r: o, correctness: s, interactive: p, correctData: m, label: h, ...g }) => {
|
|
17
|
+
let [_, v] = i.useState(!1), y = !s && p;
|
|
18
|
+
return /* @__PURE__ */ u("g", {
|
|
19
|
+
onMouseEnter: () => v(!0),
|
|
20
|
+
onMouseLeave: () => v(!1),
|
|
21
|
+
onTouchStart: () => v(!0),
|
|
22
|
+
onTouchEnd: () => v(!1),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ l(f, {
|
|
25
|
+
cx: n.x(r),
|
|
26
|
+
cy: n.y(a),
|
|
27
|
+
r: o * 3,
|
|
28
|
+
onMouseEnter: () => v(!0),
|
|
29
|
+
onMouseLeave: () => v(!1),
|
|
30
|
+
...g
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ l(d, {
|
|
33
|
+
cx: n.x(r),
|
|
34
|
+
cy: n.y(a),
|
|
35
|
+
r: o,
|
|
36
|
+
correctness: s,
|
|
37
|
+
interactive: p,
|
|
38
|
+
...g
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ l(e, {
|
|
41
|
+
scale: n,
|
|
42
|
+
x: r,
|
|
43
|
+
y: a,
|
|
44
|
+
r: o,
|
|
45
|
+
correctness: s,
|
|
46
|
+
interactive: p
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ l(t, {
|
|
49
|
+
scale: n,
|
|
50
|
+
x: r,
|
|
51
|
+
r: o,
|
|
52
|
+
correctness: s,
|
|
53
|
+
correctData: m,
|
|
54
|
+
label: h
|
|
55
|
+
}),
|
|
56
|
+
_ && y && /* @__PURE__ */ l("rect", {
|
|
57
|
+
x: n.x(r) - o * 2,
|
|
58
|
+
y: n.y(a) - o * 2,
|
|
59
|
+
width: o * 4,
|
|
60
|
+
height: o * 4,
|
|
61
|
+
stroke: c.defaults.BORDER_GRAY,
|
|
62
|
+
strokeWidth: "1",
|
|
63
|
+
fill: "none"
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
p.propTypes = {
|
|
69
|
+
scale: a.object,
|
|
70
|
+
x: a.number,
|
|
71
|
+
y: a.number,
|
|
72
|
+
r: a.number,
|
|
73
|
+
correctness: a.shape({
|
|
74
|
+
value: a.string,
|
|
75
|
+
label: a.string
|
|
76
|
+
}),
|
|
77
|
+
interactive: a.bool,
|
|
78
|
+
correctData: a.array,
|
|
79
|
+
label: a.string
|
|
80
|
+
};
|
|
81
|
+
var m = class extends i.Component {
|
|
82
|
+
static propTypes = {
|
|
83
|
+
data: a.array,
|
|
84
|
+
onChange: a.func,
|
|
85
|
+
graphProps: s.GraphPropsType.isRequired
|
|
86
|
+
};
|
|
87
|
+
render() {
|
|
88
|
+
let e = this.props, { data: t, graphProps: i } = e, { scale: a = {}, size: o = {} } = i || {}, s = n(a.x, t, o.width, "lineDot");
|
|
89
|
+
return /* @__PURE__ */ l(r, {
|
|
90
|
+
...e,
|
|
91
|
+
xBand: s,
|
|
92
|
+
CustomDraggableComponent: p
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, h = () => ({
|
|
96
|
+
type: "lineDot",
|
|
97
|
+
Component: m,
|
|
98
|
+
name: "Line Dot"
|
|
99
|
+
});
|
|
100
|
+
//#endregion
|
|
101
|
+
export { h as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/mark-label.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 MarkLabel: {
|
|
12
|
+
(props: any): React.JSX.Element;
|
|
13
|
+
propTypes: {
|
|
14
|
+
autoFocus: PropTypes.Requireable<boolean>;
|
|
15
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
16
|
+
error: PropTypes.Requireable<any>;
|
|
17
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
graphProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
20
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
21
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
22
|
+
}>>>;
|
|
23
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
24
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
25
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
26
|
+
}>>>;
|
|
27
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
28
|
+
min: PropTypes.Validator<number>;
|
|
29
|
+
max: PropTypes.Validator<number>;
|
|
30
|
+
step: PropTypes.Requireable<number>;
|
|
31
|
+
}>>>;
|
|
32
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
33
|
+
min: PropTypes.Validator<number>;
|
|
34
|
+
max: PropTypes.Validator<number>;
|
|
35
|
+
step: PropTypes.Requireable<number>;
|
|
36
|
+
}>>>;
|
|
37
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
38
|
+
width: PropTypes.Validator<number>;
|
|
39
|
+
height: PropTypes.Validator<number>;
|
|
40
|
+
}>>>;
|
|
41
|
+
}>>;
|
|
42
|
+
inputRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
|
+
mark: PropTypes.Requireable<object>;
|
|
44
|
+
barWidth: PropTypes.Requireable<number>;
|
|
45
|
+
rotate: PropTypes.Requireable<number>;
|
|
46
|
+
correctness: PropTypes.Requireable<PropTypes.InferProps<{
|
|
47
|
+
value: PropTypes.Requireable<string>;
|
|
48
|
+
label: PropTypes.Requireable<string>;
|
|
49
|
+
}>>;
|
|
50
|
+
isHiddenLabel: PropTypes.Requireable<boolean>;
|
|
51
|
+
limitCharacters: PropTypes.Requireable<boolean>;
|
|
52
|
+
correctnessIndicator: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export default MarkLabel;
|