@multiplatform.one/components 9.5.0 → 9.6.0

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 (46) hide show
  1. package/dist/cjs/charts/LineChart.cjs +137 -81
  2. package/dist/cjs/charts/LineChart.native.js +209 -93
  3. package/dist/cjs/charts/LineChart.native.js.map +1 -1
  4. package/dist/cjs/charts/SeriesLegend.cjs +85 -0
  5. package/dist/cjs/charts/SeriesLegend.native.js +93 -0
  6. package/dist/cjs/charts/SeriesLegend.native.js.map +1 -0
  7. package/dist/cjs/charts/series.cjs +47 -3
  8. package/dist/cjs/charts/series.native.js +49 -5
  9. package/dist/cjs/charts/series.native.js.map +1 -1
  10. package/dist/esm/charts/LineChart.mjs +138 -82
  11. package/dist/esm/charts/LineChart.mjs.map +1 -1
  12. package/dist/esm/charts/LineChart.native.js +210 -94
  13. package/dist/esm/charts/LineChart.native.js.map +1 -1
  14. package/dist/esm/charts/SeriesLegend.mjs +60 -0
  15. package/dist/esm/charts/SeriesLegend.mjs.map +1 -0
  16. package/dist/esm/charts/SeriesLegend.native.js +65 -0
  17. package/dist/esm/charts/SeriesLegend.native.js.map +1 -0
  18. package/dist/esm/charts/series.mjs +43 -3
  19. package/dist/esm/charts/series.mjs.map +1 -1
  20. package/dist/esm/charts/series.native.js +45 -5
  21. package/dist/esm/charts/series.native.js.map +1 -1
  22. package/dist/jsx/charts/LineChart.mjs +138 -82
  23. package/dist/jsx/charts/LineChart.mjs.map +1 -1
  24. package/dist/jsx/charts/LineChart.native.js +209 -93
  25. package/dist/jsx/charts/LineChart.native.js.map +1 -1
  26. package/dist/jsx/charts/SeriesLegend.mjs +60 -0
  27. package/dist/jsx/charts/SeriesLegend.mjs.map +1 -0
  28. package/dist/jsx/charts/SeriesLegend.native.js +93 -0
  29. package/dist/jsx/charts/SeriesLegend.native.js.map +1 -0
  30. package/dist/jsx/charts/series.mjs +43 -3
  31. package/dist/jsx/charts/series.mjs.map +1 -1
  32. package/dist/jsx/charts/series.native.js +49 -5
  33. package/dist/jsx/charts/series.native.js.map +1 -1
  34. package/package.json +7 -7
  35. package/src/charts/Charts.stories.tsx +25 -0
  36. package/src/charts/LineChart.tsx +185 -105
  37. package/src/charts/SeriesLegend.native.spec.tsx +99 -0
  38. package/src/charts/SeriesLegend.tsx +68 -0
  39. package/src/charts/multiSeriesLine.spec.tsx +111 -0
  40. package/src/charts/series.tsx +73 -11
  41. package/types/charts/LineChart.d.ts +21 -5
  42. package/types/charts/LineChart.d.ts.map +1 -1
  43. package/types/charts/SeriesLegend.d.ts +21 -0
  44. package/types/charts/SeriesLegend.d.ts.map +1 -0
  45. package/types/charts/series.d.ts +18 -1
  46. package/types/charts/series.d.ts.map +1 -1
@@ -26,6 +26,8 @@ __export(LineChart_exports, {
26
26
  LineChart: () => LineChart
27
27
  });
28
28
  module.exports = __toCommonJS(LineChart_exports);
29
+ var import_react = require("react");
30
+ var import_tamagui = require("tamagui");
29
31
  var import_i18n = require("../shared/i18n.cjs");
30
32
  var import_Axis = require("./Axis.cjs");
31
33
  var import_ChartDataView = require("./ChartDataView.cjs");
@@ -34,10 +36,13 @@ var import_accessibility = require("./accessibility.cjs");
34
36
  var import_composeChart = require("./composeChart.cjs");
35
37
  var import_math = require("./math.cjs");
36
38
  var import_series = require("./series.cjs");
39
+ var import_SeriesLegend = require("./SeriesLegend.cjs");
40
+ var import_svg = require("./svg.cjs");
37
41
  var import_useChartTheme = require("./useChartTheme.cjs");
38
42
  var import_jsx_runtime = require("react/jsx-runtime");
39
43
  function LineChart({
40
44
  data,
45
+ series,
41
46
  height = 200,
42
47
  width,
43
48
  color,
@@ -66,96 +71,147 @@ function LineChart({
66
71
  palette,
67
72
  labelFontSize
68
73
  } = (0, import_useChartTheme.useChartTheme)();
69
- const stroke = color ?? palette.single;
74
+ const [hidden, setHidden] = (0, import_react.useState)(() => /* @__PURE__ */new Set());
75
+ const all = series ?? [{
76
+ id: "series",
77
+ label: title ?? "",
78
+ data: data ?? []
79
+ }];
80
+ const multi = all.length > 1;
81
+ const strokes = all.map((entry, index) => multi ? entry.color ?? palette.categorical[index % palette.categorical.length] : color ?? entry.color ?? palette.single);
82
+ const encodings = all.map((_, index) => multi ? (0, import_series.seriesEncoding)(index) : {
83
+ marker: "circle",
84
+ dash: void 0
85
+ });
86
+ const flat = multi ? all.flatMap(entry => entry.data.map(datum => ({
87
+ ...datum,
88
+ label: `${entry.label} ${datum.label}`
89
+ }))) : all[0]?.data ?? [];
70
90
  const format = valueFormatter ?? import_math.formatChartValue;
71
- const ariaLabel = label ?? (0, import_accessibility.describeChart)({
72
- typeLabel: typeLabel ?? (showArea ? t("Area chart") : t("Line chart")),
91
+ const kind = typeLabel ?? (showArea ? t("Area chart") : t("Line chart"));
92
+ const ariaLabel = label ?? (multi ? `${title ? `${kind}, ${title}` : kind}: ${all.length} series. ${all.map(entry => (0, import_accessibility.describeChart)({
93
+ typeLabel: entry.label,
94
+ data: entry.data,
95
+ formatValue: valueFormatter
96
+ })).join(" ")}` : (0, import_accessibility.describeChart)({
97
+ typeLabel: kind,
73
98
  title,
74
- data,
99
+ data: flat,
75
100
  formatValue: valueFormatter
76
- });
101
+ }));
77
102
  const interactive = Boolean(onDatumPress || onDatumHoverIn || onDatumHoverOut);
103
+ const toggle = id => setHidden(current => {
104
+ const next = new Set(current);
105
+ if (next.has(id)) next.delete(id);else next.add(id);
106
+ return next;
107
+ });
108
+ const categories = [];
109
+ for (const entry of all) for (const datum of entry.data) if (!categories.includes(datum.label)) categories.push(datum.label);
110
+ const chart = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ChartSurface.ChartSurface, {
111
+ label: ariaLabel,
112
+ proof: {
113
+ kind: showArea ? "area" : "line",
114
+ separated: false,
115
+ datumText: false,
116
+ datumValues: (0, import_accessibility.chartDatumText)(flat, valueFormatter),
117
+ datumCount: flat.length
118
+ },
119
+ height,
120
+ width,
121
+ ...(multi ? {} : stackProps),
122
+ children: size => {
123
+ const domain = (0, import_math.valueDomain)(flat.map(datum => datum.value));
124
+ const marginScale = (0, import_math.createLinearScale)({
125
+ domain,
126
+ range: [0, 1]
127
+ });
128
+ const tickValues = (0, import_math.getLinearTicks)(marginScale, yTicks);
129
+ const plot = (0, import_composeChart.computeCartesianPlot)(size, {
130
+ showXAxis,
131
+ showYAxis,
132
+ yTickLabels: tickValues.map(value => format(value)),
133
+ fontSize: labelFontSize
134
+ });
135
+ if (plot.width <= 0 || plot.height <= 0 || categories.length === 0) return null;
136
+ const xScale = (0, import_math.createPointScale)({
137
+ domain: categories,
138
+ range: [plot.x, plot.x + plot.width],
139
+ padding: 0.5
140
+ });
141
+ const yScale = (0, import_math.createLinearScale)({
142
+ domain,
143
+ range: [plot.y + plot.height, plot.y]
144
+ });
145
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
146
+ children: [showYAxis || showGrid ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.YAxis, {
147
+ plot,
148
+ scale: yScale,
149
+ ticks: yTicks,
150
+ tickFormat: value => format(value),
151
+ showLabels: showYAxis,
152
+ showGrid
153
+ }) : null, all.map((entry, index) => {
154
+ if (hidden.has(entry.id)) return null;
155
+ const points = entry.data.map(datum => ({
156
+ x: xScale(datum.label) ?? plot.x,
157
+ y: yScale(datum.value)
158
+ }));
159
+ const stroke = strokes[index];
160
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_svg.G, {
161
+ children: [showArea ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.AreaSeries, {
162
+ points,
163
+ baseline: plot.y + plot.height,
164
+ color: stroke,
165
+ opacity: areaOpacity,
166
+ curve
167
+ }) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.LineSeries, {
168
+ seriesId: entry.id,
169
+ data: entry.data,
170
+ points,
171
+ color: stroke,
172
+ strokeWidth,
173
+ curve,
174
+ showPoints,
175
+ marker: encodings[index]?.marker,
176
+ dash: encodings[index]?.dash,
177
+ bounds: size,
178
+ onDatumPress,
179
+ onDatumHoverIn,
180
+ onDatumHoverOut,
181
+ datumLabel: interactive ? datum => (0, import_accessibility.describeDatum)({
182
+ datum,
183
+ formatValue: valueFormatter
184
+ }) : void 0
185
+ })]
186
+ }, entry.id);
187
+ }), showXAxis ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.XAxis, {
188
+ plot,
189
+ scale: xScale,
190
+ tickValues: (0, import_composeChart.thinCategories)(categories, plot.width, labelFontSize)
191
+ }) : null]
192
+ });
193
+ }
194
+ });
78
195
  return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ChartDataView.ChartDataFrame, {
79
- data,
196
+ data: flat,
80
197
  title,
81
198
  valueFormatter,
82
199
  width,
83
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ChartSurface.ChartSurface, {
84
- label: ariaLabel,
85
- proof: {
86
- kind: showArea ? "area" : "line",
87
- separated: false,
88
- datumText: false,
89
- datumValues: (0, import_accessibility.chartDatumText)(data, valueFormatter),
90
- datumCount: data.length
91
- },
92
- height,
93
- width,
200
+ children: multi ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
201
+ gap: "$2",
94
202
  ...stackProps,
95
- children: size => {
96
- const domain = (0, import_math.valueDomain)(data.map(datum => datum.value));
97
- const marginScale = (0, import_math.createLinearScale)({
98
- domain,
99
- range: [0, 1]
100
- });
101
- const tickValues = (0, import_math.getLinearTicks)(marginScale, yTicks);
102
- const plot = (0, import_composeChart.computeCartesianPlot)(size, {
103
- showXAxis,
104
- showYAxis,
105
- yTickLabels: tickValues.map(value => format(value)),
106
- fontSize: labelFontSize
107
- });
108
- if (plot.width <= 0 || plot.height <= 0 || data.length === 0) return null;
109
- const xScale = (0, import_math.createPointScale)({
110
- domain: data.map(datum => datum.label),
111
- range: [plot.x, plot.x + plot.width],
112
- padding: 0.5
113
- });
114
- const yScale = (0, import_math.createLinearScale)({
115
- domain,
116
- range: [plot.y + plot.height, plot.y]
117
- });
118
- const points = data.map(datum => ({
119
- x: xScale(datum.label) ?? plot.x,
120
- y: yScale(datum.value)
121
- }));
122
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
123
- children: [showYAxis || showGrid ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.YAxis, {
124
- plot,
125
- scale: yScale,
126
- ticks: yTicks,
127
- tickFormat: value => format(value),
128
- showLabels: showYAxis,
129
- showGrid
130
- }) : null, showArea ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.AreaSeries, {
131
- points,
132
- baseline: plot.y + plot.height,
133
- color: stroke,
134
- opacity: areaOpacity,
135
- curve
136
- }) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.LineSeries, {
137
- data,
138
- points,
139
- color: stroke,
140
- strokeWidth,
141
- curve,
142
- showPoints,
143
- bounds: size,
144
- onDatumPress,
145
- onDatumHoverIn,
146
- onDatumHoverOut,
147
- datumLabel: interactive ? datum => (0, import_accessibility.describeDatum)({
148
- datum,
149
- formatValue: valueFormatter
150
- }) : void 0
151
- }), showXAxis ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.XAxis, {
152
- plot,
153
- scale: xScale,
154
- tickValues: (0, import_composeChart.thinCategories)(data.map(datum => datum.label), plot.width, labelFontSize)
155
- }) : null]
156
- });
157
- }
158
- })
203
+ children: [chart, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_SeriesLegend.SeriesLegend, {
204
+ entries: all.map((entry, index) => ({
205
+ id: entry.id,
206
+ label: entry.label,
207
+ color: strokes[index],
208
+ marker: encodings[index]?.marker ?? "circle",
209
+ dash: encodings[index]?.dash,
210
+ shown: !hidden.has(entry.id)
211
+ })),
212
+ onToggle: toggle
213
+ })]
214
+ }) : chart
159
215
  });
160
216
  }
161
217
  function AreaChart(props) {
@@ -29,6 +29,8 @@ __export(LineChart_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(LineChart_exports);
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
+ var import_react = require("react");
33
+ var import_tamagui = require("tamagui");
32
34
  var import_i18n = require("../shared/i18n.native.js");
33
35
  var import_Axis = require("./Axis.native.js");
34
36
  var import_ChartDataView = require("./ChartDataView.native.js");
@@ -37,10 +39,13 @@ var import_accessibility = require("./accessibility.native.js");
37
39
  var import_composeChart = require("./composeChart.native.js");
38
40
  var import_math = require("./math.native.js");
39
41
  var import_series = require("./series.native.js");
42
+ var import_SeriesLegend = require("./SeriesLegend.native.js");
43
+ var import_svg = require("./svg.native.js");
40
44
  var import_useChartTheme = require("./useChartTheme.native.js");
41
45
  function LineChart(param) {
42
46
  var {
43
47
  data,
48
+ series,
44
49
  height = 200,
45
50
  width,
46
51
  color,
@@ -62,6 +67,8 @@ function LineChart(param) {
62
67
  onDatumHoverOut,
63
68
  ...stackProps
64
69
  } = param;
70
+ var _ref;
71
+ var _all_;
65
72
  var {
66
73
  t
67
74
  } = (0, import_i18n.useTranslation)();
@@ -69,111 +76,220 @@ function LineChart(param) {
69
76
  palette,
70
77
  labelFontSize
71
78
  } = (0, import_useChartTheme.useChartTheme)();
72
- var stroke = color !== null && color !== void 0 ? color : palette.single;
79
+ var [hidden, setHidden] = (0, import_react.useState)(function () {
80
+ return /* @__PURE__ */new Set();
81
+ });
82
+ var all = series !== null && series !== void 0 ? series : [{
83
+ id: "series",
84
+ label: title !== null && title !== void 0 ? title : "",
85
+ data: data !== null && data !== void 0 ? data : []
86
+ }];
87
+ var multi = all.length > 1;
88
+ var strokes = all.map(function (entry2, index) {
89
+ var _entry_color, _ref2;
90
+ return multi ? (_entry_color = entry2.color) !== null && _entry_color !== void 0 ? _entry_color : palette.categorical[index % palette.categorical.length] : (_ref2 = color !== null && color !== void 0 ? color : entry2.color) !== null && _ref2 !== void 0 ? _ref2 : palette.single;
91
+ });
92
+ var encodings = all.map(function (_, index) {
93
+ return multi ? (0, import_series.seriesEncoding)(index) : {
94
+ marker: "circle",
95
+ dash: void 0
96
+ };
97
+ });
98
+ var flat = multi ? all.flatMap(function (entry2) {
99
+ return entry2.data.map(function (datum2) {
100
+ return {
101
+ ...datum2,
102
+ label: `${entry2.label} ${datum2.label}`
103
+ };
104
+ });
105
+ }) : (_ref = (_all_ = all[0]) === null || _all_ === void 0 ? void 0 : _all_.data) !== null && _ref !== void 0 ? _ref : [];
73
106
  var format = valueFormatter !== null && valueFormatter !== void 0 ? valueFormatter : import_math.formatChartValue;
74
- var ariaLabel = label !== null && label !== void 0 ? label : (0, import_accessibility.describeChart)({
75
- typeLabel: typeLabel !== null && typeLabel !== void 0 ? typeLabel : showArea ? t("Area chart") : t("Line chart"),
107
+ var kind = typeLabel !== null && typeLabel !== void 0 ? typeLabel : showArea ? t("Area chart") : t("Line chart");
108
+ var ariaLabel = label !== null && label !== void 0 ? label : multi ? `${title ? `${kind}, ${title}` : kind}: ${all.length} series. ${all.map(function (entry2) {
109
+ return (0, import_accessibility.describeChart)({
110
+ typeLabel: entry2.label,
111
+ data: entry2.data,
112
+ formatValue: valueFormatter
113
+ });
114
+ }).join(" ")}` : (0, import_accessibility.describeChart)({
115
+ typeLabel: kind,
76
116
  title,
77
- data,
117
+ data: flat,
78
118
  formatValue: valueFormatter
79
119
  });
80
120
  var interactive = Boolean(onDatumPress || onDatumHoverIn || onDatumHoverOut);
121
+ var toggle = function toggle2(id) {
122
+ return setHidden(function (current) {
123
+ var next = new Set(current);
124
+ if (next.has(id)) next.delete(id);else next.add(id);
125
+ return next;
126
+ });
127
+ };
128
+ var categories = [];
129
+ var _iteratorNormalCompletion = true,
130
+ _didIteratorError = false,
131
+ _iteratorError = void 0,
132
+ _iteratorNormalCompletion1 = true,
133
+ _didIteratorError1 = false,
134
+ _iteratorError1 = void 0;
135
+ try {
136
+ for (var _iterator = all[Symbol.iterator](), _step; !(_iteratorNormalCompletion1 = (_step = _iterator.next()).done); _iteratorNormalCompletion1 = true) {
137
+ var entry = _step.value;
138
+ try {
139
+ for (var _iterator1 = entry.data[Symbol.iterator](), _step1; !(_iteratorNormalCompletion = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion = true) {
140
+ var datum = _step1.value;
141
+ if (!categories.includes(datum.label)) categories.push(datum.label);
142
+ }
143
+ } catch (err) {
144
+ _didIteratorError = true;
145
+ _iteratorError = err;
146
+ } finally {
147
+ try {
148
+ if (!_iteratorNormalCompletion && _iterator1.return != null) {
149
+ _iterator1.return();
150
+ }
151
+ } finally {
152
+ if (_didIteratorError) {
153
+ throw _iteratorError;
154
+ }
155
+ }
156
+ }
157
+ }
158
+ } catch (err) {
159
+ _didIteratorError1 = true;
160
+ _iteratorError1 = err;
161
+ } finally {
162
+ try {
163
+ if (!_iteratorNormalCompletion1 && _iterator.return != null) {
164
+ _iterator.return();
165
+ }
166
+ } finally {
167
+ if (_didIteratorError1) {
168
+ throw _iteratorError1;
169
+ }
170
+ }
171
+ }
172
+ var chart = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ChartSurface.ChartSurface, {
173
+ label: ariaLabel,
174
+ proof: {
175
+ kind: showArea ? "area" : "line",
176
+ separated: false,
177
+ datumText: false,
178
+ datumValues: (0, import_accessibility.chartDatumText)(flat, valueFormatter),
179
+ datumCount: flat.length
180
+ },
181
+ height,
182
+ width,
183
+ ...(multi ? {} : stackProps),
184
+ children: function children(size) {
185
+ var domain = (0, import_math.valueDomain)(flat.map(function (datum2) {
186
+ return datum2.value;
187
+ }));
188
+ var marginScale = (0, import_math.createLinearScale)({
189
+ domain,
190
+ range: [0, 1]
191
+ });
192
+ var tickValues = (0, import_math.getLinearTicks)(marginScale, yTicks);
193
+ var plot = (0, import_composeChart.computeCartesianPlot)(size, {
194
+ showXAxis,
195
+ showYAxis,
196
+ yTickLabels: tickValues.map(function (value) {
197
+ return format(value);
198
+ }),
199
+ fontSize: labelFontSize
200
+ });
201
+ if (plot.width <= 0 || plot.height <= 0 || categories.length === 0) return null;
202
+ var xScale = (0, import_math.createPointScale)({
203
+ domain: categories,
204
+ range: [plot.x, plot.x + plot.width],
205
+ padding: 0.5
206
+ });
207
+ var yScale = (0, import_math.createLinearScale)({
208
+ domain,
209
+ range: [plot.y + plot.height, plot.y]
210
+ });
211
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
212
+ children: [showYAxis || showGrid ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.YAxis, {
213
+ plot,
214
+ scale: yScale,
215
+ ticks: yTicks,
216
+ tickFormat: function tickFormat(value) {
217
+ return format(value);
218
+ },
219
+ showLabels: showYAxis,
220
+ showGrid
221
+ }) : null, all.map(function (entry2, index) {
222
+ var _encodings_index, _encodings_index1;
223
+ if (hidden.has(entry2.id)) return null;
224
+ var points = entry2.data.map(function (datum2) {
225
+ var _xScale;
226
+ return {
227
+ x: (_xScale = xScale(datum2.label)) !== null && _xScale !== void 0 ? _xScale : plot.x,
228
+ y: yScale(datum2.value)
229
+ };
230
+ });
231
+ var stroke = strokes[index];
232
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_svg.G, {
233
+ children: [showArea ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.AreaSeries, {
234
+ points,
235
+ baseline: plot.y + plot.height,
236
+ color: stroke,
237
+ opacity: areaOpacity,
238
+ curve
239
+ }) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.LineSeries, {
240
+ seriesId: entry2.id,
241
+ data: entry2.data,
242
+ points,
243
+ color: stroke,
244
+ strokeWidth,
245
+ curve,
246
+ showPoints,
247
+ marker: (_encodings_index = encodings[index]) === null || _encodings_index === void 0 ? void 0 : _encodings_index.marker,
248
+ dash: (_encodings_index1 = encodings[index]) === null || _encodings_index1 === void 0 ? void 0 : _encodings_index1.dash,
249
+ bounds: size,
250
+ onDatumPress,
251
+ onDatumHoverIn,
252
+ onDatumHoverOut,
253
+ datumLabel: interactive ? function (datum2) {
254
+ return (0, import_accessibility.describeDatum)({
255
+ datum: datum2,
256
+ formatValue: valueFormatter
257
+ });
258
+ } : void 0
259
+ })]
260
+ }, entry2.id);
261
+ }), showXAxis ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.XAxis, {
262
+ plot,
263
+ scale: xScale,
264
+ tickValues: (0, import_composeChart.thinCategories)(categories, plot.width, labelFontSize)
265
+ }) : null]
266
+ });
267
+ }
268
+ });
81
269
  return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ChartDataView.ChartDataFrame, {
82
- data,
270
+ data: flat,
83
271
  title,
84
272
  valueFormatter,
85
273
  width,
86
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ChartSurface.ChartSurface, {
87
- label: ariaLabel,
88
- proof: {
89
- kind: showArea ? "area" : "line",
90
- separated: false,
91
- datumText: false,
92
- datumValues: (0, import_accessibility.chartDatumText)(data, valueFormatter),
93
- datumCount: data.length
94
- },
95
- height,
96
- width,
274
+ children: multi ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
275
+ gap: "$2",
97
276
  ...stackProps,
98
- children: function children(size) {
99
- var domain = (0, import_math.valueDomain)(data.map(function (datum) {
100
- return datum.value;
101
- }));
102
- var marginScale = (0, import_math.createLinearScale)({
103
- domain,
104
- range: [0, 1]
105
- });
106
- var tickValues = (0, import_math.getLinearTicks)(marginScale, yTicks);
107
- var plot = (0, import_composeChart.computeCartesianPlot)(size, {
108
- showXAxis,
109
- showYAxis,
110
- yTickLabels: tickValues.map(function (value) {
111
- return format(value);
112
- }),
113
- fontSize: labelFontSize
114
- });
115
- if (plot.width <= 0 || plot.height <= 0 || data.length === 0) return null;
116
- var xScale = (0, import_math.createPointScale)({
117
- domain: data.map(function (datum) {
118
- return datum.label;
119
- }),
120
- range: [plot.x, plot.x + plot.width],
121
- padding: 0.5
122
- });
123
- var yScale = (0, import_math.createLinearScale)({
124
- domain,
125
- range: [plot.y + plot.height, plot.y]
126
- });
127
- var points = data.map(function (datum) {
128
- var _xScale;
277
+ children: [chart, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_SeriesLegend.SeriesLegend, {
278
+ entries: all.map(function (entry2, index) {
279
+ var _ref2;
280
+ var _encodings_index, _encodings_index1;
129
281
  return {
130
- x: (_xScale = xScale(datum.label)) !== null && _xScale !== void 0 ? _xScale : plot.x,
131
- y: yScale(datum.value)
282
+ id: entry2.id,
283
+ label: entry2.label,
284
+ color: strokes[index],
285
+ marker: (_ref2 = (_encodings_index = encodings[index]) === null || _encodings_index === void 0 ? void 0 : _encodings_index.marker) !== null && _ref2 !== void 0 ? _ref2 : "circle",
286
+ dash: (_encodings_index1 = encodings[index]) === null || _encodings_index1 === void 0 ? void 0 : _encodings_index1.dash,
287
+ shown: !hidden.has(entry2.id)
132
288
  };
133
- });
134
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
135
- children: [showYAxis || showGrid ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.YAxis, {
136
- plot,
137
- scale: yScale,
138
- ticks: yTicks,
139
- tickFormat: function tickFormat(value) {
140
- return format(value);
141
- },
142
- showLabels: showYAxis,
143
- showGrid
144
- }) : null, showArea ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.AreaSeries, {
145
- points,
146
- baseline: plot.y + plot.height,
147
- color: stroke,
148
- opacity: areaOpacity,
149
- curve
150
- }) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_series.LineSeries, {
151
- data,
152
- points,
153
- color: stroke,
154
- strokeWidth,
155
- curve,
156
- showPoints,
157
- bounds: size,
158
- onDatumPress,
159
- onDatumHoverIn,
160
- onDatumHoverOut,
161
- datumLabel: interactive ? function (datum) {
162
- return (0, import_accessibility.describeDatum)({
163
- datum,
164
- formatValue: valueFormatter
165
- });
166
- } : void 0
167
- }), showXAxis ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Axis.XAxis, {
168
- plot,
169
- scale: xScale,
170
- tickValues: (0, import_composeChart.thinCategories)(data.map(function (datum) {
171
- return datum.label;
172
- }), plot.width, labelFontSize)
173
- }) : null]
174
- });
175
- }
176
- })
289
+ }),
290
+ onToggle: toggle
291
+ })]
292
+ }) : chart
177
293
  });
178
294
  }
179
295
  function AreaChart(props) {
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","LineChart_exports","__export","AreaChart","LineChart","module","exports","import_jsx_runtime","require","import_i18n","import_Axis","import_ChartDataView","import_ChartSurface","import_accessibility","import_composeChart","import_math","import_series","import_useChartTheme","param","data","height","width","color","showArea","areaOpacity","curve","showPoints","strokeWidth","showXAxis","showYAxis","showGrid","yTicks","valueFormatter","title","label","typeLabel","onDatumPress","onDatumHoverIn","onDatumHoverOut","stackProps","t","useTranslation","palette","labelFontSize","useChartTheme","stroke","single","format","formatChartValue","ariaLabel","describeChart","formatValue","interactive","Boolean","jsx","ChartDataFrame","children","ChartSurface","proof","kind","separated","datumText","datumValues","chartDatumText","datumCount","length","size","domain","valueDomain","map","datum","marginScale","createLinearScale","range","tickValues","getLinearTicks","plot","computeCartesianPlot","yTickLabels","fontSize","xScale","createPointScale","x","padding","yScale","y","points","_xScale","jsxs","Fragment","YAxis","scale","ticks","tickFormat","showLabels","AreaSeries","baseline","opacity","LineSeries","bounds","datumLabel","describeDatum","XAxis","thinCategories","props"],"sources":["../../../src/charts/LineChart.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,iBAAA;AAAAC,QAAA,CAAAD,iBAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAV,YAA+B,CAAAK,iBAAA;AAE/B,IAAAM,kBAA6B,GAAAC,OAAA;AAC7B,IAAAC,WAAA,GAAAD,OAAA,2B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AAA;YAAA/E,IAAA;YACCmE,MAAA;YACAhE,KAAA,EAAAuB,MAAA;YACAlB,WAAO;YACPF,KAAA;YACAC,UAAA;YACAyE,MAAA,EAAAjC,IAAA;YACA9B,YAAQ;YACRC,cAAA;YACAC,eAAA;YACA8D,UAAA,EAAAhD,WAAA,aAAAkB,KAAA;cACA,WACEzD,oBACK,CAAAwF,aAAU;gBACX/B,KAAA;gBAERnB,WAAA,EAAAnB;cACC;YACE;UAAA,IAAAJ,SACC,sBAAArB,kBAAA,CAAA+C,GAAA,EAAA5C,WAAA,CAAA4F,KAAA;YACA1B,IAAA;YACAe,KAAA,EAAAX,MAAA;YAAYN,UACL,EAAK,IAAA5D,mBAAqB,CAAAyF,cAAA,EAAApF,IAAA,CAAAkD,GAAA,WAAAC,KAAA;cAC/B,OAAKA,KAAA,CAAApC,KAAA;YAAA,EACL,EAAA0C,IAAA,CAAAvD,KAAA,EAAAsB,aAAA;UAAA,EACF;QAAA,EACF;MACE;IACN;EAEJ;AAAA;AAIR,SAAAxC,UAAAqG,KAAA;EAKO,OAAS,eAAU,CAAuB,GAAAjG,kBAAA,CAAA+C,GAAA,EAAAlD,SAAA;IAC/CmB,QAAO;IACT,GAAAiF","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","LineChart_exports","__export","AreaChart","LineChart","module","exports","import_jsx_runtime","require","import_react","import_tamagui","import_i18n","import_Axis","import_ChartDataView","import_ChartSurface","import_accessibility","import_composeChart","import_math","import_series","import_SeriesLegend","import_svg","import_useChartTheme","param","data","series","height","width","color","showArea","areaOpacity","curve","showPoints","strokeWidth","showXAxis","showYAxis","showGrid","yTicks","valueFormatter","title","label","typeLabel","onDatumPress","onDatumHoverIn","onDatumHoverOut","stackProps","_ref","_all_","t","useTranslation","palette","labelFontSize","useChartTheme","hidden","setHidden","useState","Set","all","id","multi","length","strokes","map","entry2","index","_entry_color","_ref2","categorical","single","encodings","_","seriesEncoding","marker","dash","flat","flatMap","datum2","format","formatChartValue","kind","ariaLabel","describeChart","formatValue","join","interactive","Boolean","toggle","toggle2","current","next","has","delete","add","categories","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator","Symbol","iterator","_step","done","entry","_iterator1","_step1","datum","includes","push","err","return","chart","jsx","ChartSurface","proof","separated","datumText","datumValues","chartDatumText","datumCount","children","size","domain","valueDomain","marginScale","createLinearScale","range","tickValues","getLinearTicks","plot","computeCartesianPlot","yTickLabels","fontSize","xScale","createPointScale","x","padding","yScale","y","jsxs","Fragment","YAxis","scale","ticks","tickFormat","showLabels","_encodings_index","_encodings_index1","points","_xScale","stroke","G","AreaSeries","baseline","opacity"],"sources":["../../../src/charts/LineChart.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,iBAAA;AAAAC,QAAA,CAAAD,iBAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAAyB,CAAAK,iBAAA;AACzB,IAAAM,kBAAyC,GAAAC,OAAA;AAEzC,IAAAC,YAAA,GAA+BD,OAAA;AAC/B,IAAAE,cAA6B,GAAAF,OAAA;AAC7B,IAAAG,WAAA,GAAAH,OAAA,2BAA+B;AAC/B,IAAAI,WAAA,GAAAJ,OAAA,CAA6B;AAC7B,IAAAK,oBAAA,GAA6DL,OAAA;AAC7D,IAAAM,mBAAA,GAAqDN,OAAA;AACrD,IAAAO,oBAMO,GAAAP,OAAA;AACP,IAAAQ,mBAAuD,GAAAR,OAAA;AACvD,IAAAS,WAAA,GAAAT,OAAA,CAA6B;AAC7B,IAAAU,aAAkB,GAAAV,OAAA;AAElB,IAAAW,mBAAA,GAAAX,OAA8B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