@pie-lib/charting 7.0.4-next.3 → 7.0.4-next.31
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.17.21/node_modules/lodash/_Hash.js +21 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js +21 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js +10 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js +21 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js +9 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +15 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +16 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js +9 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +8 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js +15 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js +19 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js +11 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js +18 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js +16 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +11 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +19 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +13 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +14 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +9 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js +10 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js +20 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js +11 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js +16 -0
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js +12 -0
- package/dist/node_modules/.bun/lodash@4.17.21/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,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, c = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, l = (e, t, n) => (c(e, t, "default"), n && c(n, t, "default")), u = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : a, n)), d = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { o as __commonJSMin, s as __exportAll, l as __reExport, d as __require, u as __toESM };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/actions-button.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 ActionsButton extends React.Component {
|
|
12
|
+
constructor(props: any);
|
|
13
|
+
componentWillUnmount(): void;
|
|
14
|
+
static propTypes: {
|
|
15
|
+
addCategory: PropTypes.Validator<(...args: any[]) => any>;
|
|
16
|
+
deleteCategory: PropTypes.Validator<(...args: any[]) => any>;
|
|
17
|
+
language: PropTypes.Requireable<string>;
|
|
18
|
+
categories: PropTypes.Requireable<any[]>;
|
|
19
|
+
};
|
|
20
|
+
handleActionsClick: any;
|
|
21
|
+
handleActionsClose: any;
|
|
22
|
+
handleAddCategory: any;
|
|
23
|
+
handleDeleteCategory: any;
|
|
24
|
+
render(): React.JSX.Element;
|
|
25
|
+
}
|
|
26
|
+
export default ActionsButton;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { styled as n } from "@mui/material/styles";
|
|
4
|
+
import { color as r } from "@pie-lib/render-ui";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import o from "@mui/material/Button";
|
|
7
|
+
import s from "@mui/material/Popover";
|
|
8
|
+
import c from "@mui/material/Paper";
|
|
9
|
+
import l from "@pie-lib/translator";
|
|
10
|
+
//#region src/actions-button.tsx
|
|
11
|
+
var { translator: u } = l, d = n("div")(() => ({ alignSelf: "flex-end" })), f = n("div")(({ theme: e }) => ({
|
|
12
|
+
cursor: "pointer",
|
|
13
|
+
fontSize: e.typography.fontSize,
|
|
14
|
+
color: r.tertiary(),
|
|
15
|
+
padding: e.spacing(1)
|
|
16
|
+
})), p = n(c)(({ theme: e }) => ({
|
|
17
|
+
padding: e.spacing(1),
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "column",
|
|
20
|
+
gap: e.spacing(1),
|
|
21
|
+
"& button": {
|
|
22
|
+
textTransform: "none",
|
|
23
|
+
fontSize: e.typography.fontSize,
|
|
24
|
+
color: r.text(),
|
|
25
|
+
justifyContent: "flex-start"
|
|
26
|
+
}
|
|
27
|
+
})), m = class extends e.Component {
|
|
28
|
+
constructor(e) {
|
|
29
|
+
super(e), this.state = { actionsAnchorEl: null };
|
|
30
|
+
}
|
|
31
|
+
componentWillUnmount() {
|
|
32
|
+
this.setState({ actionsAnchorEl: null });
|
|
33
|
+
}
|
|
34
|
+
static propTypes = {
|
|
35
|
+
addCategory: t.func.isRequired,
|
|
36
|
+
deleteCategory: t.func.isRequired,
|
|
37
|
+
language: t.string,
|
|
38
|
+
categories: t.array
|
|
39
|
+
};
|
|
40
|
+
handleActionsClick = (e) => {
|
|
41
|
+
this.setState({ actionsAnchorEl: e.currentTarget });
|
|
42
|
+
};
|
|
43
|
+
handleActionsClose = () => {
|
|
44
|
+
this.setState({ actionsAnchorEl: null });
|
|
45
|
+
};
|
|
46
|
+
handleAddCategory = () => {
|
|
47
|
+
let { addCategory: e } = this.props;
|
|
48
|
+
e(), this.handleActionsClose();
|
|
49
|
+
};
|
|
50
|
+
handleDeleteCategory = (e) => {
|
|
51
|
+
let { deleteCategory: t } = this.props;
|
|
52
|
+
t(e), this.handleActionsClose();
|
|
53
|
+
};
|
|
54
|
+
render() {
|
|
55
|
+
let { categories: e, language: t } = this.props, { actionsAnchorEl: n } = this.state;
|
|
56
|
+
return /* @__PURE__ */ a(d, { children: [/* @__PURE__ */ i(f, {
|
|
57
|
+
role: "button",
|
|
58
|
+
tabIndex: 0,
|
|
59
|
+
onClick: this.handleActionsClick,
|
|
60
|
+
children: "Actions"
|
|
61
|
+
}), /* @__PURE__ */ i(s, {
|
|
62
|
+
open: !!n,
|
|
63
|
+
anchorEl: n,
|
|
64
|
+
onClose: this.handleActionsClose,
|
|
65
|
+
anchorOrigin: {
|
|
66
|
+
vertical: "bottom",
|
|
67
|
+
horizontal: "left"
|
|
68
|
+
},
|
|
69
|
+
transformOrigin: {
|
|
70
|
+
vertical: "top",
|
|
71
|
+
horizontal: "left"
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ a(p, { children: [/* @__PURE__ */ a(o, {
|
|
74
|
+
onClick: () => this.handleAddCategory(),
|
|
75
|
+
children: ["+ ", u.t("charting.add", { lng: t })]
|
|
76
|
+
}), e.length > 0 && e.map((e, n) => e.deletable && !e.correctness && /* @__PURE__ */ i(o, {
|
|
77
|
+
onClick: () => this.handleDeleteCategory(n),
|
|
78
|
+
children: `${u.t("charting.delete", { lng: t })} <${e.label || u.t("charting.newLabel", { lng: t })}>`
|
|
79
|
+
}, n))] })
|
|
80
|
+
}, `actions-popover-${Math.random()}`)] });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { m as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AutosizeInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {
|
|
3
|
+
className?: string;
|
|
4
|
+
inputClassName?: string;
|
|
5
|
+
inputRef?: (node: HTMLInputElement | null) => void;
|
|
6
|
+
inputStyle?: React.CSSProperties;
|
|
7
|
+
minWidth?: number | string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare const AutosizeInput: React.ForwardRefExoticComponent<AutosizeInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import e, { useCallback as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
//#region src/autosize-input.tsx
|
|
4
|
+
var s = (e) => {
|
|
5
|
+
let t = Number.parseFloat(e);
|
|
6
|
+
return Number.isFinite(t) ? t : 0;
|
|
7
|
+
}, c = (e, t) => {
|
|
8
|
+
let n = e ?? t;
|
|
9
|
+
return typeof n == "number" ? n : typeof n == "string" && n.endsWith("px") ? s(n) : 1;
|
|
10
|
+
}, l = e.forwardRef(({ className: e, inputClassName: l, inputRef: u, inputStyle: d, minWidth: f, placeholder: p, style: m, value: h, defaultValue: g, ..._ }, v) => {
|
|
11
|
+
let y = r(null), b = r(u), x = r(v), S = r(null), [C, w] = i(() => c(f, d?.minWidth));
|
|
12
|
+
b.current = u, x.current = v;
|
|
13
|
+
let T = t((e) => {
|
|
14
|
+
y.current = e, b.current?.(e);
|
|
15
|
+
let t = x.current;
|
|
16
|
+
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
17
|
+
}, []);
|
|
18
|
+
return n(() => {
|
|
19
|
+
let e = y.current, t = S.current;
|
|
20
|
+
if (!e || !t) return;
|
|
21
|
+
let n = window.getComputedStyle(e);
|
|
22
|
+
t.style.font = n.font, t.style.letterSpacing = n.letterSpacing, t.style.textTransform = n.textTransform, t.textContent = String(h ?? g ?? p ?? "") || " ";
|
|
23
|
+
let r = s(n.paddingLeft) + s(n.paddingRight) + s(n.borderLeftWidth) + s(n.borderRightWidth), i = Math.ceil(t.getBoundingClientRect().width + 2), a = n.boxSizing === "border-box" ? i + r : i;
|
|
24
|
+
w(Math.max(c(f, d?.minWidth), a));
|
|
25
|
+
}, [
|
|
26
|
+
g,
|
|
27
|
+
l,
|
|
28
|
+
d,
|
|
29
|
+
f,
|
|
30
|
+
p,
|
|
31
|
+
h
|
|
32
|
+
]), /* @__PURE__ */ o("span", {
|
|
33
|
+
className: e,
|
|
34
|
+
style: {
|
|
35
|
+
display: "inline-block",
|
|
36
|
+
...m
|
|
37
|
+
},
|
|
38
|
+
children: [/* @__PURE__ */ a("input", {
|
|
39
|
+
..._,
|
|
40
|
+
ref: T,
|
|
41
|
+
className: l,
|
|
42
|
+
placeholder: p,
|
|
43
|
+
style: {
|
|
44
|
+
width: C,
|
|
45
|
+
...d
|
|
46
|
+
},
|
|
47
|
+
value: h,
|
|
48
|
+
defaultValue: g
|
|
49
|
+
}), /* @__PURE__ */ a("span", {
|
|
50
|
+
ref: S,
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
style: {
|
|
53
|
+
height: 0,
|
|
54
|
+
left: 0,
|
|
55
|
+
overflow: "hidden",
|
|
56
|
+
position: "absolute",
|
|
57
|
+
top: 0,
|
|
58
|
+
visibility: "hidden",
|
|
59
|
+
whiteSpace: "pre"
|
|
60
|
+
}
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
l.displayName = "AutosizeInput";
|
|
65
|
+
//#endregion
|
|
66
|
+
export { l as AutosizeInput };
|
package/dist/axes.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/charting/src/axes.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 TickComponent extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
defineChart: PropTypes.Requireable<boolean>;
|
|
14
|
+
error: PropTypes.Requireable<any>;
|
|
15
|
+
};
|
|
16
|
+
constructor(props: any);
|
|
17
|
+
componentDidUpdate(prevProps: any): void;
|
|
18
|
+
handleAlertDialog: (open: any, callback: any) => void;
|
|
19
|
+
changeCategory: any;
|
|
20
|
+
changeInteractive: any;
|
|
21
|
+
changeEditable: any;
|
|
22
|
+
splitText: any;
|
|
23
|
+
render(): React.JSX.Element | null;
|
|
24
|
+
}
|
|
25
|
+
export declare class RawChartAxes extends React.Component {
|
|
26
|
+
static propTypes: {
|
|
27
|
+
bottomScale: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
+
categories: PropTypes.Requireable<any[]>;
|
|
29
|
+
defineChart: PropTypes.Requireable<boolean>;
|
|
30
|
+
error: PropTypes.Requireable<any>;
|
|
31
|
+
graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
32
|
+
scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
33
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
34
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
35
|
+
}>>>;
|
|
36
|
+
snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
37
|
+
x: PropTypes.Validator<(...args: any[]) => any>;
|
|
38
|
+
y: PropTypes.Validator<(...args: any[]) => any>;
|
|
39
|
+
}>>>;
|
|
40
|
+
domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
41
|
+
min: PropTypes.Validator<number>;
|
|
42
|
+
max: PropTypes.Validator<number>;
|
|
43
|
+
step: PropTypes.Requireable<number>;
|
|
44
|
+
}>>>;
|
|
45
|
+
range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
46
|
+
min: PropTypes.Validator<number>;
|
|
47
|
+
max: PropTypes.Validator<number>;
|
|
48
|
+
step: PropTypes.Requireable<number>;
|
|
49
|
+
}>>>;
|
|
50
|
+
size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
51
|
+
width: PropTypes.Validator<number>;
|
|
52
|
+
height: PropTypes.Validator<number>;
|
|
53
|
+
}>>>;
|
|
54
|
+
}>>>;
|
|
55
|
+
xBand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
56
|
+
leftAxis: PropTypes.Requireable<boolean>;
|
|
57
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
58
|
+
onChangeCategory: PropTypes.Requireable<(...args: any[]) => any>;
|
|
59
|
+
top: PropTypes.Requireable<number>;
|
|
60
|
+
theme: PropTypes.Requireable<object>;
|
|
61
|
+
chartingOptions: PropTypes.Requireable<object>;
|
|
62
|
+
changeInteractiveEnabled: PropTypes.Requireable<boolean>;
|
|
63
|
+
changeEditableEnabled: PropTypes.Requireable<boolean>;
|
|
64
|
+
autoFocus: PropTypes.Requireable<boolean>;
|
|
65
|
+
onAutoFocusUsed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
66
|
+
showCorrectness: PropTypes.Requireable<boolean>;
|
|
67
|
+
hiddenLabelRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
68
|
+
current: PropTypes.Requireable<Element>;
|
|
69
|
+
}> | null | undefined>>;
|
|
70
|
+
};
|
|
71
|
+
state: {
|
|
72
|
+
height: number;
|
|
73
|
+
width: number;
|
|
74
|
+
};
|
|
75
|
+
measureHiddenLabel: any;
|
|
76
|
+
_onDocMutation: any;
|
|
77
|
+
observeHiddenLabel: any;
|
|
78
|
+
setHiddenLabelRef: any;
|
|
79
|
+
componentDidMount(): void;
|
|
80
|
+
componentWillUnmount(): void;
|
|
81
|
+
componentDidUpdate(prevProps: any): void;
|
|
82
|
+
render(): React.JSX.Element;
|
|
83
|
+
}
|
|
84
|
+
export default RawChartAxes;
|
package/dist/axes.js
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import e from "./node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisLeft.js";
|
|
2
|
+
import t from "./node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisBottom.js";
|
|
3
|
+
import { TickCorrectnessIndicator as n } from "./common/correctness-indicators.js";
|
|
4
|
+
import { bandKey as r, getRotateAngle as i, getTickValues as a } from "./utils.js";
|
|
5
|
+
import o from "./mark-label.js";
|
|
6
|
+
import s from "react";
|
|
7
|
+
import c from "prop-types";
|
|
8
|
+
import { styled as l } from "@mui/material/styles";
|
|
9
|
+
import { types as u } from "@pie-lib/plot";
|
|
10
|
+
import { AlertDialog as d } from "@pie-lib/config-ui";
|
|
11
|
+
import { color as f } from "@pie-lib/render-ui";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
+
import h from "@mui/material/Checkbox";
|
|
14
|
+
import { renderMath as g } from "@pie-element/shared-math-rendering-mathjax";
|
|
15
|
+
//#region src/axes.tsx
|
|
16
|
+
var _ = /* @__PURE__ */ new Set(), v = null;
|
|
17
|
+
function y(e) {
|
|
18
|
+
_.add(e), !v && typeof document < "u" && (v = new MutationObserver(() => {
|
|
19
|
+
_.forEach((e) => e());
|
|
20
|
+
}), v.observe(document.body, {
|
|
21
|
+
childList: !0,
|
|
22
|
+
subtree: !0
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
function b(e) {
|
|
26
|
+
_.delete(e), _.size === 0 && v && (v.disconnect(), v = null);
|
|
27
|
+
}
|
|
28
|
+
var x = l("text")(({ theme: e }) => ({
|
|
29
|
+
fontSize: e.typography.fontSize - 2,
|
|
30
|
+
fill: e.palette.error.main
|
|
31
|
+
})), S = l(h)(() => ({ color: `${f.tertiary()} !important` })), C = l("g")(({ theme: e }) => ({
|
|
32
|
+
"& .vx-axis-line": {
|
|
33
|
+
stroke: f.visualElementsColors.AXIS_LINE_COLOR,
|
|
34
|
+
strokeWidth: 2
|
|
35
|
+
},
|
|
36
|
+
"& .vx-axis-tick": {
|
|
37
|
+
fill: f.visualElementsColors.AXIS_TICK_COLOR,
|
|
38
|
+
"& line": {
|
|
39
|
+
stroke: f.visualElementsColors.AXIS_TICK_COLOR,
|
|
40
|
+
strokeWidth: 2
|
|
41
|
+
},
|
|
42
|
+
fontFamily: e.typography.body1?.fontFamily,
|
|
43
|
+
fontSize: e.typography.fontSize,
|
|
44
|
+
textAnchor: "middle"
|
|
45
|
+
}
|
|
46
|
+
})), w = (e) => ({
|
|
47
|
+
borderRadius: e.spacing(2),
|
|
48
|
+
color: f.defaults.WHITE,
|
|
49
|
+
fontSize: "16px",
|
|
50
|
+
width: "16px",
|
|
51
|
+
height: "16px",
|
|
52
|
+
padding: "2px",
|
|
53
|
+
border: `1px solid ${f.defaults.WHITE}`,
|
|
54
|
+
boxSizing: "unset"
|
|
55
|
+
}), T = { backgroundColor: f.incorrectWithIcon() }, E = { backgroundColor: f.correct() }, D = class extends s.Component {
|
|
56
|
+
static propTypes = {
|
|
57
|
+
defineChart: c.bool,
|
|
58
|
+
error: c.any
|
|
59
|
+
};
|
|
60
|
+
constructor(e) {
|
|
61
|
+
super(e), this.state = { dialog: { open: !1 } };
|
|
62
|
+
}
|
|
63
|
+
componentDidUpdate(e) {
|
|
64
|
+
this.props.autoFocus && !e.autoFocus && this.props.onAutoFocusUsed();
|
|
65
|
+
}
|
|
66
|
+
handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
|
|
67
|
+
changeCategory = (e, t) => {
|
|
68
|
+
let { categories: n, onChangeCategory: r } = this.props, i = n[e];
|
|
69
|
+
r(e, {
|
|
70
|
+
...i,
|
|
71
|
+
label: t
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
changeInteractive = (e, t) => {
|
|
75
|
+
let { categories: n, onChangeCategory: r } = this.props, i = n[e];
|
|
76
|
+
t ? r(e, {
|
|
77
|
+
...i,
|
|
78
|
+
interactive: !i.interactive
|
|
79
|
+
}) : this.setState({ dialog: {
|
|
80
|
+
open: !0,
|
|
81
|
+
title: "Warning",
|
|
82
|
+
text: "This will remove the correct answer value that has been defined for this category.",
|
|
83
|
+
onConfirm: () => this.handleAlertDialog(!1, r(e, {
|
|
84
|
+
...i,
|
|
85
|
+
interactive: !i.interactive
|
|
86
|
+
})),
|
|
87
|
+
onClose: () => this.handleAlertDialog(!1)
|
|
88
|
+
} });
|
|
89
|
+
};
|
|
90
|
+
changeEditable = (e, t) => {
|
|
91
|
+
let { categories: n, onChangeCategory: r } = this.props, i = n[e];
|
|
92
|
+
t ? r(e, {
|
|
93
|
+
...i,
|
|
94
|
+
editable: !i.editable || !1
|
|
95
|
+
}) : this.setState({ dialog: {
|
|
96
|
+
open: !0,
|
|
97
|
+
title: "Warning",
|
|
98
|
+
text: "This will remove the correct answer category name that has been defined for this category.",
|
|
99
|
+
onConfirm: () => this.handleAlertDialog(!1, r(e, {
|
|
100
|
+
...i,
|
|
101
|
+
editable: !i.editable || !1
|
|
102
|
+
})),
|
|
103
|
+
onClose: () => this.handleAlertDialog(!1)
|
|
104
|
+
} });
|
|
105
|
+
};
|
|
106
|
+
splitText = (e, t) => {
|
|
107
|
+
let n = [];
|
|
108
|
+
for (; (e || "").length > 0;) {
|
|
109
|
+
let r;
|
|
110
|
+
e.length > t ? (r = e.lastIndexOf(" ", t), r === -1 && (r = t)) : r = e.length, n.push(e.substring(0, r)), e = e.substring(r).trim();
|
|
111
|
+
}
|
|
112
|
+
return n;
|
|
113
|
+
};
|
|
114
|
+
render() {
|
|
115
|
+
let { categories: e, xBand: t, bandWidth: i, barWidth: a, rotate: s, top: c, graphProps: l, defineChart: u, chartingOptions: f, x: h, y: g, formattedValue: _, changeInteractiveEnabled: v, changeEditableEnabled: y, error: b, autoFocus: C, hiddenLabelRef: D, showCorrectness: O } = this.props;
|
|
116
|
+
if (!_) return null;
|
|
117
|
+
let k = {
|
|
118
|
+
correctnessIcon: w,
|
|
119
|
+
incorrectIcon: T,
|
|
120
|
+
correctIcon: E
|
|
121
|
+
}, { dialog: A } = this.state, { changeEditable: j, changeInteractive: M } = f || {}, N = parseInt(_.split("-")[0], 10), P = e[N], { editable: F, interactive: I, label: L, correctness: R } = P || {}, z = t(r({ label: L }, N)), B = (e || []).reduce((e, t) => (e && e.label ? e.label.length : 0) > (t && t.label ? t.label.length : 0) ? e : t, { label: "" }), V = b ? [...new Set(Object.values(b))].join(" ") : "";
|
|
122
|
+
return /* @__PURE__ */ m("g", { children: [
|
|
123
|
+
/* @__PURE__ */ m("foreignObject", {
|
|
124
|
+
x: i ? z : h - a / 2,
|
|
125
|
+
y: 18,
|
|
126
|
+
width: a,
|
|
127
|
+
height: 4,
|
|
128
|
+
style: {
|
|
129
|
+
pointerEvents: "none",
|
|
130
|
+
overflow: "visible"
|
|
131
|
+
},
|
|
132
|
+
children: [N === 0 && /* @__PURE__ */ p(o, {
|
|
133
|
+
isHiddenLabel: !0,
|
|
134
|
+
inputRef: D,
|
|
135
|
+
disabled: !0,
|
|
136
|
+
mark: B,
|
|
137
|
+
graphProps: l,
|
|
138
|
+
barWidth: a
|
|
139
|
+
}), /* @__PURE__ */ p(o, {
|
|
140
|
+
autoFocus: u && C,
|
|
141
|
+
inputRef: (e) => this.input = e,
|
|
142
|
+
disabled: !u && !F,
|
|
143
|
+
mark: P,
|
|
144
|
+
graphProps: l,
|
|
145
|
+
onChange: (e) => this.changeCategory(N, e),
|
|
146
|
+
barWidth: a,
|
|
147
|
+
rotate: s,
|
|
148
|
+
correctness: R,
|
|
149
|
+
error: b && b[N],
|
|
150
|
+
limitCharacters: !0,
|
|
151
|
+
correctnessIndicator: O && R && /* @__PURE__ */ p(n, {
|
|
152
|
+
correctness: R,
|
|
153
|
+
interactive: I,
|
|
154
|
+
classes: k
|
|
155
|
+
})
|
|
156
|
+
})]
|
|
157
|
+
}),
|
|
158
|
+
b && N === 0 && /* @__PURE__ */ p(x, {
|
|
159
|
+
y: g + 23,
|
|
160
|
+
height: 6,
|
|
161
|
+
textAnchor: "start",
|
|
162
|
+
children: V
|
|
163
|
+
}),
|
|
164
|
+
u && N === 0 && /* @__PURE__ */ m("svg", {
|
|
165
|
+
x: -55,
|
|
166
|
+
style: { overflow: "visible" },
|
|
167
|
+
children: [v && /* @__PURE__ */ p("text", {
|
|
168
|
+
y: g + 90 + c,
|
|
169
|
+
width: a,
|
|
170
|
+
height: 4,
|
|
171
|
+
style: {
|
|
172
|
+
position: "absolute",
|
|
173
|
+
pointerEvents: "none",
|
|
174
|
+
wordBreak: "break-word",
|
|
175
|
+
maxWidth: a,
|
|
176
|
+
display: "inline-block"
|
|
177
|
+
},
|
|
178
|
+
children: this.splitText(M?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ p("tspan", {
|
|
179
|
+
x: "0",
|
|
180
|
+
dy: `${t > 0 ? "1.2em" : ".6em"}`,
|
|
181
|
+
children: e
|
|
182
|
+
}, t))
|
|
183
|
+
}), y && /* @__PURE__ */ p("text", {
|
|
184
|
+
y: g + 145 + c,
|
|
185
|
+
width: a,
|
|
186
|
+
height: 4,
|
|
187
|
+
style: {
|
|
188
|
+
position: "absolute",
|
|
189
|
+
pointerEvents: "none",
|
|
190
|
+
wordBreak: "break-word",
|
|
191
|
+
maxWidth: a,
|
|
192
|
+
display: "inline-block"
|
|
193
|
+
},
|
|
194
|
+
children: this.splitText(j?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ p("tspan", {
|
|
195
|
+
x: "0",
|
|
196
|
+
dy: `${t > 0 ? "1.2em" : ".6em"}`,
|
|
197
|
+
children: e
|
|
198
|
+
}, t))
|
|
199
|
+
})]
|
|
200
|
+
}),
|
|
201
|
+
u && v && /* @__PURE__ */ p("foreignObject", {
|
|
202
|
+
x: h - 24,
|
|
203
|
+
y: g + 80 + c,
|
|
204
|
+
width: a,
|
|
205
|
+
height: 4,
|
|
206
|
+
style: {
|
|
207
|
+
pointerEvents: "visible",
|
|
208
|
+
overflow: "visible"
|
|
209
|
+
},
|
|
210
|
+
children: /* @__PURE__ */ p(S, {
|
|
211
|
+
style: { position: "fixed" },
|
|
212
|
+
checked: I,
|
|
213
|
+
onChange: (e) => this.changeInteractive(N, e.target.checked)
|
|
214
|
+
})
|
|
215
|
+
}),
|
|
216
|
+
u && y && /* @__PURE__ */ p("foreignObject", {
|
|
217
|
+
x: h - 24,
|
|
218
|
+
y: g + 130 + c,
|
|
219
|
+
width: a,
|
|
220
|
+
height: 4,
|
|
221
|
+
style: {
|
|
222
|
+
pointerEvents: "visible",
|
|
223
|
+
overflow: "visible"
|
|
224
|
+
},
|
|
225
|
+
children: /* @__PURE__ */ p(S, {
|
|
226
|
+
style: { position: "fixed" },
|
|
227
|
+
checked: F,
|
|
228
|
+
onChange: (e) => this.changeEditable(N, e.target.checked)
|
|
229
|
+
})
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ p("foreignObject", {
|
|
232
|
+
x: h - 24,
|
|
233
|
+
y: g + 100 + c,
|
|
234
|
+
width: a,
|
|
235
|
+
height: 4,
|
|
236
|
+
style: {
|
|
237
|
+
pointerEvents: "visible",
|
|
238
|
+
overflow: "visible"
|
|
239
|
+
},
|
|
240
|
+
children: /* @__PURE__ */ p(d, {
|
|
241
|
+
open: A.open,
|
|
242
|
+
title: A.title,
|
|
243
|
+
text: A.text,
|
|
244
|
+
onClose: A.onClose,
|
|
245
|
+
onConfirm: A.onConfirm
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
] });
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
D.propTypes = {
|
|
252
|
+
categories: c.array,
|
|
253
|
+
xBand: c.func,
|
|
254
|
+
bandWidth: c.number,
|
|
255
|
+
barWidth: c.number,
|
|
256
|
+
rotate: c.number,
|
|
257
|
+
top: c.number,
|
|
258
|
+
x: c.number,
|
|
259
|
+
y: c.number,
|
|
260
|
+
graphProps: c.object,
|
|
261
|
+
formattedValue: c.string,
|
|
262
|
+
onChangeCategory: c.func,
|
|
263
|
+
onChange: c.func,
|
|
264
|
+
error: c.object,
|
|
265
|
+
defineChart: c.bool,
|
|
266
|
+
chartingOptions: c.object,
|
|
267
|
+
changeInteractiveEnabled: c.bool,
|
|
268
|
+
changeEditableEnabled: c.bool,
|
|
269
|
+
autoFocus: c.bool,
|
|
270
|
+
onAutoFocusUsed: c.func,
|
|
271
|
+
showCorrectness: c.bool,
|
|
272
|
+
hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })])
|
|
273
|
+
};
|
|
274
|
+
var O = class extends s.Component {
|
|
275
|
+
static propTypes = {
|
|
276
|
+
bottomScale: c.func,
|
|
277
|
+
categories: c.array,
|
|
278
|
+
defineChart: c.bool,
|
|
279
|
+
error: c.any,
|
|
280
|
+
graphProps: u.GraphPropsType.isRequired,
|
|
281
|
+
xBand: c.func,
|
|
282
|
+
leftAxis: c.bool,
|
|
283
|
+
onChange: c.func,
|
|
284
|
+
onChangeCategory: c.func,
|
|
285
|
+
top: c.number,
|
|
286
|
+
theme: c.object,
|
|
287
|
+
chartingOptions: c.object,
|
|
288
|
+
changeInteractiveEnabled: c.bool,
|
|
289
|
+
changeEditableEnabled: c.bool,
|
|
290
|
+
autoFocus: c.bool,
|
|
291
|
+
onAutoFocusUsed: c.func,
|
|
292
|
+
showCorrectness: c.bool,
|
|
293
|
+
hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })])
|
|
294
|
+
};
|
|
295
|
+
state = {
|
|
296
|
+
height: 0,
|
|
297
|
+
width: 0
|
|
298
|
+
};
|
|
299
|
+
measureHiddenLabel = () => {
|
|
300
|
+
if (!this.hiddenLabelRef) return;
|
|
301
|
+
let e = this.hiddenLabelRef.querySelector("mjx-container"), t = this.hiddenLabelRef.querySelector("input"), n = (e || t || this.hiddenLabelRef).getBoundingClientRect(), r = Math.floor(n.height), i = Math.floor(n.width);
|
|
302
|
+
(r !== this.state.height || i !== this.state.width) && this.setState({
|
|
303
|
+
height: r,
|
|
304
|
+
width: i
|
|
305
|
+
});
|
|
306
|
+
};
|
|
307
|
+
_onDocMutation = () => {
|
|
308
|
+
this.hiddenLabelRef && this.hiddenLabelRef.querySelector("mjx-container") && this.measureHiddenLabel();
|
|
309
|
+
};
|
|
310
|
+
observeHiddenLabel = (e) => {
|
|
311
|
+
if (!e) return;
|
|
312
|
+
let t = e.querySelector("[data-latex], [data-raw]");
|
|
313
|
+
t && g(e), (e.querySelector("mjx-container") || !t) && this.measureHiddenLabel(), y(this._onDocMutation);
|
|
314
|
+
};
|
|
315
|
+
setHiddenLabelRef = (e) => {
|
|
316
|
+
e && e !== this.hiddenLabelRef && (this.hiddenLabelRef = e, this.observeHiddenLabel(e));
|
|
317
|
+
};
|
|
318
|
+
componentDidMount() {
|
|
319
|
+
this.hiddenLabelRef && this.observeHiddenLabel(this.hiddenLabelRef);
|
|
320
|
+
}
|
|
321
|
+
componentWillUnmount() {
|
|
322
|
+
b(this._onDocMutation), this._updateTimer && clearTimeout(this._updateTimer);
|
|
323
|
+
}
|
|
324
|
+
componentDidUpdate(e) {
|
|
325
|
+
e.categories !== this.props.categories && (this._updateTimer && clearTimeout(this._updateTimer), this._updateTimer = setTimeout(() => this.measureHiddenLabel(), 50));
|
|
326
|
+
}
|
|
327
|
+
render() {
|
|
328
|
+
let { graphProps: n, xBand: r, leftAxis: o, onChange: s, onChangeCategory: c, categories: l = [], top: u, defineChart: d, chartingOptions: f, changeInteractiveEnabled: h, changeEditableEnabled: g, theme: _, autoFocus: v, onAutoFocusUsed: y, error: b, showCorrectness: x } = this.props, { scale: S = {}, range: w = {}, domain: T = {}, size: E = {} } = n || {}, { height: O, width: k } = this.state, A = r && typeof r.rangeRound == "function" && r.rangeRound([0, E.width]), j = r && typeof r.bandwidth == "function" && r.bandwidth(), M = j || S.x && S.x(T.max) / l.length, N = a({
|
|
329
|
+
...w,
|
|
330
|
+
step: w.labelStep
|
|
331
|
+
}), P = i(_ && _.typography ? _.typography.fontSize : 14, O), F = k > M ? 25 : 0;
|
|
332
|
+
return /* @__PURE__ */ m(C, { children: [o && /* @__PURE__ */ p(e, {
|
|
333
|
+
scale: S.y,
|
|
334
|
+
tickLength: 10,
|
|
335
|
+
tickFormat: (e) => e,
|
|
336
|
+
tickValues: N,
|
|
337
|
+
tickLabelProps: (e) => ({
|
|
338
|
+
dy: 4,
|
|
339
|
+
dx: -10 - (e.toLocaleString().length || 1) * 5
|
|
340
|
+
})
|
|
341
|
+
}), /* @__PURE__ */ p(t, {
|
|
342
|
+
scale: A,
|
|
343
|
+
labelProps: { y: 60 + u },
|
|
344
|
+
top: S.y && S.y(w.min),
|
|
345
|
+
textLabelProps: () => ({ textAnchor: "middle" }),
|
|
346
|
+
tickFormat: (e) => e,
|
|
347
|
+
tickComponent: (e) => /* @__PURE__ */ p(D, {
|
|
348
|
+
hiddenLabelRef: this.setHiddenLabelRef,
|
|
349
|
+
categories: l,
|
|
350
|
+
xBand: r,
|
|
351
|
+
bandWidth: j,
|
|
352
|
+
barWidth: M,
|
|
353
|
+
rotate: P || F,
|
|
354
|
+
top: u,
|
|
355
|
+
defineChart: d,
|
|
356
|
+
chartingOptions: f,
|
|
357
|
+
autoFocus: v,
|
|
358
|
+
onAutoFocusUsed: y,
|
|
359
|
+
error: b,
|
|
360
|
+
onChangeCategory: c,
|
|
361
|
+
changeInteractiveEnabled: h,
|
|
362
|
+
changeEditableEnabled: g,
|
|
363
|
+
onChange: s,
|
|
364
|
+
graphProps: n,
|
|
365
|
+
x: e.x,
|
|
366
|
+
y: e.y,
|
|
367
|
+
formattedValue: e.formattedValue,
|
|
368
|
+
showCorrectness: x
|
|
369
|
+
}),
|
|
370
|
+
autoFocus: v,
|
|
371
|
+
onAutoFocusUsed: y
|
|
372
|
+
})] });
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
//#endregion
|
|
376
|
+
export { O as default };
|