@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/grid.js CHANGED
@@ -1,31 +1,31 @@
1
- import e from "./node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridColumns.js";
2
- import t from "./node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridRows.js";
3
- import n from "react";
4
- import r from "prop-types";
5
- import { styled as i } from "@mui/material/styles";
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import { styled as n } from "@mui/material/styles";
4
+ import r from "./node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridColumns.js";
5
+ import i from "./node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridRows.js";
6
6
  import { types as a } from "@pie-lib/plot";
7
7
  import { color as o } from "@pie-lib/render-ui";
8
8
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
9
  // src/grid.tsx
10
- var l = i("g")(() => ({ stroke: o.primaryLight() })), u = class extends n.Component {
10
+ var l = n("g")(() => ({ stroke: o.primaryLight() })), u = class extends e.Component {
11
11
  static propTypes = {
12
- className: r.string,
12
+ className: t.string,
13
13
  graphProps: a.GraphPropsType.isRequired,
14
- xBand: r.func,
15
- columnTickValues: r.array,
16
- rowTickValues: r.array
14
+ xBand: t.func,
15
+ columnTickValues: t.array,
16
+ rowTickValues: t.array
17
17
  };
18
18
  static defaultProps = {};
19
19
  render() {
20
- let { graphProps: n, xBand: r, rowTickValues: i, columnTickValues: a } = this.props, { scale: u = {}, size: d = {}, range: f = {} } = n || {}, { step: p = 0, labelStep: m = 0 } = f, h = p && m && p < m, g = (e, t) => {
20
+ let { graphProps: e, xBand: t, rowTickValues: n, columnTickValues: a } = this.props, { scale: u = {}, size: d = {}, range: f = {} } = e || {}, { step: p = 0, labelStep: m = 0 } = f, h = p && m && p < m, g = (e, t) => {
21
21
  let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = 10 ** Math.max(n, r);
22
22
  return e * i % (t * i) / i;
23
- }, { unlabeledLines: _, labeledLines: v } = (i || []).reduce((e, t) => (h && g(t, m) !== 0 ? e.unlabeledLines.push(t) : e.labeledLines.push(t), e), {
23
+ }, { unlabeledLines: _, labeledLines: v } = (n || []).reduce((e, t) => (h && g(t, m) !== 0 ? e.unlabeledLines.push(t) : e.labeledLines.push(t), e), {
24
24
  unlabeledLines: [],
25
25
  labeledLines: []
26
26
  });
27
27
  return /* @__PURE__ */ c(l, { children: [
28
- /* @__PURE__ */ s(t, {
28
+ /* @__PURE__ */ s(i, {
29
29
  scale: u.y,
30
30
  width: d.width,
31
31
  tickValues: _,
@@ -34,7 +34,7 @@ var l = i("g")(() => ({ stroke: o.primaryLight() })), u = class extends n.Compon
34
34
  strokeWidth: 1
35
35
  }
36
36
  }),
37
- /* @__PURE__ */ s(t, {
37
+ /* @__PURE__ */ s(i, {
38
38
  scale: u.y,
39
39
  width: d.width,
40
40
  tickValues: v,
@@ -43,10 +43,10 @@ var l = i("g")(() => ({ stroke: o.primaryLight() })), u = class extends n.Compon
43
43
  strokeWidth: 1
44
44
  }
45
45
  }),
46
- /* @__PURE__ */ s(e, {
47
- scale: r,
46
+ /* @__PURE__ */ s(r, {
47
+ scale: t,
48
48
  height: d.height,
49
- offset: r.bandwidth() / 2,
49
+ offset: t.bandwidth() / 2,
50
50
  tickValues: a
51
51
  })
52
52
  ] });
@@ -1,9 +1,9 @@
1
- import e from "./en-US.js";
2
- import { defineCatalogs as t } from "@pie-element/shared-i18n";
1
+ import { defineCatalogs as e } from "@pie-element/shared-i18n";
2
+ import t from "./en-US.js";
3
3
  // src/i18n/index.ts
4
- var n = t({
4
+ var n = e({
5
5
  packageName: "@pie-lib/charting",
6
- source: e,
6
+ source: t,
7
7
  loaders: {
8
8
  es: () => import(
9
9
  /* webpackMode: "eager" */
@@ -1,49 +1,49 @@
1
- import { catalogs as e } from "./i18n/index.js";
2
- import { useReducer as t } from "react";
3
- import n from "prop-types";
4
- import { styled as r } from "@mui/material/styles";
5
- import { color as i } from "@pie-lib/render-ui";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import s from "@mui/icons-material/Check";
8
- import c from "@mui/icons-material/Close";
1
+ import { useReducer as e } from "react";
2
+ import t from "prop-types";
3
+ import { styled as n } from "@mui/material/styles";
4
+ import r from "@mui/icons-material/Check";
5
+ import i from "@mui/icons-material/Close";
6
+ import { color as a } from "@pie-lib/render-ui";
7
+ import { catalogs as o } from "./i18n/index.js";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
9
  // src/key-legend.tsx
10
- var l = r("div")(({ theme: e }) => ({
11
- backgroundColor: i.v("pie")("background", i.defaults.WHITE),
12
- color: i.text(),
10
+ var l = n("div")(({ theme: e }) => ({
11
+ backgroundColor: a.v("pie")("background", a.defaults.WHITE),
12
+ color: a.text(),
13
13
  padding: e.spacing(2),
14
14
  width: "355px",
15
15
  boxShadow: "inset 0px 1px 5px 0px #9297A6",
16
16
  display: "flex",
17
17
  flexDirection: "column",
18
18
  gap: "16px"
19
- })), u = r("div")(() => ({
19
+ })), u = n("div")(() => ({
20
20
  display: "flex",
21
21
  alignItems: "center",
22
22
  gap: "12px"
23
- })), d = r("div")(({ theme: e }) => ({
23
+ })), d = n("div")(({ theme: e }) => ({
24
24
  fontSize: e.typography.h6.fontSize,
25
25
  fontWeight: "700"
26
- })), f = r("div")(() => ({ marginLeft: "2px" })), p = r(s)(({ theme: e }) => ({
27
- backgroundColor: i.correct(),
26
+ })), f = n("div")(() => ({ marginLeft: "2px" })), p = n(r)(({ theme: e }) => ({
27
+ backgroundColor: a.correct(),
28
28
  borderRadius: e.spacing(2),
29
- color: i.defaults.WHITE
30
- })), m = r(c)(({ theme: e }) => ({
31
- backgroundColor: i.incorrectWithIcon(),
29
+ color: a.defaults.WHITE
30
+ })), m = n(i)(({ theme: e }) => ({
31
+ backgroundColor: a.incorrectWithIcon(),
32
32
  borderRadius: e.spacing(2),
33
- color: i.defaults.WHITE
34
- })), h = r("div")(() => ({
33
+ color: a.defaults.WHITE
34
+ })), h = n("div")(() => ({
35
35
  marginLeft: "3px",
36
36
  display: "flex",
37
37
  alignItems: "center",
38
38
  gap: "12px"
39
- })), g = ({ language: n }) => {
40
- let [, r] = t((e) => e + 1, 0), i = e.forLocale(n, r);
41
- return /* @__PURE__ */ o(l, { children: [
42
- /* @__PURE__ */ a(d, { children: i.t("key") }),
43
- /* @__PURE__ */ o(u, { children: [/* @__PURE__ */ a(m, {}), /* @__PURE__ */ a("div", { children: i.t("keyLegend.incorrectAnswer") })] }),
44
- /* @__PURE__ */ o(u, { children: [/* @__PURE__ */ a(p, {}), /* @__PURE__ */ a("div", { children: i.t("keyLegend.correctAnswer") })] }),
45
- /* @__PURE__ */ o(h, { children: [/* @__PURE__ */ a(p, { fontSize: "small" }), /* @__PURE__ */ a(f, { children: i.t("keyLegend.correctKeyAnswer") })] })
39
+ })), g = ({ language: t }) => {
40
+ let [, n] = e((e) => e + 1, 0), r = o.forLocale(t, n);
41
+ return /* @__PURE__ */ c(l, { children: [
42
+ /* @__PURE__ */ s(d, { children: r.t("key") }),
43
+ /* @__PURE__ */ c(u, { children: [/* @__PURE__ */ s(m, {}), /* @__PURE__ */ s("div", { children: r.t("keyLegend.incorrectAnswer") })] }),
44
+ /* @__PURE__ */ c(u, { children: [/* @__PURE__ */ s(p, {}), /* @__PURE__ */ s("div", { children: r.t("keyLegend.correctAnswer") })] }),
45
+ /* @__PURE__ */ c(h, { children: [/* @__PURE__ */ s(p, { fontSize: "small" }), /* @__PURE__ */ s(f, { children: r.t("keyLegend.correctKeyAnswer") })] })
46
46
  ] });
47
47
  };
48
- g.propTypes = { language: n.string };
48
+ g.propTypes = { language: t.string };
49
49
  export { g as default };
@@ -1,17 +1,17 @@
1
- import { clsx as e } from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
- import { disabled as t } from "../../common/styles.js";
3
- import n from "react";
4
- import r from "prop-types";
5
- import { styled as i } from "@mui/material/styles";
6
- import { gridDraggable as a, types as o, utils as s } from "@pie-lib/plot";
7
- import { color as c } from "@pie-lib/render-ui";
1
+ import e from "react";
2
+ import { clsx as t } from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
3
+ import n from "prop-types";
4
+ import { styled as r } from "@mui/material/styles";
5
+ import { gridDraggable as i, types as a, utils as o } from "@pie-lib/plot";
6
+ import { color as s } from "@pie-lib/render-ui";
7
+ import { disabled as c } from "../../common/styles.js";
8
8
  import { jsx as l } from "react/jsx-runtime";
9
9
  // src/line/common/drag-handle.tsx
10
- var u = i("g")(({ theme: e }) => ({
10
+ var u = r("g")(({ theme: e }) => ({
11
11
  color: "black",
12
12
  "& .handle": {
13
13
  transition: "fill 200ms linear, height 200ms linear",
14
- "&.non-interactive": t("fill")
14
+ "&.non-interactive": c("fill")
15
15
  },
16
16
  "& .transparentHandle": {
17
17
  height: "20px",
@@ -19,24 +19,24 @@ var u = i("g")(({ theme: e }) => ({
19
19
  stroke: "transparent"
20
20
  },
21
21
  "& .line": {
22
- stroke: c.defaults.TEXT,
22
+ stroke: s.defaults.TEXT,
23
23
  transition: "fill 200ms linear, height 200ms linear",
24
- "&.non-interactive": t("stroke")
24
+ "&.non-interactive": c("stroke")
25
25
  },
26
26
  "& .disabledPoint": {
27
- fill: c.defaults.BLACK + " !important",
28
- stroke: c.defaults.BLACK + " !important"
27
+ fill: s.defaults.BLACK + " !important",
28
+ stroke: s.defaults.BLACK + " !important"
29
29
  },
30
- "& .correctIcon": { backgroundColor: c.correct() },
31
- "& .incorrectIcon": { backgroundColor: c.incorrectWithIcon() },
30
+ "& .correctIcon": { backgroundColor: s.correct() },
31
+ "& .incorrectIcon": { backgroundColor: s.incorrectWithIcon() },
32
32
  "& .correctnessIcon": {
33
33
  borderRadius: e.spacing(2),
34
- color: c.defaults.WHITE,
34
+ color: s.defaults.WHITE,
35
35
  fontSize: "16px",
36
36
  width: "16px",
37
37
  height: "16px",
38
38
  padding: "2px",
39
- border: `1px solid ${c.defaults.WHITE}`,
39
+ border: `1px solid ${s.defaults.WHITE}`,
40
40
  stroke: "initial",
41
41
  boxSizing: "unset"
42
42
  },
@@ -45,35 +45,35 @@ var u = i("g")(({ theme: e }) => ({
45
45
  width: "10px",
46
46
  height: "10px"
47
47
  }
48
- })), d = class extends n.Component {
48
+ })), d = class extends e.Component {
49
49
  static propTypes = {
50
- x: r.number.isRequired,
51
- y: r.number.isRequired,
52
- width: r.number,
53
- graphProps: o.GraphPropsType.isRequired,
54
- className: r.string,
55
- interactive: r.bool,
56
- CustomDraggableComponent: r.func,
57
- correctness: r.shape({
58
- value: r.string,
59
- label: r.string
50
+ x: n.number.isRequired,
51
+ y: n.number.isRequired,
52
+ width: n.number,
53
+ graphProps: a.GraphPropsType.isRequired,
54
+ className: n.string,
55
+ interactive: n.bool,
56
+ CustomDraggableComponent: n.func,
57
+ correctness: n.shape({
58
+ value: n.string,
59
+ label: n.string
60
60
  })
61
61
  };
62
62
  render() {
63
- let { x: t, y: n, graphProps: r, className: i, interactive: a, CustomDraggableComponent: o, correctness: s, ...c } = this.props, { scale: d } = r;
63
+ let { x: e, y: n, graphProps: r, className: i, interactive: a, CustomDraggableComponent: o, correctness: s, ...c } = this.props, { scale: d } = r;
64
64
  return o ? /* @__PURE__ */ l(u, { children: /* @__PURE__ */ l(o, {
65
65
  scale: d,
66
- x: t,
66
+ x: e,
67
67
  y: n,
68
- className: e(i, !a && "non-interactive"),
68
+ className: t(i, !a && "non-interactive"),
69
69
  correctness: s,
70
70
  interactive: a,
71
71
  ...c
72
72
  }) }) : null;
73
73
  }
74
- }, f = a({
74
+ }, f = i({
75
75
  axis: "y",
76
- fromDelta: (e, t) => (t.x = 0, s.point(e).add(s.point(t)).y),
76
+ fromDelta: (e, t) => (t.x = 0, o.point(e).add(o.point(t)).y),
77
77
  bounds: (e, { domain: t, range: n }) => {
78
78
  let r = {
79
79
  left: 0,
@@ -81,7 +81,7 @@ var u = i("g")(({ theme: e }) => ({
81
81
  bottom: e.y,
82
82
  right: 0
83
83
  };
84
- return s.bounds(r, t, n);
84
+ return o.bounds(r, t, n);
85
85
  },
86
86
  anchorPoint: (e) => ({
87
87
  x: e.x,
@@ -1,12 +1,12 @@
1
- import e from "../../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
2
- import t from "../../node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/LinePath.js";
3
- import n, { DragHandle as r } from "./drag-handle.js";
4
- import { MarkSlider as i } from "../../common/mark-slider.js";
5
- import a from "react";
6
- import o from "prop-types";
7
- import { styled as s } from "@mui/material/styles";
8
- import { isEqual as c } from "@pie-element/shared-lodash";
9
- import { types as l } from "@pie-lib/plot";
1
+ import e from "react";
2
+ import t from "../../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
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 "prop-types";
5
+ import { types as i } from "@pie-lib/plot";
6
+ import a, { DragHandle as o } from "./drag-handle.js";
7
+ import { MarkSlider as s } from "../../common/mark-slider.js";
8
+ import { styled as c } from "@mui/material/styles";
9
+ import { isEqual as l } from "@pie-element/shared-lodash";
10
10
  import { color as u } from "@pie-lib/render-ui";
11
11
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
12
  // src/line/common/line.tsx
@@ -17,28 +17,28 @@ var p = (e, t) => {
17
17
  x: r > 1 ? t * (n / (r - 1)) : .5,
18
18
  y: e.value
19
19
  }));
20
- }, m = s(t)(() => ({
20
+ }, m = c(n)(() => ({
21
21
  fill: "transparent",
22
22
  stroke: u.defaults.TERTIARY,
23
23
  strokeWidth: 3,
24
24
  transition: "stroke 200ms ease-in, stroke-width 200ms ease-in"
25
- })), h = class extends a.Component {
25
+ })), h = class extends e.Component {
26
26
  static propTypes = {
27
- onChange: o.func,
28
- value: o.number,
29
- label: o.string,
30
- xBand: o.func,
31
- index: o.number.isRequired,
32
- graphProps: l.GraphPropsType.isRequired,
33
- defineChart: o.bool,
34
- disabled: o.bool,
35
- data: o.arrayOf(o.shape({
36
- label: o.string,
37
- value: o.number
27
+ onChange: r.func,
28
+ value: r.number,
29
+ label: r.string,
30
+ xBand: r.func,
31
+ index: r.number.isRequired,
32
+ graphProps: i.GraphPropsType.isRequired,
33
+ defineChart: r.bool,
34
+ disabled: r.bool,
35
+ data: r.arrayOf(r.shape({
36
+ label: r.string,
37
+ value: r.number
38
38
  })),
39
- CustomDraggableComponent: o.func,
40
- correctData: o.array,
41
- language: o.string
39
+ CustomDraggableComponent: r.func,
40
+ correctData: r.array,
41
+ language: r.string
42
42
  };
43
43
  static defaultProps = { index: 0 };
44
44
  constructor(e) {
@@ -48,7 +48,7 @@ var p = (e, t) => {
48
48
  };
49
49
  }
50
50
  UNSAFE_componentWillReceiveProps(e) {
51
- c(this.props.data, e.data) || this.setState({ line: p(e.data, e.graphProps.domain) });
51
+ l(this.props.data, e.data) || this.setState({ line: p(e.data, e.graphProps.domain) });
52
52
  }
53
53
  componentDidUpdate(e) {
54
54
  this.props.disabled && !e.disabled && this.state.dragging && this.setState({
@@ -75,69 +75,69 @@ var p = (e, t) => {
75
75
  r[e].dragValue = n, this.setDragValue(r);
76
76
  };
77
77
  render() {
78
- let { graphProps: e, data: t, CustomDraggableComponent: o, defineChart: s, correctData: c, disabled: l, language: u } = this.props, { line: h, dragging: g } = this.state, { scale: _ } = e, v = g ? h : p(t, e.domain);
79
- return /* @__PURE__ */ f(a.Fragment, { children: [/* @__PURE__ */ d(m, {
78
+ let { graphProps: t, data: n, CustomDraggableComponent: r, defineChart: i, correctData: c, disabled: l, language: u } = this.props, { line: h, dragging: g } = this.state, { scale: _ } = t, v = g ? h : p(n, t.domain);
79
+ return /* @__PURE__ */ f(e.Fragment, { children: [/* @__PURE__ */ d(m, {
80
80
  data: v,
81
81
  x: (e) => _.x(e.x),
82
82
  y: (e) => _.y(e.dragValue === void 0 ? e.y : e.dragValue),
83
83
  className: "line"
84
- }), v && v.map((t, a) => {
85
- let f = s || t.interactive, p = f ? n : r, m = t.dragValue === void 0 ? t.y : t.dragValue;
86
- return /* @__PURE__ */ d(i, {
84
+ }), v && v.map((e, n) => {
85
+ let f = i || e.interactive, p = f ? a : o, m = e.dragValue === void 0 ? e.y : e.dragValue;
86
+ return /* @__PURE__ */ d(s, {
87
87
  enabled: f && !l,
88
- label: t.label,
89
- index: a,
88
+ label: e.label,
89
+ index: n,
90
90
  value: m,
91
- graphProps: e,
91
+ graphProps: t,
92
92
  language: u,
93
93
  focusBox: {
94
- x: _.x(t.x) - 14,
94
+ x: _.x(e.x) - 14,
95
95
  y: _.y(m) - 14,
96
96
  width: 28,
97
97
  height: 28
98
98
  },
99
- onChange: (e) => this.changeValue(a, t, e),
99
+ onChange: (t) => this.changeValue(n, e, t),
100
100
  children: /* @__PURE__ */ d(p, {
101
- x: t.x,
101
+ x: e.x,
102
102
  y: m,
103
103
  interactive: f,
104
104
  disabled: l,
105
105
  r: 6,
106
106
  onDragStart: () => this.setState({ dragging: !0 }),
107
- onDrag: (e) => this.dragValue(a, m, e),
108
- onDragStop: () => this.dragStop(a),
109
- graphProps: e,
110
- CustomDraggableComponent: o,
111
- correctness: t.correctness,
107
+ onDrag: (e) => this.dragValue(n, m, e),
108
+ onDragStop: () => this.dragStop(n),
109
+ graphProps: t,
110
+ CustomDraggableComponent: r,
111
+ correctness: e.correctness,
112
112
  correctData: c,
113
- label: t.label
113
+ label: e.label
114
114
  })
115
- }, `point-${t.x}-${a}`);
115
+ }, `point-${e.x}-${n}`);
116
116
  })] });
117
117
  }
118
- }, g = s(h)(() => ({ "& .line": {
118
+ }, g = c(h)(() => ({ "& .line": {
119
119
  fill: "transparent",
120
120
  stroke: u.defaults.TERTIARY,
121
121
  strokeWidth: 3,
122
122
  transition: "stroke 200ms ease-in, stroke-width 200ms ease-in"
123
- } })), _ = class extends a.Component {
123
+ } })), _ = class extends e.Component {
124
124
  static propTypes = {
125
- data: o.array,
126
- onChange: o.func,
127
- xBand: o.func,
128
- graphProps: l.GraphPropsType.isRequired,
129
- CustomDraggableComponent: o.func,
130
- defineChart: o.bool,
131
- correctData: o.array
125
+ data: r.array,
126
+ onChange: r.func,
127
+ xBand: r.func,
128
+ graphProps: i.GraphPropsType.isRequired,
129
+ CustomDraggableComponent: r.func,
130
+ defineChart: r.bool,
131
+ correctData: r.array
132
132
  };
133
133
  changeLine = (e, t) => {
134
134
  let { onChange: n } = this.props, r = [...this.props.data], { dragValue: i, value: a } = t;
135
135
  r[e].value = i >= 0 ? i : a, n(r);
136
136
  };
137
137
  render() {
138
- let t = this.props;
139
- return /* @__PURE__ */ d(e, { children: /* @__PURE__ */ d(g, {
140
- ...t,
138
+ let e = this.props;
139
+ return /* @__PURE__ */ d(t, { children: /* @__PURE__ */ d(g, {
140
+ ...e,
141
141
  onChange: this.changeLine
142
142
  }) });
143
143
  }
@@ -1,71 +1,71 @@
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 { Line as r } from "./common/line.js";
5
- import { CorrectnessIndicator as i, SmallCorrectPointIndicator as a } from "../common/correctness-indicators.js";
6
- import { useDragHover as o } from "../common/drag-hover.js";
7
- import s from "react";
8
- import c from "prop-types";
9
- import { styled as l } from "@mui/material/styles";
10
- import { types as u } from "@pie-lib/plot";
11
- import { color as d } 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 { color as a } from "@pie-lib/render-ui";
7
+ import { dataToXBand as o } from "../utils.js";
8
+ import { types as s } from "@pie-lib/plot";
9
+ import { Line as c } from "./common/line.js";
10
+ import { CorrectnessIndicator as l, SmallCorrectPointIndicator as u } from "../common/correctness-indicators.js";
11
+ import { useDragHover as d } from "../common/drag-hover.js";
12
12
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
13
13
  // src/line/line-cross.tsx
14
- var m = l(e)(() => ({
15
- stroke: d.defaults.TEXT,
14
+ var m = i(n)(() => ({
15
+ stroke: a.defaults.TEXT,
16
16
  transition: "fill 200ms linear, height 200ms linear",
17
- "&.non-interactive": { stroke: d.disabled?.() || "#ccc" }
18
- })), h = l(t, { shouldForwardProp: (e) => e !== "correctness" && e !== "interactive" })(({ correctness: e, interactive: t }) => ({
19
- stroke: d.defaults.TEXT,
17
+ "&.non-interactive": { stroke: a.disabled?.() || "#ccc" }
18
+ })), h = i(r, { shouldForwardProp: (e) => e !== "correctness" && e !== "interactive" })(({ correctness: e, interactive: t }) => ({
19
+ stroke: a.defaults.TEXT,
20
20
  transition: "fill 200ms linear, height 200ms linear",
21
21
  ...e && !t && {
22
- fill: `${d.defaults.BLACK} !important`,
23
- stroke: `${d.defaults.BLACK} !important`
22
+ fill: `${a.defaults.BLACK} !important`,
23
+ stroke: `${a.defaults.BLACK} !important`
24
24
  },
25
- "&.non-interactive": { stroke: d.disabled?.() || "#ccc" }
26
- })), g = l("circle")(() => ({
25
+ "&.non-interactive": { stroke: a.disabled?.() || "#ccc" }
26
+ })), g = i("circle")(() => ({
27
27
  height: "20px",
28
28
  fill: "transparent",
29
29
  stroke: "transparent"
30
30
  })), _ = (e) => {
31
- let { className: t, scale: n, x: r, y: s, r: c, correctness: l, interactive: u, correctData: _, label: v, isDragging: y, disabled: b, onDragStart: x, onDrag: S, onDragStop: C, ...w } = e, { hovered: T, onEnter: E, onLeave: D } = o(!!y && !b), O = c * 4, k = O / 2, A = n.x(r), j = n.y(s);
31
+ let { className: t, scale: n, x: r, y: i, r: o, correctness: s, interactive: c, correctData: _, label: v, isDragging: y, disabled: b, onDragStart: x, onDrag: S, onDragStop: C, ...w } = e, { hovered: T, onEnter: E, onLeave: D } = d(!!y && !b), O = o * 4, k = O / 2, A = n.x(r), j = n.y(i);
32
32
  return /* @__PURE__ */ p(h, {
33
33
  className: t,
34
- correctness: l,
35
- interactive: u,
34
+ correctness: s,
35
+ interactive: c,
36
36
  children: [
37
37
  /* @__PURE__ */ f(m, {
38
38
  data: [{
39
- x: n.x(r) - c,
40
- y: n.y(s) + c
39
+ x: n.x(r) - o,
40
+ y: n.y(i) + o
41
41
  }, {
42
- x: n.x(r) + c,
43
- y: n.y(s) - c
42
+ x: n.x(r) + o,
43
+ y: n.y(i) - o
44
44
  }],
45
45
  x: (e) => e.x,
46
46
  y: (e) => e.y,
47
47
  strokeWidth: 5,
48
48
  style: { pointerEvents: "none" }
49
- }, `point-${r}-${s}-1`),
49
+ }, `point-${r}-${i}-1`),
50
50
  /* @__PURE__ */ f(m, {
51
51
  data: [{
52
- x: n.x(r) - c,
53
- y: n.y(s) - c
52
+ x: n.x(r) - o,
53
+ y: n.y(i) - o
54
54
  }, {
55
- x: n.x(r) + c,
56
- y: n.y(s) + c
55
+ x: n.x(r) + o,
56
+ y: n.y(i) + o
57
57
  }],
58
58
  x: (e) => e.x,
59
59
  y: (e) => e.y,
60
60
  strokeWidth: 5,
61
61
  style: { pointerEvents: "none" }
62
- }, `point-${r}-${s}-2`),
62
+ }, `point-${r}-${i}-2`),
63
63
  T && /* @__PURE__ */ f("rect", {
64
64
  x: A - k,
65
65
  y: j - k,
66
66
  width: O,
67
67
  height: O,
68
- stroke: d.defaults.BORDER_GRAY,
68
+ stroke: a.defaults.BORDER_GRAY,
69
69
  fill: "none",
70
70
  strokeWidth: 2,
71
71
  pointerEvents: "none"
@@ -73,24 +73,24 @@ var m = l(e)(() => ({
73
73
  /* @__PURE__ */ f(g, {
74
74
  cx: A,
75
75
  cy: j,
76
- r: c * 2,
76
+ r: o * 2,
77
77
  onMouseEnter: E,
78
78
  onMouseLeave: D,
79
79
  ...w
80
80
  }),
81
- /* @__PURE__ */ f(i, {
81
+ /* @__PURE__ */ f(l, {
82
82
  scale: n,
83
83
  x: r,
84
- y: s,
85
- r: c,
86
- correctness: l,
87
- interactive: u
84
+ y: i,
85
+ r: o,
86
+ correctness: s,
87
+ interactive: c
88
88
  }),
89
- /* @__PURE__ */ f(a, {
89
+ /* @__PURE__ */ f(u, {
90
90
  scale: n,
91
91
  x: r,
92
- r: c,
93
- correctness: l,
92
+ r: o,
93
+ correctness: s,
94
94
  correctData: _,
95
95
  label: v
96
96
  })
@@ -98,30 +98,30 @@ var m = l(e)(() => ({
98
98
  });
99
99
  };
100
100
  _.propTypes = {
101
- scale: c.object,
102
- x: c.number,
103
- y: c.number,
104
- r: c.number,
105
- className: c.string,
106
- correctness: c.shape({
107
- value: c.string,
108
- label: c.string
101
+ scale: t.object,
102
+ x: t.number,
103
+ y: t.number,
104
+ r: t.number,
105
+ className: t.string,
106
+ correctness: t.shape({
107
+ value: t.string,
108
+ label: t.string
109
109
  }),
110
- interactive: c.bool,
111
- correctData: c.array,
112
- label: c.string
110
+ interactive: t.bool,
111
+ correctData: t.array,
112
+ label: t.string
113
113
  };
114
- var v = class extends s.Component {
114
+ var v = class extends e.Component {
115
115
  static propTypes = {
116
- data: c.array,
117
- onChange: c.func,
118
- graphProps: u.GraphPropsType.isRequired
116
+ data: t.array,
117
+ onChange: t.func,
118
+ graphProps: s.GraphPropsType.isRequired
119
119
  };
120
120
  render() {
121
- let e = this.props, { data: t, graphProps: i } = e, { scale: a = {}, size: o = {} } = i || {}, s = n(a.x, t, o.width, "lineCross");
122
- return /* @__PURE__ */ f(r, {
121
+ let e = this.props, { data: t, graphProps: n } = e, { scale: r = {}, size: i = {} } = n || {}, a = o(r.x, t, i.width, "lineCross");
122
+ return /* @__PURE__ */ f(c, {
123
123
  ...e,
124
- xBand: s,
124
+ xBand: a,
125
125
  CustomDraggableComponent: _
126
126
  });
127
127
  }