@pie-lib/charting 7.0.4-next.29 → 7.0.4-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +23 -0
- package/dist/actions-button.d.ts +26 -0
- package/dist/actions-button.js +84 -0
- package/dist/autosize-input.d.ts +10 -0
- package/dist/autosize-input.js +66 -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 +138 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +101 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisBottom.js +46 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisLeft.js +47 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +63 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +44 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +21 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +15 -0
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +79 -0
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +79 -0
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
- package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +50 -0
- package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +18 -0
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/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 +29 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Circle.js +29 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +47 -0
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/LinePath.js +50 -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 +53 -0
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +57 -0
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +91 -0
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +21 -0
- package/dist/node_modules/.bun/@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/classnames@2.5.1/node_modules/classnames/index.js +32 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/node_modules/.bun/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/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 +39 -28
- package/CHANGELOG.json +0 -17
- package/CHANGELOG.md +0 -1116
- 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 -112
- 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 -80
- 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,108 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region ../../../node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js
|
|
3
|
+
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
+
var n = function(e) {
|
|
5
|
+
this.value = e;
|
|
6
|
+
};
|
|
7
|
+
n.math = {
|
|
8
|
+
isDegree: !0,
|
|
9
|
+
acos: function(e) {
|
|
10
|
+
return n.math.isDegree ? 180 / Math.PI * Math.acos(e) : Math.acos(e);
|
|
11
|
+
},
|
|
12
|
+
add: function(e, t) {
|
|
13
|
+
return e + t;
|
|
14
|
+
},
|
|
15
|
+
asin: function(e) {
|
|
16
|
+
return n.math.isDegree ? 180 / Math.PI * Math.asin(e) : Math.asin(e);
|
|
17
|
+
},
|
|
18
|
+
atan: function(e) {
|
|
19
|
+
return n.math.isDegree ? 180 / Math.PI * Math.atan(e) : Math.atan(e);
|
|
20
|
+
},
|
|
21
|
+
acosh: function(e) {
|
|
22
|
+
return Math.log(e + Math.sqrt(e * e - 1));
|
|
23
|
+
},
|
|
24
|
+
asinh: function(e) {
|
|
25
|
+
return Math.log(e + Math.sqrt(e * e + 1));
|
|
26
|
+
},
|
|
27
|
+
atanh: function(e) {
|
|
28
|
+
return Math.log((1 + e) / (1 - e));
|
|
29
|
+
},
|
|
30
|
+
C: function(e, t) {
|
|
31
|
+
var r = 1, i = e - t, a = t;
|
|
32
|
+
a < i && (a = i, i = t);
|
|
33
|
+
for (var o = a + 1; o <= e; o++) r *= o;
|
|
34
|
+
return r / n.math.fact(i);
|
|
35
|
+
},
|
|
36
|
+
changeSign: function(e) {
|
|
37
|
+
return -e;
|
|
38
|
+
},
|
|
39
|
+
cos: function(e) {
|
|
40
|
+
return n.math.isDegree && (e = n.math.toRadian(e)), Math.cos(e);
|
|
41
|
+
},
|
|
42
|
+
cosh: function(e) {
|
|
43
|
+
return (Math.E ** +e + Math.E ** (-1 * e)) / 2;
|
|
44
|
+
},
|
|
45
|
+
div: function(e, t) {
|
|
46
|
+
return e / t;
|
|
47
|
+
},
|
|
48
|
+
fact: function(e) {
|
|
49
|
+
if (e % 1 != 0) return "NaN";
|
|
50
|
+
for (var t = 1, n = 2; n <= e; n++) t *= n;
|
|
51
|
+
return t;
|
|
52
|
+
},
|
|
53
|
+
inverse: function(e) {
|
|
54
|
+
return 1 / e;
|
|
55
|
+
},
|
|
56
|
+
log: function(e) {
|
|
57
|
+
return Math.log(e) / Math.log(10);
|
|
58
|
+
},
|
|
59
|
+
mod: function(e, t) {
|
|
60
|
+
return e % t;
|
|
61
|
+
},
|
|
62
|
+
mul: function(e, t) {
|
|
63
|
+
return e * t;
|
|
64
|
+
},
|
|
65
|
+
P: function(e, t) {
|
|
66
|
+
for (var n = 1, r = Math.floor(e) - Math.floor(t) + 1; r <= Math.floor(e); r++) n *= r;
|
|
67
|
+
return n;
|
|
68
|
+
},
|
|
69
|
+
Pi: function(e, t, n) {
|
|
70
|
+
for (var r = 1, i = e; i <= t; i++) r *= Number(n.postfixEval({ n: i }));
|
|
71
|
+
return r;
|
|
72
|
+
},
|
|
73
|
+
pow10x: function(e) {
|
|
74
|
+
for (var t = 1; e--;) t *= 10;
|
|
75
|
+
return t;
|
|
76
|
+
},
|
|
77
|
+
sigma: function(e, t, n) {
|
|
78
|
+
for (var r = 0, i = e; i <= t; i++) r += Number(n.postfixEval({ n: i }));
|
|
79
|
+
return r;
|
|
80
|
+
},
|
|
81
|
+
sin: function(e) {
|
|
82
|
+
return n.math.isDegree && (e = n.math.toRadian(e)), Math.sin(e);
|
|
83
|
+
},
|
|
84
|
+
sinh: function(e) {
|
|
85
|
+
return (Math.E ** +e - Math.E ** (-1 * e)) / 2;
|
|
86
|
+
},
|
|
87
|
+
sub: function(e, t) {
|
|
88
|
+
return e - t;
|
|
89
|
+
},
|
|
90
|
+
tan: function(e) {
|
|
91
|
+
return n.math.isDegree && (e = n.math.toRadian(e)), Math.tan(e);
|
|
92
|
+
},
|
|
93
|
+
tanh: function(e) {
|
|
94
|
+
return n.sinha(e) / n.cosha(e);
|
|
95
|
+
},
|
|
96
|
+
toRadian: function(e) {
|
|
97
|
+
return e * Math.PI / 180;
|
|
98
|
+
},
|
|
99
|
+
and: function(e, t) {
|
|
100
|
+
return e & t;
|
|
101
|
+
}
|
|
102
|
+
}, n.Exception = function(e) {
|
|
103
|
+
this.message = e;
|
|
104
|
+
}, t.exports = n;
|
|
105
|
+
}));
|
|
106
|
+
//#endregion
|
|
107
|
+
export default t();
|
|
108
|
+
export { t as require_math_function };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_lexer as t } from "./lexer.js";
|
|
3
|
+
//#region ../../../node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js
|
|
4
|
+
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
+
var r = t();
|
|
6
|
+
r.prototype.toPostfix = function() {
|
|
7
|
+
for (var e = [], t, n, i, a, o, s = [{
|
|
8
|
+
value: "(",
|
|
9
|
+
type: 4,
|
|
10
|
+
pre: 0
|
|
11
|
+
}], c = this.value, l = 1; l < c.length; l++) if (c[l].type === 1 || c[l].type === 3 || c[l].type === 13) c[l].type === 1 && (c[l].value = Number(c[l].value)), e.push(c[l]);
|
|
12
|
+
else if (c[l].type === 4) s.push(c[l]);
|
|
13
|
+
else if (c[l].type === 5) for (; (n = s.pop()).type !== 4;) e.push(n);
|
|
14
|
+
else if (c[l].type === 11) {
|
|
15
|
+
for (; (n = s.pop()).type !== 4;) e.push(n);
|
|
16
|
+
s.push(n);
|
|
17
|
+
} else {
|
|
18
|
+
t = c[l], a = t.pre, o = s[s.length - 1], i = o.pre;
|
|
19
|
+
var u = o.value == "Math.pow" && t.value == "Math.pow";
|
|
20
|
+
if (a > i) s.push(t);
|
|
21
|
+
else {
|
|
22
|
+
for (; i >= a && !u || u && a < i;) n = s.pop(), o = s[s.length - 1], e.push(n), i = o.pre, u = t.value == "Math.pow" && o.value == "Math.pow";
|
|
23
|
+
s.push(t);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return new r(e);
|
|
27
|
+
}, n.exports = r;
|
|
28
|
+
}));
|
|
29
|
+
//#endregion
|
|
30
|
+
export default n();
|
|
31
|
+
export { n as require_postfix };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_postfix as t } from "./postfix.js";
|
|
3
|
+
//#region ../../../node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js
|
|
4
|
+
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
+
var r = t();
|
|
6
|
+
r.prototype.postfixEval = function(e) {
|
|
7
|
+
e ||= {}, e.PI = Math.PI, e.E = Math.E;
|
|
8
|
+
for (var t = [], n, i, a, o = this.value, s = e.n !== void 0, c = 0; c < o.length; c++) if (o[c].type === 1) t.push({
|
|
9
|
+
value: o[c].value,
|
|
10
|
+
type: 1
|
|
11
|
+
});
|
|
12
|
+
else if (o[c].type === 3) t.push({
|
|
13
|
+
value: e[o[c].value],
|
|
14
|
+
type: 1
|
|
15
|
+
});
|
|
16
|
+
else if (o[c].type === 0) t[t.length - 1].type === void 0 ? t[t.length - 1].value.push(o[c]) : t[t.length - 1].value = o[c].value(t[t.length - 1].value);
|
|
17
|
+
else if (o[c].type === 7) t[t.length - 1].type === void 0 ? t[t.length - 1].value.push(o[c]) : t[t.length - 1].value = o[c].value(t[t.length - 1].value);
|
|
18
|
+
else if (o[c].type === 8) {
|
|
19
|
+
for (var l = [], u = 0; u < o[c].numberOfArguments; u++) l.push(t.pop().value);
|
|
20
|
+
t.push({
|
|
21
|
+
type: 1,
|
|
22
|
+
value: o[c].value.apply(o[c], l.reverse())
|
|
23
|
+
});
|
|
24
|
+
} else o[c].type === 10 ? (n = t.pop(), i = t.pop(), i.type === void 0 ? (i.value = i.concat(n), i.value.push(o[c]), t.push(i)) : n.type === void 0 ? (n.unshift(i), n.push(o[c]), t.push(n)) : t.push({
|
|
25
|
+
type: 1,
|
|
26
|
+
value: o[c].value(i.value, n.value)
|
|
27
|
+
})) : o[c].type === 2 || o[c].type === 9 ? (n = t.pop(), i = t.pop(), i.type === void 0 ? (i = i.concat(n), i.push(o[c]), t.push(i)) : n.type === void 0 ? (n.unshift(i), n.push(o[c]), t.push(n)) : t.push({
|
|
28
|
+
type: 1,
|
|
29
|
+
value: o[c].value(i.value, n.value)
|
|
30
|
+
})) : o[c].type === 12 ? (n = t.pop(), n.type !== void 0 && (n = [n]), i = t.pop(), a = t.pop(), t.push({
|
|
31
|
+
type: 1,
|
|
32
|
+
value: o[c].value(a.value, i.value, new r(n))
|
|
33
|
+
})) : o[c].type === 13 && (s ? t.push({
|
|
34
|
+
value: e[o[c].value],
|
|
35
|
+
type: 3
|
|
36
|
+
}) : t.push([o[c]]));
|
|
37
|
+
if (t.length > 1) throw new r.Exception("Uncaught Syntax error");
|
|
38
|
+
return t[0].value > 0x38d7ea4c68000 ? "Infinity" : parseFloat(t[0].value.toFixed(15));
|
|
39
|
+
}, r.eval = function(e, t, n) {
|
|
40
|
+
return t === void 0 ? this.lex(e).toPostfix().postfixEval() : n === void 0 ? t.length === void 0 ? this.lex(e).toPostfix().postfixEval(t) : this.lex(e, t).toPostfix().postfixEval() : this.lex(e, t).toPostfix().postfixEval(n);
|
|
41
|
+
}, n.exports = r;
|
|
42
|
+
}));
|
|
43
|
+
//#endregion
|
|
44
|
+
export default n();
|
|
45
|
+
export { n as require_postfix_evaluator };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_balanced_match as t } from "../../../balanced-match@0.4.2/node_modules/balanced-match/index.js";
|
|
3
|
+
import { require_reduce_function_call as n } from "../../../reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js";
|
|
4
|
+
import { require_formula_evaluator as r } from "../../../math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js";
|
|
5
|
+
//#region ../../../node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js
|
|
6
|
+
var i = /* @__PURE__ */ e(((e, i) => {
|
|
7
|
+
var a = t(), o = n(), s = r(), c = 100, l = /(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g, u;
|
|
8
|
+
i.exports = d;
|
|
9
|
+
function d(e, t) {
|
|
10
|
+
u = 0, t = 10 ** (t === void 0 ? 5 : t), e = e.replace(/\n+/g, " ");
|
|
11
|
+
function n(e, n, i) {
|
|
12
|
+
if (u++ > c) throw u = 0, Error("Call stack overflow for " + i);
|
|
13
|
+
if (e === "") throw Error(n + "(): '" + i + "' must contain a non-whitespace string");
|
|
14
|
+
e = r(e, i);
|
|
15
|
+
var a = f(e);
|
|
16
|
+
if (a.length > 1 || e.indexOf("var(") > -1) return n + "(" + e + ")";
|
|
17
|
+
var o = a[0] || "";
|
|
18
|
+
o === "%" && (e = e.replace(/\b[0-9\.]+%/g, function(e) {
|
|
19
|
+
return parseFloat(e.slice(0, -1)) * .01;
|
|
20
|
+
}));
|
|
21
|
+
var l = e.replace(new RegExp(o, "gi"), ""), d;
|
|
22
|
+
try {
|
|
23
|
+
d = s.eval(l);
|
|
24
|
+
} catch {
|
|
25
|
+
return n + "(" + e + ")";
|
|
26
|
+
}
|
|
27
|
+
return o === "%" && (d *= 100), (n.length || o === "%") && (d = Math.round(d * t) / t), d += o, d;
|
|
28
|
+
}
|
|
29
|
+
function r(e, t) {
|
|
30
|
+
e = e.replace(/((?:\-[a-z]+\-)?calc)/g, "");
|
|
31
|
+
for (var r = "", i = e, o; o = l.exec(i);) {
|
|
32
|
+
o[0].index > 0 && (r += i.substring(0, o[0].index));
|
|
33
|
+
var s = a("(", ")", i.substring([0].index));
|
|
34
|
+
if (s.body === "") throw Error("'" + e + "' must contain a non-whitespace string");
|
|
35
|
+
var c = n(s.body, "", t);
|
|
36
|
+
r += s.pre + c, i = s.post;
|
|
37
|
+
}
|
|
38
|
+
return r + i;
|
|
39
|
+
}
|
|
40
|
+
return o(e, /((?:\-[a-z]+\-)?calc)\(/, n);
|
|
41
|
+
}
|
|
42
|
+
function f(e) {
|
|
43
|
+
for (var t = [], n = [], r = /[\.0-9]([%a-z]+)/gi, i = r.exec(e); i;) !i || !i[1] || (n.indexOf(i[1].toLowerCase()) === -1 && (t.push(i[1]), n.push(i[1].toLowerCase())), i = r.exec(e));
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
//#endregion
|
|
48
|
+
export default i();
|
|
49
|
+
export { i as require_reduce_css_calc };
|
package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_balanced_match as t } from "../../../balanced-match@1.0.2/node_modules/balanced-match/index.js";
|
|
3
|
+
//#region ../../../node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js
|
|
4
|
+
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
+
var r = t();
|
|
6
|
+
n.exports = i;
|
|
7
|
+
function i(e, t, n) {
|
|
8
|
+
var r = e;
|
|
9
|
+
return a(e, t).reduce(function(e, i) {
|
|
10
|
+
return e.replace(i.functionIdentifier + "(" + i.matches.body + ")", o(i.matches.body, i.functionIdentifier, n, r, t));
|
|
11
|
+
}, e);
|
|
12
|
+
}
|
|
13
|
+
function a(e, t) {
|
|
14
|
+
var n = [], i = typeof t == "string" ? RegExp("\\b(" + t + ")\\(") : t;
|
|
15
|
+
do {
|
|
16
|
+
var a = i.exec(e);
|
|
17
|
+
if (!a) return n;
|
|
18
|
+
if (a[1] === void 0) throw Error("Missing the first couple of parenthesis to get the function identifier in " + t);
|
|
19
|
+
var o = a[1], s = a.index, c = r("(", ")", e.substring(s));
|
|
20
|
+
if (!c || c.start !== a[0].length - 1) throw SyntaxError(o + "(): missing closing ')' in the value '" + e + "'");
|
|
21
|
+
n.push({
|
|
22
|
+
matches: c,
|
|
23
|
+
functionIdentifier: o
|
|
24
|
+
}), e = c.post;
|
|
25
|
+
} while (i.test(e));
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
function o(e, t, n, r, a) {
|
|
29
|
+
return n(i(e, a, n), t, r);
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
//#endregion
|
|
33
|
+
export default n();
|
|
34
|
+
export { n as require_reduce_function_call };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/plot/common/plot.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 RawPlot extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
onChangeCategory: 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
|
+
CustomBarElement: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
|
+
interactive: PropTypes.Requireable<boolean>;
|
|
44
|
+
correctness: PropTypes.Requireable<PropTypes.InferProps<{
|
|
45
|
+
value: PropTypes.Requireable<string>;
|
|
46
|
+
label: PropTypes.Requireable<string>;
|
|
47
|
+
}>>;
|
|
48
|
+
defineChart: PropTypes.Requireable<boolean>;
|
|
49
|
+
correctData: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
50
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
51
|
+
label: PropTypes.Requireable<string>;
|
|
52
|
+
}> | null | undefined)[]>;
|
|
53
|
+
className: PropTypes.Requireable<string>;
|
|
54
|
+
};
|
|
55
|
+
constructor(props: any);
|
|
56
|
+
handleMouseEnter: any;
|
|
57
|
+
handleMouseLeave: any;
|
|
58
|
+
setDragValue: (dragValue: any) => void;
|
|
59
|
+
dragStop: any;
|
|
60
|
+
dragValue: any;
|
|
61
|
+
renderCorrectnessIcon: any;
|
|
62
|
+
render(): React.JSX.Element;
|
|
63
|
+
}
|
|
64
|
+
export declare class Plot extends React.Component {
|
|
65
|
+
static propTypes: {
|
|
66
|
+
data: PropTypes.Requireable<any[]>;
|
|
67
|
+
onChangeCategory: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
|
+
xBand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
69
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
70
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
71
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
72
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
73
|
+
}>>>;
|
|
74
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
75
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
76
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
77
|
+
}>>>;
|
|
78
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
79
|
+
min: PropTypes.Validator<number>;
|
|
80
|
+
max: PropTypes.Validator<number>;
|
|
81
|
+
step: PropTypes.Requireable<number>;
|
|
82
|
+
}>>>;
|
|
83
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
84
|
+
min: PropTypes.Validator<number>;
|
|
85
|
+
max: PropTypes.Validator<number>;
|
|
86
|
+
step: PropTypes.Requireable<number>;
|
|
87
|
+
}>>>;
|
|
88
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
89
|
+
width: PropTypes.Validator<number>;
|
|
90
|
+
height: PropTypes.Validator<number>;
|
|
91
|
+
}>>>;
|
|
92
|
+
}>>>;
|
|
93
|
+
defineChart: PropTypes.Requireable<boolean>;
|
|
94
|
+
CustomBarElement: PropTypes.Requireable<(...args: any[]) => any>;
|
|
95
|
+
correctData: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
96
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
97
|
+
label: PropTypes.Requireable<string>;
|
|
98
|
+
}> | null | undefined)[]>;
|
|
99
|
+
className: PropTypes.Requireable<string>;
|
|
100
|
+
};
|
|
101
|
+
render(): React.JSX.Element;
|
|
102
|
+
}
|
|
103
|
+
export default Plot;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import e from "../../node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js";
|
|
2
|
+
import { bandKey as t } from "../../utils.js";
|
|
3
|
+
import { correct as n, incorrect as r } from "../../common/styles.js";
|
|
4
|
+
import i, { DragHandle as a } from "../../common/drag-handle.js";
|
|
5
|
+
import o from "react";
|
|
6
|
+
import s from "prop-types";
|
|
7
|
+
import { styled as c } from "@mui/material/styles";
|
|
8
|
+
import l from "debug";
|
|
9
|
+
import { types as u } from "@pie-lib/plot";
|
|
10
|
+
import { color as d } from "@pie-lib/render-ui";
|
|
11
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
import h from "@mui/icons-material/Check";
|
|
13
|
+
//#region src/plot/common/plot.tsx
|
|
14
|
+
var g = l("pie-lib:chart:bars"), _ = 16, v = c(class extends o.Component {
|
|
15
|
+
static propTypes = {
|
|
16
|
+
onChangeCategory: s.func,
|
|
17
|
+
value: s.number,
|
|
18
|
+
label: s.string,
|
|
19
|
+
xBand: s.func,
|
|
20
|
+
index: s.number.isRequired,
|
|
21
|
+
graphProps: u.GraphPropsType.isRequired,
|
|
22
|
+
CustomBarElement: s.func,
|
|
23
|
+
interactive: s.bool,
|
|
24
|
+
correctness: s.shape({
|
|
25
|
+
value: s.string,
|
|
26
|
+
label: s.string
|
|
27
|
+
}),
|
|
28
|
+
defineChart: s.bool,
|
|
29
|
+
correctData: s.arrayOf(s.shape({
|
|
30
|
+
value: s.oneOfType([s.string, s.number]),
|
|
31
|
+
label: s.string
|
|
32
|
+
})),
|
|
33
|
+
className: s.string
|
|
34
|
+
};
|
|
35
|
+
constructor(e) {
|
|
36
|
+
super(e), this.state = {
|
|
37
|
+
dragValue: void 0,
|
|
38
|
+
isHovered: !1
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
handleMouseEnter = () => {
|
|
42
|
+
this.setState({ isHovered: !0 });
|
|
43
|
+
};
|
|
44
|
+
handleMouseLeave = () => {
|
|
45
|
+
this.setState({ isHovered: !1 });
|
|
46
|
+
};
|
|
47
|
+
setDragValue = (e) => this.setState({ dragValue: e });
|
|
48
|
+
dragStop = () => {
|
|
49
|
+
let { label: e, onChangeCategory: t } = this.props, { dragValue: n } = this.state;
|
|
50
|
+
g("[dragStop]", n), n !== void 0 && t({
|
|
51
|
+
label: e,
|
|
52
|
+
value: n
|
|
53
|
+
}), this.setDragValue(void 0);
|
|
54
|
+
};
|
|
55
|
+
dragValue = (e, t) => {
|
|
56
|
+
g("[dragValue] next:", t), this.setDragValue(t);
|
|
57
|
+
};
|
|
58
|
+
renderCorrectnessIcon = (e, t, n, r, i, a, o) => {
|
|
59
|
+
let s;
|
|
60
|
+
if (n === 0) s = i.y(0) - _ / 2;
|
|
61
|
+
else {
|
|
62
|
+
let e = n - 1;
|
|
63
|
+
s = i.y(e) - (a - o) / 2 - o / 2 - _ / 2;
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ p("foreignObject", {
|
|
66
|
+
x: e + t / 2 - _ / 2,
|
|
67
|
+
y: s,
|
|
68
|
+
width: _,
|
|
69
|
+
height: _,
|
|
70
|
+
children: /* @__PURE__ */ p(h, {
|
|
71
|
+
className: "correctnessIcon correctIcon smallIcon",
|
|
72
|
+
title: r.label
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
render() {
|
|
77
|
+
let { graphProps: e, value: n, label: r, xBand: s, index: c, CustomBarElement: l, interactive: u, correctness: h, defineChart: _, correctData: v, className: y } = this.props, { scale: b, range: x, size: S } = e, { max: C } = x || {}, { dragValue: w, isHovered: T } = this.state, E = Number.isFinite(w) ? w : n, D = s.bandwidth(), O = b.y(x.max - E), k = s(t({ label: r }, c));
|
|
78
|
+
g("label:", r, "barX:", k, "v: ", E, "barHeight:", O, "barWidth: ", D);
|
|
79
|
+
let A = [];
|
|
80
|
+
for (let e = 0; e < E; e++) A.push(e);
|
|
81
|
+
let j = S.height / C, M = (j > D ? D : j) * .8, N = u ? i : a, P = u && !h;
|
|
82
|
+
return /* @__PURE__ */ p(o.Fragment, { children: /* @__PURE__ */ m("g", {
|
|
83
|
+
className: y,
|
|
84
|
+
onMouseEnter: this.handleMouseEnter,
|
|
85
|
+
onMouseLeave: this.handleMouseLeave,
|
|
86
|
+
onTouchStart: this.handleMouseEnter,
|
|
87
|
+
onTouchEnd: this.handleMouseLeave,
|
|
88
|
+
children: [
|
|
89
|
+
T && P && /* @__PURE__ */ p("rect", {
|
|
90
|
+
x: k,
|
|
91
|
+
y: b.y(E),
|
|
92
|
+
width: D,
|
|
93
|
+
height: A?.length ? j * A.length : 0,
|
|
94
|
+
stroke: d.defaults.BORDER_GRAY,
|
|
95
|
+
strokeWidth: "4px",
|
|
96
|
+
fill: "transparent"
|
|
97
|
+
}),
|
|
98
|
+
A.map((e) => l({
|
|
99
|
+
index: e,
|
|
100
|
+
pointDiameter: M,
|
|
101
|
+
barX: k,
|
|
102
|
+
barWidth: D,
|
|
103
|
+
pointHeight: j,
|
|
104
|
+
label: r,
|
|
105
|
+
value: n,
|
|
106
|
+
scale: b
|
|
107
|
+
})),
|
|
108
|
+
h && h.value === "incorrect" && (() => {
|
|
109
|
+
let e = parseFloat(v[c] && v[c].value);
|
|
110
|
+
if (isNaN(e)) return null;
|
|
111
|
+
let i = E;
|
|
112
|
+
if (e === 0) return this.renderCorrectnessIcon(k, D, e, h, b, j, M);
|
|
113
|
+
if (i > e) {
|
|
114
|
+
let i = [];
|
|
115
|
+
for (let t = 0; t < e; t++) i.push(t);
|
|
116
|
+
let a = i[i.length - 1], o = s(t({ label: r }, c)), u = s.bandwidth(), d = S.height / C, g = (d > u ? u : d) * .8;
|
|
117
|
+
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(l, {
|
|
118
|
+
index: a,
|
|
119
|
+
pointDiameter: g + 10,
|
|
120
|
+
barX: o,
|
|
121
|
+
barWidth: u,
|
|
122
|
+
pointHeight: d,
|
|
123
|
+
label: r,
|
|
124
|
+
value: n,
|
|
125
|
+
scale: b,
|
|
126
|
+
dottedOverline: !0
|
|
127
|
+
}), this.renderCorrectnessIcon(o, u, e, h, b, d, g)] });
|
|
128
|
+
}
|
|
129
|
+
let a = [];
|
|
130
|
+
for (let t = i; t < e; t++) a.push(t);
|
|
131
|
+
return /* @__PURE__ */ m(f, { children: [a.map((e) => l({
|
|
132
|
+
index: e,
|
|
133
|
+
pointDiameter: M,
|
|
134
|
+
barX: k,
|
|
135
|
+
barWidth: D,
|
|
136
|
+
pointHeight: j,
|
|
137
|
+
label: r,
|
|
138
|
+
value: n,
|
|
139
|
+
scale: b,
|
|
140
|
+
dottedOverline: !0
|
|
141
|
+
})), this.renderCorrectnessIcon(k, D, e, h, b, j, M)] });
|
|
142
|
+
})(),
|
|
143
|
+
/* @__PURE__ */ p(N, {
|
|
144
|
+
x: k,
|
|
145
|
+
y: E,
|
|
146
|
+
interactive: u,
|
|
147
|
+
width: D,
|
|
148
|
+
onDrag: (e) => this.dragValue(n, e),
|
|
149
|
+
onDragStop: this.dragStop,
|
|
150
|
+
graphProps: e,
|
|
151
|
+
correctness: h,
|
|
152
|
+
isHovered: T,
|
|
153
|
+
defineChart: _,
|
|
154
|
+
color: d.primaryDark(),
|
|
155
|
+
isPlot: !0
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
}) });
|
|
159
|
+
}
|
|
160
|
+
})(({ theme: e }) => ({
|
|
161
|
+
"& .dot": {
|
|
162
|
+
fill: d.visualElementsColors.PLOT_FILL_COLOR,
|
|
163
|
+
"&.correct": n("stroke"),
|
|
164
|
+
"&.incorrect": r("stroke")
|
|
165
|
+
},
|
|
166
|
+
"& .dotColor": {
|
|
167
|
+
fill: d.visualElementsColors.PLOT_FILL_COLOR,
|
|
168
|
+
"&.correct": n("fill"),
|
|
169
|
+
"&.incorrect": r("fill")
|
|
170
|
+
},
|
|
171
|
+
"& .line": {
|
|
172
|
+
stroke: d.visualElementsColors.PLOT_FILL_COLOR,
|
|
173
|
+
"&.correct": n("stroke"),
|
|
174
|
+
"&.incorrect": r("stroke")
|
|
175
|
+
},
|
|
176
|
+
"& .correctIcon": { backgroundColor: d.correct() },
|
|
177
|
+
"& .incorrectIcon": { backgroundColor: d.incorrectWithIcon() },
|
|
178
|
+
"& .correctnessIcon": {
|
|
179
|
+
borderRadius: e.spacing(2),
|
|
180
|
+
color: d.defaults.WHITE,
|
|
181
|
+
fontSize: "16px",
|
|
182
|
+
width: "16px",
|
|
183
|
+
height: "16px",
|
|
184
|
+
padding: "2px",
|
|
185
|
+
border: `1px solid ${d.defaults.WHITE}`,
|
|
186
|
+
stroke: "initial",
|
|
187
|
+
boxSizing: "unset",
|
|
188
|
+
display: "block"
|
|
189
|
+
},
|
|
190
|
+
"& .smallIcon": {
|
|
191
|
+
fontSize: "10px",
|
|
192
|
+
width: "10px",
|
|
193
|
+
height: "10px"
|
|
194
|
+
}
|
|
195
|
+
})), y = class extends o.Component {
|
|
196
|
+
static propTypes = {
|
|
197
|
+
data: s.array,
|
|
198
|
+
onChangeCategory: s.func,
|
|
199
|
+
xBand: s.func,
|
|
200
|
+
graphProps: u.GraphPropsType.isRequired,
|
|
201
|
+
defineChart: s.bool,
|
|
202
|
+
CustomBarElement: s.func,
|
|
203
|
+
correctData: s.arrayOf(s.shape({
|
|
204
|
+
value: s.oneOfType([s.string, s.number]),
|
|
205
|
+
label: s.string
|
|
206
|
+
})),
|
|
207
|
+
className: s.string
|
|
208
|
+
};
|
|
209
|
+
render() {
|
|
210
|
+
let { data: t, graphProps: n, xBand: r, CustomBarElement: i, onChangeCategory: a, defineChart: o, correctData: s } = this.props;
|
|
211
|
+
return /* @__PURE__ */ p(e, { children: (t || []).map((e, t) => /* @__PURE__ */ p(v, {
|
|
212
|
+
value: e.value,
|
|
213
|
+
label: e.label,
|
|
214
|
+
interactive: o || e.interactive,
|
|
215
|
+
defineChart: o,
|
|
216
|
+
xBand: r,
|
|
217
|
+
index: t,
|
|
218
|
+
onChangeCategory: (e) => a(t, e),
|
|
219
|
+
graphProps: n,
|
|
220
|
+
CustomBarElement: i,
|
|
221
|
+
correctness: e.correctness,
|
|
222
|
+
correctData: s
|
|
223
|
+
}, `bar-${e.label}-${e.value}-${t}`)) });
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
//#endregion
|
|
227
|
+
export { y as default };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/plot/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 DotPlot 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 DotPlot;
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|