@pie-lib/charting 8.0.10 → 8.0.11-next.20261202142832
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 +6 -6
- package/dist/actions-button.js +42 -42
- package/dist/axes.js +166 -166
- package/dist/bars/bar.js +12 -12
- package/dist/bars/common/bars.js +59 -59
- package/dist/bars/histogram.js +12 -12
- package/dist/chart-setup.js +62 -62
- package/dist/chart-type.js +38 -38
- package/dist/chart.js +110 -110
- package/dist/common/correctness-indicators.js +22 -22
- package/dist/common/drag-handle.js +33 -33
- package/dist/common/drag-icon.js +11 -11
- package/dist/common/mark-slider.js +14 -14
- package/dist/grid.js +17 -17
- package/dist/i18n/index.js +4 -4
- package/dist/key-legend.js +28 -28
- package/dist/line/common/drag-handle.js +34 -34
- package/dist/line/common/line.js +56 -56
- package/dist/line/line-cross.js +61 -61
- package/dist/line/line-dot.js +48 -48
- package/dist/mark-label.js +45 -45
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/hooks/useText.js +11 -11
- package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-interpolate.js +1 -1
- package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-scale.js +1 -1
- package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-shape.js +1 -1
- package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-time.js +1 -1
- package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +12 -11
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +1 -1
- package/dist/plot/common/plot.js +116 -116
- package/dist/plot/dot.js +33 -33
- package/dist/plot/line.js +44 -44
- package/package.json +8 -8
package/dist/bars/common/bars.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import d from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import n from "../../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
|
|
4
|
+
import r from "../../node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Bar.js";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
|
+
import a from "debug";
|
|
7
|
+
import { color as o } from "@pie-lib/render-ui";
|
|
8
|
+
import { types as s } from "@pie-lib/plot";
|
|
9
|
+
import { bandKey as c } from "../../utils.js";
|
|
10
|
+
import { D as l, DragHandle as u } from "../../common/drag-handle.js";
|
|
11
|
+
import { DragHover as d } from "../../common/drag-hover.js";
|
|
12
|
+
import { MarkSlider as f } from "../../common/mark-slider.js";
|
|
13
|
+
import { CorrectCheckIcon as p } from "./correct-check-icon.js";
|
|
14
14
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
15
15
|
// src/bars/common/bars.tsx
|
|
16
|
-
var _ =
|
|
16
|
+
var _ = a("pie-lib:chart:bars"), v = [
|
|
17
17
|
"#006699",
|
|
18
18
|
"#F59B00",
|
|
19
19
|
"#08916D",
|
|
@@ -39,30 +39,30 @@ var _ = d("pie-lib:chart:bars"), v = [
|
|
|
39
39
|
"#167A7A",
|
|
40
40
|
"#91862D",
|
|
41
41
|
"#894A65"
|
|
42
|
-
], b = (e, t, n, r, i) => e && t && i ? r[n % r.length] : e && i ?
|
|
42
|
+
], b = (e, t, n, r, i) => e && t && i ? r[n % r.length] : e && i ? o.visualElementsColors.ROLLOVER_FILL_BAR_COLOR : t || null, x = i(r)(() => ({ fill: o.defaults.TERTIARY })), S = 10, C = class extends e.Component {
|
|
43
43
|
static propTypes = {
|
|
44
|
-
barColor:
|
|
45
|
-
onChangeCategory:
|
|
46
|
-
value:
|
|
47
|
-
label:
|
|
48
|
-
xBand:
|
|
49
|
-
index:
|
|
50
|
-
graphProps:
|
|
51
|
-
interactive:
|
|
52
|
-
disabled:
|
|
53
|
-
correctness:
|
|
54
|
-
value:
|
|
55
|
-
label:
|
|
44
|
+
barColor: t.string,
|
|
45
|
+
onChangeCategory: t.func,
|
|
46
|
+
value: t.number,
|
|
47
|
+
label: t.string,
|
|
48
|
+
xBand: t.func,
|
|
49
|
+
index: t.number.isRequired,
|
|
50
|
+
graphProps: s.GraphPropsType.isRequired,
|
|
51
|
+
interactive: t.bool,
|
|
52
|
+
disabled: t.bool,
|
|
53
|
+
correctness: t.shape({
|
|
54
|
+
value: t.string,
|
|
55
|
+
label: t.string
|
|
56
56
|
}),
|
|
57
|
-
correctData:
|
|
58
|
-
defineChart:
|
|
59
|
-
language:
|
|
57
|
+
correctData: t.array,
|
|
58
|
+
defineChart: t.bool,
|
|
59
|
+
language: t.string
|
|
60
60
|
};
|
|
61
61
|
constructor(e) {
|
|
62
62
|
super(e), this.state = {
|
|
63
63
|
dragValue: void 0,
|
|
64
64
|
isHovered: !1
|
|
65
|
-
}, this.hover = new
|
|
65
|
+
}, this.hover = new d((e) => this.setState({ isHovered: e })), this.mouseX = 0, this.mouseY = 0;
|
|
66
66
|
}
|
|
67
67
|
componentDidMount() {
|
|
68
68
|
this.hover.attach(), window.addEventListener("mousemove", this.handleMouseMove);
|
|
@@ -99,16 +99,16 @@ var _ = d("pie-lib:chart:bars"), v = [
|
|
|
99
99
|
_("[dragValue] next:", t), this.setDragValue(t);
|
|
100
100
|
};
|
|
101
101
|
render() {
|
|
102
|
-
let { graphProps: e, value: t, label:
|
|
103
|
-
return /* @__PURE__ */ g(
|
|
102
|
+
let { graphProps: e, value: t, label: n, xBand: r, index: i, interactive: a, disabled: s, correctness: d, barColor: _, defineChart: v, correctData: C, language: w } = this.props, { scale: T, range: E } = e, { dragValue: D, isHovered: O } = this.state, k = b(O, _, i, y, a && !d), A = Number.isFinite(D) ? D : t, j = r.bandwidth(), M = T.y(E.max - A), N = r(c({ label: n }, i)), P = E.max - A, F = E.max - P, I = C ? C.find((e) => e.label === n) : null, L = a ? l : u, R = !!_;
|
|
103
|
+
return /* @__PURE__ */ g(f, {
|
|
104
104
|
ref: (e) => this.gRef = e,
|
|
105
105
|
onMouseEnter: this.handleMouseEnter,
|
|
106
106
|
onMouseLeave: this.handleMouseLeave,
|
|
107
107
|
onTouchStart: this.handleMouseEnter,
|
|
108
108
|
onTouchEnd: this.handleMouseLeave,
|
|
109
|
-
enabled:
|
|
110
|
-
label:
|
|
111
|
-
index:
|
|
109
|
+
enabled: a && !s,
|
|
110
|
+
label: n,
|
|
111
|
+
index: i,
|
|
112
112
|
value: A,
|
|
113
113
|
graphProps: e,
|
|
114
114
|
language: w,
|
|
@@ -127,13 +127,13 @@ var _ = d("pie-lib:chart:bars"), v = [
|
|
|
127
127
|
height: M,
|
|
128
128
|
style: { fill: k }
|
|
129
129
|
}),
|
|
130
|
-
|
|
130
|
+
d && d.value === "incorrect" && (() => {
|
|
131
131
|
let e = parseFloat(I && I.value);
|
|
132
132
|
if (isNaN(e)) return null;
|
|
133
|
-
let t = T.y(E.max - e), n = M, r = Math.abs(t - n), i = T.y(e), a = t > n ?
|
|
133
|
+
let t = T.y(E.max - e), n = M, r = Math.abs(t - n), i = T.y(e), a = t > n ? o.borderGray() : o.defaults.WHITE, s = t > n ? i : i - r;
|
|
134
134
|
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(x, {
|
|
135
135
|
x: N + 2,
|
|
136
|
-
y:
|
|
136
|
+
y: s,
|
|
137
137
|
width: j - 4,
|
|
138
138
|
height: r,
|
|
139
139
|
style: {
|
|
@@ -147,55 +147,55 @@ var _ = d("pie-lib:chart:bars"), v = [
|
|
|
147
147
|
y: i - 12,
|
|
148
148
|
width: 24,
|
|
149
149
|
height: 24,
|
|
150
|
-
children: /* @__PURE__ */ h(
|
|
150
|
+
children: /* @__PURE__ */ h(p, { dashColor: a })
|
|
151
151
|
})] });
|
|
152
152
|
})(),
|
|
153
153
|
/* @__PURE__ */ h(L, {
|
|
154
154
|
x: N,
|
|
155
155
|
y: A,
|
|
156
156
|
defineChart: v,
|
|
157
|
-
interactive:
|
|
158
|
-
disabled:
|
|
157
|
+
interactive: a,
|
|
158
|
+
disabled: s,
|
|
159
159
|
width: j,
|
|
160
160
|
onDragStart: this.dragStart,
|
|
161
161
|
onDrag: (e) => this.dragValue(t, e),
|
|
162
162
|
onDragStop: this.dragStop,
|
|
163
163
|
graphProps: e,
|
|
164
|
-
correctness:
|
|
164
|
+
correctness: d,
|
|
165
165
|
isHovered: O,
|
|
166
166
|
color: k
|
|
167
167
|
})
|
|
168
168
|
]
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
}, w = C, T = class extends
|
|
171
|
+
}, w = C, T = class extends e.Component {
|
|
172
172
|
static propTypes = {
|
|
173
|
-
data:
|
|
174
|
-
correctData:
|
|
175
|
-
onChangeCategory:
|
|
176
|
-
defineChart:
|
|
177
|
-
xBand:
|
|
178
|
-
graphProps:
|
|
179
|
-
histogram:
|
|
180
|
-
language:
|
|
173
|
+
data: t.array,
|
|
174
|
+
correctData: t.array,
|
|
175
|
+
onChangeCategory: t.func,
|
|
176
|
+
defineChart: t.bool,
|
|
177
|
+
xBand: t.func,
|
|
178
|
+
graphProps: s.GraphPropsType.isRequired,
|
|
179
|
+
histogram: t.bool,
|
|
180
|
+
language: t.string
|
|
181
181
|
};
|
|
182
182
|
render() {
|
|
183
|
-
let { data:
|
|
184
|
-
return /* @__PURE__ */ h(
|
|
183
|
+
let { data: e, graphProps: t, xBand: r, onChangeCategory: i, defineChart: a, histogram: o, correctData: s, disabled: c, language: l } = this.props;
|
|
184
|
+
return /* @__PURE__ */ h(n, { children: (e || []).map((e, n) => /* @__PURE__ */ h(w, {
|
|
185
185
|
value: e.value,
|
|
186
186
|
interactive: a || e.interactive,
|
|
187
187
|
defineChart: a,
|
|
188
188
|
disabled: c,
|
|
189
189
|
label: e.label,
|
|
190
190
|
xBand: r,
|
|
191
|
-
index:
|
|
192
|
-
onChangeCategory: (e) => i(
|
|
193
|
-
graphProps:
|
|
191
|
+
index: n,
|
|
192
|
+
onChangeCategory: (e) => i(n, e),
|
|
193
|
+
graphProps: t,
|
|
194
194
|
correctness: e.correctness,
|
|
195
195
|
correctData: s,
|
|
196
196
|
language: l,
|
|
197
|
-
barColor: o && (v[
|
|
198
|
-
}, `bar-${e.label}-${
|
|
197
|
+
barColor: o && (v[n] ? v[n] : v[n % v.length])
|
|
198
|
+
}, `bar-${e.label}-${n}`)) });
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
export { T as Bars, T as default, C as RawBar };
|
package/dist/bars/histogram.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { types as n } from "@pie-lib/plot";
|
|
4
|
+
import { dataToXBand as r } from "../utils.js";
|
|
5
|
+
import { Bars as i } from "./common/bars.js";
|
|
6
6
|
import { jsx as a } from "react/jsx-runtime";
|
|
7
7
|
// src/bars/histogram.tsx
|
|
8
|
-
var o = class extends
|
|
8
|
+
var o = class extends e.Component {
|
|
9
9
|
static propTypes = {
|
|
10
|
-
data:
|
|
11
|
-
onChange:
|
|
12
|
-
graphProps:
|
|
10
|
+
data: t.array,
|
|
11
|
+
onChange: t.func,
|
|
12
|
+
graphProps: n.GraphPropsType.isRequired
|
|
13
13
|
};
|
|
14
14
|
render() {
|
|
15
|
-
let
|
|
16
|
-
return /* @__PURE__ */ a(
|
|
17
|
-
...
|
|
15
|
+
let e = this.props, { data: t, graphProps: n } = e, { scale: o = {}, size: s = {} } = n || {}, c = r(o.x, t, s.width, "histogram");
|
|
16
|
+
return /* @__PURE__ */ a(i, {
|
|
17
|
+
...e,
|
|
18
18
|
xBand: c,
|
|
19
19
|
histogram: !0
|
|
20
20
|
});
|
package/dist/chart-setup.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
import n from "prop-types";
|
|
3
|
+
import { color as r } from "@pie-lib/render-ui";
|
|
4
4
|
import { styled as i } from "@mui/material/styles";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import u from "
|
|
5
|
+
import a from "@mui/material/Typography";
|
|
6
|
+
import o from "./chart-type.js";
|
|
7
|
+
import { AlertDialog as s, NumberTextFieldCustom as c } from "@pie-lib/config-ui";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
9
|
// src/chart-setup.tsx
|
|
10
10
|
var d = (e, t, n, r, i) => {
|
|
11
11
|
(e || []).forEach((e) => {
|
|
@@ -28,10 +28,10 @@ var d = (e, t, n, r, i) => {
|
|
|
28
28
|
display: "flex",
|
|
29
29
|
justifyContent: "space-around",
|
|
30
30
|
alignItems: "center"
|
|
31
|
-
})), g = i(
|
|
31
|
+
})), g = i(c)(({ theme: e }) => ({
|
|
32
32
|
width: "130px",
|
|
33
33
|
margin: `${e.spacing(1)} ${e.spacing(.5)}`
|
|
34
|
-
})), _ = i(
|
|
34
|
+
})), _ = i(c)(({ theme: e }) => ({
|
|
35
35
|
width: "160px",
|
|
36
36
|
margin: `${e.spacing(1)} ${e.spacing(.5)}`
|
|
37
37
|
})), v = i("div")(({ theme: e }) => ({
|
|
@@ -39,14 +39,14 @@ var d = (e, t, n, r, i) => {
|
|
|
39
39
|
justifyContent: "space-between",
|
|
40
40
|
alignItems: "center",
|
|
41
41
|
margin: `${e.spacing(3)} 0`
|
|
42
|
-
})), y = i(
|
|
43
|
-
let { model:
|
|
42
|
+
})), y = i(a)(() => ({ color: r.disabled() })), b = (n) => {
|
|
43
|
+
let { model: r, onChange: i, chartDimensions: c, gridValues: b = {}, labelValues: x = {}, studentNewCategoryDefaultLabel: S = {}, availableChartTypes: C = {}, chartTypeLabel: w } = n, [T, E] = t({
|
|
44
44
|
open: !1,
|
|
45
45
|
title: "",
|
|
46
46
|
text: "",
|
|
47
47
|
onClose: null,
|
|
48
48
|
onConfirm: null
|
|
49
|
-
}), [D, O] =
|
|
49
|
+
}), [D, O] = t(!1), [k, A] = t(""), [j, M] = t(0), { range: N = {}, correctAnswer: P, changeInteractiveEnabled: F, changeEditableEnabled: I } = r, L = r.graph, { showInConfigPanel: R, width: z, height: B } = c || {}, V = {
|
|
50
50
|
min: z?.min ? Math.max(50, z.min) : 50,
|
|
51
51
|
max: z?.max ? Math.min(700, z.max) : 700,
|
|
52
52
|
step: z?.step >= 1 ? Math.min(200, z.step) : 20
|
|
@@ -60,13 +60,13 @@ var d = (e, t, n, r, i) => {
|
|
|
60
60
|
}, W = x && x.range ? { customValues: x.range } : {
|
|
61
61
|
min: 0,
|
|
62
62
|
max: 1e4
|
|
63
|
-
}, G = /* @__PURE__ */
|
|
63
|
+
}, G = /* @__PURE__ */ u(h, { children: [/* @__PURE__ */ l(_, {
|
|
64
64
|
label: "Grid Interval",
|
|
65
65
|
value: N.step,
|
|
66
66
|
variant: "outlined",
|
|
67
67
|
onChange: (e, t) => $("step", t, e),
|
|
68
68
|
...U
|
|
69
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ l(_, {
|
|
70
70
|
label: "Label Interval",
|
|
71
71
|
value: N.labelStep,
|
|
72
72
|
variant: "outlined",
|
|
@@ -78,12 +78,12 @@ var d = (e, t, n, r, i) => {
|
|
|
78
78
|
open: e
|
|
79
79
|
})), O(e);
|
|
80
80
|
}, q = (e, t) => e.map((e) => (Object.prototype.hasOwnProperty.call(e, t) && (e[t] = t == "interactive"), e)), J = (e) => {
|
|
81
|
-
let { correctAnswer: t, data: n } =
|
|
82
|
-
F === !1 && q(n, "interactive"), I === !1 && q(n, "editable"), d(n, e, N,
|
|
81
|
+
let { correctAnswer: t, data: n } = r;
|
|
82
|
+
F === !1 && q(n, "interactive"), I === !1 && q(n, "editable"), d(n, e, N, i, r), d(t.data, !1, N, i, r);
|
|
83
83
|
}, Y = () => {
|
|
84
84
|
let e = S?.label;
|
|
85
|
-
|
|
86
|
-
...
|
|
85
|
+
i({
|
|
86
|
+
...r,
|
|
87
87
|
studentCategoryDefaultLabel: e
|
|
88
88
|
});
|
|
89
89
|
}, X = (e) => e.includes("Plot") ? {
|
|
@@ -97,26 +97,26 @@ var d = (e, t, n, r, i) => {
|
|
|
97
97
|
...L,
|
|
98
98
|
[e]: t
|
|
99
99
|
};
|
|
100
|
-
|
|
101
|
-
...
|
|
100
|
+
i({
|
|
101
|
+
...r,
|
|
102
102
|
graph: n
|
|
103
103
|
});
|
|
104
104
|
}, Q = (e, t) => (e || []).find((e) => e.value > t.max || e.value - t.step * Math.floor(e.value / t.step) !== 0), $ = (e, t, n) => {
|
|
105
|
-
M(N[e]), A(e), N[e] = t, (e === "max" || e === "step") && (Q(
|
|
106
|
-
...
|
|
105
|
+
M(N[e]), A(e), N[e] = t, (e === "max" || e === "step") && (Q(r.data, N) || Q(r.correctAnswer.data, N)) && n?.target ? O(!0) : i({
|
|
106
|
+
...r,
|
|
107
107
|
range: N
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
|
-
|
|
110
|
+
e(() => {
|
|
111
111
|
J(!0), Y();
|
|
112
|
-
}, []),
|
|
112
|
+
}, []), e(() => {
|
|
113
113
|
D && E({
|
|
114
114
|
open: !0,
|
|
115
115
|
title: "Warning",
|
|
116
116
|
text: "This change will remove values defined for one or more categories",
|
|
117
117
|
onConfirm: () => {
|
|
118
|
-
J(), K(!1),
|
|
119
|
-
...
|
|
118
|
+
J(), K(!1), i({
|
|
119
|
+
...r,
|
|
120
120
|
range: N,
|
|
121
121
|
correctAnswer: P
|
|
122
122
|
});
|
|
@@ -127,8 +127,8 @@ var d = (e, t, n, r, i) => {
|
|
|
127
127
|
});
|
|
128
128
|
}, [D]);
|
|
129
129
|
let ee = N.step === 1 && N.labelStep === 1 && 3 <= N.max && N.max <= 10, te = () => {
|
|
130
|
-
X.min = 3, X.max = 10, N.max = 10, N.step = 1, N.labelStep = 1,
|
|
131
|
-
...
|
|
130
|
+
X.min = 3, X.max = 10, N.max = 10, N.step = 1, N.labelStep = 1, i({
|
|
131
|
+
...r,
|
|
132
132
|
range: N
|
|
133
133
|
});
|
|
134
134
|
}, ne = (e) => {
|
|
@@ -139,8 +139,8 @@ var d = (e, t, n, r, i) => {
|
|
|
139
139
|
title: "Warning",
|
|
140
140
|
text: "The selected chart type does not support the current chart configuration. Reset chart configuration?",
|
|
141
141
|
onConfirm: () => {
|
|
142
|
-
te(), J(), K(!1),
|
|
143
|
-
...
|
|
142
|
+
te(), J(), K(!1), i({
|
|
143
|
+
...r,
|
|
144
144
|
range: N,
|
|
145
145
|
chartType: e
|
|
146
146
|
});
|
|
@@ -151,38 +151,38 @@ var d = (e, t, n, r, i) => {
|
|
|
151
151
|
});
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
X.min = 3, X.max = 10,
|
|
155
|
-
...
|
|
154
|
+
X.min = 3, X.max = 10, i({
|
|
155
|
+
...r,
|
|
156
156
|
chartType: e
|
|
157
157
|
});
|
|
158
|
-
} else
|
|
159
|
-
...
|
|
158
|
+
} else i({
|
|
159
|
+
...r,
|
|
160
160
|
chartType: e
|
|
161
161
|
});
|
|
162
162
|
};
|
|
163
|
-
return /* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ u(f, { children: [
|
|
164
|
+
/* @__PURE__ */ l(a, {
|
|
165
165
|
variant: "subtitle1",
|
|
166
166
|
children: "Configure Chart"
|
|
167
167
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
value:
|
|
168
|
+
/* @__PURE__ */ u(p, { children: [
|
|
169
|
+
/* @__PURE__ */ u(h, { children: [/* @__PURE__ */ l(o, {
|
|
170
|
+
value: r.chartType,
|
|
171
171
|
onChange: (e) => ne(e.target.value),
|
|
172
172
|
availableChartTypes: C,
|
|
173
173
|
chartTypeLabel: w
|
|
174
|
-
}), /* @__PURE__ */
|
|
174
|
+
}), /* @__PURE__ */ l(_, {
|
|
175
175
|
label: "Max Value",
|
|
176
176
|
value: N.max,
|
|
177
|
-
min: X(
|
|
178
|
-
max: X(
|
|
177
|
+
min: X(r.chartType).min,
|
|
178
|
+
max: X(r.chartType).max,
|
|
179
179
|
variant: "outlined",
|
|
180
180
|
onChange: (e, t) => $("max", t, e)
|
|
181
181
|
})] }),
|
|
182
|
-
!
|
|
183
|
-
R && /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
182
|
+
!r.chartType.includes("Plot") && G,
|
|
183
|
+
R && /* @__PURE__ */ u(v, { children: [
|
|
184
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(a, { children: "Dimensions(px)" }) }),
|
|
185
|
+
/* @__PURE__ */ u(m, { children: [/* @__PURE__ */ l(g, {
|
|
186
186
|
label: "Width",
|
|
187
187
|
value: L.width,
|
|
188
188
|
min: V.min,
|
|
@@ -190,8 +190,8 @@ var d = (e, t, n, r, i) => {
|
|
|
190
190
|
step: V.step,
|
|
191
191
|
variant: "outlined",
|
|
192
192
|
onChange: (e, t) => Z("width", t)
|
|
193
|
-
}), /* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ l(y, { children: "Min 50, Max 700" })] }),
|
|
194
|
+
/* @__PURE__ */ u(m, { children: [/* @__PURE__ */ l(g, {
|
|
195
195
|
label: "Height",
|
|
196
196
|
value: L.height,
|
|
197
197
|
min: H.min,
|
|
@@ -199,10 +199,10 @@ var d = (e, t, n, r, i) => {
|
|
|
199
199
|
step: H.step,
|
|
200
200
|
variant: "outlined",
|
|
201
201
|
onChange: (e, t) => Z("height", t)
|
|
202
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ l(y, { children: "Min 400, Max 700" })] })
|
|
203
203
|
] })
|
|
204
204
|
] }),
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ l(s, {
|
|
206
206
|
open: T.open,
|
|
207
207
|
title: T.title,
|
|
208
208
|
text: T.text,
|
|
@@ -212,17 +212,17 @@ var d = (e, t, n, r, i) => {
|
|
|
212
212
|
] });
|
|
213
213
|
};
|
|
214
214
|
b.propTypes = {
|
|
215
|
-
chartDimensions:
|
|
216
|
-
domain:
|
|
217
|
-
gridValues:
|
|
218
|
-
labelValues:
|
|
219
|
-
model:
|
|
220
|
-
onChange:
|
|
221
|
-
range:
|
|
222
|
-
chartDimension:
|
|
223
|
-
size:
|
|
224
|
-
studentNewCategoryDefaultLabel:
|
|
225
|
-
availableChartTypes:
|
|
226
|
-
chartTypeLabel:
|
|
215
|
+
chartDimensions: n.object,
|
|
216
|
+
domain: n.object,
|
|
217
|
+
gridValues: n.object,
|
|
218
|
+
labelValues: n.object,
|
|
219
|
+
model: n.object,
|
|
220
|
+
onChange: n.func,
|
|
221
|
+
range: n.object,
|
|
222
|
+
chartDimension: n.object,
|
|
223
|
+
size: n.object,
|
|
224
|
+
studentNewCategoryDefaultLabel: n.object,
|
|
225
|
+
availableChartTypes: n.object,
|
|
226
|
+
chartTypeLabel: n.string
|
|
227
227
|
};
|
|
228
228
|
export { b as default, d as resetValues };
|
package/dist/chart-type.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import e from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
2
|
+
import { styled as e } from "@mui/material/styles";
|
|
3
|
+
import t from "@mui/material/MenuItem";
|
|
4
|
+
import n from "@mui/material/FormControl";
|
|
5
|
+
import r from "@mui/material/InputLabel";
|
|
6
|
+
import { Select as i } from "@mui/material";
|
|
7
|
+
import a from "prop-types";
|
|
8
|
+
import { useUniqueId as o } from "@pie-lib/render-ui";
|
|
9
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
10
|
// src/chart-type.tsx
|
|
11
|
-
var l =
|
|
12
|
-
let f =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var l = e("div")(() => ({ width: "160px" })), u = e(n)(() => ({ width: "160px" })), d = e(r)(() => ({ backgroundColor: "transparent" })), f = ({ onChange: e, value: n, availableChartTypes: r, chartTypeLabel: a }) => {
|
|
12
|
+
let f = o("chart-type-label");
|
|
13
|
+
return /* @__PURE__ */ s(l, { children: /* @__PURE__ */ c(u, {
|
|
14
14
|
variant: "outlined",
|
|
15
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ s(d, {
|
|
16
16
|
id: f,
|
|
17
|
-
children:
|
|
18
|
-
}), /* @__PURE__ */ i
|
|
17
|
+
children: a
|
|
18
|
+
}), /* @__PURE__ */ c(i, {
|
|
19
19
|
labelId: f,
|
|
20
20
|
id: `${f}-select`,
|
|
21
21
|
name: "chartType",
|
|
22
|
-
value:
|
|
22
|
+
value: n,
|
|
23
23
|
onChange: e,
|
|
24
|
-
label:
|
|
24
|
+
label: a,
|
|
25
25
|
MenuProps: { transitionDuration: {
|
|
26
26
|
enter: 225,
|
|
27
27
|
exit: 195
|
|
28
28
|
} },
|
|
29
29
|
children: [
|
|
30
|
-
|
|
30
|
+
r?.histogram && /* @__PURE__ */ s(t, {
|
|
31
31
|
value: "histogram",
|
|
32
|
-
children:
|
|
32
|
+
children: r.histogram
|
|
33
33
|
}),
|
|
34
|
-
|
|
34
|
+
r?.bar && /* @__PURE__ */ s(t, {
|
|
35
35
|
value: "bar",
|
|
36
|
-
children:
|
|
36
|
+
children: r.bar
|
|
37
37
|
}),
|
|
38
|
-
|
|
38
|
+
r?.lineDot && /* @__PURE__ */ s(t, {
|
|
39
39
|
value: "lineDot",
|
|
40
|
-
children:
|
|
40
|
+
children: r.lineDot
|
|
41
41
|
}),
|
|
42
|
-
|
|
42
|
+
r?.lineCross && /* @__PURE__ */ s(t, {
|
|
43
43
|
value: "lineCross",
|
|
44
|
-
children:
|
|
44
|
+
children: r.lineCross
|
|
45
45
|
}),
|
|
46
|
-
|
|
46
|
+
r?.dotPlot && /* @__PURE__ */ s(t, {
|
|
47
47
|
value: "dotPlot",
|
|
48
|
-
children:
|
|
48
|
+
children: r.dotPlot
|
|
49
49
|
}),
|
|
50
|
-
|
|
50
|
+
r?.linePlot && /* @__PURE__ */ s(t, {
|
|
51
51
|
value: "linePlot",
|
|
52
|
-
children:
|
|
52
|
+
children: r.linePlot
|
|
53
53
|
})
|
|
54
54
|
]
|
|
55
55
|
})]
|
|
56
56
|
}) });
|
|
57
57
|
};
|
|
58
58
|
f.propTypes = {
|
|
59
|
-
onChange:
|
|
60
|
-
value:
|
|
61
|
-
availableChartTypes:
|
|
62
|
-
histogram:
|
|
63
|
-
bar:
|
|
64
|
-
lineDot:
|
|
65
|
-
lineCross:
|
|
66
|
-
dotPlot:
|
|
67
|
-
linePlot:
|
|
59
|
+
onChange: a.func.isRequired,
|
|
60
|
+
value: a.string.isRequired,
|
|
61
|
+
availableChartTypes: a.shape({
|
|
62
|
+
histogram: a.string,
|
|
63
|
+
bar: a.string,
|
|
64
|
+
lineDot: a.string,
|
|
65
|
+
lineCross: a.string,
|
|
66
|
+
dotPlot: a.string,
|
|
67
|
+
linePlot: a.string
|
|
68
68
|
}),
|
|
69
|
-
chartTypeLabel:
|
|
69
|
+
chartTypeLabel: a.string
|
|
70
70
|
};
|
|
71
71
|
export { f as default };
|