@pie-lib/charting 8.0.1-next.20261004181842 → 8.0.1-next.20261004202944
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/__tests__/page-unique-ids.test.d.ts +1 -0
- package/dist/actions-button.js +8 -8
- package/dist/axes.js +33 -33
- package/dist/bars/common/bars.js +11 -11
- package/dist/bars/common/correct-check-icon.js +46 -42
- package/dist/chart-setup.js +19 -19
- package/dist/chart-type.js +55 -51
- package/dist/chart.js +21 -21
- package/dist/common/correctness-indicators.js +18 -18
- package/dist/common/drag-handle.js +14 -38
- package/dist/grid.js +9 -9
- package/dist/key-legend.js +13 -13
- package/dist/line/common/drag-handle.js +12 -12
- package/dist/line/common/line.js +8 -8
- package/dist/line/line-cross.js +17 -17
- package/dist/line/line-dot.js +10 -10
- package/dist/mark-label.js +9 -9
- package/dist/plot/common/plot.js +22 -22
- package/dist/plot/dot.js +7 -7
- package/dist/plot/line.js +8 -8
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/actions-button.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import t from "prop-types";
|
|
3
3
|
import { styled as n } from "@mui/material/styles";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { color as r } from "@pie-lib/render-ui";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
import o from "@pie-lib/translator";
|
|
7
7
|
import s from "@mui/material/Button";
|
|
8
8
|
import c from "@mui/material/Popover";
|
|
@@ -11,7 +11,7 @@ import l from "@mui/material/Paper";
|
|
|
11
11
|
var { translator: u } = o, d = n("div")(() => ({ alignSelf: "flex-end" })), f = n("div")(({ theme: e }) => ({
|
|
12
12
|
cursor: "pointer",
|
|
13
13
|
fontSize: e.typography.fontSize,
|
|
14
|
-
color:
|
|
14
|
+
color: r.tertiary(),
|
|
15
15
|
padding: e.spacing(1)
|
|
16
16
|
})), p = n(l)(({ theme: e }) => ({
|
|
17
17
|
padding: e.spacing(1),
|
|
@@ -21,7 +21,7 @@ var { translator: u } = o, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
21
21
|
"& button": {
|
|
22
22
|
textTransform: "none",
|
|
23
23
|
fontSize: e.typography.fontSize,
|
|
24
|
-
color:
|
|
24
|
+
color: r.text(),
|
|
25
25
|
justifyContent: "flex-start"
|
|
26
26
|
}
|
|
27
27
|
})), m = class extends e.Component {
|
|
@@ -53,12 +53,12 @@ var { translator: u } = o, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
53
53
|
};
|
|
54
54
|
render() {
|
|
55
55
|
let { categories: e, language: t } = this.props, { actionsAnchorEl: n } = this.state;
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ a(d, { children: [/* @__PURE__ */ i(f, {
|
|
57
57
|
role: "button",
|
|
58
58
|
tabIndex: 0,
|
|
59
59
|
onClick: this.handleActionsClick,
|
|
60
60
|
children: "Actions"
|
|
61
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ i(c, {
|
|
62
62
|
open: !!n,
|
|
63
63
|
anchorEl: n,
|
|
64
64
|
onClose: this.handleActionsClose,
|
|
@@ -70,10 +70,10 @@ var { translator: u } = o, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
70
70
|
vertical: "top",
|
|
71
71
|
horizontal: "left"
|
|
72
72
|
},
|
|
73
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ a(p, { children: [/* @__PURE__ */ a(s, {
|
|
74
74
|
onClick: () => this.handleAddCategory(),
|
|
75
75
|
children: ["+ ", u.t("charting.add", { lng: t })]
|
|
76
|
-
}), e.length > 0 && e.map((e, n) => e.deletable && !e.correctness && /* @__PURE__ */
|
|
76
|
+
}), e.length > 0 && e.map((e, n) => e.deletable && !e.correctness && /* @__PURE__ */ i(s, {
|
|
77
77
|
onClick: () => this.handleDeleteCategory(n),
|
|
78
78
|
children: `${u.t("charting.delete", { lng: t })} <${e.label || u.t("charting.newLabel", { lng: t })}>`
|
|
79
79
|
}, n))] })
|
package/dist/axes.js
CHANGED
|
@@ -8,8 +8,8 @@ import c from "prop-types";
|
|
|
8
8
|
import { styled as l } from "@mui/material/styles";
|
|
9
9
|
import { types as u } from "@pie-lib/plot";
|
|
10
10
|
import { AlertDialog as d } from "@pie-lib/config-ui";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { color as f } from "@pie-lib/render-ui";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
13
|
import h from "@mui/material/Checkbox";
|
|
14
14
|
import { renderMath as g } from "@pie-element/shared-math-rendering-mathjax";
|
|
15
15
|
import _ from "@pie-lib/translator";
|
|
@@ -29,15 +29,15 @@ function S(e) {
|
|
|
29
29
|
var C = l("text")(({ theme: e }) => ({
|
|
30
30
|
fontSize: e.typography.fontSize - 2,
|
|
31
31
|
fill: e.palette.error.main
|
|
32
|
-
})), w = l(h)(() => ({ color: `${
|
|
32
|
+
})), w = l(h)(() => ({ color: `${f.tertiary()} !important` })), T = l("g")(({ theme: e }) => ({
|
|
33
33
|
"& .vx-axis-line": {
|
|
34
|
-
stroke:
|
|
34
|
+
stroke: f.visualElementsColors.AXIS_LINE_COLOR,
|
|
35
35
|
strokeWidth: 2
|
|
36
36
|
},
|
|
37
37
|
"& .vx-axis-tick": {
|
|
38
|
-
fill:
|
|
38
|
+
fill: f.visualElementsColors.AXIS_TICK_COLOR,
|
|
39
39
|
"& line": {
|
|
40
|
-
stroke:
|
|
40
|
+
stroke: f.visualElementsColors.AXIS_TICK_COLOR,
|
|
41
41
|
strokeWidth: 2
|
|
42
42
|
},
|
|
43
43
|
fontFamily: e.typography.body1?.fontFamily,
|
|
@@ -46,14 +46,14 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
46
46
|
}
|
|
47
47
|
})), E = (e) => ({
|
|
48
48
|
borderRadius: e.spacing(2),
|
|
49
|
-
color:
|
|
49
|
+
color: f.defaults.WHITE,
|
|
50
50
|
fontSize: "16px",
|
|
51
51
|
width: "16px",
|
|
52
52
|
height: "16px",
|
|
53
53
|
padding: "2px",
|
|
54
|
-
border: `1px solid ${
|
|
54
|
+
border: `1px solid ${f.defaults.WHITE}`,
|
|
55
55
|
boxSizing: "unset"
|
|
56
|
-
}), D = { backgroundColor:
|
|
56
|
+
}), D = { backgroundColor: f.incorrectWithIcon() }, O = { backgroundColor: f.correct() }, k = class extends s.Component {
|
|
57
57
|
static propTypes = {
|
|
58
58
|
defineChart: c.bool,
|
|
59
59
|
error: c.any
|
|
@@ -113,15 +113,15 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
113
113
|
return n;
|
|
114
114
|
};
|
|
115
115
|
render() {
|
|
116
|
-
let { categories: e, xBand: t, bandWidth: i, barWidth: a, rotate: s, top: c, graphProps: l, defineChart: u, chartingOptions:
|
|
116
|
+
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: y, changeEditableEnabled: b, error: x, autoFocus: S, hiddenLabelRef: T, showCorrectness: k, language: A } = this.props;
|
|
117
117
|
if (!_) return null;
|
|
118
118
|
let j = {
|
|
119
119
|
correctnessIcon: E,
|
|
120
120
|
incorrectIcon: D,
|
|
121
121
|
correctIcon: O
|
|
122
|
-
}, { dialog: M } = this.state, { changeEditable: N, changeInteractive: P } =
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
122
|
+
}, { dialog: M } = this.state, { changeEditable: N, changeInteractive: P } = f || {}, F = parseInt(_.split("-")[0], 10), I = e[F], { editable: L, interactive: R, label: z, correctness: B } = I || {}, V = t(r({ label: z }, F)), H = (e || []).reduce((e, t) => (e && e.label ? e.label.length : 0) > (t && t.label ? t.label.length : 0) ? e : t, { label: "" }), U = x ? [...new Set(Object.values(x))].join(" ") : "";
|
|
123
|
+
return /* @__PURE__ */ m("g", { children: [
|
|
124
|
+
/* @__PURE__ */ m("foreignObject", {
|
|
125
125
|
x: i ? V : h - a / 2,
|
|
126
126
|
y: 18,
|
|
127
127
|
width: a,
|
|
@@ -130,14 +130,14 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
130
130
|
pointerEvents: "none",
|
|
131
131
|
overflow: "visible"
|
|
132
132
|
},
|
|
133
|
-
children: [F === 0 && /* @__PURE__ */
|
|
133
|
+
children: [F === 0 && /* @__PURE__ */ p(o, {
|
|
134
134
|
isHiddenLabel: !0,
|
|
135
135
|
inputRef: T,
|
|
136
136
|
disabled: !0,
|
|
137
137
|
mark: H,
|
|
138
138
|
graphProps: l,
|
|
139
139
|
barWidth: a
|
|
140
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ p(o, {
|
|
141
141
|
autoFocus: u && S,
|
|
142
142
|
inputRef: (e) => this.input = e,
|
|
143
143
|
disabled: !u && !L,
|
|
@@ -153,23 +153,23 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
153
153
|
index: F + 1
|
|
154
154
|
}),
|
|
155
155
|
limitCharacters: !0,
|
|
156
|
-
correctnessIndicator: k && B && /* @__PURE__ */
|
|
156
|
+
correctnessIndicator: k && B && /* @__PURE__ */ p(n, {
|
|
157
157
|
correctness: B,
|
|
158
158
|
interactive: R,
|
|
159
159
|
classes: j
|
|
160
160
|
})
|
|
161
161
|
})]
|
|
162
162
|
}),
|
|
163
|
-
x && F === 0 && /* @__PURE__ */
|
|
163
|
+
x && F === 0 && /* @__PURE__ */ p(C, {
|
|
164
164
|
y: g + 23,
|
|
165
165
|
height: 6,
|
|
166
166
|
textAnchor: "start",
|
|
167
167
|
children: U
|
|
168
168
|
}),
|
|
169
|
-
u && F === 0 && /* @__PURE__ */
|
|
169
|
+
u && F === 0 && /* @__PURE__ */ m("svg", {
|
|
170
170
|
x: -55,
|
|
171
171
|
style: { overflow: "visible" },
|
|
172
|
-
children: [y && /* @__PURE__ */
|
|
172
|
+
children: [y && /* @__PURE__ */ p("text", {
|
|
173
173
|
y: g + 90 + c,
|
|
174
174
|
width: a,
|
|
175
175
|
height: 4,
|
|
@@ -180,12 +180,12 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
180
180
|
maxWidth: a,
|
|
181
181
|
display: "inline-block"
|
|
182
182
|
},
|
|
183
|
-
children: this.splitText(P?.authoringLabel, 20).map((e, t) => /* @__PURE__ */
|
|
183
|
+
children: this.splitText(P?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ p("tspan", {
|
|
184
184
|
x: "0",
|
|
185
185
|
dy: `${t > 0 ? "1.2em" : ".6em"}`,
|
|
186
186
|
children: e
|
|
187
187
|
}, t))
|
|
188
|
-
}), b && /* @__PURE__ */
|
|
188
|
+
}), b && /* @__PURE__ */ p("text", {
|
|
189
189
|
y: g + 145 + c,
|
|
190
190
|
width: a,
|
|
191
191
|
height: 4,
|
|
@@ -196,14 +196,14 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
196
196
|
maxWidth: a,
|
|
197
197
|
display: "inline-block"
|
|
198
198
|
},
|
|
199
|
-
children: this.splitText(N?.authoringLabel, 20).map((e, t) => /* @__PURE__ */
|
|
199
|
+
children: this.splitText(N?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ p("tspan", {
|
|
200
200
|
x: "0",
|
|
201
201
|
dy: `${t > 0 ? "1.2em" : ".6em"}`,
|
|
202
202
|
children: e
|
|
203
203
|
}, t))
|
|
204
204
|
})]
|
|
205
205
|
}),
|
|
206
|
-
u && y && /* @__PURE__ */
|
|
206
|
+
u && y && /* @__PURE__ */ p("foreignObject", {
|
|
207
207
|
x: h - 24,
|
|
208
208
|
y: g + 80 + c,
|
|
209
209
|
width: a,
|
|
@@ -212,13 +212,13 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
212
212
|
pointerEvents: "visible",
|
|
213
213
|
overflow: "visible"
|
|
214
214
|
},
|
|
215
|
-
children: /* @__PURE__ */
|
|
215
|
+
children: /* @__PURE__ */ p(w, {
|
|
216
216
|
style: { position: "fixed" },
|
|
217
217
|
checked: R,
|
|
218
218
|
onChange: (e) => this.changeInteractive(F, e.target.checked)
|
|
219
219
|
})
|
|
220
220
|
}),
|
|
221
|
-
u && b && /* @__PURE__ */
|
|
221
|
+
u && b && /* @__PURE__ */ p("foreignObject", {
|
|
222
222
|
x: h - 24,
|
|
223
223
|
y: g + 130 + c,
|
|
224
224
|
width: a,
|
|
@@ -227,13 +227,13 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
227
227
|
pointerEvents: "visible",
|
|
228
228
|
overflow: "visible"
|
|
229
229
|
},
|
|
230
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ p(w, {
|
|
231
231
|
style: { position: "fixed" },
|
|
232
232
|
checked: L,
|
|
233
233
|
onChange: (e) => this.changeEditable(F, e.target.checked)
|
|
234
234
|
})
|
|
235
235
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ p("foreignObject", {
|
|
237
237
|
x: h - 24,
|
|
238
238
|
y: g + 100 + c,
|
|
239
239
|
width: a,
|
|
@@ -242,7 +242,7 @@ var C = l("text")(({ theme: e }) => ({
|
|
|
242
242
|
pointerEvents: "visible",
|
|
243
243
|
overflow: "visible"
|
|
244
244
|
},
|
|
245
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ p(d, {
|
|
246
246
|
open: M.open,
|
|
247
247
|
title: M.title,
|
|
248
248
|
text: M.text,
|
|
@@ -332,11 +332,11 @@ var A = class extends s.Component {
|
|
|
332
332
|
e.categories !== this.props.categories && (this._updateTimer && clearTimeout(this._updateTimer), this._updateTimer = setTimeout(() => this.measureHiddenLabel(), 50));
|
|
333
333
|
}
|
|
334
334
|
render() {
|
|
335
|
-
let { graphProps: n, xBand: r, leftAxis: o, onChange: s, onChangeCategory: c, categories: l = [], top: u, defineChart: d, chartingOptions:
|
|
335
|
+
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, language: S } = this.props, { scale: C = {}, range: w = {}, domain: E = {}, size: D = {} } = n || {}, { height: O, width: A } = this.state, j = r && typeof r.rangeRound == "function" && r.rangeRound([0, D.width]), M = r && typeof r.bandwidth == "function" && r.bandwidth(), N = M || C.x && C.x(E.max) / l.length, P = a({
|
|
336
336
|
...w,
|
|
337
337
|
step: w.labelStep
|
|
338
338
|
}), F = i(_ && _.typography ? _.typography.fontSize : 14, O), I = A > N ? 25 : 0;
|
|
339
|
-
return /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ m(T, { children: [o && /* @__PURE__ */ p(e, {
|
|
340
340
|
scale: C.y,
|
|
341
341
|
tickLength: 10,
|
|
342
342
|
tickFormat: (e) => e,
|
|
@@ -345,13 +345,13 @@ var A = class extends s.Component {
|
|
|
345
345
|
dy: 4,
|
|
346
346
|
dx: -10 - (e.toLocaleString().length || 1) * 5
|
|
347
347
|
})
|
|
348
|
-
}), /* @__PURE__ */
|
|
348
|
+
}), /* @__PURE__ */ p(t, {
|
|
349
349
|
scale: j,
|
|
350
350
|
labelProps: { y: 60 + u },
|
|
351
351
|
top: C.y && C.y(w.min),
|
|
352
352
|
textLabelProps: () => ({ textAnchor: "middle" }),
|
|
353
353
|
tickFormat: (e) => e,
|
|
354
|
-
tickComponent: (e) => /* @__PURE__ */
|
|
354
|
+
tickComponent: (e) => /* @__PURE__ */ p(k, {
|
|
355
355
|
hiddenLabelRef: this.setHiddenLabelRef,
|
|
356
356
|
categories: l,
|
|
357
357
|
xBand: r,
|
|
@@ -360,7 +360,7 @@ var A = class extends s.Component {
|
|
|
360
360
|
rotate: F || I,
|
|
361
361
|
top: u,
|
|
362
362
|
defineChart: d,
|
|
363
|
-
chartingOptions:
|
|
363
|
+
chartingOptions: f,
|
|
364
364
|
autoFocus: v,
|
|
365
365
|
onAutoFocusUsed: y,
|
|
366
366
|
error: b,
|
package/dist/bars/common/bars.js
CHANGED
|
@@ -8,8 +8,8 @@ import s from "prop-types";
|
|
|
8
8
|
import { styled as c } from "@mui/material/styles";
|
|
9
9
|
import l from "debug";
|
|
10
10
|
import { types as u } from "@pie-lib/plot";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { color as d } from "@pie-lib/render-ui";
|
|
12
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
13
|
//#region src/bars/common/bars.tsx
|
|
14
14
|
var h = l("pie-lib:chart:bars"), g = [
|
|
15
15
|
"#006699",
|
|
@@ -37,7 +37,7 @@ var h = l("pie-lib:chart:bars"), g = [
|
|
|
37
37
|
"#167A7A",
|
|
38
38
|
"#91862D",
|
|
39
39
|
"#894A65"
|
|
40
|
-
], v = (e, t, n, r, i) => e && t && i ? r[n % r.length] : e && i ?
|
|
40
|
+
], v = (e, t, n, r, i) => e && t && i ? r[n % r.length] : e && i ? d.visualElementsColors.ROLLOVER_FILL_BAR_COLOR : t || null, y = c(t)(() => ({ fill: d.defaults.TERTIARY })), b = class extends o.Component {
|
|
41
41
|
static propTypes = {
|
|
42
42
|
barColor: s.string,
|
|
43
43
|
onChangeCategory: s.func,
|
|
@@ -90,14 +90,14 @@ var h = l("pie-lib:chart:bars"), g = [
|
|
|
90
90
|
};
|
|
91
91
|
render() {
|
|
92
92
|
let { graphProps: e, value: t, label: o, xBand: s, index: c, interactive: l, correctness: u, barColor: h, defineChart: g, correctData: b } = this.props, { scale: x, range: S } = e, { dragValue: C, isHovered: w } = this.state, T = v(w, h, c, _, l && !u), E = Number.isFinite(C) ? C : t, D = s.bandwidth(), O = x.y(S.max - E), k = s(n({ label: o }, c)), A = S.max - E, j = S.max - A, M = b ? b.find((e) => e.label === o) : null, N = l ? r : i, P = !!h;
|
|
93
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ m("g", {
|
|
94
94
|
ref: (e) => this.gRef = e,
|
|
95
95
|
onMouseEnter: this.handleMouseEnter,
|
|
96
96
|
onMouseLeave: this.handleMouseLeave,
|
|
97
97
|
onTouchStart: this.handleMouseEnter,
|
|
98
98
|
onTouchEnd: this.handleMouseLeave,
|
|
99
99
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ p(y, {
|
|
101
101
|
x: k,
|
|
102
102
|
y: x.y(j),
|
|
103
103
|
width: D,
|
|
@@ -107,8 +107,8 @@ var h = l("pie-lib:chart:bars"), g = [
|
|
|
107
107
|
u && u.value === "incorrect" && (() => {
|
|
108
108
|
let e = parseFloat(M && M.value);
|
|
109
109
|
if (isNaN(e)) return null;
|
|
110
|
-
let t = x.y(S.max - e), n = O, r = Math.abs(t - n), i = x.y(e), o = t > n ?
|
|
111
|
-
return /* @__PURE__ */
|
|
110
|
+
let t = x.y(S.max - e), n = O, r = Math.abs(t - n), i = x.y(e), o = t > n ? d.borderGray() : d.defaults.WHITE, s = t > n ? i : i - r;
|
|
111
|
+
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(y, {
|
|
112
112
|
x: k + 2,
|
|
113
113
|
y: s,
|
|
114
114
|
width: D - 4,
|
|
@@ -119,15 +119,15 @@ var h = l("pie-lib:chart:bars"), g = [
|
|
|
119
119
|
strokeDasharray: "5,2",
|
|
120
120
|
fill: "none"
|
|
121
121
|
}
|
|
122
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ p("foreignObject", {
|
|
123
123
|
x: k + D - (P ? 24 : 14),
|
|
124
124
|
y: i - 12,
|
|
125
125
|
width: 24,
|
|
126
126
|
height: 24,
|
|
127
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ p(a, { dashColor: o })
|
|
128
128
|
})] });
|
|
129
129
|
})(),
|
|
130
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ p(N, {
|
|
131
131
|
x: k,
|
|
132
132
|
y: E,
|
|
133
133
|
defineChart: g,
|
|
@@ -155,7 +155,7 @@ var h = l("pie-lib:chart:bars"), g = [
|
|
|
155
155
|
};
|
|
156
156
|
render() {
|
|
157
157
|
let { data: t, graphProps: n, xBand: r, onChangeCategory: i, defineChart: a, histogram: o, correctData: s } = this.props;
|
|
158
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ p(e, { children: (t || []).map((e, t) => /* @__PURE__ */ p(x, {
|
|
159
159
|
value: e.value,
|
|
160
160
|
interactive: a || e.interactive,
|
|
161
161
|
defineChart: a,
|
|
@@ -1,50 +1,54 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import e from "prop-types";
|
|
3
|
-
import {
|
|
3
|
+
import { useUniqueId as t } from "@pie-lib/render-ui";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
5
|
//#region src/bars/common/correct-check-icon.tsx
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
strokeWidth: "2",
|
|
19
|
-
strokeDasharray: "5 5"
|
|
20
|
-
}),
|
|
21
|
-
/* @__PURE__ */ n("mask", {
|
|
22
|
-
id: "path-2-outside-1_3089_3799",
|
|
23
|
-
maskUnits: "userSpaceOnUse",
|
|
24
|
-
x: "2",
|
|
25
|
-
y: "3",
|
|
26
|
-
width: "19",
|
|
27
|
-
height: "18",
|
|
28
|
-
fill: "black",
|
|
29
|
-
children: [/* @__PURE__ */ t("rect", {
|
|
6
|
+
var i = ({ dashColor: e }) => {
|
|
7
|
+
let i = t("correct-check-mask");
|
|
8
|
+
return /* @__PURE__ */ r("svg", {
|
|
9
|
+
width: "24",
|
|
10
|
+
height: "24",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
fill: "none",
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ n("circle", {
|
|
16
|
+
cx: "12",
|
|
17
|
+
cy: "12",
|
|
18
|
+
r: "11",
|
|
30
19
|
fill: "white",
|
|
20
|
+
stroke: e || "#7E8494",
|
|
21
|
+
strokeWidth: "2",
|
|
22
|
+
strokeDasharray: "5 5"
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ r("mask", {
|
|
25
|
+
id: i,
|
|
26
|
+
maskUnits: "userSpaceOnUse",
|
|
31
27
|
x: "2",
|
|
32
28
|
y: "3",
|
|
33
29
|
width: "19",
|
|
34
|
-
height: "18"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
|
|
30
|
+
height: "18",
|
|
31
|
+
fill: "black",
|
|
32
|
+
children: [/* @__PURE__ */ n("rect", {
|
|
33
|
+
fill: "white",
|
|
34
|
+
x: "2",
|
|
35
|
+
y: "3",
|
|
36
|
+
width: "19",
|
|
37
|
+
height: "18"
|
|
38
|
+
}), /* @__PURE__ */ n("path", { d: "M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z" })]
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ n("path", {
|
|
41
|
+
d: "M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z",
|
|
42
|
+
fill: "#0EA449"
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ n("path", {
|
|
45
|
+
d: "M5.0625 16L5.92942 15.5015L5.92668 15.4968L5.0625 16ZM5.0625 8L4.19831 7.4968L4.19559 7.50153L5.0625 8ZM18.9062 8L19.7732 7.50152L19.7704 7.49681L18.9062 8ZM18.9062 16L18.0421 15.4968L18.0393 15.5015L18.9062 16ZM15.5312 10.5312L16.2384 11.2384L17.9455 9.53125H15.5312V10.5312ZM15.5 10.5312L14.831 9.78796L12.894 11.5312H15.5V10.5312ZM14.4688 9.46875L13.7616 8.76164L13.7585 8.76482L14.4688 9.46875ZM11 12.9688L10.2929 13.6759L11.0032 14.3861L11.7103 13.6727L11 12.9688ZM8.46875 11.5L9.13771 12.2433L9.17684 12.2081L9.21204 12.169L8.46875 11.5ZM8.46875 12.5312L9.17586 11.8241L9.15726 11.8055L9.13771 11.788L8.46875 12.5312ZM10.4688 14.5312L11.212 13.8623L11.1945 13.8427L11.1759 13.8241L10.4688 14.5312ZM12 20V19C9.479 19 7.18657 17.6879 5.92941 15.5015L5.0625 16L4.19559 16.4985C5.81343 19.3121 8.771 21 12 21V20ZM5.0625 16L5.92668 15.4968C4.6714 13.341 4.66824 10.6918 5.92941 8.49847L5.0625 8L4.19559 7.50153C2.58176 10.3082 2.5786 13.7215 4.19832 16.5032L5.0625 16ZM5.0625 8L5.92668 8.50319C7.18712 6.33851 9.48502 5 12 5V4V3C8.76498 3 5.81288 4.72399 4.19832 7.49681L5.0625 8ZM12 4V5C14.4816 5 16.7805 6.33661 18.0421 8.50319L18.9062 8L19.7704 7.49681C18.157 4.72589 15.2059 3 12 3V4ZM18.9062 8L18.0393 8.49847C19.3005 10.6918 19.2973 13.341 18.0421 15.4968L18.9062 16L19.7704 16.5032C21.3902 13.7215 21.387 10.3082 19.7732 7.50153L18.9062 8ZM18.9062 16L18.0393 15.5015C16.7811 17.6898 14.4876 19 12 19V20V21C15.1999 21 18.1564 19.3102 19.7732 16.4985L18.9062 16ZM15.5312 10.5312V9.53125H15.5V10.5312V11.5312H15.5312V10.5312ZM15.5 10.5312L16.169 11.2745C16.9447 10.5764 16.8883 9.44281 16.2071 8.76164L15.5 9.46875L14.7929 10.1759C14.7696 10.1525 14.7344 10.0966 14.7344 10.0117C14.7344 9.92377 14.7735 9.83972 14.831 9.78796L15.5 10.5312ZM15.5 9.46875L16.2071 8.76164C15.5353 8.08987 14.4334 8.08987 13.7616 8.76164L14.4688 9.46875L15.1759 10.1759C15.1167 10.235 15.0442 10.2578 14.9844 10.2578C14.9245 10.2578 14.8521 10.235 14.7929 10.1759L15.5 9.46875ZM14.4688 9.46875L13.7585 8.76482L10.2897 12.2648L11 12.9688L11.7103 13.6727L15.179 10.1727L14.4688 9.46875ZM11 12.9688L11.7071 12.2616L10.2384 10.7929L9.53125 11.5L8.82414 12.2071L10.2929 13.6759L11 12.9688ZM9.53125 11.5L10.2384 10.7929C9.55719 10.1117 8.42362 10.0553 7.72546 10.831L8.46875 11.5L9.21204 12.169C9.16028 12.2265 9.07623 12.2656 8.98828 12.2656C8.90344 12.2656 8.84748 12.2304 8.82414 12.2071L9.53125 11.5ZM8.46875 11.5L7.79979 10.7567C7.04591 11.4352 7.04591 12.5961 7.79979 13.2745L8.46875 12.5312L9.13771 11.788C9.19301 11.8377 9.23438 11.9208 9.23438 12.0156C9.23438 12.1105 9.19301 12.1935 9.13771 12.2433L8.46875 11.5ZM8.46875 12.5312L7.76164 13.2384L9.76164 15.2384L10.4688 14.5312L11.1759 13.8241L9.17586 11.8241L8.46875 12.5312ZM10.4688 14.5312L9.72546 15.2002C10.4236 15.976 11.5572 15.9195 12.2384 15.2384L11.5312 14.5312L10.8241 13.8241C10.8475 13.8008 10.9034 13.7656 10.9883 13.7656C11.0762 13.7656 11.1603 13.8048 11.212 13.8623L10.4688 14.5312ZM11.5312 14.5312L12.2384 15.2384L16.2384 11.2384L15.5312 10.5312L14.8241 9.82414L10.8241 13.8241L11.5312 14.5312Z",
|
|
46
|
+
fill: "white",
|
|
47
|
+
mask: `url(#${i})`
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
i.propTypes = { dashColor: e.string };
|
|
49
53
|
//#endregion
|
|
50
|
-
export {
|
|
54
|
+
export { i as CorrectCheckIcon };
|
package/dist/chart-setup.js
CHANGED
|
@@ -3,8 +3,8 @@ import { useEffect as t, useState as n } from "react";
|
|
|
3
3
|
import r from "prop-types";
|
|
4
4
|
import { styled as i } from "@mui/material/styles";
|
|
5
5
|
import { AlertDialog as a, NumberTextFieldCustom as o } from "@pie-lib/config-ui";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { color as s } from "@pie-lib/render-ui";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
import u from "@mui/material/Typography";
|
|
9
9
|
//#region src/chart-setup.tsx
|
|
10
10
|
var d = (e, t, n, r, i) => {
|
|
@@ -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(u)(() => ({ color:
|
|
43
|
-
let { model: i, onChange: o, chartDimensions:
|
|
42
|
+
})), y = i(u)(() => ({ color: s.disabled() })), b = (r) => {
|
|
43
|
+
let { model: i, onChange: o, chartDimensions: s, gridValues: b = {}, labelValues: x = {}, studentNewCategoryDefaultLabel: S = {}, availableChartTypes: C = {}, chartTypeLabel: w } = r, [T, E] = n({
|
|
44
44
|
open: !1,
|
|
45
45
|
title: "",
|
|
46
46
|
text: "",
|
|
47
47
|
onClose: null,
|
|
48
48
|
onConfirm: null
|
|
49
|
-
}), [D, O] = n(!1), [k, A] = n(""), [j, M] = n(0), { range: N = {}, correctAnswer: P, changeInteractiveEnabled: F, changeEditableEnabled: I } = i, L = i.graph, { showInConfigPanel: R, width: z, height: B } =
|
|
49
|
+
}), [D, O] = n(!1), [k, A] = n(""), [j, M] = n(0), { range: N = {}, correctAnswer: P, changeInteractiveEnabled: F, changeEditableEnabled: I } = i, L = i.graph, { showInConfigPanel: R, width: z, height: B } = s || {}, V = {
|
|
50
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__ */ l(h, { children: [/* @__PURE__ */ c(_, {
|
|
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__ */ c(_, {
|
|
70
70
|
label: "Label Interval",
|
|
71
71
|
value: N.labelStep,
|
|
72
72
|
variant: "outlined",
|
|
@@ -162,18 +162,18 @@ var d = (e, t, n, r, i) => {
|
|
|
162
162
|
chartType: e
|
|
163
163
|
});
|
|
164
164
|
};
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ l(f, { children: [
|
|
166
|
+
/* @__PURE__ */ c(u, {
|
|
167
167
|
variant: "subtitle1",
|
|
168
168
|
children: "Configure Chart"
|
|
169
169
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ l(p, { children: [
|
|
171
|
+
/* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(e, {
|
|
172
172
|
value: i.chartType,
|
|
173
173
|
onChange: (e) => ne(e.target.value),
|
|
174
174
|
availableChartTypes: C,
|
|
175
175
|
chartTypeLabel: w
|
|
176
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ c(_, {
|
|
177
177
|
label: "Max Value",
|
|
178
178
|
value: N.max,
|
|
179
179
|
min: X(i.chartType).min,
|
|
@@ -182,9 +182,9 @@ var d = (e, t, n, r, i) => {
|
|
|
182
182
|
onChange: (e, t) => $("max", t, e)
|
|
183
183
|
})] }),
|
|
184
184
|
!i.chartType.includes("Plot") && G,
|
|
185
|
-
R && /* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
185
|
+
R && /* @__PURE__ */ l(v, { children: [
|
|
186
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(u, { children: "Dimensions(px)" }) }),
|
|
187
|
+
/* @__PURE__ */ l(m, { children: [/* @__PURE__ */ c(g, {
|
|
188
188
|
label: "Width",
|
|
189
189
|
value: L.width,
|
|
190
190
|
min: V.min,
|
|
@@ -192,8 +192,8 @@ var d = (e, t, n, r, i) => {
|
|
|
192
192
|
step: V.step,
|
|
193
193
|
variant: "outlined",
|
|
194
194
|
onChange: (e, t) => Z("width", t)
|
|
195
|
-
}), /* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ c(y, { children: "Min 50, Max 700" })] }),
|
|
196
|
+
/* @__PURE__ */ l(m, { children: [/* @__PURE__ */ c(g, {
|
|
197
197
|
label: "Height",
|
|
198
198
|
value: L.height,
|
|
199
199
|
min: H.min,
|
|
@@ -201,10 +201,10 @@ var d = (e, t, n, r, i) => {
|
|
|
201
201
|
step: H.step,
|
|
202
202
|
variant: "outlined",
|
|
203
203
|
onChange: (e, t) => Z("height", t)
|
|
204
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ c(y, { children: "Min 400, Max 700" })] })
|
|
205
205
|
] })
|
|
206
206
|
] }),
|
|
207
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ c(a, {
|
|
208
208
|
open: T.open,
|
|
209
209
|
title: T.title,
|
|
210
210
|
text: T.text,
|