@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/axes.js CHANGED
@@ -1,18 +1,18 @@
1
- import e from "./node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisBottom.js";
2
- import t from "./node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisLeft.js";
3
- import { TickCorrectnessIndicator as n } from "./common/correctness-indicators.js";
4
- import { bandKey as r, getRotateAngle as i, getRotatedLabelOverhang as a, getTickValues as o, textOf as s } from "./utils.js";
5
- import { MarkLabel as c } from "./mark-label.js";
6
- import { catalogs as l } from "./i18n/index.js";
7
- import u, { useEffect as d, useRef as f } from "react";
8
- import p from "prop-types";
9
- import { styled as m } from "@mui/material/styles";
10
- import { types as h } from "@pie-lib/plot";
11
- import { AlertDialog as g } from "@pie-lib/config-ui";
12
- import { color as _ } from "@pie-lib/render-ui";
13
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
14
- import b from "@mui/material/Checkbox";
15
- import { renderMath as x } from "@pie-element/shared-math-rendering-mathjax";
1
+ import e, { useEffect as t, useRef as n } from "react";
2
+ import r from "prop-types";
3
+ import { styled as i } from "@mui/material/styles";
4
+ import a from "./node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisBottom.js";
5
+ import o from "./node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisLeft.js";
6
+ import s from "@mui/material/Checkbox";
7
+ import { types as c } from "@pie-lib/plot";
8
+ import { color as l } from "@pie-lib/render-ui";
9
+ import { AlertDialog as u } from "@pie-lib/config-ui";
10
+ import { renderMath as d } from "@pie-element/shared-math-rendering-mathjax";
11
+ import { TickCorrectnessIndicator as f } from "./common/correctness-indicators.js";
12
+ import { bandKey as p, getRotateAngle as m, getRotatedLabelOverhang as h, getTickValues as g, textOf as _ } from "./utils.js";
13
+ import { MarkLabel as v } from "./mark-label.js";
14
+ import { catalogs as y } from "./i18n/index.js";
15
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
16
16
  // src/axes.tsx
17
17
  var S = 24, C = -110, w = 12, T = /* @__PURE__ */ new Set(), E = null;
18
18
  function D(e) {
@@ -26,18 +26,18 @@ function D(e) {
26
26
  function O(e) {
27
27
  T.delete(e), T.size === 0 && E && (E.disconnect(), E = null);
28
28
  }
29
- var k = m("text")(({ theme: e }) => ({
29
+ var k = i("text")(({ theme: e }) => ({
30
30
  fontSize: e.typography.fontSize - 2,
31
31
  fill: e.palette.error.main
32
- })), A = m(b)(() => ({ color: `${_.tertiary()} !important` })), j = m("g")(({ theme: e }) => ({
32
+ })), A = i(s)(() => ({ color: `${l.tertiary()} !important` })), j = i("g")(({ theme: e }) => ({
33
33
  "& .vx-axis-line": {
34
- stroke: _.visualElementsColors.AXIS_LINE_COLOR,
34
+ stroke: l.visualElementsColors.AXIS_LINE_COLOR,
35
35
  strokeWidth: 2
36
36
  },
37
37
  "& .vx-axis-tick": {
38
- fill: _.visualElementsColors.AXIS_TICK_COLOR,
38
+ fill: l.visualElementsColors.AXIS_TICK_COLOR,
39
39
  "& line": {
40
- stroke: _.visualElementsColors.AXIS_TICK_COLOR,
40
+ stroke: l.visualElementsColors.AXIS_TICK_COLOR,
41
41
  strokeWidth: 2
42
42
  },
43
43
  fontFamily: e.typography.body1?.fontFamily,
@@ -46,17 +46,17 @@ var k = m("text")(({ theme: e }) => ({
46
46
  }
47
47
  })), M = (e) => ({
48
48
  borderRadius: e.spacing(2),
49
- color: _.defaults.WHITE,
49
+ color: l.defaults.WHITE,
50
50
  fontSize: "16px",
51
51
  width: "16px",
52
52
  height: "16px",
53
53
  padding: "2px",
54
- border: `1px solid ${_.defaults.WHITE}`,
54
+ border: `1px solid ${l.defaults.WHITE}`,
55
55
  boxSizing: "unset"
56
- }), N = { backgroundColor: _.incorrectWithIcon() }, P = { backgroundColor: _.correct() }, F = class extends u.Component {
56
+ }), N = { backgroundColor: l.incorrectWithIcon() }, P = { backgroundColor: l.correct() }, F = class extends e.Component {
57
57
  static propTypes = {
58
- defineChart: p.bool,
59
- error: p.any
58
+ defineChart: r.bool,
59
+ error: r.any
60
60
  };
61
61
  relabel = () => this.forceUpdate();
62
62
  constructor(e) {
@@ -67,9 +67,9 @@ var k = m("text")(({ theme: e }) => ({
67
67
  }
68
68
  handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
69
69
  changeCategory = (e, t) => {
70
- let { categories: n, onChangeCategory: r } = this.props, i = n[e];
70
+ let { categories: n, onChangeCategory: r } = this.props;
71
71
  r(e, {
72
- ...i,
72
+ ...n[e],
73
73
  label: t
74
74
  });
75
75
  };
@@ -114,137 +114,137 @@ var k = m("text")(({ theme: e }) => ({
114
114
  return n;
115
115
  };
116
116
  render() {
117
- let { categories: e, xBand: t, bandWidth: i, barWidth: a, rotate: o, top: u, graphProps: d, defineChart: f, chartingOptions: p, x: m, y: h, formattedValue: _, changeInteractiveEnabled: b, changeEditableEnabled: x, error: S, autoFocus: T, hiddenLabelRef: E, showCorrectness: D, language: O } = this.props;
118
- if (!_) return null;
117
+ let { categories: e, xBand: t, bandWidth: n, barWidth: r, rotate: i, top: a, graphProps: o, defineChart: s, chartingOptions: c, x: l, y: d, formattedValue: m, changeInteractiveEnabled: h, changeEditableEnabled: g, error: S, autoFocus: T, hiddenLabelRef: E, showCorrectness: D, language: O } = this.props;
118
+ if (!m) return null;
119
119
  let j = {
120
120
  correctnessIcon: M,
121
121
  incorrectIcon: N,
122
122
  correctIcon: P
123
- }, { dialog: F } = this.state, { changeEditable: I, changeInteractive: L } = p || {}, R = parseInt(_.split("-")[0], 10), z = e[R], { editable: B, interactive: V, label: H, correctness: U } = z || {}, W = t(r({ label: H }, R)), G = (e || []).reduce((e, t) => (e && e.label ? e.label.length : 0) > (t && t.label ? t.label.length : 0) ? e : t, { label: "" }), K = S ? [...new Set(Object.values(S))].join(" ") : "", q = l.forLocale(O, this.relabel);
124
- return /* @__PURE__ */ y("g", { children: [
125
- /* @__PURE__ */ y("foreignObject", {
126
- x: i ? W : m - a / 2,
123
+ }, { dialog: F } = this.state, { changeEditable: I, changeInteractive: L } = c || {}, R = parseInt(m.split("-")[0], 10), z = e[R], { editable: B, interactive: V, label: H, correctness: U } = z || {}, W = t(p({ label: H }, R)), G = (e || []).reduce((e, t) => (e && e.label ? e.label.length : 0) > (t && t.label ? t.label.length : 0) ? e : t, { label: "" }), K = S ? [...new Set(Object.values(S))].join(" ") : "", q = y.forLocale(O, this.relabel);
124
+ return /* @__PURE__ */ x("g", { children: [
125
+ /* @__PURE__ */ x("foreignObject", {
126
+ x: n ? W : l - r / 2,
127
127
  y: 18,
128
- width: a,
128
+ width: r,
129
129
  height: 4,
130
130
  style: {
131
131
  pointerEvents: "none",
132
132
  overflow: "visible"
133
133
  },
134
- children: [R === 0 && /* @__PURE__ */ v(c, {
134
+ children: [R === 0 && /* @__PURE__ */ b(v, {
135
135
  isHiddenLabel: !0,
136
136
  inputRef: E,
137
137
  disabled: !0,
138
138
  mark: G,
139
- graphProps: d,
140
- barWidth: a
141
- }), /* @__PURE__ */ v(c, {
142
- autoFocus: f && T,
139
+ graphProps: o,
140
+ barWidth: r
141
+ }), /* @__PURE__ */ b(v, {
142
+ autoFocus: s && T,
143
143
  inputRef: (e) => this.input = e,
144
- disabled: !f && !B,
144
+ disabled: !s && !B,
145
145
  mark: z,
146
- graphProps: d,
146
+ graphProps: o,
147
147
  onChange: (e) => this.changeCategory(R, e),
148
- barWidth: a,
149
- rotate: o,
148
+ barWidth: r,
149
+ rotate: i,
150
150
  correctness: U,
151
151
  error: S && S[R],
152
152
  ariaLabel: q.t("categoryLabel", { index: R + 1 }),
153
153
  mathAriaLabel: q.t("categoryLabelValue", {
154
154
  index: R + 1,
155
- label: s(H)
155
+ label: _(H)
156
156
  }),
157
157
  limitCharacters: !0,
158
- correctnessIndicator: D && U && /* @__PURE__ */ v(n, {
158
+ correctnessIndicator: D && U && /* @__PURE__ */ b(f, {
159
159
  correctness: U,
160
160
  interactive: V,
161
161
  classes: j
162
162
  })
163
163
  })]
164
164
  }),
165
- S && R === 0 && /* @__PURE__ */ v(k, {
166
- y: h + 23,
165
+ S && R === 0 && /* @__PURE__ */ b(k, {
166
+ y: d + 23,
167
167
  height: 6,
168
168
  textAnchor: "start",
169
169
  children: K
170
170
  }),
171
- f && R === 0 && /* @__PURE__ */ y("svg", {
171
+ s && R === 0 && /* @__PURE__ */ x("svg", {
172
172
  x: C,
173
173
  style: { overflow: "visible" },
174
- children: [b && /* @__PURE__ */ v("text", {
175
- y: h + 90 + u,
176
- width: a,
174
+ children: [h && /* @__PURE__ */ b("text", {
175
+ y: d + 90 + a,
176
+ width: r,
177
177
  height: 4,
178
178
  style: {
179
179
  position: "absolute",
180
180
  pointerEvents: "none",
181
181
  wordBreak: "break-word",
182
- maxWidth: a,
182
+ maxWidth: r,
183
183
  display: "inline-block"
184
184
  },
185
- children: this.splitText(L?.authoringLabel, w).map((e, t) => /* @__PURE__ */ v("tspan", {
185
+ children: this.splitText(L?.authoringLabel, w).map((e, t) => /* @__PURE__ */ b("tspan", {
186
186
  x: "0",
187
187
  dy: `${t > 0 ? "1.2em" : ".6em"}`,
188
188
  children: e
189
189
  }, t))
190
- }), x && /* @__PURE__ */ v("text", {
191
- y: h + 145 + u,
192
- width: a,
190
+ }), g && /* @__PURE__ */ b("text", {
191
+ y: d + 145 + a,
192
+ width: r,
193
193
  height: 4,
194
194
  style: {
195
195
  position: "absolute",
196
196
  pointerEvents: "none",
197
197
  wordBreak: "break-word",
198
- maxWidth: a,
198
+ maxWidth: r,
199
199
  display: "inline-block"
200
200
  },
201
- children: this.splitText(I?.authoringLabel, w).map((e, t) => /* @__PURE__ */ v("tspan", {
201
+ children: this.splitText(I?.authoringLabel, w).map((e, t) => /* @__PURE__ */ b("tspan", {
202
202
  x: "0",
203
203
  dy: `${t > 0 ? "1.2em" : ".6em"}`,
204
204
  children: e
205
205
  }, t))
206
206
  })]
207
207
  }),
208
- f && b && /* @__PURE__ */ v("foreignObject", {
209
- x: m - 24,
210
- y: h + 80 + u,
211
- width: a,
208
+ s && h && /* @__PURE__ */ b("foreignObject", {
209
+ x: l - 24,
210
+ y: d + 80 + a,
211
+ width: r,
212
212
  height: 4,
213
213
  style: {
214
214
  pointerEvents: "visible",
215
215
  overflow: "visible"
216
216
  },
217
- children: /* @__PURE__ */ v(A, {
217
+ children: /* @__PURE__ */ b(A, {
218
218
  style: { position: "fixed" },
219
219
  checked: V,
220
220
  onChange: (e) => this.changeInteractive(R, e.target.checked)
221
221
  })
222
222
  }),
223
- f && x && /* @__PURE__ */ v("foreignObject", {
224
- x: m - 24,
225
- y: h + 130 + u,
226
- width: a,
223
+ s && g && /* @__PURE__ */ b("foreignObject", {
224
+ x: l - 24,
225
+ y: d + 130 + a,
226
+ width: r,
227
227
  height: 4,
228
228
  style: {
229
229
  pointerEvents: "visible",
230
230
  overflow: "visible"
231
231
  },
232
- children: /* @__PURE__ */ v(A, {
232
+ children: /* @__PURE__ */ b(A, {
233
233
  style: { position: "fixed" },
234
234
  checked: B,
235
235
  onChange: (e) => this.changeEditable(R, e.target.checked)
236
236
  })
237
237
  }),
238
- /* @__PURE__ */ v("foreignObject", {
239
- x: m - 24,
240
- y: h + 100 + u,
241
- width: a,
238
+ /* @__PURE__ */ b("foreignObject", {
239
+ x: l - 24,
240
+ y: d + 100 + a,
241
+ width: r,
242
242
  height: 4,
243
243
  style: {
244
244
  pointerEvents: "visible",
245
245
  overflow: "visible"
246
246
  },
247
- children: /* @__PURE__ */ v(g, {
247
+ children: /* @__PURE__ */ b(u, {
248
248
  open: F.open,
249
249
  title: F.title,
250
250
  text: F.text,
@@ -256,84 +256,84 @@ var k = m("text")(({ theme: e }) => ({
256
256
  }
257
257
  };
258
258
  F.propTypes = {
259
- categories: p.array,
260
- xBand: p.func,
261
- bandWidth: p.number,
262
- barWidth: p.number,
263
- rotate: p.number,
264
- top: p.number,
265
- x: p.number,
266
- y: p.number,
267
- graphProps: p.object,
268
- formattedValue: p.string,
269
- onChangeCategory: p.func,
270
- onChange: p.func,
271
- error: p.object,
272
- defineChart: p.bool,
273
- chartingOptions: p.object,
274
- changeInteractiveEnabled: p.bool,
275
- changeEditableEnabled: p.bool,
276
- autoFocus: p.bool,
277
- onAutoFocusUsed: p.func,
278
- showCorrectness: p.bool,
279
- hiddenLabelRef: p.oneOfType([p.func, p.shape({ current: p.instanceOf(Element) })]),
280
- language: p.string
259
+ categories: r.array,
260
+ xBand: r.func,
261
+ bandWidth: r.number,
262
+ barWidth: r.number,
263
+ rotate: r.number,
264
+ top: r.number,
265
+ x: r.number,
266
+ y: r.number,
267
+ graphProps: r.object,
268
+ formattedValue: r.string,
269
+ onChangeCategory: r.func,
270
+ onChange: r.func,
271
+ error: r.object,
272
+ defineChart: r.bool,
273
+ chartingOptions: r.object,
274
+ changeInteractiveEnabled: r.bool,
275
+ changeEditableEnabled: r.bool,
276
+ autoFocus: r.bool,
277
+ onAutoFocusUsed: r.func,
278
+ showCorrectness: r.bool,
279
+ hiddenLabelRef: r.oneOfType([r.func, r.shape({ current: r.instanceOf(Element) })]),
280
+ language: r.string
281
281
  };
282
- var I = 80, L = 6, R = 18, z = m("div")(({ theme: e }) => ({
282
+ var I = 80, L = 6, R = 18, z = i("div")(({ theme: e }) => ({
283
283
  textAlign: "right",
284
284
  fontSize: e.typography.fontSize + 2,
285
285
  fontFamily: e.typography.fontFamily,
286
- color: _.defaults.TEXT,
286
+ color: l.defaults.TEXT,
287
287
  lineHeight: 1
288
- })), B = ({ x: e, y: t, formattedValue: n }) => {
289
- let r = f(null), i = `\\(${n}\\)`;
290
- return d(() => {
291
- let e = r.current;
292
- e && (e.textContent = i, x(e));
293
- }, [i]), /* @__PURE__ */ v("foreignObject", {
288
+ })), B = ({ x: e, y: r, formattedValue: i }) => {
289
+ let a = n(null), o = `\\(${i}\\)`;
290
+ return t(() => {
291
+ let e = a.current;
292
+ e && (e.textContent = o, d(e));
293
+ }, [o]), /* @__PURE__ */ b("foreignObject", {
294
294
  x: e - L - I,
295
- y: t,
295
+ y: r,
296
296
  width: I,
297
297
  height: 1,
298
298
  style: {
299
299
  pointerEvents: "none",
300
300
  overflow: "visible"
301
301
  },
302
- children: /* @__PURE__ */ v(z, {
303
- ref: r,
302
+ children: /* @__PURE__ */ b(z, {
303
+ ref: a,
304
304
  "data-range-label": !0,
305
305
  style: { transform: "translateY(-50%)" }
306
306
  })
307
307
  });
308
308
  };
309
309
  B.propTypes = {
310
- x: p.number,
311
- y: p.number,
312
- formattedValue: p.string
310
+ x: r.number,
311
+ y: r.number,
312
+ formattedValue: r.string
313
313
  };
314
- var V = (e) => /* @__PURE__ */ v(B, { ...e }), H = class extends u.Component {
314
+ var V = (e) => /* @__PURE__ */ b(B, { ...e }), H = class extends e.Component {
315
315
  static propTypes = {
316
- bottomScale: p.func,
317
- categories: p.array,
318
- defineChart: p.bool,
319
- error: p.any,
320
- graphProps: h.GraphPropsType.isRequired,
321
- xBand: p.func,
322
- leftAxis: p.bool,
323
- onChange: p.func,
324
- onChangeCategory: p.func,
325
- top: p.number,
326
- theme: p.object,
327
- chartingOptions: p.object,
328
- changeInteractiveEnabled: p.bool,
329
- changeEditableEnabled: p.bool,
330
- autoFocus: p.bool,
331
- onAutoFocusUsed: p.func,
332
- showCorrectness: p.bool,
333
- hiddenLabelRef: p.oneOfType([p.func, p.shape({ current: p.instanceOf(Element) })]),
334
- language: p.string,
335
- onLabelOverhang: p.func,
336
- onRangeLabelOverhang: p.func
316
+ bottomScale: r.func,
317
+ categories: r.array,
318
+ defineChart: r.bool,
319
+ error: r.any,
320
+ graphProps: c.GraphPropsType.isRequired,
321
+ xBand: r.func,
322
+ leftAxis: r.bool,
323
+ onChange: r.func,
324
+ onChangeCategory: r.func,
325
+ top: r.number,
326
+ theme: r.object,
327
+ chartingOptions: r.object,
328
+ changeInteractiveEnabled: r.bool,
329
+ changeEditableEnabled: r.bool,
330
+ autoFocus: r.bool,
331
+ onAutoFocusUsed: r.func,
332
+ showCorrectness: r.bool,
333
+ hiddenLabelRef: r.oneOfType([r.func, r.shape({ current: r.instanceOf(Element) })]),
334
+ language: r.string,
335
+ onLabelOverhang: r.func,
336
+ onRangeLabelOverhang: r.func
337
337
  };
338
338
  state = {
339
339
  height: 0,
@@ -344,15 +344,15 @@ var V = (e) => /* @__PURE__ */ v(B, { ...e }), H = class extends u.Component {
344
344
  reportedOverhang = 0;
345
345
  reportedRangeOverhang = 0;
346
346
  labelLayout = () => {
347
- let { graphProps: e, xBand: t, categories: n = [], theme: r } = this.props, { scale: a = {}, domain: o = {} } = e || {}, { height: s, width: c } = this.state, l = t && typeof t.bandwidth == "function" && t.bandwidth(), u = l || a.x && a.x(o.max) / n.length, d = r && r.typography ? r.typography.fontSize : 14;
347
+ let { graphProps: e, xBand: t, categories: n = [], theme: r } = this.props, { scale: i = {}, domain: a = {} } = e || {}, { height: o, width: s } = this.state, c = t && typeof t.bandwidth == "function" && t.bandwidth(), l = c || i.x && i.x(a.max) / n.length, u = r && r.typography ? r.typography.fontSize : 14;
348
348
  return {
349
- bandWidth: l,
350
- barWidth: u,
351
- rotate: i(d, s) || (c > u ? 25 : 0)
349
+ bandWidth: c,
350
+ barWidth: l,
351
+ rotate: m(u, o) || (s > l ? 25 : 0)
352
352
  };
353
353
  };
354
354
  reportLabelOverhang = () => {
355
- let { onLabelOverhang: e } = this.props, { height: t, width: n, labelHeight: r } = this.state, i = a(n, t, this.labelLayout().rotate) + Math.max(0, r - S);
355
+ let { onLabelOverhang: e } = this.props, { height: t, width: n, labelHeight: r } = this.state, i = h(n, t, this.labelLayout().rotate) + Math.max(0, r - S);
356
356
  e && i !== this.reportedOverhang && (this.reportedOverhang = i, e(i));
357
357
  };
358
358
  reportRangeLabelOverhang = () => {
@@ -379,7 +379,7 @@ var V = (e) => /* @__PURE__ */ v(B, { ...e }), H = class extends u.Component {
379
379
  observeHiddenLabel = (e) => {
380
380
  if (!e) return;
381
381
  let t = e.querySelector("[data-latex], [data-raw]");
382
- t && x(e), (e.querySelector("mjx-container") || !t) && this.measureHiddenLabel(), D(this._onDocMutation), this.observeHiddenLabelSize(e);
382
+ t && d(e), (e.querySelector("mjx-container") || !t) && this.measureHiddenLabel(), D(this._onDocMutation), this.observeHiddenLabelSize(e);
383
383
  };
384
384
  observeHiddenLabelSize = (e) => {
385
385
  e !== this._sizedLabel && typeof ResizeObserver < "u" && (this._sizeObserver?.disconnect(), this._sizedLabel = e, this._sizeObserver = new ResizeObserver(() => this.measureHiddenLabel()), this._sizeObserver.observe(e));
@@ -397,53 +397,53 @@ var V = (e) => /* @__PURE__ */ v(B, { ...e }), H = class extends u.Component {
397
397
  e.categories !== this.props.categories && (this._updateTimer && clearTimeout(this._updateTimer), this._updateTimer = setTimeout(() => this.measureHiddenLabel(), 50)), this.reportLabelOverhang(), this.reportRangeLabelOverhang();
398
398
  }
399
399
  render() {
400
- let { graphProps: n, xBand: r, leftAxis: i, onChange: a, onChangeCategory: s, categories: c = [], top: l, defineChart: u, chartingOptions: d, changeInteractiveEnabled: f, changeEditableEnabled: p, autoFocus: m, onAutoFocusUsed: h, error: g, showCorrectness: _, language: b } = this.props, { scale: x = {}, range: S = {}, size: C = {} } = n || {}, w = r && typeof r.rangeRound == "function" && r.rangeRound([0, C.width]), { bandWidth: T, barWidth: E, rotate: D } = this.labelLayout(), O = o({
400
+ let { graphProps: e, xBand: t, leftAxis: n, onChange: r, onChangeCategory: i, categories: s = [], top: c, defineChart: l, chartingOptions: u, changeInteractiveEnabled: d, changeEditableEnabled: f, autoFocus: p, onAutoFocusUsed: m, error: h, showCorrectness: _, language: v } = this.props, { scale: y = {}, range: S = {}, size: C = {} } = e || {}, w = t && typeof t.rangeRound == "function" && t.rangeRound([0, C.width]), { bandWidth: T, barWidth: E, rotate: D } = this.labelLayout(), O = g({
401
401
  ...S,
402
402
  step: S.labelStep
403
403
  });
404
- return /* @__PURE__ */ y(j, {
404
+ return /* @__PURE__ */ x(j, {
405
405
  ref: (e) => this.axesNode = e,
406
- children: [i && /* @__PURE__ */ v(t, {
407
- scale: x.y,
406
+ children: [n && /* @__PURE__ */ b(o, {
407
+ scale: y.y,
408
408
  tickLength: 10,
409
409
  tickFormat: (e) => `${e}`,
410
410
  tickValues: O,
411
411
  tickComponent: V
412
- }), /* @__PURE__ */ v(e, {
412
+ }), /* @__PURE__ */ b(a, {
413
413
  scale: w,
414
- labelProps: { y: 60 + l },
415
- top: x.y && x.y(S.min),
414
+ labelProps: { y: 60 + c },
415
+ top: y.y && y.y(S.min),
416
416
  textLabelProps: () => ({ textAnchor: "middle" }),
417
417
  tickFormat: (e) => e,
418
- tickComponent: (e) => {
419
- let t = {
418
+ tickComponent: (n) => {
419
+ let a = {
420
420
  hiddenLabelRef: this.setHiddenLabelRef,
421
- categories: c,
422
- xBand: r,
421
+ categories: s,
422
+ xBand: t,
423
423
  bandWidth: T,
424
424
  barWidth: E,
425
425
  rotate: D,
426
- top: l,
427
- defineChart: u,
428
- chartingOptions: d,
429
- autoFocus: m,
430
- onAutoFocusUsed: h,
431
- error: g,
432
- onChangeCategory: s,
433
- changeInteractiveEnabled: f,
434
- changeEditableEnabled: p,
435
- onChange: a,
436
- graphProps: n,
437
- x: e.x,
438
- y: e.y,
439
- formattedValue: e.formattedValue,
426
+ top: c,
427
+ defineChart: l,
428
+ chartingOptions: u,
429
+ autoFocus: p,
430
+ onAutoFocusUsed: m,
431
+ error: h,
432
+ onChangeCategory: i,
433
+ changeInteractiveEnabled: d,
434
+ changeEditableEnabled: f,
435
+ onChange: r,
436
+ graphProps: e,
437
+ x: n.x,
438
+ y: n.y,
439
+ formattedValue: n.formattedValue,
440
440
  showCorrectness: _,
441
- language: b
441
+ language: v
442
442
  };
443
- return /* @__PURE__ */ v(F, { ...t });
443
+ return /* @__PURE__ */ b(F, { ...a });
444
444
  },
445
- autoFocus: m,
446
- onAutoFocusUsed: h
445
+ autoFocus: p,
446
+ onAutoFocusUsed: m
447
447
  })]
448
448
  });
449
449
  }
package/dist/bars/bar.js CHANGED
@@ -1,20 +1,20 @@
1
- import { dataToXBand as e } from "../utils.js";
2
- import { Bars as t } from "./common/bars.js";
3
- import n from "react";
4
- import r from "prop-types";
5
- import { types as i } from "@pie-lib/plot";
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/bar.tsx
8
- var o = class extends n.Component {
8
+ var o = class extends e.Component {
9
9
  static propTypes = {
10
- data: r.array,
11
- onChange: r.func,
12
- graphProps: i.GraphPropsType.isRequired
10
+ data: t.array,
11
+ onChange: t.func,
12
+ graphProps: n.GraphPropsType.isRequired
13
13
  };
14
14
  render() {
15
- let n = this.props, { data: r, graphProps: i } = n, { scale: o = {}, size: s = {} } = i || {}, c = e(o.x, r, s.width, "bar");
16
- return /* @__PURE__ */ a(t, {
17
- ...n,
15
+ let e = this.props, { data: t, graphProps: n } = e, { scale: o = {}, size: s = {} } = n || {}, c = r(o.x, t, s.width, "bar");
16
+ return /* @__PURE__ */ a(i, {
17
+ ...e,
18
18
  xBand: c
19
19
  });
20
20
  }