@pie-lib/charting 7.0.4-next.30 → 7.0.4-next.34
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/CHANGELOG.json +17 -0
- package/CHANGELOG.md +1116 -0
- package/LICENSE.md +5 -0
- package/lib/actions-button.js +145 -0
- package/lib/actions-button.js.map +1 -0
- package/lib/axes.js +643 -0
- package/lib/axes.js.map +1 -0
- package/lib/bars/bar.js +58 -0
- package/lib/bars/bar.js.map +1 -0
- package/lib/bars/common/bars.js +277 -0
- package/lib/bars/common/bars.js.map +1 -0
- package/lib/bars/common/correct-check-icon.js +54 -0
- package/lib/bars/common/correct-check-icon.js.map +1 -0
- package/lib/bars/histogram.js +59 -0
- package/lib/bars/histogram.js.map +1 -0
- package/lib/chart-setup.js +382 -0
- package/lib/chart-setup.js.map +1 -0
- package/lib/chart-type.js +80 -0
- package/lib/chart-type.js.map +1 -0
- package/lib/chart-types.js +22 -0
- package/lib/chart-types.js.map +1 -0
- package/lib/chart.js +384 -0
- package/lib/chart.js.map +1 -0
- package/lib/common/correctness-indicators.js +156 -0
- package/lib/common/correctness-indicators.js.map +1 -0
- package/lib/common/drag-handle.js +160 -0
- package/lib/common/drag-handle.js.map +1 -0
- package/lib/common/drag-icon.js +52 -0
- package/lib/common/drag-icon.js.map +1 -0
- package/lib/common/styles.js +22 -0
- package/lib/common/styles.js.map +1 -0
- package/lib/grid.js +112 -0
- package/lib/grid.js.map +1 -0
- package/lib/index.js +42 -0
- package/lib/index.js.map +1 -0
- package/lib/key-legend.js +87 -0
- package/lib/key-legend.js.map +1 -0
- package/lib/line/common/drag-handle.js +146 -0
- package/lib/line/common/drag-handle.js.map +1 -0
- package/lib/line/common/line.js +214 -0
- package/lib/line/common/line.js.map +1 -0
- package/lib/line/line-cross.js +214 -0
- package/lib/line/line-cross.js.map +1 -0
- package/lib/line/line-dot.js +158 -0
- package/lib/line/line-dot.js.map +1 -0
- package/lib/mark-label.js +237 -0
- package/lib/mark-label.js.map +1 -0
- package/lib/plot/common/plot.js +349 -0
- package/lib/plot/common/plot.js.map +1 -0
- package/lib/plot/dot.js +110 -0
- package/lib/plot/dot.js.map +1 -0
- package/lib/plot/line.js +140 -0
- package/lib/plot/line.js.map +1 -0
- package/lib/tool-menu.js +106 -0
- package/lib/tool-menu.js.map +1 -0
- package/lib/utils.js +189 -0
- package/lib/utils.js.map +1 -0
- package/package.json +28 -39
- package/src/__tests__/actions-button.test.jsx +280 -0
- package/src/__tests__/axes.test.jsx +667 -0
- package/src/__tests__/chart-setup.test.jsx +532 -0
- package/src/__tests__/chart-type.test.jsx +23 -0
- package/src/__tests__/chart.test.jsx +86 -0
- package/src/__tests__/grid.test.jsx +37 -0
- package/src/__tests__/key-legend.test.jsx +223 -0
- package/src/__tests__/mark-label.test.jsx +33 -0
- package/src/__tests__/tool-menu.test.jsx +522 -0
- package/src/__tests__/utils.js +36 -0
- package/src/__tests__/utils.test.js +100 -0
- package/src/actions-button.jsx +115 -0
- package/src/axes.jsx +594 -0
- package/src/bars/__tests__/bar.test.jsx +45 -0
- package/src/bars/__tests__/histogram.test.jsx +45 -0
- package/src/bars/__tests__/utils.js +30 -0
- package/src/bars/bar.js +28 -0
- package/src/bars/common/__tests__/bars.test.jsx +68 -0
- package/src/bars/common/__tests__/utils.js +30 -0
- package/src/bars/common/bars.jsx +249 -0
- package/src/bars/common/correct-check-icon.jsx +25 -0
- package/src/bars/histogram.js +28 -0
- package/src/chart-setup.jsx +356 -0
- package/src/chart-type.js +59 -0
- package/src/chart-types.js +8 -0
- package/src/chart.jsx +357 -0
- package/src/common/__tests__/correctness-indicators.test.jsx +720 -0
- package/src/common/__tests__/drag-handle.test.jsx +58 -0
- package/src/common/__tests__/utils.js +30 -0
- package/src/common/correctness-indicators.jsx +128 -0
- package/src/common/drag-handle.jsx +125 -0
- package/src/common/drag-icon.jsx +36 -0
- package/src/common/styles.js +19 -0
- package/src/grid.jsx +80 -0
- package/src/index.js +7 -0
- package/src/key-legend.jsx +77 -0
- package/src/line/__tests__/line-cross.test.jsx +463 -0
- package/src/line/__tests__/line-dot.test.jsx +41 -0
- package/src/line/__tests__/utils.js +36 -0
- package/src/line/common/__tests__/drag-handle.test.jsx +62 -0
- package/src/line/common/__tests__/line.test.jsx +79 -0
- package/src/line/common/__tests__/utils.js +30 -0
- package/src/line/common/drag-handle.jsx +114 -0
- package/src/line/common/line.jsx +171 -0
- package/src/line/line-cross.js +144 -0
- package/src/line/line-dot.js +111 -0
- package/src/mark-label.jsx +238 -0
- package/src/plot/__tests__/dot.test.jsx +344 -0
- package/src/plot/__tests__/line.test.jsx +375 -0
- package/src/plot/__tests__/utils.js +30 -0
- package/src/plot/common/__tests__/plot.test.jsx +69 -0
- package/src/plot/common/__tests__/utils.js +30 -0
- package/src/plot/common/plot.jsx +358 -0
- package/src/plot/dot.js +74 -0
- package/src/plot/line.js +98 -0
- package/src/tool-menu.jsx +85 -0
- package/src/utils.js +201 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -23
- package/dist/actions-button.d.ts +0 -26
- package/dist/actions-button.js +0 -84
- package/dist/autosize-input.d.ts +0 -10
- package/dist/autosize-input.js +0 -66
- package/dist/axes.d.ts +0 -84
- package/dist/axes.js +0 -376
- package/dist/bars/bar.d.ts +0 -47
- package/dist/bars/bar.js +0 -27
- package/dist/bars/common/bars.d.ts +0 -98
- package/dist/bars/common/bars.js +0 -174
- package/dist/bars/common/correct-check-icon.d.ts +0 -18
- package/dist/bars/common/correct-check-icon.js +0 -50
- package/dist/bars/histogram.d.ts +0 -47
- package/dist/bars/histogram.js +0 -28
- package/dist/chart-setup.d.ts +0 -29
- package/dist/chart-setup.js +0 -231
- package/dist/chart-type.d.ts +0 -32
- package/dist/chart-type.js +0 -68
- package/dist/chart-types.d.ts +0 -41
- package/dist/chart-types.js +0 -17
- package/dist/chart.d.ts +0 -88
- package/dist/chart.js +0 -250
- package/dist/common/correctness-indicators.d.ts +0 -70
- package/dist/common/correctness-indicators.js +0 -106
- package/dist/common/drag-handle.d.ts +0 -129
- package/dist/common/drag-handle.js +0 -120
- package/dist/common/drag-icon.d.ts +0 -23
- package/dist/common/drag-icon.js +0 -45
- package/dist/common/styles.d.ts +0 -23
- package/dist/common/styles.js +0 -17
- package/dist/grid.d.ts +0 -45
- package/dist/grid.js +0 -56
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -6
- package/dist/key-legend.d.ts +0 -19
- package/dist/key-legend.js +0 -46
- package/dist/line/common/drag-handle.d.ts +0 -120
- package/dist/line/common/drag-handle.js +0 -92
- package/dist/line/common/line.d.ts +0 -96
- package/dist/line/common/line.js +0 -114
- package/dist/line/line-cross.d.ts +0 -47
- package/dist/line/line-cross.js +0 -133
- package/dist/line/line-dot.d.ts +0 -47
- package/dist/line/line-dot.js +0 -101
- package/dist/mark-label.d.ts +0 -55
- package/dist/mark-label.js +0 -138
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +0 -101
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisBottom.js +0 -46
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisLeft.js +0 -47
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +0 -63
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +0 -44
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +0 -9
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +0 -14
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +0 -21
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +0 -16
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +0 -8
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +0 -15
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +0 -6
- package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +0 -50
- package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +0 -18
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/align.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/base.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/clamp.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/constant.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/domain.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/exponent.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/interpolate.js +0 -10
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/nice.js +0 -37
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/padding.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/range.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/reverse.js +0 -9
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/round.js +0 -7
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/scaleOperator.js +0 -58
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/unknown.js +0 -6
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/operators/zero.js +0 -9
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/band.js +0 -9
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/scales/point.js +0 -9
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +0 -10
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/createColorInterpolator.js +0 -29
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +0 -9
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/isUtcScale.js +0 -7
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +0 -6
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Bar.js +0 -29
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Circle.js +0 -29
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +0 -47
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +0 -50
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +0 -9
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +0 -6
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +0 -53
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +0 -57
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +0 -91
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +0 -21
- package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-interpolate.js +0 -8
- package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-scale.js +0 -8
- package/dist/node_modules/.bun/@visx_vendor@3.12.0/node_modules/@visx/vendor/esm/d3-time.js +0 -8
- package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +0 -32
- package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +0 -33
- package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +0 -32
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Hash.js +0 -21
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_ListCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Map.js +0 -10
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_MapCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Symbol.js +0 -9
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +0 -15
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +0 -16
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_coreJsData.js +0 -9
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +0 -8
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getMapData.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getNative.js +0 -15
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getRawTag.js +0 -19
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getValue.js +0 -11
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashClear.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashDelete.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashGet.js +0 -18
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashHas.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isKeyable.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isMasked.js +0 -16
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +0 -11
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +0 -19
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +0 -9
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_objectToString.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_root.js +0 -10
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_toSource.js +0 -20
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/eq.js +0 -11
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isFunction.js +0 -16
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isObject.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/memoize.js +0 -20
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +0 -37
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +0 -509
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +0 -108
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +0 -31
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +0 -45
- package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +0 -49
- package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +0 -34
- package/dist/plot/common/plot.d.ts +0 -103
- package/dist/plot/common/plot.js +0 -227
- package/dist/plot/dot.d.ts +0 -47
- package/dist/plot/dot.js +0 -62
- package/dist/plot/line.d.ts +0 -47
- package/dist/plot/line.js +0 -84
- package/dist/tool-menu.d.ts +0 -31
- package/dist/utils.d.ts +0 -39
- package/dist/utils.js +0 -101
package/dist/bars/common/bars.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
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/Bar.js";
|
|
3
|
-
import { bandKey as n } from "../../utils.js";
|
|
4
|
-
import r, { DragHandle as i } from "../../common/drag-handle.js";
|
|
5
|
-
import { CorrectCheckIcon as a } from "./correct-check-icon.js";
|
|
6
|
-
import o from "react";
|
|
7
|
-
import s from "prop-types";
|
|
8
|
-
import { styled as c } from "@mui/material/styles";
|
|
9
|
-
import l from "debug";
|
|
10
|
-
import { types as u } from "@pie-lib/plot";
|
|
11
|
-
import { color as d } from "@pie-lib/render-ui";
|
|
12
|
-
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
-
//#region src/bars/common/bars.tsx
|
|
14
|
-
var h = l("pie-lib:chart:bars"), g = [
|
|
15
|
-
"#006699",
|
|
16
|
-
"#F59B00",
|
|
17
|
-
"#08916D",
|
|
18
|
-
"#529EE0",
|
|
19
|
-
"#52B7D8",
|
|
20
|
-
"#D9A6C2",
|
|
21
|
-
"#FFB03B",
|
|
22
|
-
"#54A77B",
|
|
23
|
-
"#E16032",
|
|
24
|
-
"#4FD2D2",
|
|
25
|
-
"#F0E442",
|
|
26
|
-
"#E287B2"
|
|
27
|
-
], _ = [
|
|
28
|
-
"#003754",
|
|
29
|
-
"#975616",
|
|
30
|
-
"#00503B",
|
|
31
|
-
"#225982",
|
|
32
|
-
"#1F687D",
|
|
33
|
-
"#825E6F",
|
|
34
|
-
"#996428",
|
|
35
|
-
"#255E44",
|
|
36
|
-
"#8A331F",
|
|
37
|
-
"#167A7A",
|
|
38
|
-
"#91862D",
|
|
39
|
-
"#894A65"
|
|
40
|
-
], v = (e, t, n, r, i) => e && t && i ? r[n % r.length] : e && i ? d.visualElementsColors.ROLLOVER_FILL_BAR_COLOR : t || null, y = c(t)(() => ({ fill: d.defaults.TERTIARY })), b = class extends o.Component {
|
|
41
|
-
static propTypes = {
|
|
42
|
-
barColor: s.string,
|
|
43
|
-
onChangeCategory: s.func,
|
|
44
|
-
value: s.number,
|
|
45
|
-
label: s.string,
|
|
46
|
-
xBand: s.func,
|
|
47
|
-
index: s.number.isRequired,
|
|
48
|
-
graphProps: u.GraphPropsType.isRequired,
|
|
49
|
-
interactive: s.bool,
|
|
50
|
-
correctness: s.shape({
|
|
51
|
-
value: s.string,
|
|
52
|
-
label: s.string
|
|
53
|
-
}),
|
|
54
|
-
correctData: s.array,
|
|
55
|
-
defineChart: s.bool
|
|
56
|
-
};
|
|
57
|
-
constructor(e) {
|
|
58
|
-
super(e), this.state = {
|
|
59
|
-
dragValue: void 0,
|
|
60
|
-
isHovered: !1
|
|
61
|
-
}, this.mouseX = 0, this.mouseY = 0;
|
|
62
|
-
}
|
|
63
|
-
componentDidMount() {
|
|
64
|
-
window.addEventListener("mousemove", this.handleMouseMove);
|
|
65
|
-
}
|
|
66
|
-
componentWillUnmount() {
|
|
67
|
-
window.removeEventListener("mousemove", this.handleMouseMove);
|
|
68
|
-
}
|
|
69
|
-
handleMouseMove = (e) => {
|
|
70
|
-
this.mouseX = e.clientX, this.mouseY = e.clientY;
|
|
71
|
-
let t = this.isMouseInsideSvgElement();
|
|
72
|
-
this.setState({ isHovered: t });
|
|
73
|
-
};
|
|
74
|
-
isMouseInsideSvgElement = () => {
|
|
75
|
-
let e = this.gRef.getBoundingClientRect();
|
|
76
|
-
return this.mouseX >= e.left && this.mouseX <= e.right && this.mouseY >= e.top && this.mouseY <= e.bottom;
|
|
77
|
-
};
|
|
78
|
-
handleMouseEnter = () => this.setState({ isHovered: !0 });
|
|
79
|
-
handleMouseLeave = () => this.setState({ isHovered: !1 });
|
|
80
|
-
setDragValue = (e) => this.setState({ dragValue: e });
|
|
81
|
-
dragStop = () => {
|
|
82
|
-
let { label: e, onChangeCategory: t } = this.props, { dragValue: n } = this.state;
|
|
83
|
-
h("[dragStop]", n), n !== void 0 && t({
|
|
84
|
-
label: e,
|
|
85
|
-
value: n
|
|
86
|
-
}), this.setDragValue(void 0);
|
|
87
|
-
};
|
|
88
|
-
dragValue = (e, t) => {
|
|
89
|
-
h("[dragValue] next:", t), this.setDragValue(t);
|
|
90
|
-
};
|
|
91
|
-
render() {
|
|
92
|
-
let { graphProps: e, value: t, label: o, xBand: s, index: c, interactive: l, correctness: u, barColor: h, defineChart: g, correctData: b } = this.props, { scale: x, range: S } = e, { dragValue: C, isHovered: w } = this.state, T = v(w, h, c, _, l && !u), E = Number.isFinite(C) ? C : t, D = s.bandwidth(), O = x.y(S.max - E), k = s(n({ label: o }, c)), A = S.max - E, j = S.max - A, M = b ? b.find((e) => e.label === o) : null, N = l ? r : i, P = !!h;
|
|
93
|
-
return /* @__PURE__ */ m("g", {
|
|
94
|
-
ref: (e) => this.gRef = e,
|
|
95
|
-
onMouseEnter: this.handleMouseEnter,
|
|
96
|
-
onMouseLeave: this.handleMouseLeave,
|
|
97
|
-
onTouchStart: this.handleMouseEnter,
|
|
98
|
-
onTouchEnd: this.handleMouseLeave,
|
|
99
|
-
children: [
|
|
100
|
-
/* @__PURE__ */ p(y, {
|
|
101
|
-
x: k,
|
|
102
|
-
y: x.y(j),
|
|
103
|
-
width: D,
|
|
104
|
-
height: O,
|
|
105
|
-
style: { fill: T }
|
|
106
|
-
}),
|
|
107
|
-
u && u.value === "incorrect" && (() => {
|
|
108
|
-
let e = parseFloat(M && M.value);
|
|
109
|
-
if (isNaN(e)) return null;
|
|
110
|
-
let t = x.y(S.max - e), n = O, r = Math.abs(t - n), i = x.y(e), o = t > n ? d.borderGray() : d.defaults.WHITE, s = t > n ? i : i - r;
|
|
111
|
-
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(y, {
|
|
112
|
-
x: k + 2,
|
|
113
|
-
y: s,
|
|
114
|
-
width: D - 4,
|
|
115
|
-
height: r,
|
|
116
|
-
style: {
|
|
117
|
-
stroke: o,
|
|
118
|
-
strokeWidth: 2,
|
|
119
|
-
strokeDasharray: "5,2",
|
|
120
|
-
fill: "none"
|
|
121
|
-
}
|
|
122
|
-
}), /* @__PURE__ */ p("foreignObject", {
|
|
123
|
-
x: k + D - (P ? 24 : 14),
|
|
124
|
-
y: i - 12,
|
|
125
|
-
width: 24,
|
|
126
|
-
height: 24,
|
|
127
|
-
children: /* @__PURE__ */ p(a, { dashColor: o })
|
|
128
|
-
})] });
|
|
129
|
-
})(),
|
|
130
|
-
/* @__PURE__ */ p(N, {
|
|
131
|
-
x: k,
|
|
132
|
-
y: E,
|
|
133
|
-
defineChart: g,
|
|
134
|
-
interactive: l,
|
|
135
|
-
width: D,
|
|
136
|
-
onDrag: (e) => this.dragValue(t, e),
|
|
137
|
-
onDragStop: this.dragStop,
|
|
138
|
-
graphProps: e,
|
|
139
|
-
correctness: u,
|
|
140
|
-
isHovered: w,
|
|
141
|
-
color: T
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}, x = class extends o.Component {
|
|
147
|
-
static propTypes = {
|
|
148
|
-
data: s.array,
|
|
149
|
-
correctData: s.array,
|
|
150
|
-
onChangeCategory: s.func,
|
|
151
|
-
defineChart: s.bool,
|
|
152
|
-
xBand: s.func,
|
|
153
|
-
graphProps: u.GraphPropsType.isRequired,
|
|
154
|
-
histogram: s.bool
|
|
155
|
-
};
|
|
156
|
-
render() {
|
|
157
|
-
let { data: t, graphProps: n, xBand: r, onChangeCategory: i, defineChart: a, histogram: o, correctData: s } = this.props;
|
|
158
|
-
return /* @__PURE__ */ p(e, { children: (t || []).map((e, t) => /* @__PURE__ */ p(b, {
|
|
159
|
-
value: e.value,
|
|
160
|
-
interactive: a || e.interactive,
|
|
161
|
-
defineChart: a,
|
|
162
|
-
label: e.label,
|
|
163
|
-
xBand: r,
|
|
164
|
-
index: t,
|
|
165
|
-
onChangeCategory: (e) => i(t, e),
|
|
166
|
-
graphProps: n,
|
|
167
|
-
correctness: e.correctness,
|
|
168
|
-
correctData: s,
|
|
169
|
-
barColor: o && (g[t] ? g[t] : g[t % g.length])
|
|
170
|
-
}, `bar-${e.label}-${e.value}-${t}`)) });
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
//#endregion
|
|
174
|
-
export { x as default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/charting/src/bars/common/correct-check-icon.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 CorrectCheckIcon: {
|
|
12
|
-
({ dashColor }: {
|
|
13
|
-
dashColor: any;
|
|
14
|
-
}): React.JSX.Element;
|
|
15
|
-
propTypes: {
|
|
16
|
-
dashColor: PropTypes.Requireable<string>;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import e from "prop-types";
|
|
3
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/bars/common/correct-check-icon.tsx
|
|
5
|
-
var r = ({ dashColor: e }) => /* @__PURE__ */ n("svg", {
|
|
6
|
-
width: "24",
|
|
7
|
-
height: "24",
|
|
8
|
-
viewBox: "0 0 24 24",
|
|
9
|
-
fill: "none",
|
|
10
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ t("circle", {
|
|
13
|
-
cx: "12",
|
|
14
|
-
cy: "12",
|
|
15
|
-
r: "11",
|
|
16
|
-
fill: "white",
|
|
17
|
-
stroke: e || "#7E8494",
|
|
18
|
-
strokeWidth: "2",
|
|
19
|
-
strokeDasharray: "5 5"
|
|
20
|
-
}),
|
|
21
|
-
/* @__PURE__ */ n("mask", {
|
|
22
|
-
id: "path-2-outside-1_3089_3799",
|
|
23
|
-
maskUnits: "userSpaceOnUse",
|
|
24
|
-
x: "2",
|
|
25
|
-
y: "3",
|
|
26
|
-
width: "19",
|
|
27
|
-
height: "18",
|
|
28
|
-
fill: "black",
|
|
29
|
-
children: [/* @__PURE__ */ t("rect", {
|
|
30
|
-
fill: "white",
|
|
31
|
-
x: "2",
|
|
32
|
-
y: "3",
|
|
33
|
-
width: "19",
|
|
34
|
-
height: "18"
|
|
35
|
-
}), /* @__PURE__ */ t("path", { d: "M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z" })]
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ t("path", {
|
|
38
|
-
d: "M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z",
|
|
39
|
-
fill: "#0EA449"
|
|
40
|
-
}),
|
|
41
|
-
/* @__PURE__ */ t("path", {
|
|
42
|
-
d: "M5.0625 16L5.92942 15.5015L5.92668 15.4968L5.0625 16ZM5.0625 8L4.19831 7.4968L4.19559 7.50153L5.0625 8ZM18.9062 8L19.7732 7.50152L19.7704 7.49681L18.9062 8ZM18.9062 16L18.0421 15.4968L18.0393 15.5015L18.9062 16ZM15.5312 10.5312L16.2384 11.2384L17.9455 9.53125H15.5312V10.5312ZM15.5 10.5312L14.831 9.78796L12.894 11.5312H15.5V10.5312ZM14.4688 9.46875L13.7616 8.76164L13.7585 8.76482L14.4688 9.46875ZM11 12.9688L10.2929 13.6759L11.0032 14.3861L11.7103 13.6727L11 12.9688ZM8.46875 11.5L9.13771 12.2433L9.17684 12.2081L9.21204 12.169L8.46875 11.5ZM8.46875 12.5312L9.17586 11.8241L9.15726 11.8055L9.13771 11.788L8.46875 12.5312ZM10.4688 14.5312L11.212 13.8623L11.1945 13.8427L11.1759 13.8241L10.4688 14.5312ZM12 20V19C9.479 19 7.18657 17.6879 5.92941 15.5015L5.0625 16L4.19559 16.4985C5.81343 19.3121 8.771 21 12 21V20ZM5.0625 16L5.92668 15.4968C4.6714 13.341 4.66824 10.6918 5.92941 8.49847L5.0625 8L4.19559 7.50153C2.58176 10.3082 2.5786 13.7215 4.19832 16.5032L5.0625 16ZM5.0625 8L5.92668 8.50319C7.18712 6.33851 9.48502 5 12 5V4V3C8.76498 3 5.81288 4.72399 4.19832 7.49681L5.0625 8ZM12 4V5C14.4816 5 16.7805 6.33661 18.0421 8.50319L18.9062 8L19.7704 7.49681C18.157 4.72589 15.2059 3 12 3V4ZM18.9062 8L18.0393 8.49847C19.3005 10.6918 19.2973 13.341 18.0421 15.4968L18.9062 16L19.7704 16.5032C21.3902 13.7215 21.387 10.3082 19.7732 7.50153L18.9062 8ZM18.9062 16L18.0393 15.5015C16.7811 17.6898 14.4876 19 12 19V20V21C15.1999 21 18.1564 19.3102 19.7732 16.4985L18.9062 16ZM15.5312 10.5312V9.53125H15.5V10.5312V11.5312H15.5312V10.5312ZM15.5 10.5312L16.169 11.2745C16.9447 10.5764 16.8883 9.44281 16.2071 8.76164L15.5 9.46875L14.7929 10.1759C14.7696 10.1525 14.7344 10.0966 14.7344 10.0117C14.7344 9.92377 14.7735 9.83972 14.831 9.78796L15.5 10.5312ZM15.5 9.46875L16.2071 8.76164C15.5353 8.08987 14.4334 8.08987 13.7616 8.76164L14.4688 9.46875L15.1759 10.1759C15.1167 10.235 15.0442 10.2578 14.9844 10.2578C14.9245 10.2578 14.8521 10.235 14.7929 10.1759L15.5 9.46875ZM14.4688 9.46875L13.7585 8.76482L10.2897 12.2648L11 12.9688L11.7103 13.6727L15.179 10.1727L14.4688 9.46875ZM11 12.9688L11.7071 12.2616L10.2384 10.7929L9.53125 11.5L8.82414 12.2071L10.2929 13.6759L11 12.9688ZM9.53125 11.5L10.2384 10.7929C9.55719 10.1117 8.42362 10.0553 7.72546 10.831L8.46875 11.5L9.21204 12.169C9.16028 12.2265 9.07623 12.2656 8.98828 12.2656C8.90344 12.2656 8.84748 12.2304 8.82414 12.2071L9.53125 11.5ZM8.46875 11.5L7.79979 10.7567C7.04591 11.4352 7.04591 12.5961 7.79979 13.2745L8.46875 12.5312L9.13771 11.788C9.19301 11.8377 9.23438 11.9208 9.23438 12.0156C9.23438 12.1105 9.19301 12.1935 9.13771 12.2433L8.46875 11.5ZM8.46875 12.5312L7.76164 13.2384L9.76164 15.2384L10.4688 14.5312L11.1759 13.8241L9.17586 11.8241L8.46875 12.5312ZM10.4688 14.5312L9.72546 15.2002C10.4236 15.976 11.5572 15.9195 12.2384 15.2384L11.5312 14.5312L10.8241 13.8241C10.8475 13.8008 10.9034 13.7656 10.9883 13.7656C11.0762 13.7656 11.1603 13.8048 11.212 13.8623L10.4688 14.5312ZM11.5312 14.5312L12.2384 15.2384L16.2384 11.2384L15.5312 10.5312L14.8241 9.82414L10.8241 13.8241L11.5312 14.5312Z",
|
|
43
|
-
fill: "white",
|
|
44
|
-
mask: "url(#path-2-outside-1_3089_3799)"
|
|
45
|
-
})
|
|
46
|
-
]
|
|
47
|
-
});
|
|
48
|
-
r.propTypes = { dashColor: e.string };
|
|
49
|
-
//#endregion
|
|
50
|
-
export { r as CorrectCheckIcon };
|
package/dist/bars/histogram.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/charting/src/bars/histogram.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 Histogram 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 Histogram;
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
47
|
-
export default _default;
|
package/dist/bars/histogram.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { dataToXBand as e } from "../utils.js";
|
|
2
|
-
import t from "./common/bars.js";
|
|
3
|
-
import n from "react";
|
|
4
|
-
import r from "prop-types";
|
|
5
|
-
import { types as i } from "@pie-lib/plot";
|
|
6
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
-
//#region src/bars/histogram.tsx
|
|
8
|
-
var o = class extends n.Component {
|
|
9
|
-
static propTypes = {
|
|
10
|
-
data: r.array,
|
|
11
|
-
onChange: r.func,
|
|
12
|
-
graphProps: i.GraphPropsType.isRequired
|
|
13
|
-
};
|
|
14
|
-
render() {
|
|
15
|
-
let n = this.props, { data: r, graphProps: i } = n, { scale: o = {}, size: s = {} } = i || {}, c = e(o.x, r, s.width, "histogram");
|
|
16
|
-
return /* @__PURE__ */ a(t, {
|
|
17
|
-
...n,
|
|
18
|
-
xBand: c,
|
|
19
|
-
histogram: !0
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}, s = () => ({
|
|
23
|
-
type: "histogram",
|
|
24
|
-
Component: o,
|
|
25
|
-
name: "Histogram"
|
|
26
|
-
});
|
|
27
|
-
//#endregion
|
|
28
|
-
export { s as default };
|
package/dist/chart-setup.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/charting/src/chart-setup.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 resetValues: (data: any, updateModel: any, range: any, onChange: any, model: any) => void;
|
|
12
|
-
declare const ConfigureChartPanel: {
|
|
13
|
-
(props: any): React.JSX.Element;
|
|
14
|
-
propTypes: {
|
|
15
|
-
chartDimensions: PropTypes.Requireable<object>;
|
|
16
|
-
domain: PropTypes.Requireable<object>;
|
|
17
|
-
gridValues: PropTypes.Requireable<object>;
|
|
18
|
-
labelValues: PropTypes.Requireable<object>;
|
|
19
|
-
model: PropTypes.Requireable<object>;
|
|
20
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
-
range: PropTypes.Requireable<object>;
|
|
22
|
-
chartDimension: PropTypes.Requireable<object>;
|
|
23
|
-
size: PropTypes.Requireable<object>;
|
|
24
|
-
studentNewCategoryDefaultLabel: PropTypes.Requireable<object>;
|
|
25
|
-
availableChartTypes: PropTypes.Requireable<object>;
|
|
26
|
-
chartTypeLabel: PropTypes.Requireable<string>;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export default ConfigureChartPanel;
|
package/dist/chart-setup.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import e from "./chart-type.js";
|
|
2
|
-
import { useEffect as t, useState as n } from "react";
|
|
3
|
-
import r from "prop-types";
|
|
4
|
-
import { styled as i } from "@mui/material/styles";
|
|
5
|
-
import { AlertDialog as a, NumberTextFieldCustom as o } from "@pie-lib/config-ui";
|
|
6
|
-
import { color as s } from "@pie-lib/render-ui";
|
|
7
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
import u from "@mui/material/Typography";
|
|
9
|
-
//#region src/chart-setup.tsx
|
|
10
|
-
var d = (e, t, n, r, i) => {
|
|
11
|
-
(e || []).forEach((e) => {
|
|
12
|
-
let t = Math.round(e.value * 10) % Math.round(n.step * 10) / 10;
|
|
13
|
-
(e.value > n.max || t !== 0) && (e.value = 0);
|
|
14
|
-
}), t && r({
|
|
15
|
-
...i,
|
|
16
|
-
data: e
|
|
17
|
-
});
|
|
18
|
-
}, f = i("div")(() => ({ width: "450px" })), p = i("div")(({ theme: e }) => ({
|
|
19
|
-
display: "flex",
|
|
20
|
-
flexDirection: "column",
|
|
21
|
-
width: "100%",
|
|
22
|
-
marginTop: e.spacing(3)
|
|
23
|
-
})), m = i("div")(() => ({
|
|
24
|
-
display: "flex",
|
|
25
|
-
flexDirection: "column",
|
|
26
|
-
alignItems: "center"
|
|
27
|
-
})), h = i("div")(() => ({
|
|
28
|
-
display: "flex",
|
|
29
|
-
justifyContent: "space-around",
|
|
30
|
-
alignItems: "center"
|
|
31
|
-
})), g = i(o)(({ theme: e }) => ({
|
|
32
|
-
width: "130px",
|
|
33
|
-
margin: `${e.spacing(1)} ${e.spacing(.5)}`
|
|
34
|
-
})), _ = i(o)(({ theme: e }) => ({
|
|
35
|
-
width: "160px",
|
|
36
|
-
margin: `${e.spacing(1)} ${e.spacing(.5)}`
|
|
37
|
-
})), v = i("div")(({ theme: e }) => ({
|
|
38
|
-
display: "flex",
|
|
39
|
-
justifyContent: "space-between",
|
|
40
|
-
alignItems: "center",
|
|
41
|
-
margin: `${e.spacing(3)} 0`
|
|
42
|
-
})), y = i(u)(() => ({ color: s.disabled() })), b = (r) => {
|
|
43
|
-
let { model: i, onChange: o, chartDimensions: s, gridValues: b = {}, labelValues: x = {}, studentNewCategoryDefaultLabel: S = {}, availableChartTypes: C = {}, chartTypeLabel: w } = r, [T, E] = n({
|
|
44
|
-
open: !1,
|
|
45
|
-
title: "",
|
|
46
|
-
text: "",
|
|
47
|
-
onClose: null,
|
|
48
|
-
onConfirm: null
|
|
49
|
-
}), [D, O] = n(!1), [k, A] = n(""), [j, M] = n(0), { range: N = {}, correctAnswer: P, changeInteractiveEnabled: F, changeEditableEnabled: I } = i, L = i.graph, { showInConfigPanel: R, width: z, height: B } = s || {}, V = {
|
|
50
|
-
min: z?.min ? Math.max(50, z.min) : 50,
|
|
51
|
-
max: z?.max ? Math.min(700, z.max) : 700,
|
|
52
|
-
step: z?.step >= 1 ? Math.min(200, z.step) : 20
|
|
53
|
-
}, H = {
|
|
54
|
-
min: B?.min ? Math.max(400, B.min) : 400,
|
|
55
|
-
max: B?.max ? Math.min(700, B.max) : 700,
|
|
56
|
-
step: B?.step >= 1 ? Math.min(200, B.step) : 20
|
|
57
|
-
}, U = b && b.range ? { customValues: b.range } : {
|
|
58
|
-
min: 0,
|
|
59
|
-
max: 1e4
|
|
60
|
-
}, W = x && x.range ? { customValues: x.range } : {
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 1e4
|
|
63
|
-
}, G = /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(_, {
|
|
64
|
-
label: "Grid Interval",
|
|
65
|
-
value: N.step,
|
|
66
|
-
variant: "outlined",
|
|
67
|
-
onChange: (e, t) => $("step", t, e),
|
|
68
|
-
...U
|
|
69
|
-
}), /* @__PURE__ */ c(_, {
|
|
70
|
-
label: "Label Interval",
|
|
71
|
-
value: N.labelStep,
|
|
72
|
-
variant: "outlined",
|
|
73
|
-
onChange: (e, t) => $("labelStep", t, e),
|
|
74
|
-
...W
|
|
75
|
-
})] }), K = (e) => {
|
|
76
|
-
E((t) => ({
|
|
77
|
-
...t,
|
|
78
|
-
open: e
|
|
79
|
-
})), O(e);
|
|
80
|
-
}, q = (e, t) => e.map((e) => (Object.prototype.hasOwnProperty.call(e, t) && (e[t] = t == "interactive"), e)), J = (e) => {
|
|
81
|
-
let { correctAnswer: t, data: n } = i;
|
|
82
|
-
F === !1 && q(n, "interactive"), I === !1 && q(n, "editable"), d(n, e, N, o, i), d(t.data, !1, N, o, i);
|
|
83
|
-
}, Y = () => {
|
|
84
|
-
let e = S?.label;
|
|
85
|
-
o({
|
|
86
|
-
...i,
|
|
87
|
-
studentCategoryDefaultLabel: e
|
|
88
|
-
});
|
|
89
|
-
}, X = (e) => e.includes("Plot") ? {
|
|
90
|
-
min: 3,
|
|
91
|
-
max: 10
|
|
92
|
-
} : {
|
|
93
|
-
min: .05,
|
|
94
|
-
max: 1e4
|
|
95
|
-
}, Z = (e, t) => {
|
|
96
|
-
let n = {
|
|
97
|
-
...L,
|
|
98
|
-
[e]: t
|
|
99
|
-
};
|
|
100
|
-
o({
|
|
101
|
-
...i,
|
|
102
|
-
graph: n
|
|
103
|
-
});
|
|
104
|
-
}, Q = (e, t) => (e || []).find((e) => e.value > t.max || e.value - t.step * Math.floor(e.value / t.step) !== 0), $ = (e, t, n) => {
|
|
105
|
-
M(N[e]), A(e), N[e] = t, (e === "max" || e === "step") && (Q(i.data, N) || Q(i.correctAnswer.data, N)) && n?.target ? O(!0) : o({
|
|
106
|
-
...i,
|
|
107
|
-
range: N
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
t(() => {
|
|
111
|
-
J(!0), Y();
|
|
112
|
-
}, []), t(() => {
|
|
113
|
-
D && E({
|
|
114
|
-
open: !0,
|
|
115
|
-
title: "Warning",
|
|
116
|
-
text: "This change will remove values defined for one or more categories",
|
|
117
|
-
onConfirm: () => {
|
|
118
|
-
J(), K(!1), o({
|
|
119
|
-
...i,
|
|
120
|
-
range: N,
|
|
121
|
-
correctAnswer: P
|
|
122
|
-
});
|
|
123
|
-
},
|
|
124
|
-
onClose: () => {
|
|
125
|
-
N[k] = j, K(!1);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}, [D]);
|
|
129
|
-
let ee = N.step === 1 && N.labelStep === 1 && 3 <= N.max && N.max <= 10, te = () => {
|
|
130
|
-
X.min = 3, X.max = 10, N.max = 10, N.step = 1, N.labelStep = 1, o({
|
|
131
|
-
...i,
|
|
132
|
-
range: N
|
|
133
|
-
});
|
|
134
|
-
}, ne = (e) => {
|
|
135
|
-
if (e.includes("Plot")) {
|
|
136
|
-
if (!ee) {
|
|
137
|
-
E({
|
|
138
|
-
open: !0,
|
|
139
|
-
title: "Warning",
|
|
140
|
-
text: "The selected chart type does not support the current chart configuration. Reset chart configuration?",
|
|
141
|
-
onConfirm: () => {
|
|
142
|
-
te(), J(), K(!1), o({
|
|
143
|
-
...i,
|
|
144
|
-
range: N,
|
|
145
|
-
chartType: e
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
onClose: () => {
|
|
149
|
-
K(!1);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
X.min = 3, X.max = 10, o({
|
|
155
|
-
...i,
|
|
156
|
-
chartType: e
|
|
157
|
-
});
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
o({
|
|
161
|
-
...i,
|
|
162
|
-
chartType: e
|
|
163
|
-
});
|
|
164
|
-
};
|
|
165
|
-
return /* @__PURE__ */ l(f, { children: [
|
|
166
|
-
/* @__PURE__ */ c(u, {
|
|
167
|
-
variant: "subtitle1",
|
|
168
|
-
children: "Configure Chart"
|
|
169
|
-
}),
|
|
170
|
-
/* @__PURE__ */ l(p, { children: [
|
|
171
|
-
/* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(e, {
|
|
172
|
-
value: i.chartType,
|
|
173
|
-
onChange: (e) => ne(e.target.value),
|
|
174
|
-
availableChartTypes: C,
|
|
175
|
-
chartTypeLabel: w
|
|
176
|
-
}), /* @__PURE__ */ c(_, {
|
|
177
|
-
label: "Max Value",
|
|
178
|
-
value: N.max,
|
|
179
|
-
min: X(i.chartType).min,
|
|
180
|
-
max: X(i.chartType).max,
|
|
181
|
-
variant: "outlined",
|
|
182
|
-
onChange: (e, t) => $("max", t, e)
|
|
183
|
-
})] }),
|
|
184
|
-
!i.chartType.includes("Plot") && G,
|
|
185
|
-
R && /* @__PURE__ */ l(v, { children: [
|
|
186
|
-
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(u, { children: "Dimensions(px)" }) }),
|
|
187
|
-
/* @__PURE__ */ l(m, { children: [/* @__PURE__ */ c(g, {
|
|
188
|
-
label: "Width",
|
|
189
|
-
value: L.width,
|
|
190
|
-
min: V.min,
|
|
191
|
-
max: V.max,
|
|
192
|
-
step: V.step,
|
|
193
|
-
variant: "outlined",
|
|
194
|
-
onChange: (e, t) => Z("width", t)
|
|
195
|
-
}), /* @__PURE__ */ c(y, { children: "Min 50, Max 700" })] }),
|
|
196
|
-
/* @__PURE__ */ l(m, { children: [/* @__PURE__ */ c(g, {
|
|
197
|
-
label: "Height",
|
|
198
|
-
value: L.height,
|
|
199
|
-
min: H.min,
|
|
200
|
-
max: H.max,
|
|
201
|
-
step: H.step,
|
|
202
|
-
variant: "outlined",
|
|
203
|
-
onChange: (e, t) => Z("height", t)
|
|
204
|
-
}), /* @__PURE__ */ c(y, { children: "Min 400, Max 700" })] })
|
|
205
|
-
] })
|
|
206
|
-
] }),
|
|
207
|
-
/* @__PURE__ */ c(a, {
|
|
208
|
-
open: T.open,
|
|
209
|
-
title: T.title,
|
|
210
|
-
text: T.text,
|
|
211
|
-
onClose: T.onClose,
|
|
212
|
-
onConfirm: T.onConfirm
|
|
213
|
-
})
|
|
214
|
-
] });
|
|
215
|
-
};
|
|
216
|
-
b.propTypes = {
|
|
217
|
-
chartDimensions: r.object,
|
|
218
|
-
domain: r.object,
|
|
219
|
-
gridValues: r.object,
|
|
220
|
-
labelValues: r.object,
|
|
221
|
-
model: r.object,
|
|
222
|
-
onChange: r.func,
|
|
223
|
-
range: r.object,
|
|
224
|
-
chartDimension: r.object,
|
|
225
|
-
size: r.object,
|
|
226
|
-
studentNewCategoryDefaultLabel: r.object,
|
|
227
|
-
availableChartTypes: r.object,
|
|
228
|
-
chartTypeLabel: r.string
|
|
229
|
-
};
|
|
230
|
-
//#endregion
|
|
231
|
-
export { b as default };
|
package/dist/chart-type.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/charting/src/chart-type.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
|
-
declare const ChartType: {
|
|
12
|
-
({ onChange, value, availableChartTypes, chartTypeLabel }: {
|
|
13
|
-
onChange: any;
|
|
14
|
-
value: any;
|
|
15
|
-
availableChartTypes: any;
|
|
16
|
-
chartTypeLabel: any;
|
|
17
|
-
}): React.JSX.Element;
|
|
18
|
-
propTypes: {
|
|
19
|
-
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
20
|
-
value: PropTypes.Validator<string>;
|
|
21
|
-
availableChartTypes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
|
-
histogram: PropTypes.Requireable<string>;
|
|
23
|
-
bar: PropTypes.Requireable<string>;
|
|
24
|
-
lineDot: PropTypes.Requireable<string>;
|
|
25
|
-
lineCross: PropTypes.Requireable<string>;
|
|
26
|
-
dotPlot: PropTypes.Requireable<string>;
|
|
27
|
-
linePlot: PropTypes.Requireable<string>;
|
|
28
|
-
}>>;
|
|
29
|
-
chartTypeLabel: PropTypes.Requireable<string>;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export default ChartType;
|
package/dist/chart-type.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import e from "prop-types";
|
|
3
|
-
import { styled as t } from "@mui/material/styles";
|
|
4
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
-
import i from "@mui/material/MenuItem";
|
|
6
|
-
import a from "@mui/material/FormControl";
|
|
7
|
-
import o from "@mui/material/InputLabel";
|
|
8
|
-
import { Select as s } from "@mui/material";
|
|
9
|
-
//#region src/chart-type.tsx
|
|
10
|
-
var c = t("div")(() => ({ width: "160px" })), l = t(a)(() => ({ width: "160px" })), u = t(o)(() => ({ backgroundColor: "transparent" })), d = ({ onChange: e, value: t, availableChartTypes: a, chartTypeLabel: o }) => /* @__PURE__ */ n(c, { children: /* @__PURE__ */ r(l, {
|
|
11
|
-
variant: "outlined",
|
|
12
|
-
children: [/* @__PURE__ */ n(u, {
|
|
13
|
-
id: "type-helper-label",
|
|
14
|
-
children: o
|
|
15
|
-
}), /* @__PURE__ */ r(s, {
|
|
16
|
-
labelId: "type-helper-label",
|
|
17
|
-
id: "type-helper-label-select",
|
|
18
|
-
name: "chartType",
|
|
19
|
-
value: t,
|
|
20
|
-
onChange: e,
|
|
21
|
-
label: o,
|
|
22
|
-
MenuProps: { transitionDuration: {
|
|
23
|
-
enter: 225,
|
|
24
|
-
exit: 195
|
|
25
|
-
} },
|
|
26
|
-
children: [
|
|
27
|
-
a?.histogram && /* @__PURE__ */ n(i, {
|
|
28
|
-
value: "histogram",
|
|
29
|
-
children: a.histogram
|
|
30
|
-
}),
|
|
31
|
-
a?.bar && /* @__PURE__ */ n(i, {
|
|
32
|
-
value: "bar",
|
|
33
|
-
children: a.bar
|
|
34
|
-
}),
|
|
35
|
-
a?.lineDot && /* @__PURE__ */ n(i, {
|
|
36
|
-
value: "lineDot",
|
|
37
|
-
children: a.lineDot
|
|
38
|
-
}),
|
|
39
|
-
a?.lineCross && /* @__PURE__ */ n(i, {
|
|
40
|
-
value: "lineCross",
|
|
41
|
-
children: a.lineCross
|
|
42
|
-
}),
|
|
43
|
-
a?.dotPlot && /* @__PURE__ */ n(i, {
|
|
44
|
-
value: "dotPlot",
|
|
45
|
-
children: a.dotPlot
|
|
46
|
-
}),
|
|
47
|
-
a?.linePlot && /* @__PURE__ */ n(i, {
|
|
48
|
-
value: "linePlot",
|
|
49
|
-
children: a.linePlot
|
|
50
|
-
})
|
|
51
|
-
]
|
|
52
|
-
})]
|
|
53
|
-
}) });
|
|
54
|
-
d.propTypes = {
|
|
55
|
-
onChange: e.func.isRequired,
|
|
56
|
-
value: e.string.isRequired,
|
|
57
|
-
availableChartTypes: e.shape({
|
|
58
|
-
histogram: e.string,
|
|
59
|
-
bar: e.string,
|
|
60
|
-
lineDot: e.string,
|
|
61
|
-
lineCross: e.string,
|
|
62
|
-
dotPlot: e.string,
|
|
63
|
-
linePlot: e.string
|
|
64
|
-
}),
|
|
65
|
-
chartTypeLabel: e.string
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
export { d as default };
|