@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
@@ -1,46 +1,46 @@
1
- import e from "../../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
2
- import { D as t, DragHandle as n } from "../../common/drag-handle.js";
3
- import { DragHover as r } from "../../common/drag-hover.js";
4
- import { MarkSlider as i } from "../../common/mark-slider.js";
5
- import { bandKey as a } from "../../utils.js";
6
- import { correct as o, incorrect as s } from "../../common/styles.js";
7
- import c from "react";
8
- import l from "prop-types";
9
- import { styled as u } from "@mui/material/styles";
10
- import d from "debug";
11
- import { types as f } from "@pie-lib/plot";
12
- import { color as p } from "@pie-lib/render-ui";
13
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
14
- import _ from "@mui/icons-material/Check";
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import n from "@mui/icons-material/Check";
4
+ import { styled as r } from "@mui/material/styles";
5
+ import i from "../../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
6
+ import a from "debug";
7
+ import { types as o } from "@pie-lib/plot";
8
+ import { D as s, DragHandle as c } from "../../common/drag-handle.js";
9
+ import { DragHover as l } from "../../common/drag-hover.js";
10
+ import { MarkSlider as u } from "../../common/mark-slider.js";
11
+ import { color as d } from "@pie-lib/render-ui";
12
+ import { bandKey as f } from "../../utils.js";
13
+ import { correct as p, incorrect as m } from "../../common/styles.js";
14
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
15
15
  // src/plot/common/plot.tsx
16
- var v = d("pie-lib:chart:bars"), y = 16, b = 10, x = class extends c.Component {
16
+ var v = a("pie-lib:chart:bars"), y = 16, b = 10, x = class extends e.Component {
17
17
  static propTypes = {
18
- onChangeCategory: l.func,
19
- value: l.number,
20
- label: l.string,
21
- xBand: l.func,
22
- index: l.number.isRequired,
23
- graphProps: f.GraphPropsType.isRequired,
24
- CustomBarElement: l.func,
25
- interactive: l.bool,
26
- disabled: l.bool,
27
- correctness: l.shape({
28
- value: l.string,
29
- label: l.string
18
+ onChangeCategory: t.func,
19
+ value: t.number,
20
+ label: t.string,
21
+ xBand: t.func,
22
+ index: t.number.isRequired,
23
+ graphProps: o.GraphPropsType.isRequired,
24
+ CustomBarElement: t.func,
25
+ interactive: t.bool,
26
+ disabled: t.bool,
27
+ correctness: t.shape({
28
+ value: t.string,
29
+ label: t.string
30
30
  }),
31
- defineChart: l.bool,
32
- correctData: l.arrayOf(l.shape({
33
- value: l.oneOfType([l.string, l.number]),
34
- label: l.string
31
+ defineChart: t.bool,
32
+ correctData: t.arrayOf(t.shape({
33
+ value: t.oneOfType([t.string, t.number]),
34
+ label: t.string
35
35
  })),
36
- className: l.string,
37
- language: l.string
36
+ className: t.string,
37
+ language: t.string
38
38
  };
39
39
  constructor(e) {
40
40
  super(e), this.state = {
41
41
  dragValue: void 0,
42
42
  isHovered: !1
43
- }, this.hover = new r((e) => this.setState({ isHovered: e }));
43
+ }, this.hover = new l((e) => this.setState({ isHovered: e }));
44
44
  }
45
45
  componentDidMount() {
46
46
  this.hover.attach();
@@ -69,41 +69,41 @@ var v = d("pie-lib:chart:bars"), y = 16, b = 10, x = class extends c.Component {
69
69
  dragValue = (e, t) => {
70
70
  v("[dragValue] next:", t), this.setDragValue(t);
71
71
  };
72
- renderCorrectnessIcon = (e, t, n, r, i, a, o) => {
73
- let s;
74
- if (n === 0) s = i.y(0) - y / 2;
72
+ renderCorrectnessIcon = (e, t, r, i, a, o, s) => {
73
+ let c;
74
+ if (r === 0) c = a.y(0) - y / 2;
75
75
  else {
76
- let e = n - 1;
77
- s = i.y(e) - (a - o) / 2 - o / 2 - y / 2;
76
+ let e = r - 1;
77
+ c = a.y(e) - (o - s) / 2 - s / 2 - y / 2;
78
78
  }
79
- return /* @__PURE__ */ h("foreignObject", {
79
+ return /* @__PURE__ */ g("foreignObject", {
80
80
  x: e + t / 2 - y / 2,
81
- y: s,
81
+ y: c,
82
82
  width: y,
83
83
  height: y,
84
- children: /* @__PURE__ */ h(_, {
84
+ children: /* @__PURE__ */ g(n, {
85
85
  className: "correctnessIcon correctIcon smallIcon",
86
- title: r.label
86
+ title: i.label
87
87
  })
88
88
  });
89
89
  };
90
90
  render() {
91
- let { graphProps: e, value: r, label: o, xBand: s, index: l, CustomBarElement: u, interactive: d, disabled: f, correctness: _, defineChart: y, correctData: x, className: S, language: C } = this.props, { scale: w, range: T, size: E } = e, { max: D } = T || {}, { dragValue: O, isHovered: k } = this.state, A = Number.isFinite(O) ? O : r, j = s.bandwidth(), M = w.y(T.max - A), N = s(a({ label: o }, l));
92
- v("label:", o, "barX:", N, "v: ", A, "barHeight:", M, "barWidth: ", j);
91
+ let { graphProps: t, value: n, label: r, xBand: i, index: a, CustomBarElement: o, interactive: l, disabled: p, correctness: m, defineChart: y, correctData: x, className: S, language: C } = this.props, { scale: w, range: T, size: E } = t, { max: D } = T || {}, { dragValue: O, isHovered: k } = this.state, A = Number.isFinite(O) ? O : n, j = i.bandwidth(), M = w.y(T.max - A), N = i(f({ label: r }, a));
92
+ v("label:", r, "barX:", N, "v: ", A, "barHeight:", M, "barWidth: ", j);
93
93
  let P = [];
94
94
  for (let e = 0; e < A; e++) P.push(e);
95
- let F = E.height / D, I = (F > j ? j : F) * .8, L = d ? t : n, R = d && !_;
96
- return /* @__PURE__ */ h(c.Fragment, { children: /* @__PURE__ */ g(i, {
95
+ let F = E.height / D, I = (F > j ? j : F) * .8, L = l ? s : c, R = l && !m;
96
+ return /* @__PURE__ */ g(e.Fragment, { children: /* @__PURE__ */ _(u, {
97
97
  className: S,
98
98
  onMouseEnter: this.handleMouseEnter,
99
99
  onMouseLeave: this.handleMouseLeave,
100
100
  onTouchStart: this.handleMouseEnter,
101
101
  onTouchEnd: this.handleMouseLeave,
102
- enabled: d && !f,
103
- label: o,
104
- index: l,
102
+ enabled: l && !p,
103
+ label: r,
104
+ index: a,
105
105
  value: A,
106
- graphProps: e,
106
+ graphProps: t,
107
107
  language: C,
108
108
  focusBox: {
109
109
  x: N,
@@ -113,105 +113,105 @@ var v = d("pie-lib:chart:bars"), y = 16, b = 10, x = class extends c.Component {
113
113
  },
114
114
  onChange: this.changeValue,
115
115
  children: [
116
- k && R && /* @__PURE__ */ h("rect", {
116
+ k && R && /* @__PURE__ */ g("rect", {
117
117
  x: N,
118
118
  y: w.y(A),
119
119
  width: j,
120
120
  height: P?.length ? F * P.length : 0,
121
- stroke: p.defaults.BORDER_GRAY,
121
+ stroke: d.defaults.BORDER_GRAY,
122
122
  strokeWidth: "4px",
123
123
  fill: "transparent"
124
124
  }),
125
- P.map((e) => u({
125
+ P.map((e) => o({
126
126
  index: e,
127
127
  pointDiameter: I,
128
128
  barX: N,
129
129
  barWidth: j,
130
130
  pointHeight: F,
131
- label: o,
132
- value: r,
131
+ label: r,
132
+ value: n,
133
133
  scale: w
134
134
  })),
135
- _ && _.value === "incorrect" && (() => {
136
- let e = parseFloat(x[l] && x[l].value);
135
+ m && m.value === "incorrect" && (() => {
136
+ let e = parseFloat(x[a] && x[a].value);
137
137
  if (isNaN(e)) return null;
138
138
  let t = A;
139
- if (e === 0) return this.renderCorrectnessIcon(N, j, e, _, w, F, I);
139
+ if (e === 0) return this.renderCorrectnessIcon(N, j, e, m, w, F, I);
140
140
  if (t > e) {
141
141
  let t = [];
142
142
  for (let n = 0; n < e; n++) t.push(n);
143
- let n = t[t.length - 1], i = s(a({ label: o }, l)), c = s.bandwidth(), d = E.height / D, f = (d > c ? c : d) * .8;
144
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(u, {
145
- index: n,
146
- pointDiameter: f + 10,
147
- barX: i,
148
- barWidth: c,
149
- pointHeight: d,
150
- label: o,
151
- value: r,
143
+ let s = t[t.length - 1], c = i(f({ label: r }, a)), l = i.bandwidth(), u = E.height / D, d = (u > l ? l : u) * .8;
144
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, {
145
+ index: s,
146
+ pointDiameter: d + 10,
147
+ barX: c,
148
+ barWidth: l,
149
+ pointHeight: u,
150
+ label: r,
151
+ value: n,
152
152
  scale: w,
153
153
  dottedOverline: !0
154
- }), this.renderCorrectnessIcon(i, c, e, _, w, d, f)] });
154
+ }), this.renderCorrectnessIcon(c, l, e, m, w, u, d)] });
155
155
  }
156
- let n = [];
157
- for (let r = t; r < e; r++) n.push(r);
158
- return /* @__PURE__ */ g(m, { children: [n.map((e) => u({
156
+ let s = [];
157
+ for (let n = t; n < e; n++) s.push(n);
158
+ return /* @__PURE__ */ _(h, { children: [s.map((e) => o({
159
159
  index: e,
160
160
  pointDiameter: I,
161
161
  barX: N,
162
162
  barWidth: j,
163
163
  pointHeight: F,
164
- label: o,
165
- value: r,
164
+ label: r,
165
+ value: n,
166
166
  scale: w,
167
167
  dottedOverline: !0
168
- })), this.renderCorrectnessIcon(N, j, e, _, w, F, I)] });
168
+ })), this.renderCorrectnessIcon(N, j, e, m, w, F, I)] });
169
169
  })(),
170
- /* @__PURE__ */ h(L, {
170
+ /* @__PURE__ */ g(L, {
171
171
  x: N,
172
172
  y: A,
173
- interactive: d,
174
- disabled: f,
173
+ interactive: l,
174
+ disabled: p,
175
175
  width: j,
176
176
  onDragStart: this.dragStart,
177
- onDrag: (e) => this.dragValue(r, e),
177
+ onDrag: (e) => this.dragValue(n, e),
178
178
  onDragStop: this.dragStop,
179
- graphProps: e,
180
- correctness: _,
179
+ graphProps: t,
180
+ correctness: m,
181
181
  isHovered: k,
182
182
  defineChart: y,
183
- color: p.primaryDark(),
183
+ color: d.primaryDark(),
184
184
  isPlot: !0
185
185
  })
186
186
  ]
187
187
  }) });
188
188
  }
189
- }, S = u(x)(({ theme: e }) => ({
189
+ }, S = r(x)(({ theme: e }) => ({
190
190
  "& .dot": {
191
- fill: p.visualElementsColors.PLOT_FILL_COLOR,
192
- "&.correct": o("stroke"),
193
- "&.incorrect": s("stroke")
191
+ fill: d.visualElementsColors.PLOT_FILL_COLOR,
192
+ "&.correct": p("stroke"),
193
+ "&.incorrect": m("stroke")
194
194
  },
195
195
  "& .dotColor": {
196
- fill: p.visualElementsColors.PLOT_FILL_COLOR,
197
- "&.correct": o("fill"),
198
- "&.incorrect": s("fill")
196
+ fill: d.visualElementsColors.PLOT_FILL_COLOR,
197
+ "&.correct": p("fill"),
198
+ "&.incorrect": m("fill")
199
199
  },
200
200
  "& .line": {
201
- stroke: p.visualElementsColors.PLOT_FILL_COLOR,
202
- "&.correct": o("stroke"),
203
- "&.incorrect": s("stroke")
201
+ stroke: d.visualElementsColors.PLOT_FILL_COLOR,
202
+ "&.correct": p("stroke"),
203
+ "&.incorrect": m("stroke")
204
204
  },
205
- "& .correctIcon": { backgroundColor: p.correct() },
206
- "& .incorrectIcon": { backgroundColor: p.incorrectWithIcon() },
205
+ "& .correctIcon": { backgroundColor: d.correct() },
206
+ "& .incorrectIcon": { backgroundColor: d.incorrectWithIcon() },
207
207
  "& .correctnessIcon": {
208
208
  borderRadius: e.spacing(2),
209
- color: p.defaults.WHITE,
209
+ color: d.defaults.WHITE,
210
210
  fontSize: "16px",
211
211
  width: "16px",
212
212
  height: "16px",
213
213
  padding: "2px",
214
- border: `1px solid ${p.defaults.WHITE}`,
214
+ border: `1px solid ${d.defaults.WHITE}`,
215
215
  stroke: "initial",
216
216
  boxSizing: "unset",
217
217
  display: "block"
@@ -221,38 +221,38 @@ var v = d("pie-lib:chart:bars"), y = 16, b = 10, x = class extends c.Component {
221
221
  width: "10px",
222
222
  height: "10px"
223
223
  }
224
- })), C = class extends c.Component {
224
+ })), C = class extends e.Component {
225
225
  static propTypes = {
226
- data: l.array,
227
- onChangeCategory: l.func,
228
- xBand: l.func,
229
- graphProps: f.GraphPropsType.isRequired,
230
- defineChart: l.bool,
231
- CustomBarElement: l.func,
232
- correctData: l.arrayOf(l.shape({
233
- value: l.oneOfType([l.string, l.number]),
234
- label: l.string
226
+ data: t.array,
227
+ onChangeCategory: t.func,
228
+ xBand: t.func,
229
+ graphProps: o.GraphPropsType.isRequired,
230
+ defineChart: t.bool,
231
+ CustomBarElement: t.func,
232
+ correctData: t.arrayOf(t.shape({
233
+ value: t.oneOfType([t.string, t.number]),
234
+ label: t.string
235
235
  })),
236
- className: l.string,
237
- language: l.string
236
+ className: t.string,
237
+ language: t.string
238
238
  };
239
239
  render() {
240
- let { data: t, graphProps: n, xBand: r, CustomBarElement: i, onChangeCategory: a, defineChart: o, correctData: s, disabled: c, language: l } = this.props;
241
- return /* @__PURE__ */ h(e, { children: (t || []).map((e, t) => /* @__PURE__ */ h(S, {
240
+ let { data: e, graphProps: t, xBand: n, CustomBarElement: r, onChangeCategory: a, defineChart: o, correctData: s, disabled: c, language: l } = this.props;
241
+ return /* @__PURE__ */ g(i, { children: (e || []).map((e, i) => /* @__PURE__ */ g(S, {
242
242
  value: e.value,
243
243
  label: e.label,
244
244
  interactive: o || e.interactive,
245
245
  defineChart: o,
246
246
  disabled: c,
247
- xBand: r,
248
- index: t,
249
- onChangeCategory: (e) => a(t, e),
250
- graphProps: n,
251
- CustomBarElement: i,
247
+ xBand: n,
248
+ index: i,
249
+ onChangeCategory: (e) => a(i, e),
250
+ graphProps: t,
251
+ CustomBarElement: r,
252
252
  correctness: e.correctness,
253
253
  correctData: s,
254
254
  language: l
255
- }, `bar-${e.label}-${t}`)) });
255
+ }, `bar-${e.label}-${i}`)) });
256
256
  }
257
257
  };
258
258
  export { C as Plot, C as default, x as RawPlot };
package/dist/plot/dot.js CHANGED
@@ -1,53 +1,53 @@
1
- import e from "../node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Circle.js";
2
- import { dataToXBand as t } from "../utils.js";
3
- import { Plot as n } from "./common/plot.js";
4
- import { correct as r, incorrect as i } from "../common/styles.js";
5
- import a from "react";
6
- import o from "prop-types";
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import n from "../node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Circle.js";
4
+ import { types as r } from "@pie-lib/plot";
5
+ import { dataToXBand as i } from "../utils.js";
6
+ import { Plot as a } from "./common/plot.js";
7
+ import { color as o } from "@pie-lib/render-ui";
7
8
  import { styled as s } from "@mui/material/styles";
8
- import { types as c } from "@pie-lib/plot";
9
- import { color as l } from "@pie-lib/render-ui";
9
+ import { correct as c, incorrect as l } from "../common/styles.js";
10
10
  import { jsx as u } from "react/jsx-runtime";
11
11
  // src/plot/dot.tsx
12
- var d = s(e)(() => ({
13
- fill: l.visualElementsColors.PLOT_FILL_COLOR,
14
- "&.correct": r("stroke"),
15
- "&.incorrect": i("stroke")
16
- })), f = (t) => {
17
- let { index: n, pointDiameter: r, barX: i, barWidth: a, pointHeight: o, label: s, value: c, scale: f, dottedOverline: p } = t, m = r / 2, h = i + (a - r) / 2 + m, g = f.y(n) - (o - r) / 2 - m;
18
- return p ? /* @__PURE__ */ u(e, {
12
+ var d = s(n)(() => ({
13
+ fill: o.visualElementsColors.PLOT_FILL_COLOR,
14
+ "&.correct": c("stroke"),
15
+ "&.incorrect": l("stroke")
16
+ })), f = (e) => {
17
+ let { index: t, pointDiameter: r, barX: i, barWidth: a, pointHeight: s, label: c, value: l, scale: f, dottedOverline: p } = e, m = r / 2, h = i + (a - r) / 2 + m, g = f.y(t) - (s - r) / 2 - m;
18
+ return p ? /* @__PURE__ */ u(n, {
19
19
  cx: h,
20
20
  cy: g,
21
21
  r: m + 2,
22
22
  strokeDasharray: "4,4",
23
- stroke: l.defaults.BORDER_GRAY,
23
+ stroke: o.defaults.BORDER_GRAY,
24
24
  fill: "none"
25
- }, `point-${s}-${c}-${n}`) : /* @__PURE__ */ u(d, {
25
+ }, `point-${c}-${l}-${t}`) : /* @__PURE__ */ u(d, {
26
26
  cx: h,
27
27
  cy: g,
28
28
  r: m
29
- }, `point-${s}-${c}-${n}`);
29
+ }, `point-${c}-${l}-${t}`);
30
30
  };
31
31
  f.propTypes = {
32
- index: o.number,
33
- pointDiameter: o.number,
34
- barX: o.number,
35
- barWidth: o.number,
36
- pointHeight: o.number,
37
- value: o.number,
38
- label: o.string,
39
- scale: o.object,
40
- dottedOverline: o.bool
32
+ index: t.number,
33
+ pointDiameter: t.number,
34
+ barX: t.number,
35
+ barWidth: t.number,
36
+ pointHeight: t.number,
37
+ value: t.number,
38
+ label: t.string,
39
+ scale: t.object,
40
+ dottedOverline: t.bool
41
41
  };
42
- var p = class extends a.Component {
42
+ var p = class extends e.Component {
43
43
  static propTypes = {
44
- data: o.array,
45
- onChange: o.func,
46
- graphProps: c.GraphPropsType.isRequired
44
+ data: t.array,
45
+ onChange: t.func,
46
+ graphProps: r.GraphPropsType.isRequired
47
47
  };
48
48
  render() {
49
- let e = this.props, { data: r, graphProps: i } = e, { scale: a = {}, size: o = {} } = i || {}, s = t(a.x, r, o.width, "dotPlot");
50
- return /* @__PURE__ */ u(n, {
49
+ let e = this.props, { data: t, graphProps: n } = e, { scale: r = {}, size: o = {} } = n || {}, s = i(r.x, t, o.width, "dotPlot");
50
+ return /* @__PURE__ */ u(a, {
51
51
  ...e,
52
52
  xBand: s,
53
53
  CustomBarElement: f
package/dist/plot/line.js CHANGED
@@ -1,77 +1,77 @@
1
- import e from "../node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/LinePath.js";
2
- import t from "../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
3
- import { dataToXBand as n } from "../utils.js";
4
- import { Plot as r } from "./common/plot.js";
5
- import { correct as i, incorrect as a } from "../common/styles.js";
6
- import o from "react";
7
- import s from "prop-types";
8
- import { styled as c } from "@mui/material/styles";
9
- import { types as l } from "@pie-lib/plot";
10
- import { color as u } from "@pie-lib/render-ui";
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import n from "../node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/LinePath.js";
4
+ import r from "../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
5
+ import { styled as i } from "@mui/material/styles";
6
+ import { types as a } from "@pie-lib/plot";
7
+ import { dataToXBand as o } from "../utils.js";
8
+ import { color as s } from "@pie-lib/render-ui";
9
+ import { Plot as c } from "./common/plot.js";
10
+ import { correct as l, incorrect as u } from "../common/styles.js";
11
11
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
12
  // src/plot/line.tsx
13
- var p = c(e)(() => ({
14
- stroke: u.visualElementsColors.PLOT_FILL_COLOR,
15
- "&.correct": i("stroke"),
16
- "&.incorrect": a("stroke")
13
+ var p = i(n)(() => ({
14
+ stroke: s.visualElementsColors.PLOT_FILL_COLOR,
15
+ "&.correct": l("stroke"),
16
+ "&.incorrect": u("stroke")
17
17
  })), m = (e) => {
18
- let { index: n, pointDiameter: r, barX: i, barWidth: a, pointHeight: o, label: s, value: c, scale: l, dottedOverline: m } = e, h = i + (a - r) / 2, g = l.y(n) - (o - r) / 2;
18
+ let { index: t, pointDiameter: n, barX: i, barWidth: a, pointHeight: o, label: c, value: l, scale: u, dottedOverline: m } = e, h = i + (a - n) / 2, g = u.y(t) - (o - n) / 2;
19
19
  return m ? /* @__PURE__ */ d("rect", {
20
20
  x: h - 2,
21
- y: g - r - 2,
22
- width: r + 4,
23
- height: r + 4,
21
+ y: g - n - 2,
22
+ width: n + 4,
23
+ height: n + 4,
24
24
  strokeDasharray: "4,4",
25
- stroke: u.defaults.BORDER_GRAY,
25
+ stroke: s.defaults.BORDER_GRAY,
26
26
  fill: "none"
27
- }, `point-${s}-${c}-${n}`) : /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d(p, {
27
+ }, `point-${c}-${l}-${t}`) : /* @__PURE__ */ f(r, { children: [/* @__PURE__ */ d(p, {
28
28
  data: [{
29
29
  x: h,
30
30
  y: g
31
31
  }, {
32
- x: h + r,
33
- y: g - r
32
+ x: h + n,
33
+ y: g - n
34
34
  }],
35
35
  className: "line",
36
36
  x: (e) => e.x,
37
37
  y: (e) => e.y,
38
- strokeWidth: r / 5
39
- }, `point-${s}-${c}-${n}-1`), /* @__PURE__ */ d(p, {
38
+ strokeWidth: n / 5
39
+ }, `point-${c}-${l}-${t}-1`), /* @__PURE__ */ d(p, {
40
40
  data: [{
41
41
  x: h,
42
- y: g - r
42
+ y: g - n
43
43
  }, {
44
- x: h + r,
44
+ x: h + n,
45
45
  y: g
46
46
  }],
47
47
  x: (e) => e.x,
48
48
  y: (e) => e.y,
49
- strokeWidth: r / 5,
49
+ strokeWidth: n / 5,
50
50
  className: "line"
51
- }, `point-${s}-${c}-${n}-2`)] });
51
+ }, `point-${c}-${l}-${t}-2`)] });
52
52
  };
53
53
  m.propTypes = {
54
- index: s.number,
55
- pointDiameter: s.number,
56
- barX: s.number,
57
- barWidth: s.number,
58
- pointHeight: s.number,
59
- value: s.number,
60
- label: s.string,
61
- scale: s.object,
62
- dottedOverline: s.bool
54
+ index: t.number,
55
+ pointDiameter: t.number,
56
+ barX: t.number,
57
+ barWidth: t.number,
58
+ pointHeight: t.number,
59
+ value: t.number,
60
+ label: t.string,
61
+ scale: t.object,
62
+ dottedOverline: t.bool
63
63
  };
64
- var h = class extends o.Component {
64
+ var h = class extends e.Component {
65
65
  static propTypes = {
66
- data: s.array,
67
- onChange: s.func,
68
- graphProps: l.GraphPropsType.isRequired
66
+ data: t.array,
67
+ onChange: t.func,
68
+ graphProps: a.GraphPropsType.isRequired
69
69
  };
70
70
  render() {
71
- let e = this.props, { data: t, graphProps: i } = e, { scale: a = {}, size: o = {} } = i || {}, s = n(a.x, t, o.width, "linePlot");
72
- return /* @__PURE__ */ d(r, {
71
+ let e = this.props, { data: t, graphProps: n } = e, { scale: r = {}, size: i = {} } = n || {}, a = o(r.x, t, i.width, "linePlot");
72
+ return /* @__PURE__ */ d(c, {
73
73
  ...e,
74
- xBand: s,
74
+ xBand: a,
75
75
  CustomBarElement: m
76
76
  });
77
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/charting",
3
- "version": "8.0.10",
3
+ "version": "8.0.11-next.20261202142832",
4
4
  "description": "charting",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,10 +14,10 @@
14
14
  "@mapbox/point-geometry": "^1.1.0",
15
15
  "@mui/icons-material": "^7.3.4",
16
16
  "@mui/material": "^7.3.4",
17
- "@pie-element/shared-i18n": "0.1.5",
18
- "@pie-element/shared-utils": "0.1.9",
19
- "@pie-lib/plot": "5.0.10",
20
- "@pie-lib/render-ui": "8.0.10",
17
+ "@pie-element/shared-i18n": "0.1.6-next.20261202142832",
18
+ "@pie-element/shared-utils": "0.1.10-next.20261202142832",
19
+ "@pie-lib/plot": "5.0.11-next.20261202142832",
20
+ "@pie-lib/render-ui": "8.0.11-next.20261202142832",
21
21
  "@visx/axis": "^4.0.0",
22
22
  "@visx/event": "^4.0.0",
23
23
  "@visx/grid": "^4.0.0",
@@ -31,9 +31,9 @@
31
31
  "invariant": "^2.2.4",
32
32
  "react-draggable": "^4.7.2",
33
33
  "prop-types": "^15.8.1",
34
- "@pie-lib/config-ui": "14.0.10",
35
- "@pie-element/shared-math-rendering-mathjax": "0.1.11",
36
- "@pie-element/shared-lodash": "0.1.6",
34
+ "@pie-lib/config-ui": "14.0.11-next.20261202142832",
35
+ "@pie-element/shared-math-rendering-mathjax": "0.1.12-next.20261202142832",
36
+ "@pie-element/shared-lodash": "0.1.7-next.20261202142832",
37
37
  "clsx": "^2.1.1",
38
38
  "d3-time": "^3.1.1",
39
39
  "d3-interpolate": "^3.0.2",