@pie-lib/charting 8.0.1-next.20261006030823 → 8.0.1-next.20261006035546

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.
@@ -2,16 +2,17 @@ import e from "../../node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_m
2
2
  import t from "../../node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Bar.js";
3
3
  import { bandKey as n } from "../../utils.js";
4
4
  import { D as r, DragHandle as i } from "../../common/drag-handle.js";
5
- import { CorrectCheckIcon as a } from "./correct-check-icon.js";
6
- import o from "react";
7
- import s from "prop-types";
8
- import { styled as c } from "@mui/material/styles";
9
- import l from "debug";
10
- import { types as u } from "@pie-lib/plot";
11
- import { color as d } from "@pie-lib/render-ui";
12
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { MarkSlider as a } from "../../common/mark-slider.js";
6
+ import { CorrectCheckIcon as o } from "./correct-check-icon.js";
7
+ import s from "react";
8
+ import c from "prop-types";
9
+ import { styled as l } from "@mui/material/styles";
10
+ import u from "debug";
11
+ import { types as d } from "@pie-lib/plot";
12
+ import { color as f } from "@pie-lib/render-ui";
13
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
14
  //#region src/bars/common/bars.tsx
14
- var h = l("pie-lib:chart:bars"), g = [
15
+ var g = u("pie-lib:chart:bars"), _ = [
15
16
  "#006699",
16
17
  "#F59B00",
17
18
  "#08916D",
@@ -24,7 +25,7 @@ var h = l("pie-lib:chart:bars"), g = [
24
25
  "#4FD2D2",
25
26
  "#F0E442",
26
27
  "#E287B2"
27
- ], _ = [
28
+ ], v = [
28
29
  "#003754",
29
30
  "#975616",
30
31
  "#00503B",
@@ -37,23 +38,24 @@ var h = l("pie-lib:chart:bars"), g = [
37
38
  "#167A7A",
38
39
  "#91862D",
39
40
  "#894A65"
40
- ], v = (e, t, n, r, i) => e && t && i ? r[n % r.length] : e && i ? d.visualElementsColors.ROLLOVER_FILL_BAR_COLOR : t || null, y = c(t)(() => ({ fill: d.defaults.TERTIARY })), b = class extends o.Component {
41
+ ], y = (e, t, n, r, i) => e && t && i ? r[n % r.length] : e && i ? f.visualElementsColors.ROLLOVER_FILL_BAR_COLOR : t || null, b = l(t)(() => ({ fill: f.defaults.TERTIARY })), x = 10, S = class extends s.Component {
41
42
  static propTypes = {
42
- barColor: s.string,
43
- onChangeCategory: s.func,
44
- value: s.number,
45
- label: s.string,
46
- xBand: s.func,
47
- index: s.number.isRequired,
48
- graphProps: u.GraphPropsType.isRequired,
49
- interactive: s.bool,
50
- disabled: s.bool,
51
- correctness: s.shape({
52
- value: s.string,
53
- label: s.string
43
+ barColor: c.string,
44
+ onChangeCategory: c.func,
45
+ value: c.number,
46
+ label: c.string,
47
+ xBand: c.func,
48
+ index: c.number.isRequired,
49
+ graphProps: d.GraphPropsType.isRequired,
50
+ interactive: c.bool,
51
+ disabled: c.bool,
52
+ correctness: c.shape({
53
+ value: c.string,
54
+ label: c.string
54
55
  }),
55
- correctData: s.array,
56
- defineChart: s.bool
56
+ correctData: c.array,
57
+ defineChart: c.bool,
58
+ language: c.string
57
59
  };
58
60
  constructor(e) {
59
61
  super(e), this.state = {
@@ -79,85 +81,103 @@ var h = l("pie-lib:chart:bars"), g = [
79
81
  handleMouseEnter = () => this.setState({ isHovered: !0 });
80
82
  handleMouseLeave = () => this.setState({ isHovered: !1 });
81
83
  setDragValue = (e) => this.setState({ dragValue: e });
84
+ changeValue = (e) => {
85
+ let { label: t, onChangeCategory: n } = this.props;
86
+ n({
87
+ label: t,
88
+ value: e
89
+ });
90
+ };
82
91
  dragStop = () => {
83
- let { label: e, onChangeCategory: t } = this.props, { dragValue: n } = this.state;
84
- h("[dragStop]", n), n !== void 0 && t({
85
- label: e,
86
- value: n
87
- }), this.setDragValue(void 0);
92
+ let { dragValue: e } = this.state;
93
+ g("[dragStop]", e), e !== void 0 && this.changeValue(e), this.setDragValue(void 0);
88
94
  };
89
95
  dragValue = (e, t) => {
90
- h("[dragValue] next:", t), this.setDragValue(t);
96
+ g("[dragValue] next:", t), this.setDragValue(t);
91
97
  };
92
98
  render() {
93
- let { graphProps: e, value: t, label: o, xBand: s, index: c, interactive: l, disabled: u, correctness: h, barColor: g, defineChart: b, correctData: x } = this.props, { scale: S, range: C } = e, { dragValue: w, isHovered: T } = this.state, E = v(T, g, c, _, l && !h), D = Number.isFinite(w) ? w : t, O = s.bandwidth(), k = S.y(C.max - D), A = s(n({ label: o }, c)), j = C.max - D, M = C.max - j, N = x ? x.find((e) => e.label === o) : null, P = l ? r : i, F = !!g;
94
- return /* @__PURE__ */ m("g", {
99
+ let { graphProps: e, value: t, label: s, xBand: c, index: l, interactive: u, disabled: d, correctness: g, barColor: _, defineChart: S, correctData: C, language: w } = this.props, { scale: T, range: E } = e, { dragValue: D, isHovered: O } = this.state, k = y(O, _, l, v, u && !g), A = Number.isFinite(D) ? D : t, j = c.bandwidth(), M = T.y(E.max - A), N = c(n({ label: s }, l)), P = E.max - A, F = E.max - P, I = C ? C.find((e) => e.label === s) : null, L = u ? r : i, R = !!_;
100
+ return /* @__PURE__ */ h(a, {
95
101
  ref: (e) => this.gRef = e,
96
102
  onMouseEnter: this.handleMouseEnter,
97
103
  onMouseLeave: this.handleMouseLeave,
98
104
  onTouchStart: this.handleMouseEnter,
99
105
  onTouchEnd: this.handleMouseLeave,
106
+ enabled: u && !d,
107
+ label: s,
108
+ index: l,
109
+ value: A,
110
+ graphProps: e,
111
+ language: w,
112
+ focusBox: {
113
+ x: N,
114
+ y: T.y(F) - x,
115
+ width: j,
116
+ height: Math.max(0, M) + x
117
+ },
118
+ onChange: this.changeValue,
100
119
  children: [
101
- /* @__PURE__ */ p(y, {
102
- x: A,
103
- y: S.y(M),
104
- width: O,
105
- height: k,
106
- style: { fill: E }
120
+ /* @__PURE__ */ m(b, {
121
+ x: N,
122
+ y: T.y(F),
123
+ width: j,
124
+ height: M,
125
+ style: { fill: k }
107
126
  }),
108
- h && h.value === "incorrect" && (() => {
109
- let e = parseFloat(N && N.value);
127
+ g && g.value === "incorrect" && (() => {
128
+ let e = parseFloat(I && I.value);
110
129
  if (isNaN(e)) return null;
111
- let t = S.y(C.max - e), n = k, r = Math.abs(t - n), i = S.y(e), o = t > n ? d.borderGray() : d.defaults.WHITE, s = t > n ? i : i - r;
112
- return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(y, {
113
- x: A + 2,
130
+ let t = T.y(E.max - e), n = M, r = Math.abs(t - n), i = T.y(e), a = t > n ? f.borderGray() : f.defaults.WHITE, s = t > n ? i : i - r;
131
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(b, {
132
+ x: N + 2,
114
133
  y: s,
115
- width: O - 4,
134
+ width: j - 4,
116
135
  height: r,
117
136
  style: {
118
- stroke: o,
137
+ stroke: a,
119
138
  strokeWidth: 2,
120
139
  strokeDasharray: "5,2",
121
140
  fill: "none"
122
141
  }
123
- }), /* @__PURE__ */ p("foreignObject", {
124
- x: A + O - (F ? 24 : 14),
142
+ }), /* @__PURE__ */ m("foreignObject", {
143
+ x: N + j - (R ? 24 : 14),
125
144
  y: i - 12,
126
145
  width: 24,
127
146
  height: 24,
128
- children: /* @__PURE__ */ p(a, { dashColor: o })
147
+ children: /* @__PURE__ */ m(o, { dashColor: a })
129
148
  })] });
130
149
  })(),
131
- /* @__PURE__ */ p(P, {
132
- x: A,
133
- y: D,
134
- defineChart: b,
135
- interactive: l,
136
- disabled: u,
137
- width: O,
150
+ /* @__PURE__ */ m(L, {
151
+ x: N,
152
+ y: A,
153
+ defineChart: S,
154
+ interactive: u,
155
+ disabled: d,
156
+ width: j,
138
157
  onDrag: (e) => this.dragValue(t, e),
139
158
  onDragStop: this.dragStop,
140
159
  graphProps: e,
141
- correctness: h,
142
- isHovered: T,
143
- color: E
160
+ correctness: g,
161
+ isHovered: O,
162
+ color: k
144
163
  })
145
164
  ]
146
165
  });
147
166
  }
148
- }, x = b, S = class extends o.Component {
167
+ }, C = S, w = class extends s.Component {
149
168
  static propTypes = {
150
- data: s.array,
151
- correctData: s.array,
152
- onChangeCategory: s.func,
153
- defineChart: s.bool,
154
- xBand: s.func,
155
- graphProps: u.GraphPropsType.isRequired,
156
- histogram: s.bool
169
+ data: c.array,
170
+ correctData: c.array,
171
+ onChangeCategory: c.func,
172
+ defineChart: c.bool,
173
+ xBand: c.func,
174
+ graphProps: d.GraphPropsType.isRequired,
175
+ histogram: c.bool,
176
+ language: c.string
157
177
  };
158
178
  render() {
159
- let { data: t, graphProps: n, xBand: r, onChangeCategory: i, defineChart: a, histogram: o, correctData: s, disabled: c } = this.props;
160
- return /* @__PURE__ */ p(e, { children: (t || []).map((e, t) => /* @__PURE__ */ p(x, {
179
+ let { data: t, graphProps: n, xBand: r, onChangeCategory: i, defineChart: a, histogram: o, correctData: s, disabled: c, language: l } = this.props;
180
+ return /* @__PURE__ */ m(e, { children: (t || []).map((e, t) => /* @__PURE__ */ m(C, {
161
181
  value: e.value,
162
182
  interactive: a || e.interactive,
163
183
  defineChart: a,
@@ -169,9 +189,10 @@ var h = l("pie-lib:chart:bars"), g = [
169
189
  graphProps: n,
170
190
  correctness: e.correctness,
171
191
  correctData: s,
172
- barColor: o && (g[t] ? g[t] : g[t % g.length])
173
- }, `bar-${e.label}-${e.value}-${t}`)) });
192
+ language: l,
193
+ barColor: o && (_[t] ? _[t] : _[t % _.length])
194
+ }, `bar-${e.label}-${t}`)) });
174
195
  }
175
196
  };
176
197
  //#endregion
177
- export { S as Bars, S as default, b as RawBar };
198
+ export { w as Bars, w as default, S as RawBar };
package/dist/chart.js CHANGED
@@ -1,42 +1,42 @@
1
1
  import { Grid as e } from "./grid.js";
2
- import { dataToXBand as t, getDomainAndRangeByChartType as n, getGridLinesAndAxisByChartType as r, getTopPadding as i } from "./utils.js";
3
- import { RawChartAxes as a } from "./axes.js";
4
- import o from "./chart-types.js";
5
- import { ActionsButton as s } from "./actions-button.js";
6
- import c from "react";
7
- import l from "prop-types";
8
- import { styled as u } from "@mui/material/styles";
9
- import d from "debug";
10
- import { cloneDeep as ee } from "@pie-element/shared-lodash";
11
- import { Root as f, createGraphProps as te, utils as p } from "@pie-lib/plot";
12
- import { AlertDialog as m } from "@pie-lib/config-ui";
13
- import { createUniqueId as h } from "@pie-lib/render-ui";
14
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
15
- import v from "@pie-lib/translator";
2
+ import { dataToXBand as t, getDomainAndRangeByChartType as n, getGridLinesAndAxisByChartType as r, getTopPadding as i, textOf as a } from "./utils.js";
3
+ import { RawChartAxes as o } from "./axes.js";
4
+ import s from "./chart-types.js";
5
+ import { ActionsButton as c } from "./actions-button.js";
6
+ import l from "react";
7
+ import u from "prop-types";
8
+ import { styled as d } from "@mui/material/styles";
9
+ import f from "debug";
10
+ import { cloneDeep as p } from "@pie-element/shared-lodash";
11
+ import { Root as m, createGraphProps as h } from "@pie-lib/plot";
12
+ import { AlertDialog as g } from "@pie-lib/config-ui";
13
+ import { createUniqueId as _ } from "@pie-lib/render-ui";
14
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
+ import b from "@pie-lib/translator";
16
16
  //#region src/chart.tsx
17
- var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({ width: "min-content" })), S = (e) => e ? p.extractTextFromHTML(e).trim() : "", C = ({ title: e, chartType: t, categories: n, range: r, language: i }) => {
18
- let a = {
17
+ var { translator: x } = b, ee = f("pie-lib:charts:chart"), te = d("div")(() => ({ width: "min-content" })), S = ({ title: e, chartType: t, categories: n, range: r, language: i }) => {
18
+ let o = {
19
19
  lng: i,
20
20
  interpolation: { escapeValue: !1 }
21
- }, o = y.t(`charting.chartTypes.${t}`, a), s = S(r.label), c = s ? y.t("charting.labelledValueRange", {
22
- ...a,
23
- label: s,
21
+ }, s = x.t(`charting.chartTypes.${t}`, o), c = a(r.label), l = c ? x.t("charting.labelledValueRange", {
22
+ ...o,
23
+ label: c,
24
24
  min: r.min,
25
25
  max: r.max
26
- }) : y.t("charting.valueRange", {
27
- ...a,
26
+ }) : x.t("charting.valueRange", {
27
+ ...o,
28
28
  min: r.min,
29
29
  max: r.max
30
- }), l = y.t("charting.categories", {
31
- ...a,
30
+ }), u = x.t("charting.categories", {
31
+ ...o,
32
32
  count: n.length,
33
- categories: n.map((e) => S(e.label)).join(", ")
33
+ categories: n.map((e) => a(e.label)).join(", ")
34
34
  });
35
35
  return {
36
- ariaLabel: S(e) || o,
37
- ariaDescription: `${o}. ${l} ${c}`
36
+ ariaLabel: a(e) || s,
37
+ ariaDescription: `${s}. ${u} ${l}`
38
38
  };
39
- }, w = class extends c.Component {
39
+ }, C = class extends l.Component {
40
40
  constructor(e) {
41
41
  super(e), this.state = {
42
42
  dialog: { open: !1 },
@@ -45,54 +45,54 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
45
45
  }, this.maskUid = this.generateMaskId();
46
46
  }
47
47
  static propTypes = {
48
- className: l.string,
49
- chartType: l.string.isRequired,
50
- size: l.shape({
51
- width: l.number,
52
- height: l.number
48
+ className: u.string,
49
+ chartType: u.string.isRequired,
50
+ size: u.shape({
51
+ width: u.number,
52
+ height: u.number
53
53
  }),
54
- domain: l.shape({
55
- label: l.string,
56
- min: l.number,
57
- max: l.number,
58
- axisLabel: l.string
54
+ domain: u.shape({
55
+ label: u.string,
56
+ min: u.number,
57
+ max: u.number,
58
+ axisLabel: u.string
59
59
  }),
60
- data: l.arrayOf(l.shape({
61
- label: l.string,
62
- value: l.number
60
+ data: u.arrayOf(u.shape({
61
+ label: u.string,
62
+ value: u.number
63
63
  })),
64
- range: l.shape({
65
- label: l.string,
66
- min: l.number,
67
- max: l.number,
68
- step: l.number,
69
- labelStep: l.number,
70
- axisLabel: l.string
64
+ range: u.shape({
65
+ label: u.string,
66
+ min: u.number,
67
+ max: u.number,
68
+ step: u.number,
69
+ labelStep: u.number,
70
+ axisLabel: u.string
71
71
  }),
72
- charts: l.array,
73
- labelsPlaceholders: l.object,
74
- title: l.string,
75
- titlePlaceholder: l.string,
76
- onDataChange: l.func,
77
- onChangeLabels: l.func,
78
- onChangeTitle: l.func,
79
- error: l.any,
80
- addCategoryEnabled: l.bool,
81
- showPixelGuides: l.bool,
82
- categoryDefaultLabel: l.string,
83
- categoryDefaults: l.object,
84
- defineChart: l.bool,
85
- disabled: l.bool,
86
- theme: l.object,
87
- chartingOptions: l.object,
88
- changeInteractiveEnabled: l.bool,
89
- changeEditableEnabled: l.bool,
90
- language: l.string,
91
- mathMlOptions: l.object,
92
- labelsCharactersLimit: l.number,
93
- correctData: l.arrayOf(l.shape({
94
- label: l.string,
95
- value: l.number
72
+ charts: u.array,
73
+ labelsPlaceholders: u.object,
74
+ title: u.string,
75
+ titlePlaceholder: u.string,
76
+ onDataChange: u.func,
77
+ onChangeLabels: u.func,
78
+ onChangeTitle: u.func,
79
+ error: u.any,
80
+ addCategoryEnabled: u.bool,
81
+ showPixelGuides: u.bool,
82
+ categoryDefaultLabel: u.string,
83
+ categoryDefaults: u.object,
84
+ defineChart: u.bool,
85
+ disabled: u.bool,
86
+ theme: u.object,
87
+ chartingOptions: u.object,
88
+ changeInteractiveEnabled: u.bool,
89
+ changeEditableEnabled: u.bool,
90
+ language: u.string,
91
+ mathMlOptions: u.object,
92
+ labelsCharactersLimit: u.number,
93
+ correctData: u.arrayOf(u.shape({
94
+ label: u.string,
95
+ value: u.number
96
96
  }))
97
97
  };
98
98
  static defaultProps = { size: {
@@ -101,17 +101,17 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
101
101
  } };
102
102
  state = {
103
103
  charts: [
104
- o.Bar(),
105
- o.Histogram(),
106
- o.LineDot(),
107
- o.LineCross(),
108
- o.DotPlot(),
109
- o.LinePlot()
104
+ s.Bar(),
105
+ s.Histogram(),
106
+ s.LineDot(),
107
+ s.LineCross(),
108
+ s.DotPlot(),
109
+ s.LinePlot()
110
110
  ],
111
111
  autoFocus: !1
112
112
  };
113
113
  generateMaskId() {
114
- return h("chart");
114
+ return _("chart");
115
115
  }
116
116
  setLabelOverhang = (e) => this.setState({ labelOverhang: e });
117
117
  handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
@@ -140,15 +140,15 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
140
140
  let { onDataChange: e, data: t, categoryDefaultLabel: n, defineChart: r, categoryDefaults: i, language: a } = this.props;
141
141
  (t || []).length > 19 ? this.setState({ dialog: {
142
142
  open: !0,
143
- title: y.t("common:warning", { lng: a }),
144
- text: y.t("charting.reachedLimit_other", {
143
+ title: x.t("common:warning", { lng: a }),
144
+ text: x.t("charting.reachedLimit_other", {
145
145
  count: 20,
146
146
  lng: a
147
147
  }),
148
148
  onConfirm: () => this.handleAlertDialog(!1)
149
149
  } }) : (this.setState({ autoFocus: !0 }), e([...t, {
150
150
  inDefineChart: r,
151
- label: n || y.t("charting.newLabel", { lng: a }),
151
+ label: n || x.t("charting.newLabel", { lng: a }),
152
152
  value: 0,
153
153
  deletable: !0,
154
154
  editable: !i || i?.editable,
@@ -170,36 +170,36 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
170
170
  this.setState({ autoFocus: !1 });
171
171
  };
172
172
  render() {
173
- let { domain: o = {}, range: c = {}, chartingOptions: l, size: u, title: d, onChangeTitle: p, onChangeLabels: h, labelsPlaceholders: v, titlePlaceholder: y, addCategoryEnabled: S, 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 = {
174
- left: c?.label || "",
175
- bottom: o?.label || ""
176
- }, { type: z, ChartComponent: B } = this.getChart(), V = this.getFilteredCategories(), H = n(o, c, N), { ariaLabel: U, ariaDescription: W } = C({
173
+ let { domain: a = {}, range: s = {}, chartingOptions: l, size: u, title: d, onChangeTitle: f, onChangeLabels: _, labelsPlaceholders: b, 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 = {
174
+ left: s?.label || "",
175
+ bottom: a?.label || ""
176
+ }, { type: z, ChartComponent: B } = this.getChart(), V = this.getFilteredCategories(), H = n(a, s, N), { ariaLabel: U, ariaDescription: W } = S({
177
177
  title: d,
178
178
  chartType: z,
179
179
  categories: V,
180
180
  range: {
181
181
  ...H.range,
182
- label: c.label
182
+ label: s.label
183
183
  },
184
184
  language: k
185
- }), { verticalLines: G, horizontalLines: K, leftAxis: q } = r(H.range, N), J = { graphProps: te(H.domain, H.range, u, () => this.rootNode) };
186
- b("[render] common:", J);
185
+ }), { verticalLines: G, horizontalLines: K, leftAxis: q } = r(H.range, N), J = { graphProps: h(H.domain, H.range, u, () => this.rootNode) };
186
+ ee("[render] common:", J);
187
187
  let Y = {
188
188
  x: -10,
189
189
  y: -75,
190
190
  width: I + 20,
191
191
  height: L + 130
192
- }, { scale: X } = J.graphProps, Z = t(X.x, V, I, N), ne = Z.bandwidth() || X.x(H.domain.max) / V.length, re = F ? 160 : 60, Q = Math.max(i(ne), this.state.labelOverhang), $ = ee(J);
193
- return $.graphProps.size.height += Q + re, (N === "dotPlot" || N === "linePlot") && j?.length && R.bottom && ($.graphProps.size.height += 25), /* @__PURE__ */ _(x, { children: [/* @__PURE__ */ _(f, {
192
+ }, { scale: X } = J.graphProps, Z = t(X.x, V, I, N), ne = Z.bandwidth() || X.x(H.domain.max) / V.length, re = F ? 160 : 60, Q = Math.max(i(ne), this.state.labelOverhang), $ = p(J);
193
+ return $.graphProps.size.height += Q + re, (N === "dotPlot" || N === "linePlot") && j?.length && R.bottom && ($.graphProps.size.height += 25), /* @__PURE__ */ y(te, { children: [/* @__PURE__ */ y(m, {
194
194
  title: d,
195
- onChangeTitle: p,
195
+ onChangeTitle: f,
196
196
  disabledTitle: !F,
197
197
  showTitle: !0,
198
198
  showLabels: !0,
199
199
  labels: R,
200
- onChangeLabels: h,
201
- labelsPlaceholders: v,
202
- titlePlaceholder: y,
200
+ onChangeLabels: _,
201
+ labelsPlaceholders: b,
202
+ titlePlaceholder: x,
203
203
  defineChart: F,
204
204
  disabledLabels: !F,
205
205
  isChart: !0,
@@ -211,13 +211,13 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
211
211
  ariaDescription: W,
212
212
  ...$,
213
213
  children: [
214
- /* @__PURE__ */ g(e, {
214
+ /* @__PURE__ */ v(e, {
215
215
  ...J,
216
216
  xBand: Z,
217
217
  rowTickValues: K,
218
218
  columnTickValues: G
219
219
  }),
220
- /* @__PURE__ */ g(a, {
220
+ /* @__PURE__ */ v(o, {
221
221
  autoFocus: this.state.autoFocus,
222
222
  onAutoFocusUsed: this.resetAutoFocus,
223
223
  ...J,
@@ -236,18 +236,18 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
236
236
  language: k,
237
237
  onLabelOverhang: this.setLabelOverhang
238
238
  }),
239
- S ? /* @__PURE__ */ g("foreignObject", {
239
+ C ? /* @__PURE__ */ v("foreignObject", {
240
240
  x: I,
241
241
  y: L - 16,
242
242
  width: I,
243
243
  height: L,
244
- children: /* @__PURE__ */ g("div", {
244
+ children: /* @__PURE__ */ v("div", {
245
245
  xmlns: "http://www.w3.org/1999/xhtml",
246
246
  style: {
247
247
  display: "flex",
248
248
  justifyContent: "flex-start"
249
249
  },
250
- children: /* @__PURE__ */ g(s, {
250
+ children: /* @__PURE__ */ v(c, {
251
251
  categories: V,
252
252
  addCategory: this.addCategory,
253
253
  deleteCategory: this.deleteCategory,
@@ -255,16 +255,16 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
255
255
  })
256
256
  })
257
257
  }) : null,
258
- /* @__PURE__ */ g("mask", {
258
+ /* @__PURE__ */ v("mask", {
259
259
  id: `${this.maskUid}`,
260
- children: /* @__PURE__ */ g("rect", {
260
+ children: /* @__PURE__ */ v("rect", {
261
261
  ...Y,
262
262
  fill: "white"
263
263
  })
264
264
  }),
265
- /* @__PURE__ */ g("g", {
265
+ /* @__PURE__ */ v("g", {
266
266
  mask: `url('#${this.maskUid}')`,
267
- children: B && /* @__PURE__ */ g(B, {
267
+ children: B && /* @__PURE__ */ v(B, {
268
268
  ...J,
269
269
  data: V,
270
270
  height: $.graphProps.size.height,
@@ -272,11 +272,12 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
272
272
  onChange: this.changeData,
273
273
  onChangeCategory: this.changeCategory,
274
274
  correctData: j,
275
- disabled: M
275
+ disabled: M,
276
+ language: k
276
277
  })
277
278
  })
278
279
  ]
279
- }), /* @__PURE__ */ g(m, {
280
+ }), /* @__PURE__ */ v(g, {
280
281
  open: P.open,
281
282
  title: P.title,
282
283
  text: P.text,
@@ -286,4 +287,4 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
286
287
  }
287
288
  };
288
289
  //#endregion
289
- export { w as Chart, w as default, C as chartAlternative };
290
+ export { C as Chart, C as default, S as chartAlternative };
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ type SliderGraphProps = {
3
+ range: {
4
+ min: number;
5
+ max: number;
6
+ step?: number;
7
+ labelStep?: number;
8
+ };
9
+ snap: {
10
+ y: (value: number) => number;
11
+ };
12
+ };
13
+ export type FocusBox = {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ };
19
+ export type MarkSliderProps = Omit<React.SVGProps<SVGGElement>, 'onChange' | 'ref'> & {
20
+ /** False for a read-only or disabled mark, which is no slider and takes no focus. */
21
+ enabled: boolean;
22
+ label?: string;
23
+ index: number;
24
+ value: number;
25
+ graphProps: SliderGraphProps;
26
+ language?: string;
27
+ /** The box around the mark that the focus ring is drawn inside. */
28
+ focusBox: FocusBox;
29
+ /** The callback a drag of the mark commits through. */
30
+ onChange: (value: number) => void;
31
+ };
32
+ /**
33
+ * The group a chart mark is drawn in. An enabled mark is an APG slider over the value axis, named
34
+ * by its category: a key moves its value by the step a drag snaps to and commits it through
35
+ * `onChange`. Other props go to the group.
36
+ */
37
+ export declare const MarkSlider: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGGElement>, "onChange" | "ref"> & {
38
+ /** False for a read-only or disabled mark, which is no slider and takes no focus. */
39
+ enabled: boolean;
40
+ label?: string;
41
+ index: number;
42
+ value: number;
43
+ graphProps: SliderGraphProps;
44
+ language?: string;
45
+ /** The box around the mark that the focus ring is drawn inside. */
46
+ focusBox: FocusBox;
47
+ /** The callback a drag of the mark commits through. */
48
+ onChange: (value: number) => void;
49
+ } & React.RefAttributes<SVGGElement>>;
50
+ export default MarkSlider;