@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.
Files changed (32) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +6 -6
  2. package/dist/actions-button.js +42 -42
  3. package/dist/axes.js +166 -166
  4. package/dist/bars/bar.js +12 -12
  5. package/dist/bars/common/bars.js +59 -59
  6. package/dist/bars/histogram.js +12 -12
  7. package/dist/chart-setup.js +62 -62
  8. package/dist/chart-type.js +38 -38
  9. package/dist/chart.js +110 -110
  10. package/dist/common/correctness-indicators.js +22 -22
  11. package/dist/common/drag-handle.js +33 -33
  12. package/dist/common/drag-icon.js +11 -11
  13. package/dist/common/mark-slider.js +14 -14
  14. package/dist/grid.js +17 -17
  15. package/dist/i18n/index.js +4 -4
  16. package/dist/key-legend.js +28 -28
  17. package/dist/line/common/drag-handle.js +34 -34
  18. package/dist/line/common/line.js +56 -56
  19. package/dist/line/line-cross.js +61 -61
  20. package/dist/line/line-dot.js +48 -48
  21. package/dist/mark-label.js +45 -45
  22. package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/hooks/useText.js +11 -11
  23. package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-interpolate.js +1 -1
  24. package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-scale.js +1 -1
  25. package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-shape.js +1 -1
  26. package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-time.js +1 -1
  27. package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +12 -11
  28. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +1 -1
  29. package/dist/plot/common/plot.js +116 -116
  30. package/dist/plot/dot.js +33 -33
  31. package/dist/plot/line.js +44 -44
  32. package/package.json +8 -8
package/dist/chart.js CHANGED
@@ -1,37 +1,37 @@
1
- import { Grid as e } from "./grid.js";
2
- import { RawChartAxes as t } from "./axes.js";
3
- import { dataToXBand as n, getDomainAndRangeByChartType as r, getGridLinesAndAxisByChartType as i, getTopPadding as a, textOf as o } from "./utils.js";
4
- import s from "./chart-types.js";
5
- import { ActionsButton as c } from "./actions-button.js";
6
- import { catalogs as l } from "./i18n/index.js";
7
- import u from "react";
8
- import d from "prop-types";
9
- import { styled as f } from "@mui/material/styles";
10
- import p from "debug";
11
- import { cloneDeep as m } from "@pie-element/shared-lodash";
12
- import { Root as h, createGraphProps as g } from "@pie-lib/plot";
13
- import { AlertDialog as _ } from "@pie-lib/config-ui";
14
- import { createUniqueId as v } from "@pie-lib/render-ui";
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import { styled as n } from "@mui/material/styles";
4
+ import r from "debug";
5
+ import { cloneDeep as i } from "@pie-element/shared-lodash";
6
+ import { Root as a, createGraphProps as o } from "@pie-lib/plot";
7
+ import { AlertDialog as s } from "@pie-lib/config-ui";
8
+ import { createUniqueId as c } from "@pie-lib/render-ui";
9
+ import { Grid as l } from "./grid.js";
10
+ import { RawChartAxes as u } from "./axes.js";
11
+ import { dataToXBand as d, getDomainAndRangeByChartType as ee, getGridLinesAndAxisByChartType as f, getTopPadding as p, textOf as m } from "./utils.js";
12
+ import h from "./chart-types.js";
13
+ import { ActionsButton as g } from "./actions-button.js";
14
+ import { dynamicMessageKey as _ } from "@pie-element/shared-i18n";
15
+ import { catalogs as v } from "./i18n/index.js";
15
16
  import { jsx as y, jsxs as b } from "react/jsx-runtime";
16
- import { dynamicMessageKey as x } from "@pie-element/shared-i18n";
17
17
  // src/chart.tsx
18
- var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content" })), S = ({ title: e, chartType: t, categories: n, range: r, language: i, onLoad: a }) => {
19
- let s = l.forLocale(i, a), c = s.t(x(`chartTypes.${t}`)), u = o(r.label), d = u ? s.t("labelledValueRange", {
20
- label: u,
18
+ var x = r("pie-lib:charts:chart"), S = n("div")(() => ({ width: "min-content" })), C = ({ title: e, chartType: t, categories: n, range: r, language: i, onLoad: a }) => {
19
+ let o = v.forLocale(i, a), s = o.t(_(`chartTypes.${t}`)), c = m(r.label), l = c ? o.t("labelledValueRange", {
20
+ label: c,
21
21
  min: r.min,
22
22
  max: r.max
23
- }) : s.t("valueRange", {
23
+ }) : o.t("valueRange", {
24
24
  min: r.min,
25
25
  max: r.max
26
- }), f = n.length === 0 ? s.t("categoriesNone") : s.plural("categories", {
26
+ }), u = n.length === 0 ? o.t("categoriesNone") : o.plural("categories", {
27
27
  count: n.length,
28
- categories: n.map((e) => o(e.label)).join(", ")
28
+ categories: n.map((e) => m(e.label)).join(", ")
29
29
  });
30
30
  return {
31
- ariaLabel: o(e) || c,
32
- ariaDescription: `${c}. ${f} ${d}`
31
+ ariaLabel: m(e) || s,
32
+ ariaDescription: `${s}. ${u} ${l}`
33
33
  };
34
- }, C = class extends u.Component {
34
+ }, w = class extends e.Component {
35
35
  relabel = () => this.forceUpdate();
36
36
  constructor(e) {
37
37
  super(e), this.state = {
@@ -42,54 +42,54 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
42
42
  }, this.maskUid = this.generateMaskId();
43
43
  }
44
44
  static propTypes = {
45
- className: d.string,
46
- chartType: d.string.isRequired,
47
- size: d.shape({
48
- width: d.number,
49
- height: d.number
45
+ className: t.string,
46
+ chartType: t.string.isRequired,
47
+ size: t.shape({
48
+ width: t.number,
49
+ height: t.number
50
50
  }),
51
- domain: d.shape({
52
- label: d.string,
53
- min: d.number,
54
- max: d.number,
55
- axisLabel: d.string
51
+ domain: t.shape({
52
+ label: t.string,
53
+ min: t.number,
54
+ max: t.number,
55
+ axisLabel: t.string
56
56
  }),
57
- data: d.arrayOf(d.shape({
58
- label: d.string,
59
- value: d.number
57
+ data: t.arrayOf(t.shape({
58
+ label: t.string,
59
+ value: t.number
60
60
  })),
61
- range: d.shape({
62
- label: d.string,
63
- min: d.number,
64
- max: d.number,
65
- step: d.number,
66
- labelStep: d.number,
67
- axisLabel: d.string
61
+ range: t.shape({
62
+ label: t.string,
63
+ min: t.number,
64
+ max: t.number,
65
+ step: t.number,
66
+ labelStep: t.number,
67
+ axisLabel: t.string
68
68
  }),
69
- charts: d.array,
70
- labelsPlaceholders: d.object,
71
- title: d.string,
72
- titlePlaceholder: d.string,
73
- onDataChange: d.func,
74
- onChangeLabels: d.func,
75
- onChangeTitle: d.func,
76
- error: d.any,
77
- addCategoryEnabled: d.bool,
78
- showPixelGuides: d.bool,
79
- categoryDefaultLabel: d.string,
80
- categoryDefaults: d.object,
81
- defineChart: d.bool,
82
- disabled: d.bool,
83
- theme: d.object,
84
- chartingOptions: d.object,
85
- changeInteractiveEnabled: d.bool,
86
- changeEditableEnabled: d.bool,
87
- language: d.string,
88
- mathMlOptions: d.object,
89
- labelsCharactersLimit: d.number,
90
- correctData: d.arrayOf(d.shape({
91
- label: d.string,
92
- value: d.number
69
+ charts: t.array,
70
+ labelsPlaceholders: t.object,
71
+ title: t.string,
72
+ titlePlaceholder: t.string,
73
+ onDataChange: t.func,
74
+ onChangeLabels: t.func,
75
+ onChangeTitle: t.func,
76
+ error: t.any,
77
+ addCategoryEnabled: t.bool,
78
+ showPixelGuides: t.bool,
79
+ categoryDefaultLabel: t.string,
80
+ categoryDefaults: t.object,
81
+ defineChart: t.bool,
82
+ disabled: t.bool,
83
+ theme: t.object,
84
+ chartingOptions: t.object,
85
+ changeInteractiveEnabled: t.bool,
86
+ changeEditableEnabled: t.bool,
87
+ language: t.string,
88
+ mathMlOptions: t.object,
89
+ labelsCharactersLimit: t.number,
90
+ correctData: t.arrayOf(t.shape({
91
+ label: t.string,
92
+ value: t.number
93
93
  }))
94
94
  };
95
95
  static defaultProps = { size: {
@@ -98,17 +98,17 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
98
98
  } };
99
99
  state = {
100
100
  charts: [
101
- s.Bar(),
102
- s.Histogram(),
103
- s.LineDot(),
104
- s.LineCross(),
105
- s.DotPlot(),
106
- s.LinePlot()
101
+ h.Bar(),
102
+ h.Histogram(),
103
+ h.LineDot(),
104
+ h.LineCross(),
105
+ h.DotPlot(),
106
+ h.LinePlot()
107
107
  ],
108
108
  autoFocus: !1
109
109
  };
110
110
  generateMaskId() {
111
- return v("chart");
111
+ return c("chart");
112
112
  }
113
113
  setLabelOverhang = (e) => this.setState({ labelOverhang: e });
114
114
  setRangeLabelOverhang = (e) => this.setState({ rangeLabelOverhang: e });
@@ -135,7 +135,7 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
135
135
  }
136
136
  };
137
137
  addCategory = () => {
138
- let { onDataChange: e, data: t, categoryDefaultLabel: n, defineChart: r, categoryDefaults: i, language: a } = this.props, o = l.forLocale(a);
138
+ let { onDataChange: e, data: t, categoryDefaultLabel: n, defineChart: r, categoryDefaults: i, language: a } = this.props, o = v.forLocale(a);
139
139
  (t || []).length > 19 ? this.setState({ dialog: {
140
140
  open: !0,
141
141
  title: o.t("warning"),
@@ -165,56 +165,56 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
165
165
  this.setState({ autoFocus: !1 });
166
166
  };
167
167
  render() {
168
- let { domain: o = {}, range: s = {}, chartingOptions: l, size: u, title: d, onChangeTitle: f, onChangeLabels: p, labelsPlaceholders: v, titlePlaceholder: x, addCategoryEnabled: C, changeInteractiveEnabled: w, changeEditableEnabled: T, showPixelGuides: E, error: D, mathMlOptions: O = {}, language: k, labelsCharactersLimit: A, correctData: j, disabled: M } = this.props, { chartType: N } = this.props, { dialog: P } = this.state, F = this.props.defineChart || !1, { width: I, height: L } = u || {}, R = {
169
- left: s?.label || "",
170
- bottom: o?.label || ""
171
- }, { type: z, ChartComponent: B } = this.getChart(), V = this.getFilteredCategories(), H = r(o, s, N), { ariaLabel: U, ariaDescription: W } = S({
172
- title: d,
168
+ let { domain: e = {}, range: t = {}, chartingOptions: n, size: r, title: c, onChangeTitle: m, onChangeLabels: h, labelsPlaceholders: _, titlePlaceholder: v, addCategoryEnabled: w, changeInteractiveEnabled: T, changeEditableEnabled: E, showPixelGuides: D, error: O, mathMlOptions: k = {}, language: A, labelsCharactersLimit: j, correctData: M, disabled: te } = this.props, { chartType: N } = this.props, { dialog: P } = this.state, F = this.props.defineChart || !1, { width: I, height: L } = r || {}, R = {
169
+ left: t?.label || "",
170
+ bottom: e?.label || ""
171
+ }, { type: z, ChartComponent: B } = this.getChart(), V = this.getFilteredCategories(), H = ee(e, t, N), { ariaLabel: U, ariaDescription: W } = C({
172
+ title: c,
173
173
  chartType: z,
174
174
  categories: V,
175
175
  range: {
176
176
  ...H.range,
177
- label: s.label
177
+ label: t.label
178
178
  },
179
- language: k,
179
+ language: A,
180
180
  onLoad: this.relabel
181
- }), { verticalLines: G, horizontalLines: K, leftAxis: q } = i(H.range, N), J = { graphProps: g(H.domain, H.range, u, () => this.rootNode) };
182
- ee("[render] common:", J);
181
+ }), { verticalLines: G, horizontalLines: K, leftAxis: q } = f(H.range, N), J = { graphProps: o(H.domain, H.range, r, () => this.rootNode) };
182
+ x("[render] common:", J);
183
183
  let Y = {
184
184
  x: -10,
185
185
  y: -75,
186
186
  width: I + 20,
187
187
  height: L + 130
188
- }, { scale: X } = J.graphProps, Z = n(X.x, V, I, N), ne = Z.bandwidth() || X.x(H.domain.max) / V.length, re = F ? 160 : 60, Q = Math.max(a(ne), this.state.labelOverhang), $ = m(J);
189
- return $.graphProps.size.height += Q + re, (N === "dotPlot" || N === "linePlot") && j?.length && R.bottom && ($.graphProps.size.height += 25), /* @__PURE__ */ b(te, { children: [/* @__PURE__ */ b(h, {
190
- title: d,
191
- onChangeTitle: f,
188
+ }, { scale: X } = J.graphProps, Z = d(X.x, V, I, N), ne = Z.bandwidth() || X.x(H.domain.max) / V.length, re = F ? 160 : 60, Q = Math.max(p(ne), this.state.labelOverhang), $ = i(J);
189
+ return $.graphProps.size.height += Q + re, (N === "dotPlot" || N === "linePlot") && M?.length && R.bottom && ($.graphProps.size.height += 25), /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ b(a, {
190
+ title: c,
191
+ onChangeTitle: m,
192
192
  disabledTitle: !F,
193
193
  showTitle: !0,
194
194
  showLabels: !0,
195
195
  labels: R,
196
- onChangeLabels: p,
197
- labelsPlaceholders: v,
198
- titlePlaceholder: x,
196
+ onChangeLabels: h,
197
+ labelsPlaceholders: _,
198
+ titlePlaceholder: v,
199
199
  defineChart: F,
200
200
  disabledLabels: !F,
201
201
  isChart: !0,
202
- showPixelGuides: E,
202
+ showPixelGuides: D,
203
203
  rootRef: (e) => this.rootNode = e,
204
- mathMlOptions: O,
205
- labelsCharactersLimit: A,
204
+ mathMlOptions: k,
205
+ labelsCharactersLimit: j,
206
206
  ariaLabel: U,
207
207
  ariaDescription: W,
208
208
  leftAxisOverhang: this.state.rangeLabelOverhang,
209
209
  ...$,
210
210
  children: [
211
- /* @__PURE__ */ y(e, {
211
+ /* @__PURE__ */ y(l, {
212
212
  ...J,
213
213
  xBand: Z,
214
214
  rowTickValues: K,
215
215
  columnTickValues: G
216
216
  }),
217
- /* @__PURE__ */ y(t, {
217
+ /* @__PURE__ */ y(u, {
218
218
  autoFocus: this.state.autoFocus,
219
219
  onAutoFocusUsed: this.resetAutoFocus,
220
220
  ...J,
@@ -224,17 +224,17 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
224
224
  leftAxis: q,
225
225
  onChange: this.changeData,
226
226
  onChangeCategory: this.changeCategory,
227
- chartingOptions: l,
228
- changeInteractiveEnabled: w,
229
- changeEditableEnabled: T,
227
+ chartingOptions: n,
228
+ changeInteractiveEnabled: T,
229
+ changeEditableEnabled: E,
230
230
  top: Q,
231
- error: D,
231
+ error: O,
232
232
  showCorrectness: N === "linePlot" || N === "dotPlot",
233
- language: k,
233
+ language: A,
234
234
  onLabelOverhang: this.setLabelOverhang,
235
235
  onRangeLabelOverhang: this.setRangeLabelOverhang
236
236
  }),
237
- C ? /* @__PURE__ */ y("foreignObject", {
237
+ w ? /* @__PURE__ */ y("foreignObject", {
238
238
  x: I,
239
239
  y: L - 16,
240
240
  width: I,
@@ -245,11 +245,11 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
245
245
  display: "flex",
246
246
  justifyContent: "flex-start"
247
247
  },
248
- children: /* @__PURE__ */ y(c, {
248
+ children: /* @__PURE__ */ y(g, {
249
249
  categories: V,
250
250
  addCategory: this.addCategory,
251
251
  deleteCategory: this.deleteCategory,
252
- language: k
252
+ language: A
253
253
  })
254
254
  })
255
255
  }) : null,
@@ -269,13 +269,13 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
269
269
  defineChart: F,
270
270
  onChange: this.changeData,
271
271
  onChangeCategory: this.changeCategory,
272
- correctData: j,
273
- disabled: M,
274
- language: k
272
+ correctData: M,
273
+ disabled: te,
274
+ language: A
275
275
  })
276
276
  })
277
277
  ]
278
- }), /* @__PURE__ */ y(_, {
278
+ }), /* @__PURE__ */ y(s, {
279
279
  open: P.open,
280
280
  title: P.title,
281
281
  text: P.text,
@@ -284,4 +284,4 @@ var ee = p("pie-lib:charts:chart"), te = f("div")(() => ({ width: "min-content"
284
284
  })] });
285
285
  }
286
286
  };
287
- export { C as Chart, C as default, S as chartAlternative };
287
+ export { w as Chart, w as default, C as chartAlternative };
@@ -1,73 +1,73 @@
1
1
  import "react";
2
2
  import e from "prop-types";
3
3
  import { styled as t } from "@mui/material/styles";
4
- import { color as n } from "@pie-lib/render-ui";
5
- import { jsx as r } from "react/jsx-runtime";
6
- import i from "@mui/icons-material/Check";
7
- import a from "@mui/icons-material/Close";
4
+ import n from "@mui/icons-material/Check";
5
+ import r from "@mui/icons-material/Close";
6
+ import { color as i } from "@pie-lib/render-ui";
7
+ import { jsx as a } from "react/jsx-runtime";
8
8
  // src/common/correctness-indicators.tsx
9
- var o = t(i)(({ theme: e }) => ({
9
+ var o = t(n)(({ theme: e }) => ({
10
10
  borderRadius: e.spacing(2),
11
- color: n.defaults.WHITE,
11
+ color: i.defaults.WHITE,
12
12
  fontSize: "16px",
13
13
  width: "16px",
14
14
  height: "16px",
15
15
  padding: "2px",
16
- border: `1px solid ${n.defaults.WHITE}`,
16
+ border: `1px solid ${i.defaults.WHITE}`,
17
17
  stroke: "initial",
18
18
  boxSizing: "unset",
19
- backgroundColor: n.correct(),
19
+ backgroundColor: i.correct(),
20
20
  display: "block",
21
21
  "&.small": {
22
22
  fontSize: "10px",
23
23
  width: "10px",
24
24
  height: "10px"
25
25
  }
26
- })), s = t(a)(({ theme: e }) => ({
26
+ })), s = t(r)(({ theme: e }) => ({
27
27
  borderRadius: e.spacing(2),
28
- color: n.defaults.WHITE,
28
+ color: i.defaults.WHITE,
29
29
  fontSize: "16px",
30
30
  width: "16px",
31
31
  height: "16px",
32
32
  padding: "2px",
33
- border: `1px solid ${n.defaults.WHITE}`,
33
+ border: `1px solid ${i.defaults.WHITE}`,
34
34
  stroke: "initial",
35
35
  boxSizing: "unset",
36
- backgroundColor: n.incorrectWithIcon(),
36
+ backgroundColor: i.incorrectWithIcon(),
37
37
  display: "block",
38
38
  "&.small": {
39
39
  fontSize: "10px",
40
40
  width: "10px",
41
41
  height: "10px"
42
42
  }
43
- })), c = ({ scale: e, x: t, y: n, correctness: i, interactive: a }) => {
44
- if (!i || !a) return null;
45
- let c = e ? e.x(t) : t, l = e ? e.y(n) : n, u = i.value === "correct";
46
- return /* @__PURE__ */ r("foreignObject", {
43
+ })), c = ({ scale: e, x: t, y: n, correctness: r, interactive: i }) => {
44
+ if (!r || !i) return null;
45
+ let c = e ? e.x(t) : t, l = e ? e.y(n) : n, u = r.value === "correct";
46
+ return /* @__PURE__ */ a("foreignObject", {
47
47
  x: c - 11,
48
48
  y: l - 11,
49
49
  width: 22,
50
50
  height: 22,
51
- children: r(u ? o : s, { title: i.label })
51
+ children: a(u ? o : s, { title: r.label })
52
52
  });
53
- }, l = ({ scale: e, x: t, correctness: n, correctData: i, label: a }) => {
53
+ }, l = ({ scale: e, x: t, correctness: n, correctData: r, label: i }) => {
54
54
  if (n && n.value === "incorrect") {
55
- let s = parseFloat(i.find((e) => e.label === a)?.value);
55
+ let s = parseFloat(r.find((e) => e.label === i)?.value);
56
56
  if (isNaN(s)) return null;
57
57
  let c = e.y(s) - 7.5, l = e.x(t) - 7.5;
58
- return /* @__PURE__ */ r("foreignObject", {
58
+ return /* @__PURE__ */ a("foreignObject", {
59
59
  x: l,
60
60
  y: c,
61
61
  width: 15,
62
62
  height: 15,
63
- children: /* @__PURE__ */ r(o, {
63
+ children: /* @__PURE__ */ a(o, {
64
64
  className: "small",
65
65
  title: n.label
66
66
  })
67
67
  });
68
68
  }
69
69
  return null;
70
- }, u = ({ correctness: e, interactive: t }) => !e || !t ? null : e.value === "correct" ? /* @__PURE__ */ r(o, { title: e.label }) : /* @__PURE__ */ r(s, { title: e.label });
70
+ }, u = ({ correctness: e, interactive: t }) => !e || !t ? null : e.value === "correct" ? /* @__PURE__ */ a(o, { title: e.label }) : /* @__PURE__ */ a(s, { title: e.label });
71
71
  c.propTypes = {
72
72
  scale: e.shape({
73
73
  x: e.func,
@@ -1,18 +1,18 @@
1
- import { getScale as e } from "../utils.js";
2
- import t from "./drag-icon.js";
3
1
  import "react";
4
- import n from "prop-types";
5
- import { styled as r } from "@mui/material/styles";
2
+ import e from "prop-types";
3
+ import { styled as t } from "@mui/material/styles";
4
+ import n from "@mui/icons-material/Check";
5
+ import r from "@mui/icons-material/Close";
6
6
  import { gridDraggable as i, types as a, utils as o } from "@pie-lib/plot";
7
7
  import { color as s } from "@pie-lib/render-ui";
8
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
- import u from "@mui/icons-material/Check";
10
- import d from "@mui/icons-material/Close";
8
+ import { getScale as c } from "../utils.js";
9
+ import l from "./drag-icon.js";
10
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
11
  // src/common/drag-handle.tsx
12
- var f = r("svg")(() => ({ overflow: "visible !important" })), p = r("ellipse")(() => ({
12
+ var f = t("svg")(() => ({ overflow: "visible !important" })), p = t("ellipse")(() => ({
13
13
  fill: "transparent",
14
14
  clipPath: "polygon(50% 0%, 100% 0%, 100% 50%, 0% 50%, 0% 0%)"
15
- })), m = r(u)(() => ({
15
+ })), m = t(n)(() => ({
16
16
  backgroundColor: s.correct(),
17
17
  borderRadius: "16px",
18
18
  color: s.defaults.WHITE,
@@ -22,7 +22,7 @@ var f = r("svg")(() => ({ overflow: "visible !important" })), p = r("ellipse")((
22
22
  width: "16px",
23
23
  height: "16px",
24
24
  boxSizing: "unset"
25
- })), h = r(d)(() => ({
25
+ })), h = t(r)(() => ({
26
26
  backgroundColor: s.incorrectWithIcon(),
27
27
  borderRadius: "16px",
28
28
  color: s.defaults.WHITE,
@@ -32,48 +32,48 @@ var f = r("svg")(() => ({ overflow: "visible !important" })), p = r("ellipse")((
32
32
  width: "16px",
33
33
  height: "16px",
34
34
  boxSizing: "unset"
35
- })), g = ({ x: n, y: r, width: i, graphProps: a, interactive: o, isHovered: u, correctness: d, isPlot: g, isDragging: _, onDragStart: v, onDrag: y, onDragStop: b, ...x }) => {
36
- let { scale: S } = a, C = e(i)?.scale;
37
- return /* @__PURE__ */ l(f, {
38
- x: n,
39
- y: S.y(r) - 10,
40
- width: i,
35
+ })), g = ({ x: e, y: t, width: n, graphProps: r, interactive: i, isHovered: a, correctness: o, isPlot: g, isDragging: _, onDragStart: v, onDrag: y, onDragStop: b, ...x }) => {
36
+ let { scale: S } = r, C = c(n)?.scale;
37
+ return /* @__PURE__ */ d(f, {
38
+ x: e,
39
+ y: S.y(t) - 10,
40
+ width: n,
41
41
  overflow: "visible",
42
42
  children: [
43
- u && !d && o && /* @__PURE__ */ c(t, {
44
- width: i,
43
+ a && !o && i && /* @__PURE__ */ u(l, {
44
+ width: n,
45
45
  scaleValue: C,
46
46
  color: s.defaults.BORDER_GRAY
47
47
  }),
48
- o && !d && /* @__PURE__ */ c(p, {
49
- cx: i / 2,
48
+ i && !o && /* @__PURE__ */ u(p, {
49
+ cx: n / 2,
50
50
  cy: 10,
51
- rx: i / 2,
51
+ rx: n / 2,
52
52
  ry: 66,
53
53
  ...x
54
54
  }),
55
- d && o && !g && /* @__PURE__ */ c("foreignObject", {
56
- x: i / 2 - 14,
55
+ o && i && !g && /* @__PURE__ */ u("foreignObject", {
56
+ x: n / 2 - 14,
57
57
  y: 0,
58
58
  width: 40,
59
59
  height: 40,
60
- children: d.value === "correct" ? /* @__PURE__ */ c(m, { title: d.label }) : /* @__PURE__ */ c(h, { title: d.label })
60
+ children: o.value === "correct" ? /* @__PURE__ */ u(m, { title: o.label }) : /* @__PURE__ */ u(h, { title: o.label })
61
61
  })
62
62
  ]
63
63
  });
64
64
  };
65
65
  g.propTypes = {
66
- x: n.number.isRequired,
67
- y: n.number.isRequired,
68
- width: n.number,
66
+ x: e.number.isRequired,
67
+ y: e.number.isRequired,
68
+ width: e.number,
69
69
  graphProps: a.GraphPropsType.isRequired,
70
- interactive: n.bool,
71
- isHovered: n.bool,
72
- correctness: n.shape({
73
- value: n.string,
74
- label: n.string
70
+ interactive: e.bool,
71
+ isHovered: e.bool,
72
+ correctness: e.shape({
73
+ value: e.string,
74
+ label: e.string
75
75
  }),
76
- isPlot: n.bool
76
+ isPlot: e.bool
77
77
  };
78
78
  var _ = g, v = i({
79
79
  axis: "y",
@@ -1,16 +1,16 @@
1
- import { getAdjustedX as e, getScale as t } from "../utils.js";
2
1
  import "react";
3
- import n from "prop-types";
2
+ import e from "prop-types";
3
+ import { getAdjustedX as t, getScale as n } from "../utils.js";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  // src/common/drag-icon.tsx
6
- var a = ({ width: n, scaleValue: a, color: o }) => /* @__PURE__ */ r("svg", {
7
- x: e(n, a),
8
- y: t(n)?.deltay,
6
+ var a = ({ width: e, scaleValue: a, color: o }) => /* @__PURE__ */ r("svg", {
7
+ x: t(e, a),
8
+ y: n(e)?.deltay,
9
9
  color: o,
10
- width: n,
11
- height: n,
10
+ width: e,
11
+ height: e,
12
12
  overflow: "visible",
13
- viewBox: `0 0 ${n} ${n}`,
13
+ viewBox: `0 0 ${e} ${e}`,
14
14
  style: { overflow: "visible !important" },
15
15
  children: /* @__PURE__ */ i("g", {
16
16
  xmlns: "http://www.w3.org/2000/svg",
@@ -37,8 +37,8 @@ var a = ({ width: n, scaleValue: a, color: o }) => /* @__PURE__ */ r("svg", {
37
37
  })
38
38
  });
39
39
  a.propTypes = {
40
- width: n.number.isRequired,
41
- scaleValue: n.number.isRequired,
42
- color: n.string
40
+ width: e.number.isRequired,
41
+ scaleValue: e.number.isRequired,
42
+ color: e.string
43
43
  };
44
44
  export { a as default };
@@ -1,12 +1,12 @@
1
- import { textOf as e } from "../utils.js";
2
- import { catalogs as t } from "../i18n/index.js";
3
- import n, { useReducer as r } from "react";
4
- import { styled as i } from "@mui/material/styles";
5
- import { keyboard as a } from "@pie-lib/plot";
6
- import { color as o } from "@pie-lib/render-ui";
1
+ import e, { useReducer as t } from "react";
2
+ import { styled as n } from "@mui/material/styles";
3
+ import { keyboard as r } from "@pie-lib/plot";
4
+ import { color as i } from "@pie-lib/render-ui";
5
+ import { textOf as a } from "../utils.js";
6
+ import { catalogs as o } from "../i18n/index.js";
7
7
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
8
  // src/common/mark-slider.tsx
9
- var l = i("g")({
9
+ var l = n("g")({
10
10
  outline: "none",
11
11
  "& > .focus-ring": {
12
12
  display: "none",
@@ -15,8 +15,8 @@ var l = i("g")({
15
15
  strokeWidth: 2
16
16
  },
17
17
  "&:focus-visible > .focus-ring": { display: "inline" },
18
- "& > .focus-ring > .outer": { stroke: o.focusOutline() },
19
- "& > .focus-ring > .inner": { stroke: o.v("pie")("background", o.defaults.WHITE) }
18
+ "& > .focus-ring > .outer": { stroke: i.focusOutline() },
19
+ "& > .focus-ring > .inner": { stroke: i.v("pie")("background", i.defaults.WHITE) }
20
20
  }), u = (e, t) => Math.abs(e / t - Math.round(e / t)) < 1e-9, d = (e, t) => t && t > e && u(t, e) ? t : void 0, f = ({ x: e, y: t, width: n, height: r }) => /* @__PURE__ */ c("g", {
21
21
  className: "focus-ring",
22
22
  children: [/* @__PURE__ */ s("rect", {
@@ -32,9 +32,9 @@ var l = i("g")({
32
32
  width: Math.max(0, n - 6),
33
33
  height: Math.max(0, r - 6)
34
34
  })]
35
- }), p = n.forwardRef(({ enabled: n, label: i, index: o, value: u, graphProps: p, language: m, focusBox: h, onChange: g, children: _, ...v }, y) => {
36
- let [, b] = r((e) => e + 1, 0);
37
- if (!n) return /* @__PURE__ */ s("g", {
35
+ }), p = e.forwardRef(({ enabled: e, label: n, index: i, value: u, graphProps: p, language: m, focusBox: h, onChange: g, children: _, ...v }, y) => {
36
+ let [, b] = t((e) => e + 1, 0);
37
+ if (!e) return /* @__PURE__ */ s("g", {
38
38
  ref: y,
39
39
  ...v,
40
40
  children: _
@@ -45,8 +45,8 @@ var l = i("g")({
45
45
  step: C,
46
46
  largeStep: d(C, x.labelStep),
47
47
  snap: S.y
48
- }, T = a.fitToRange(x.min, w), E = a.fitToRange(x.max, w), D = Number.isFinite(u) ? u : T, O = e(i) || t.forLocale(m, b).t("category", { index: o + 1 }), k = (e) => {
49
- let t = a.sliderKeyValue(e.key, D, w);
48
+ }, T = r.fitToRange(x.min, w), E = r.fitToRange(x.max, w), D = Number.isFinite(u) ? u : T, O = a(n) || o.forLocale(m, b).t("category", { index: i + 1 }), k = (e) => {
49
+ let t = r.sliderKeyValue(e.key, D, w);
50
50
  t !== void 0 && (e.preventDefault(), t !== D && g(t));
51
51
  };
52
52
  return /* @__PURE__ */ c(l, {