@sckyzo/cosmos-charts 0.3.0 → 0.4.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 (79) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +12 -1
  3. package/dist/BarChart.cjs +18 -18
  4. package/dist/BarChart.js +5 -5
  5. package/dist/BoxPlotChart.cjs +18 -18
  6. package/dist/BoxPlotChart.js +5 -5
  7. package/dist/BumpChart.cjs +6 -6
  8. package/dist/BumpChart.js +3 -3
  9. package/dist/CalendarChart.cjs +9 -7
  10. package/dist/CalendarChart.cjs.map +1 -1
  11. package/dist/CalendarChart.js +5 -3
  12. package/dist/CalendarChart.js.map +1 -1
  13. package/dist/DonutChart.cjs +8 -8
  14. package/dist/DonutChart.js +3 -3
  15. package/dist/FunnelChart.cjs +8 -6
  16. package/dist/FunnelChart.cjs.map +1 -1
  17. package/dist/FunnelChart.js +4 -2
  18. package/dist/FunnelChart.js.map +1 -1
  19. package/dist/GradientRadial.cjs +3 -3
  20. package/dist/GradientRadial.js +2 -2
  21. package/dist/HeatmapChart.cjs +8 -6
  22. package/dist/HeatmapChart.cjs.map +1 -1
  23. package/dist/HeatmapChart.js +5 -3
  24. package/dist/HeatmapChart.js.map +1 -1
  25. package/dist/LineAreaChart.cjs +13 -13
  26. package/dist/LineAreaChart.js +4 -4
  27. package/dist/MixedChart.cjs +16 -16
  28. package/dist/MixedChart.js +5 -5
  29. package/dist/RadarChart.cjs +9 -9
  30. package/dist/RadarChart.js +3 -3
  31. package/dist/RadialBarChart.cjs +3 -3
  32. package/dist/RadialBarChart.js +1 -1
  33. package/dist/RangeBarChart.cjs +13 -13
  34. package/dist/RangeBarChart.js +4 -4
  35. package/dist/RealtimeChart.cjs +8 -8
  36. package/dist/RealtimeChart.js +2 -2
  37. package/dist/ScatterChart.cjs +12 -12
  38. package/dist/ScatterChart.js +4 -4
  39. package/dist/SemiCircleGauge.cjs +2 -2
  40. package/dist/SemiCircleGauge.js +1 -1
  41. package/dist/Sparkline.cjs +4 -4
  42. package/dist/Sparkline.js +1 -1
  43. package/dist/StrokedGauge.cjs +3 -3
  44. package/dist/StrokedGauge.js +2 -2
  45. package/dist/TreemapChart.cjs +2 -2
  46. package/dist/TreemapChart.js +1 -1
  47. package/dist/WaterfallChart.cjs +12 -12
  48. package/dist/WaterfallChart.js +3 -3
  49. package/dist/{chunk-6ALKZLN2.js → chunk-4AKHZNWP.js} +3 -3
  50. package/dist/{chunk-6ALKZLN2.js.map → chunk-4AKHZNWP.js.map} +1 -1
  51. package/dist/{chunk-3N43QT36.js → chunk-56WD3OHA.js} +6 -4
  52. package/dist/chunk-56WD3OHA.js.map +1 -0
  53. package/dist/{chunk-YWYF5CCJ.js → chunk-6FGJZBTC.js} +3 -3
  54. package/dist/{chunk-YWYF5CCJ.js.map → chunk-6FGJZBTC.js.map} +1 -1
  55. package/dist/{chunk-MN4CDVOS.cjs → chunk-CMBNNLIV.cjs} +4 -4
  56. package/dist/{chunk-MN4CDVOS.cjs.map → chunk-CMBNNLIV.cjs.map} +1 -1
  57. package/dist/{chunk-RILUG7JB.js → chunk-DI2FBGKM.js} +3 -3
  58. package/dist/{chunk-RILUG7JB.js.map → chunk-DI2FBGKM.js.map} +1 -1
  59. package/dist/{chunk-SGG7XKOY.js → chunk-ESVGCUJN.js} +3 -3
  60. package/dist/{chunk-SGG7XKOY.js.map → chunk-ESVGCUJN.js.map} +1 -1
  61. package/dist/{chunk-RLHGPHC7.cjs → chunk-G4WOPX4D.cjs} +4 -4
  62. package/dist/{chunk-RLHGPHC7.cjs.map → chunk-G4WOPX4D.cjs.map} +1 -1
  63. package/dist/{chunk-GZRMVE4X.cjs → chunk-RCDTBZC2.cjs} +4 -4
  64. package/dist/{chunk-GZRMVE4X.cjs.map → chunk-RCDTBZC2.cjs.map} +1 -1
  65. package/dist/{chunk-6NRRABPF.cjs → chunk-SR2ESX3R.cjs} +6 -4
  66. package/dist/chunk-SR2ESX3R.cjs.map +1 -0
  67. package/dist/{chunk-ICL5K2CW.js → chunk-UL3SNXQR.js} +3 -3
  68. package/dist/{chunk-ICL5K2CW.js.map → chunk-UL3SNXQR.js.map} +1 -1
  69. package/dist/{chunk-6BKLL7LZ.cjs → chunk-XMFBVMW7.cjs} +4 -4
  70. package/dist/{chunk-6BKLL7LZ.cjs.map → chunk-XMFBVMW7.cjs.map} +1 -1
  71. package/dist/{chunk-Z4LZFMDH.cjs → chunk-XUGQ6VXO.cjs} +4 -4
  72. package/dist/{chunk-Z4LZFMDH.cjs.map → chunk-XUGQ6VXO.cjs.map} +1 -1
  73. package/dist/{chunk-HMH6DI7U.js → chunk-YMRNTIOK.js} +3 -3
  74. package/dist/{chunk-HMH6DI7U.js.map → chunk-YMRNTIOK.js.map} +1 -1
  75. package/dist/{chunk-TPH5T3DA.cjs → chunk-ZWHCUYIN.cjs} +4 -4
  76. package/dist/{chunk-TPH5T3DA.cjs.map → chunk-ZWHCUYIN.cjs.map} +1 -1
  77. package/package.json +1 -1
  78. package/dist/chunk-3N43QT36.js.map +0 -1
  79. package/dist/chunk-6NRRABPF.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkRLHGPHC7_cjs = require('./chunk-RLHGPHC7.cjs');
4
+ var chunkG4WOPX4D_cjs = require('./chunk-G4WOPX4D.cjs');
5
5
  var chunkT3K6Q34U_cjs = require('./chunk-T3K6Q34U.cjs');
6
- var chunk6NRRABPF_cjs = require('./chunk-6NRRABPF.cjs');
6
+ var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
7
7
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
8
8
  var react = require('react');
9
9
  var recharts = require('recharts');
@@ -29,7 +29,7 @@ var Threshold = ({ y, label, color }) => /* @__PURE__ */ jsxRuntime.jsx(
29
29
  offset: 4,
30
30
  // Text on the card, whatever the status color: it reads on every theme.
31
31
  fill: chunkLT3UC65O_cjs.TEXT,
32
- style: { fill: chunkLT3UC65O_cjs.TEXT, fontSize: chunkRLHGPHC7_cjs.TEXT_SIZE, fontWeight: 600 }
32
+ style: { fill: chunkLT3UC65O_cjs.TEXT, fontSize: chunkG4WOPX4D_cjs.TEXT_SIZE, fontWeight: 600 }
33
33
  }
34
34
  }
35
35
  );
@@ -60,7 +60,7 @@ var RealtimeChart = ({
60
60
  height = 240,
61
61
  width
62
62
  }) => {
63
- const axis = chunkRLHGPHC7_cjs.useAxis();
63
+ const axis = chunkG4WOPX4D_cjs.useAxis();
64
64
  const [defaultGenerator] = react.useState(createDefaultGenerator);
65
65
  const generate = generator ?? defaultGenerator;
66
66
  const [mountedAt] = react.useState(Date.now);
@@ -106,7 +106,7 @@ var RealtimeChart = ({
106
106
  return /* @__PURE__ */ jsxRuntime.jsxs(
107
107
  recharts.LineChart,
108
108
  {
109
- ...chunk6NRRABPF_cjs.frameProps({
109
+ ...chunkSR2ESX3R_cjs.frameProps({
110
110
  height,
111
111
  width,
112
112
  ariaLabel: ariaLabel ?? "Live values, newest on the right"
@@ -114,7 +114,7 @@ var RealtimeChart = ({
114
114
  data: samples,
115
115
  margin: { top: 4, right: 12, bottom: 0, left: 0 },
116
116
  children: [
117
- /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { ...chunkRLHGPHC7_cjs.GRID_PROPS }),
117
+ /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { ...chunkG4WOPX4D_cjs.GRID_PROPS }),
118
118
  /* @__PURE__ */ jsxRuntime.jsx(
119
119
  recharts.XAxis,
120
120
  {
@@ -124,7 +124,7 @@ var RealtimeChart = ({
124
124
  hide: !showTimeAxis,
125
125
  tickFormatter: clock,
126
126
  ...axis,
127
- ...showTimeAxis ? chunkRLHGPHC7_cjs.xAxisTitle(xTitle) : {}
127
+ ...showTimeAxis ? chunkG4WOPX4D_cjs.xAxisTitle(xTitle) : {}
128
128
  }
129
129
  ),
130
130
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -136,7 +136,7 @@ var RealtimeChart = ({
136
136
  width: "auto",
137
137
  tickFormatter: formatValue,
138
138
  ...axis,
139
- ...chunkRLHGPHC7_cjs.yAxisTitle(yTitle)
139
+ ...chunkG4WOPX4D_cjs.yAxisTitle(yTitle)
140
140
  }
141
141
  ),
142
142
  /* @__PURE__ */ jsxRuntime.jsx(Threshold, { y: warnThreshold, label: warnLabel, color: chunkLT3UC65O_cjs.STATUS_WARN }),
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { useAxis, GRID_PROPS, xAxisTitle, yAxisTitle, TEXT_SIZE } from './chunk-RILUG7JB.js';
2
+ import { useAxis, GRID_PROPS, xAxisTitle, yAxisTitle, TEXT_SIZE } from './chunk-DI2FBGKM.js';
3
3
  import { TooltipCard } from './chunk-VIOSQN4Z.js';
4
- import { frameProps } from './chunk-3N43QT36.js';
4
+ import { frameProps } from './chunk-56WD3OHA.js';
5
5
  import { STATUS_WARN, STATUS_CRIT, BORDER, SERIES, PANEL, TEXT } from './chunk-UATB2IRY.js';
6
6
  import { useState, useEffect } from 'react';
7
7
  import { LineChart, CartesianGrid, XAxis, YAxis, Tooltip, Line, ReferenceLine } from 'recharts';
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkZ4LZFMDH_cjs = require('./chunk-Z4LZFMDH.cjs');
5
- var chunkGZRMVE4X_cjs = require('./chunk-GZRMVE4X.cjs');
4
+ var chunkXUGQ6VXO_cjs = require('./chunk-XUGQ6VXO.cjs');
5
+ var chunkRCDTBZC2_cjs = require('./chunk-RCDTBZC2.cjs');
6
6
  var chunkTYQWZR3S_cjs = require('./chunk-TYQWZR3S.cjs');
7
- var chunkRLHGPHC7_cjs = require('./chunk-RLHGPHC7.cjs');
7
+ var chunkG4WOPX4D_cjs = require('./chunk-G4WOPX4D.cjs');
8
8
  var chunkT3K6Q34U_cjs = require('./chunk-T3K6Q34U.cjs');
9
9
  var chunkK3R7JGOW_cjs = require('./chunk-K3R7JGOW.cjs');
10
- var chunk6NRRABPF_cjs = require('./chunk-6NRRABPF.cjs');
10
+ var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
11
11
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
12
12
  var recharts = require('recharts');
13
13
  var jsxRuntime = require('react/jsx-runtime');
@@ -33,11 +33,11 @@ var XYChart = ({
33
33
  height = 320,
34
34
  width
35
35
  }) => {
36
- const hidden = chunkGZRMVE4X_cjs.useHiddenSeries();
37
- const axis = chunkRLHGPHC7_cjs.useAxis();
36
+ const hidden = chunkRCDTBZC2_cjs.useHiddenSeries();
37
+ const axis = chunkG4WOPX4D_cjs.useAxis();
38
38
  const name = ariaLabel ?? `${bubbles ? "Bubble" : "Scatter"} chart: ${series.map((s) => s.name).join(", ")}`;
39
39
  if (chunkK3R7JGOW_cjs.hasNoData(series)) {
40
- return /* @__PURE__ */ jsxRuntime.jsx(chunk6NRRABPF_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
40
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSR2ESX3R_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
41
41
  }
42
42
  const tooltip = ({ active, payload }) => {
43
43
  const point = payload?.[0]?.payload;
@@ -60,7 +60,7 @@ var XYChart = ({
60
60
  return /* @__PURE__ */ jsxRuntime.jsxs(
61
61
  recharts.ScatterChart,
62
62
  {
63
- ...chunk6NRRABPF_cjs.frameProps({ height, width, ariaLabel: name }),
63
+ ...chunkSR2ESX3R_cjs.frameProps({ height, width, ariaLabel: name }),
64
64
  margin: { top: 4, right: bubbles ? 24 : 12, bottom: 0, left: 0 },
65
65
  children: [
66
66
  /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { stroke: chunkLT3UC65O_cjs.GRID, strokeDasharray: "4 4" }),
@@ -73,7 +73,7 @@ var XYChart = ({
73
73
  domain: ["auto", "auto"],
74
74
  tickFormatter: formatX,
75
75
  ...axis,
76
- ...chunkRLHGPHC7_cjs.xAxisTitle(xTitle)
76
+ ...chunkG4WOPX4D_cjs.xAxisTitle(xTitle)
77
77
  }
78
78
  ),
79
79
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -86,11 +86,11 @@ var XYChart = ({
86
86
  width: "auto",
87
87
  tickFormatter: formatY,
88
88
  ...axis,
89
- ...chunkRLHGPHC7_cjs.yAxisTitle(yTitle)
89
+ ...chunkG4WOPX4D_cjs.yAxisTitle(yTitle)
90
90
  }
91
91
  ),
92
92
  bubbles ? /* @__PURE__ */ jsxRuntime.jsx(recharts.ZAxis, { type: "number", dataKey: "z", name: bubbles.sizeTitle, range: BUBBLE_AREAS }) : /* @__PURE__ */ jsxRuntime.jsx(recharts.ZAxis, { type: "number", range: [POINT_AREA, POINT_AREA] }),
93
- (showLegend ?? series.length > 1) && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, { ...chunkGZRMVE4X_cjs.legendProps(legendPosition, hidden) }),
93
+ (showLegend ?? series.length > 1) && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, { ...chunkRCDTBZC2_cjs.legendProps(legendPosition, hidden) }),
94
94
  /* @__PURE__ */ jsxRuntime.jsx(
95
95
  recharts.Tooltip,
96
96
  {
@@ -115,7 +115,7 @@ var XYChart = ({
115
115
  chunkK3R7JGOW_cjs.seriesKey(index)
116
116
  );
117
117
  }),
118
- chunkZ4LZFMDH_cjs.referenceMarks({ referenceLines, referenceBands }),
118
+ chunkXUGQ6VXO_cjs.referenceMarks({ referenceLines, referenceBands }),
119
119
  children
120
120
  ]
121
121
  }
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { referenceMarks } from './chunk-SGG7XKOY.js';
3
- import { useHiddenSeries, legendProps } from './chunk-6ALKZLN2.js';
2
+ import { referenceMarks } from './chunk-ESVGCUJN.js';
3
+ import { useHiddenSeries, legendProps } from './chunk-4AKHZNWP.js';
4
4
  import { ANIMATION } from './chunk-5C2RLJYZ.js';
5
- import { useAxis, xAxisTitle, yAxisTitle } from './chunk-RILUG7JB.js';
5
+ import { useAxis, xAxisTitle, yAxisTitle } from './chunk-DI2FBGKM.js';
6
6
  import { TooltipCard } from './chunk-VIOSQN4Z.js';
7
7
  import { hasNoData, seriesKey } from './chunk-UJIV5PVI.js';
8
- import { ChartEmpty, frameProps } from './chunk-3N43QT36.js';
8
+ import { ChartEmpty, frameProps } from './chunk-56WD3OHA.js';
9
9
  import { GRID, BORDER, seriesColor } from './chunk-UATB2IRY.js';
10
10
  import { ScatterChart as ScatterChart$1, CartesianGrid, XAxis, YAxis, ZAxis, Legend, Tooltip, Scatter } from 'recharts';
11
11
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -4,7 +4,7 @@
4
4
  var chunkIW6EWB26_cjs = require('./chunk-IW6EWB26.cjs');
5
5
  var chunkAAYHG7YK_cjs = require('./chunk-AAYHG7YK.cjs');
6
6
  var chunkTYQWZR3S_cjs = require('./chunk-TYQWZR3S.cjs');
7
- var chunk6NRRABPF_cjs = require('./chunk-6NRRABPF.cjs');
7
+ var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
8
8
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
9
9
  var recharts = require('recharts');
10
10
  var jsxRuntime = require('react/jsx-runtime');
@@ -91,7 +91,7 @@ var SemiCircleGauge = ({
91
91
  children: radius > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
92
92
  recharts.RadialBarChart,
93
93
  {
94
- ...chunk6NRRABPF_cjs.frameProps({
94
+ ...chunkSR2ESX3R_cjs.frameProps({
95
95
  height: radius + row,
96
96
  width: "100%",
97
97
  ariaLabel: chunkAAYHG7YK_cjs.gaugeName(ariaLabel ?? (label || "Gauge"), text) + (target === void 0 ? "" : `, target ${formatValue(target)}`),
@@ -2,7 +2,7 @@
2
2
  import { useElementWidth } from './chunk-AOSO5QHL.js';
3
3
  import { percent, statusColor, rangeShare, clampTo, gaugeName, arcMark } from './chunk-OCD6JIIX.js';
4
4
  import { ANIMATION } from './chunk-5C2RLJYZ.js';
5
- import { frameProps } from './chunk-3N43QT36.js';
5
+ import { frameProps } from './chunk-56WD3OHA.js';
6
6
  import { SERIES, TRACK, TEXT, MUTED, PANEL } from './chunk-UATB2IRY.js';
7
7
  import { RadialBarChart, PolarAngleAxis, RadialBar, usePlotArea } from 'recharts';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -5,7 +5,7 @@ var chunkGVTMZYOM_cjs = require('./chunk-GVTMZYOM.cjs');
5
5
  var chunkTYQWZR3S_cjs = require('./chunk-TYQWZR3S.cjs');
6
6
  var chunkT3K6Q34U_cjs = require('./chunk-T3K6Q34U.cjs');
7
7
  var chunkK3R7JGOW_cjs = require('./chunk-K3R7JGOW.cjs');
8
- var chunk6NRRABPF_cjs = require('./chunk-6NRRABPF.cjs');
8
+ var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
9
9
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
10
10
  var react = require('react');
11
11
  var recharts = require('recharts');
@@ -28,7 +28,7 @@ var Sparkline = ({
28
28
  const uid = chunkK3R7JGOW_cjs.safeId(react.useId());
29
29
  const name = ariaLabel ?? `Trend of ${label}`;
30
30
  if (chunkK3R7JGOW_cjs.hasNoData([{ data }])) {
31
- return /* @__PURE__ */ jsxRuntime.jsx(chunk6NRRABPF_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
31
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSR2ESX3R_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
32
32
  }
33
33
  if (variant === "bar") {
34
34
  const fillFor = (value) => value < 0 ? chunkLT3UC65O_cjs.ERROR : void 0;
@@ -36,7 +36,7 @@ var Sparkline = ({
36
36
  return /* @__PURE__ */ jsxRuntime.jsxs(
37
37
  recharts.BarChart,
38
38
  {
39
- ...chunk6NRRABPF_cjs.frameProps({ height, width, ariaLabel: name, keyboard: false }),
39
+ ...chunkSR2ESX3R_cjs.frameProps({ height, width, ariaLabel: name, keyboard: false }),
40
40
  data: data.map((value, i) => ({ i, value })),
41
41
  margin: { top: 6, right: 4, bottom: 4, left: 4 },
42
42
  barCategoryGap: "20%",
@@ -73,7 +73,7 @@ var Sparkline = ({
73
73
  return /* @__PURE__ */ jsxRuntime.jsxs(
74
74
  recharts.AreaChart,
75
75
  {
76
- ...chunk6NRRABPF_cjs.frameProps({ height, width, ariaLabel: name, keyboard: false }),
76
+ ...chunkSR2ESX3R_cjs.frameProps({ height, width, ariaLabel: name, keyboard: false }),
77
77
  data: data.map((value, i) => ({ i, value })),
78
78
  margin: { top: 6, right: 4, bottom: 4, left: 4 },
79
79
  children: [
package/dist/Sparkline.js CHANGED
@@ -3,7 +3,7 @@ import { roundedBarShape } from './chunk-GDZLYYL2.js';
3
3
  import { ANIMATION } from './chunk-5C2RLJYZ.js';
4
4
  import { ChartTooltip } from './chunk-VIOSQN4Z.js';
5
5
  import { safeId, hasNoData } from './chunk-UJIV5PVI.js';
6
- import { ChartEmpty, frameProps } from './chunk-3N43QT36.js';
6
+ import { ChartEmpty, frameProps } from './chunk-56WD3OHA.js';
7
7
  import { BORDER, ERROR, SERIES, PANEL } from './chunk-UATB2IRY.js';
8
8
  import { useId } from 'react';
9
9
  import { BarChart, XAxis, YAxis, Tooltip, Bar, ReferenceLine, AreaChart, Area } from 'recharts';
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkMN4CDVOS_cjs = require('./chunk-MN4CDVOS.cjs');
4
+ var chunkCMBNNLIV_cjs = require('./chunk-CMBNNLIV.cjs');
5
5
  var chunkAAYHG7YK_cjs = require('./chunk-AAYHG7YK.cjs');
6
6
  require('./chunk-X3YZP5WF.cjs');
7
7
  require('./chunk-TYQWZR3S.cjs');
8
- require('./chunk-6NRRABPF.cjs');
8
+ require('./chunk-SR2ESX3R.cjs');
9
9
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
 
@@ -73,7 +73,7 @@ var StrokedGauge = ({
73
73
  height = 280,
74
74
  width
75
75
  }) => /* @__PURE__ */ jsxRuntime.jsx(
76
- chunkMN4CDVOS_cjs.RadialGauge,
76
+ chunkCMBNNLIV_cjs.RadialGauge,
77
77
  {
78
78
  value,
79
79
  label,
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { RadialGauge } from './chunk-YWYF5CCJ.js';
2
+ import { RadialGauge } from './chunk-6FGJZBTC.js';
3
3
  import { percent } from './chunk-OCD6JIIX.js';
4
4
  import './chunk-URNXLVSK.js';
5
5
  import './chunk-5C2RLJYZ.js';
6
- import './chunk-3N43QT36.js';
6
+ import './chunk-56WD3OHA.js';
7
7
  import { SERIES, TRACK } from './chunk-UATB2IRY.js';
8
8
  import { jsx, jsxs } from 'react/jsx-runtime';
9
9
 
@@ -5,7 +5,7 @@ var chunkTYQWZR3S_cjs = require('./chunk-TYQWZR3S.cjs');
5
5
  var chunkDBZQI4HM_cjs = require('./chunk-DBZQI4HM.cjs');
6
6
  var chunkT3K6Q34U_cjs = require('./chunk-T3K6Q34U.cjs');
7
7
  var chunkK3R7JGOW_cjs = require('./chunk-K3R7JGOW.cjs');
8
- var chunk6NRRABPF_cjs = require('./chunk-6NRRABPF.cjs');
8
+ var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
9
9
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
10
10
  var react = require('react');
11
11
  var recharts = require('recharts');
@@ -165,7 +165,7 @@ var TreemapChart = ({
165
165
  const name = ariaLabel ?? `Treemap: ${series.flatMap((s) => s.data.map((d) => d.x)).join(", ")}`;
166
166
  const drawn = series.map((s) => ({ ...s, data: s.data.filter((d) => d.y > 0) }));
167
167
  if (chunkK3R7JGOW_cjs.hasNoData(drawn)) {
168
- return /* @__PURE__ */ jsxRuntime.jsx(chunk6NRRABPF_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
168
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSR2ESX3R_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
169
169
  }
170
170
  const colorByName = /* @__PURE__ */ new Map();
171
171
  for (const { data: data2 } of drawn) {
@@ -3,7 +3,7 @@ import { ANIMATION } from './chunk-5C2RLJYZ.js';
3
3
  import { textOn } from './chunk-BFEDLXVW.js';
4
4
  import { TooltipCard } from './chunk-VIOSQN4Z.js';
5
5
  import { hasNoData } from './chunk-UJIV5PVI.js';
6
- import { ChartEmpty } from './chunk-3N43QT36.js';
6
+ import { ChartEmpty } from './chunk-56WD3OHA.js';
7
7
  import { seriesColor, MUTED, PANEL, TEXT, TRACK } from './chunk-UATB2IRY.js';
8
8
  import { useRef, useState } from 'react';
9
9
  import { Treemap, Tooltip } from 'recharts';
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk6BKLL7LZ_cjs = require('./chunk-6BKLL7LZ.cjs');
4
+ var chunkXMFBVMW7_cjs = require('./chunk-XMFBVMW7.cjs');
5
5
  var chunkIW6EWB26_cjs = require('./chunk-IW6EWB26.cjs');
6
6
  var chunkTYQWZR3S_cjs = require('./chunk-TYQWZR3S.cjs');
7
- var chunkRLHGPHC7_cjs = require('./chunk-RLHGPHC7.cjs');
7
+ var chunkG4WOPX4D_cjs = require('./chunk-G4WOPX4D.cjs');
8
8
  var chunkT3K6Q34U_cjs = require('./chunk-T3K6Q34U.cjs');
9
- var chunk6NRRABPF_cjs = require('./chunk-6NRRABPF.cjs');
9
+ var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
10
10
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
11
11
  var react = require('react');
12
12
  var recharts = require('recharts');
@@ -86,7 +86,7 @@ var waterfallShape = (palette, labels, format) => (props) => {
86
86
  textAnchor: "middle",
87
87
  fill: chunkLT3UC65O_cjs.TEXT,
88
88
  style: {
89
- fontSize: chunkRLHGPHC7_cjs.TEXT_SIZE,
89
+ fontSize: chunkG4WOPX4D_cjs.TEXT_SIZE,
90
90
  fontWeight: 600,
91
91
  fontVariantNumeric: "tabular-nums"
92
92
  },
@@ -144,7 +144,7 @@ var WaterfallChart = ({
144
144
  height = 320,
145
145
  width
146
146
  }) => {
147
- const axis = chunkRLHGPHC7_cjs.useAxis();
147
+ const axis = chunkG4WOPX4D_cjs.useAxis();
148
148
  const { ref, width: measured } = chunkIW6EWB26_cjs.useElementWidth();
149
149
  const bars = react.useMemo(() => waterfallBars(data), [data]);
150
150
  const rows = react.useMemo(
@@ -153,7 +153,7 @@ var WaterfallChart = ({
153
153
  );
154
154
  const name = ariaLabel ?? `Waterfall chart: ${data.map((d) => d.label).join(", ")}`;
155
155
  if (data.length === 0) {
156
- return /* @__PURE__ */ jsxRuntime.jsx(chunk6NRRABPF_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
156
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSR2ESX3R_cjs.ChartEmpty, { message: emptyMessage, ariaLabel: name, height, width });
157
157
  }
158
158
  const palette = {
159
159
  positive: colors?.positive ?? chunkLT3UC65O_cjs.SUCCESS,
@@ -167,10 +167,10 @@ var WaterfallChart = ({
167
167
  const tilted = narrow || longest * CHAR_WIDTH > band;
168
168
  const labelAxis = {
169
169
  interval: 0,
170
- tickFormatter: (_, index) => chunk6BKLL7LZ_cjs.trimLabel(rows[index]?.label ?? ""),
170
+ tickFormatter: (_, index) => chunkXMFBVMW7_cjs.trimLabel(rows[index]?.label ?? ""),
171
171
  ...tilted ? {
172
172
  angle: -40,
173
- tick: { ...chunkRLHGPHC7_cjs.AXIS.tick, textAnchor: "end" },
173
+ tick: { ...chunkG4WOPX4D_cjs.AXIS.tick, textAnchor: "end" },
174
174
  height: (xTitle ? 52 : 30) + Math.round(longest * TILT_HEIGHT)
175
175
  } : {}
176
176
  };
@@ -197,14 +197,14 @@ var WaterfallChart = ({
197
197
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, style: { width: width ?? "100%", maxWidth: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
198
198
  recharts.BarChart,
199
199
  {
200
- ...chunk6NRRABPF_cjs.frameProps({ height, width: "100%", ariaLabel: name }),
200
+ ...chunkSR2ESX3R_cjs.frameProps({ height, width: "100%", ariaLabel: name }),
201
201
  data: rows,
202
202
  margin: { top: labels ? 24 : 4, right: 8, bottom: 0, left: 0 },
203
203
  barCategoryGap: `${GAP * 100}%`,
204
204
  children: [
205
- /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { ...chunkRLHGPHC7_cjs.GRID_PROPS }),
206
- /* @__PURE__ */ jsxRuntime.jsx(recharts.XAxis, { dataKey: "key", ...axis, ...chunkRLHGPHC7_cjs.xAxisTitle(xTitle), ...labelAxis }),
207
- /* @__PURE__ */ jsxRuntime.jsx(recharts.YAxis, { width: "auto", tickFormatter: formatValue, ...axis, ...chunkRLHGPHC7_cjs.yAxisTitle(yTitle) }),
205
+ /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { ...chunkG4WOPX4D_cjs.GRID_PROPS }),
206
+ /* @__PURE__ */ jsxRuntime.jsx(recharts.XAxis, { dataKey: "key", ...axis, ...chunkG4WOPX4D_cjs.xAxisTitle(xTitle), ...labelAxis }),
207
+ /* @__PURE__ */ jsxRuntime.jsx(recharts.YAxis, { width: "auto", tickFormatter: formatValue, ...axis, ...chunkG4WOPX4D_cjs.yAxisTitle(yTitle) }),
208
208
  /* @__PURE__ */ jsxRuntime.jsx(
209
209
  recharts.Tooltip,
210
210
  {
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { trimLabel } from './chunk-HMH6DI7U.js';
2
+ import { trimLabel } from './chunk-YMRNTIOK.js';
3
3
  import { useElementWidth } from './chunk-AOSO5QHL.js';
4
4
  import { ANIMATION } from './chunk-5C2RLJYZ.js';
5
- import { useAxis, AXIS, GRID_PROPS, xAxisTitle, yAxisTitle, TEXT_SIZE } from './chunk-RILUG7JB.js';
5
+ import { useAxis, AXIS, GRID_PROPS, xAxisTitle, yAxisTitle, TEXT_SIZE } from './chunk-DI2FBGKM.js';
6
6
  import { TooltipCard } from './chunk-VIOSQN4Z.js';
7
- import { ChartEmpty, frameProps } from './chunk-3N43QT36.js';
7
+ import { ChartEmpty, frameProps } from './chunk-56WD3OHA.js';
8
8
  import { SERIES, ERROR, SUCCESS, BORDER, TEXT, MUTED } from './chunk-UATB2IRY.js';
9
9
  import { useMemo } from 'react';
10
10
  import { BarChart, CartesianGrid, XAxis, YAxis, Tooltip, Bar, useXAxisScale, useYAxisScale } from 'recharts';
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { TEXT_SIZE } from './chunk-RILUG7JB.js';
2
+ import { TEXT_SIZE } from './chunk-DI2FBGKM.js';
3
3
  import { MUTED, TEXT } from './chunk-UATB2IRY.js';
4
4
  import { useState, useCallback } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -123,5 +123,5 @@ var legendProps = (position, { hidden, toggle }) => ({
123
123
  });
124
124
 
125
125
  export { ChartLegend, legendProps, useHiddenSeries };
126
- //# sourceMappingURL=chunk-6ALKZLN2.js.map
127
- //# sourceMappingURL=chunk-6ALKZLN2.js.map
126
+ //# sourceMappingURL=chunk-4AKHZNWP.js.map
127
+ //# sourceMappingURL=chunk-4AKHZNWP.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/ChartLegend.tsx"],"names":[],"mappings":";;;;;;AAUO,IAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,IAAI,QAAA,iBAA8B,IAAI,KAAK,CAAA;AACnE,EAAA,MAAM,MAAA,GAAS,WAAA,CAAY,CAAC,GAAA,KAAgB;AAC1C,IAAA,SAAA,CAAU,CAAC,OAAA,KAAY;AACrB,MAAA,MAAM,IAAA,GAAO,IAAI,GA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SAAA,EAAW;AAAA,mBACb;AAAA,kBAEC,QAAA,EAAA,OAAA,CAAQ;AAAA;AAAA,eACX;AAAA,8BACA,GAAA;AAAA,gBAAC,MAAA;AAAA,gBAAA;AAAA,kBACC,KAAA,EAAO;AAAA,oBACL,QAAA,EAAU,SAAS,OAAA,GAAU,MAAA;AAAA,oBAC7B,kBAAA,EAAoB,cAAA;AAAA,oBACpB,SAAA,EAAW;AAAA,mBACb;AAAA,kBAEC,QAAA,EAAA,OAAA,CAAQ;AAAA;AAAA;AACX,aAAA,EACF,IAEC,KAAA,CAAM;AAAA;AAAA;AAAA,WA3DJ,GA8DT,CAAA;AAAA,IAEJ,CAAC;AAAA;AACH;AAGF,IAAM,GAAA,GAAM,MAAA;AAML,IAAM,cAAc,CACzB,QAAA,EACA,EAAE,MAAA,EAAQ,QAAO,MACA;AAAA,EACjB,QAAA;AAAA,EACA,UAAA,EAAY,IAAA;AAAA,EACZ,YAAA,EAAc;AAAA,IACZ,GAAA,EAAK,EAAE,KAAA,EAAO,MAAA,EAAQ,eAAe,GAAA,EAAI;AAAA,IACzC,MAAA,EAAQ,EAAE,KAAA,EAAO,MAAA,EAAQ,YAAY,GAAA,EAAI;AAAA,IACzC,IAAA,EAAM,EAAE,YAAA,EAAc,GAAA,EAAI;AAAA,IAC1B,KAAA,EAAO,EAAE,WAAA,EAAa,GAAA;AAAI,IAC1B,QAAQ,CAAA;AAAA,EACV,OAAA,kBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,QAAA,EAAU,MAAA;AAAA,MACV,MAAA,EAAQ,QAAA,KAAa,MAAA,IAAU,QAAA,KAAa;AAAA;AAAA;AAGlD,CAAA","file":"chunk-6ALKZLN2.js","sourcesContent":["import { useCallback, useState, type ReactNode } from 'react';\nimport type { LegendPayload, LegendProps } from 'recharts';\nimport type { ChartLegendPosition } from '../types';\nimport { MUTED, TEXT } from './colors';\nimport { TEXT_SIZE } from './axes';\n\n/**\n * The series a click on the legend hid, and the toggle. A hidden series is\n * passed to its graphical item as `hide`, so the axes fit what is left.\n */\nexport const useHiddenSeries = () => {\n const [hidden, setHidden] = useState<ReadonlySet<string>>(new Set());\n const toggle = useCallback((key: string) => {\n setHidden((current) => {\n const next = new Set(current);\n if (!next.delete(key)) next.add(key);\n return next;\n });\n }, []);\n return { hidden, toggle };\n};\n\ntype ChartLegendProps = {\n /** Given by Recharts: one entry per series, in the order the series are drawn. */\n payload?: readonly LegendPayload[];\n /** The keys of the hidden series. */\n hidden: ReadonlySet<string>;\n onToggle: (key: string) => void;\n /** Items in a column (`left`, `right`) or a row (`top`, `bottom`). */\n column?: boolean;\n /**\n * A figure written after the name of the entry at `index`: a value and its\n * share. In a column the figures sit at the right edge, aligned on their\n * last digit; in a row they follow the name.\n */\n detail?: (index: number) => { value: string; share: string };\n};\n\n/**\n * The legend of every chart: a round chip and the series name in the muted\n * text color, one button per series. A click (or Enter, Space) hides the series\n * and shows it again; the button says which in `aria-pressed`. Pass it as\n * `<Legend content={…} itemSorter={null} />`: Recharts sorts the items by name\n * unless told not to, and the series keep their order.\n */\nexport const ChartLegend = ({ payload, hidden, onToggle, column, detail }: ChartLegendProps) => (\n <ul\n style={{\n display: 'flex',\n flexDirection: column ? 'column' : 'row',\n flexWrap: 'wrap',\n gap: column ? '0.375rem' : '0.25rem 1rem',\n margin: 0,\n padding: 0,\n listStyle: 'none',\n fontSize: TEXT_SIZE,\n color: MUTED,\n }}\n >\n {payload?.map((entry, index) => {\n const key = String(entry.dataKey);\n const figures = detail?.(index);\n const off = hidden.has(key);\n return (\n <li key={key}>\n <button\n type=\"button\"\n aria-pressed={!off}\n onClick={() => onToggle(key)}\n className=\"focus-visible:focus-indicator\"\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: '0.375rem',\n padding: '0.125rem 0.25rem',\n font: 'inherit',\n color: 'inherit',\n background: 'none',\n border: 0,\n borderRadius: '0.25rem',\n cursor: 'pointer',\n textDecoration: off ? 'line-through' : undefined,\n // The figures of a column reach its right edge, which aligns them.\n ...(figures && column ? { display: 'flex', width: '100%', gap: '0.75rem' } : {}),\n }}\n >\n <span\n aria-hidden\n style={{\n width: '0.625rem',\n height: '0.625rem',\n borderRadius: '50%',\n background: entry.color,\n // Text keeps its color: dimming it would fail the contrast check.\n opacity: off ? 0.35 : 1,\n }}\n />\n {figures ? (\n <>\n <span style={column ? { flex: 1, textAlign: 'start' } : undefined}>\n {entry.value as ReactNode}\n </span>\n <span\n style={{\n color: TEXT,\n fontWeight: 600,\n fontVariantNumeric: 'tabular-nums',\n textAlign: 'end',\n }}\n >\n {figures.value}\n </span>\n <span\n style={{\n minWidth: column ? '3.5ch' : undefined,\n fontVariantNumeric: 'tabular-nums',\n textAlign: 'end',\n }}\n >\n {figures.share}\n </span>\n </>\n ) : (\n (entry.value as ReactNode)\n )}\n </button>\n </li>\n );\n })}\n </ul>\n);\n\nconst GAP = '1rem';\n\n/**\n * The props of the `<Legend>` of a chart: on `position`, the chips and names\n * of `ChartLegend`, in series order, a `GAP` away from the plot.\n */\nexport const legendProps = (\n position: ChartLegendPosition,\n { hidden, toggle }: ReturnType<typeof useHiddenSeries>\n): LegendProps => ({\n position,\n itemSorter: null,\n wrapperStyle: {\n top: { width: '100%', paddingBottom: GAP },\n bottom: { width: '100%', paddingTop: GAP },\n left: { paddingRight: GAP },\n right: { paddingLeft: GAP },\n }[position],\n content: (\n <ChartLegend\n hidden={hidden}\n onToggle={toggle}\n column={position === 'left' || position === 'right'}\n />\n ),\n});\n"]}
1
+ {"version":3,"sources":["../src/core/ChartLegend.tsx"],"names":[],"mappings":";;;;;;AAUO,IAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,IAAI,QAAA,iBAA8B,IAAI,KAAK,CAAA;AACnE,EAAA,MAAM,MAAA,GAAS,WAAA,CAAY,CAAC,GAAA,KAAgB;AAC1C,IAAA,SAAA,CAAU,CAAC,OAAA,KAAY;AACrB,MAA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A,EAAoB,cAAA;AAAA,oBACpB,SAAA,EAAW;AAAA,mBACb;AAAA,kBAEC,QAAA,EAAA,OAAA,CAAQ;AAAA;AAAA,eACX;AAAA,8BACA,GAAA;AAAA,gBAAC,MAAA;AAAA,gBAAA;AAAA,kBACC,KAAA,EAAO;AAAA,oBACL,QAAA,EAAU,SAAS,OAAA,GAAU,MAAA;AAAA,oBAC7B,kBAAA,EAAoB,cAAA;AAAA,oBACpB,SAAA,EAAW;AAAA,mBACb;AAAA,kBAEC,QAAA,EAAA,OAAA,CAAQ;AAAA;AAAA;AACX,aAAA,EACF,IAEC,KAAA,CAAM;AAAA;AAAA;AAAA,WA3DJ,GA8DT,CAAA;AAAA,IAEJ,CAAC;AAAA;AACH;AAGF,IAAM,GAAA,GAAM,MAAA;AAML,IAAM,cAAc,CACzB,QAAA,EACA,EAAE,MAAA,EAAQ,QAAO,MACA;AAAA,EACjB,QAAA;AAAA,EACA,UAAA,EAAY,IAAA;AAAA,EACZ,YAAA,EAAc;AAAA,IACZ,GAAA,EAAK,EAAE,KAAA,EAAO,MAAA,EAAQ,eAAe,GAAA,EAAI;AAAA,IACzC,MAAA,EAAQ,EAAE,KAAA,EAAO,MAAA,EAAQ,YAAY,GAAA,EAAI;AAAA,IACzC,IAAA,EAAM,EAAE,YAAA,EAAc,GAAA,EAAI;AAAA,IAC1B,KAAA,EAAO,EAAE,WAAA,EAAa,GAAA;AAAI,IAC1B,QAAQ,CAAA;AAAA,EACV,OAAA,kBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,QAAA,EAAU,MAAA;AAAA,MACV,MAAA,EAAQ,QAAA,KAAa,MAAA,IAAU,QAAA,KAAa;AAAA;AAAA;AAGlD,CAAA","file":"chunk-4AKHZNWP.js","sourcesContent":["import { useCallback, useState, type ReactNode } from 'react';\nimport type { LegendPayload, LegendProps } from 'recharts';\nimport type { ChartLegendPosition } from '../types';\nimport { MUTED, TEXT } from './colors';\nimport { TEXT_SIZE } from './axes';\n\n/**\n * The series a click on the legend hid, and the toggle. A hidden series is\n * passed to its graphical item as `hide`, so the axes fit what is left.\n */\nexport const useHiddenSeries = () => {\n const [hidden, setHidden] = useState<ReadonlySet<string>>(new Set());\n const toggle = useCallback((key: string) => {\n setHidden((current) => {\n const next = new Set(current);\n if (!next.delete(key)) next.add(key);\n return next;\n });\n }, []);\n return { hidden, toggle };\n};\n\ntype ChartLegendProps = {\n /** Given by Recharts: one entry per series, in the order the series are drawn. */\n payload?: readonly LegendPayload[];\n /** The keys of the hidden series. */\n hidden: ReadonlySet<string>;\n onToggle: (key: string) => void;\n /** Items in a column (`left`, `right`) or a row (`top`, `bottom`). */\n column?: boolean;\n /**\n * A figure written after the name of the entry at `index`: a value and its\n * share. In a column the figures sit at the right edge, aligned on their\n * last digit; in a row they follow the name.\n */\n detail?: (index: number) => { value: string; share: string };\n};\n\n/**\n * The legend of every chart: a round chip and the series name in the muted\n * text color, one button per series. A click (or Enter, Space) hides the series\n * and shows it again; the button says which in `aria-pressed`. Pass it as\n * `<Legend content={…} itemSorter={null} />`: Recharts sorts the items by name\n * unless told not to, and the series keep their order.\n */\nexport const ChartLegend = ({ payload, hidden, onToggle, column, detail }: ChartLegendProps) => (\n <ul\n style={{\n display: 'flex',\n flexDirection: column ? 'column' : 'row',\n flexWrap: 'wrap',\n gap: column ? '0.375rem' : '0.25rem 1rem',\n margin: 0,\n padding: 0,\n listStyle: 'none',\n fontSize: TEXT_SIZE,\n color: MUTED,\n }}\n >\n {payload?.map((entry, index) => {\n const key = String(entry.dataKey);\n const figures = detail?.(index);\n const off = hidden.has(key);\n return (\n <li key={key}>\n <button\n type=\"button\"\n aria-pressed={!off}\n onClick={() => onToggle(key)}\n className=\"focus-visible:focus-indicator\"\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: '0.375rem',\n padding: '0.125rem 0.25rem',\n font: 'inherit',\n color: 'inherit',\n background: 'none',\n border: 0,\n borderRadius: '0.25rem',\n cursor: 'pointer',\n textDecoration: off ? 'line-through' : undefined,\n // The figures of a column reach its right edge, which aligns them.\n ...(figures && column ? { display: 'flex', width: '100%', gap: '0.75rem' } : {}),\n }}\n >\n <span\n aria-hidden\n style={{\n width: '0.625rem',\n height: '0.625rem',\n borderRadius: '50%',\n background: entry.color,\n // Text keeps its color: dimming it would fail the contrast check.\n opacity: off ? 0.35 : 1,\n }}\n />\n {figures ? (\n <>\n <span style={column ? { flex: 1, textAlign: 'start' } : undefined}>\n {entry.value as ReactNode}\n </span>\n <span\n style={{\n color: TEXT,\n fontWeight: 600,\n fontVariantNumeric: 'tabular-nums',\n textAlign: 'end',\n }}\n >\n {figures.value}\n </span>\n <span\n style={{\n minWidth: column ? '3.5ch' : undefined,\n fontVariantNumeric: 'tabular-nums',\n textAlign: 'end',\n }}\n >\n {figures.share}\n </span>\n </>\n ) : (\n (entry.value as ReactNode)\n )}\n </button>\n </li>\n );\n })}\n </ul>\n);\n\nconst GAP = '1rem';\n\n/**\n * The props of the `<Legend>` of a chart: on `position`, the chips and names\n * of `ChartLegend`, in series order, a `GAP` away from the plot.\n */\nexport const legendProps = (\n position: ChartLegendPosition,\n { hidden, toggle }: ReturnType<typeof useHiddenSeries>\n): LegendProps => ({\n position,\n itemSorter: null,\n wrapperStyle: {\n top: { width: '100%', paddingBottom: GAP },\n bottom: { width: '100%', paddingTop: GAP },\n left: { paddingRight: GAP },\n right: { paddingLeft: GAP },\n }[position],\n content: (\n <ChartLegend\n hidden={hidden}\n onToggle={toggle}\n column={position === 'left' || position === 'right'}\n />\n ),\n});\n"]}
@@ -13,8 +13,10 @@ var frameProps = ({
13
13
  accessibilityLayer: keyboard,
14
14
  ...keyboard ? {} : { role: "img" },
15
15
  "aria-label": ariaLabel,
16
- // `maxWidth`: a chart wider than its parent would widen the page.
17
- style: { width, height, maxWidth: "100%" }
16
+ // `maxWidth`: a chart wider than its parent would widen the page. `direction`: a chart keeps
17
+ // its left-to-right axes under `dir="rtl"`; left alone, the SVG's `text-anchor` would read
18
+ // `start` and `end` from the page and put the labels on the wrong side of their marks.
19
+ style: { width, height, maxWidth: "100%", direction: "ltr" }
18
20
  });
19
21
  var useFontsLoaded = () => {
20
22
  const [loaded, setLoaded] = useState(0);
@@ -56,5 +58,5 @@ var ChartEmpty = ({ message, ariaLabel, height, width = "100%" }) => /* @__PURE_
56
58
  );
57
59
 
58
60
  export { ChartEmpty, frameProps, useFontsLoaded };
59
- //# sourceMappingURL=chunk-3N43QT36.js.map
60
- //# sourceMappingURL=chunk-3N43QT36.js.map
61
+ //# sourceMappingURL=chunk-56WD3OHA.js.map
62
+ //# sourceMappingURL=chunk-56WD3OHA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/frame.tsx"],"names":[],"mappings":";;;;;AAoBO,IAAM,aAAa,CAAC;AAAA,EACzB,MAAA;AAAA,EACA,KAAA,GAAQ,MAAA;AAAA,EACR,SAAA;AAAA,EACA,QAAA,GAAW;AACb,CAAA,MAAqB;AAAA,EACnB,UAAA,EAAY,IAAA;AAAA,EACZ,kBAAA,EAAoB,QAAA;AAAA,EACpB,GAAI,QAAA,GAAW,EAAC,GAAI,EAAE,MAAM,KAAA,EAAM;AAAA,EAClC,YAAA,EAAc,SAAA;AAAA;AAAA;AAAA;AAAA,EAId,OAAO,EAAE,KAAA,EAAO,QAAQ,QAAA,EAAU,MAAA,EAAQ,WAAW,KAAA;AACvD,CAAA;AAWO,IAAM,iBAAiB,MAAa;AACzC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAgB,CAAC,CAAA;AAC7C,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,KAAA,GAAQ,OAAO,QAAA,KAAa,WAAA,GAAc,SAAY,QAAA,CAAS,KAAA;AACrE,IAAA,IAAI,CAAC,OAAO,gBAAA,EAAkB;AAC9B,IAAA,IAAI,MAAA,GAAS,IAAA;AACb,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,IAAI,MAAA,YAAkB,CAAC,CAAA;AAAA,IACzB,CAAA;AACA,IAAA,KAAA,CAAM,gBAAA,CAAiB,eAAe,IAAI,CAAA;AAG1C,IAAA,IAAI,MAAM,MAAA,KAAW,SAAA,OAAgB,KAAA,CAAM,KAAA,CAAM,KAAK,IAAI,CAAA;AAC1D,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,GAAS,KAAA;AACT,MAAA,KAAA,CAAM,mBAAA,CAAoB,eAAe,IAAI,CAAA;AAAA,IAC/C,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,MAAA;AACT;AASO,IAAM,UAAA,GAAa,CAAC,EAAE,OAAA,EAAS,WAAW,MAAA,EAAQ,KAAA,GAAQ,QAAO,qBACtE,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,IAAA,EAAK,OAAA;AAAA,IACL,YAAA,EAAY,SAAA;AAAA,IACZ,kBAAA,EAAiB,EAAA;AAAA,IACjB,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,cAAA,EAAgB,QAAA;AAAA,MAChB,KAAA;AAAA,MACA,MAAA;AAAA,MACA,QAAA,EAAU,MAAA;AAAA,MACV,KAAA,EAAO,KAAA;AAAA,MACP,QAAA,EAAU,0BAAA;AAAA,MACV,SAAA,EAAW;AAAA,KACb;AAAA,IAEC,QAAA,EAAA;AAAA;AACH","file":"chunk-56WD3OHA.js","sourcesContent":["import { useEffect, useState, type CSSProperties } from 'react';\nimport { MUTED } from './colors';\nimport type { ChartSize } from '../types';\n\ntype FrameOptions = ChartSize & {\n ariaLabel: string;\n /**\n * Tab reaches the chart and the arrow keys walk its points (default). Off,\n * the chart is an image out of the tab order: right for a single value.\n */\n keyboard?: boolean;\n};\n\n/**\n * What every Recharts chart takes on its root, spread onto it: it fills the\n * width it is given (`width` default `100%`) at `height`, and is named by\n * `ariaLabel`. With `accessibilityLayer`, Recharts makes the chart an\n * `application` in the tab order, and the arrow keys move the tooltip from\n * point to point.\n */\nexport const frameProps = ({\n height,\n width = '100%',\n ariaLabel,\n keyboard = true,\n}: FrameOptions) => ({\n responsive: true,\n accessibilityLayer: keyboard,\n ...(keyboard ? {} : { role: 'img' }),\n 'aria-label': ariaLabel,\n // `maxWidth`: a chart wider than its parent would widen the page. `direction`: a chart keeps\n // its left-to-right axes under `dir=\"rtl\"`; left alone, the SVG's `text-anchor` would read\n // `start` and `end` from the page and put the labels on the wrong side of their marks.\n style: { width, height, maxWidth: '100%', direction: 'ltr' } satisfies CSSProperties,\n});\n\n/**\n * `0` until a web font finishes loading after the chart mounted, then `1`\n * (one more render of the chart, no more). `YAxis width=\"auto\"` measures its\n * labels once, in the fallback font if the web font is not there yet, and a\n * label set in the real font can overrun the axis: `useAxis` (axes.ts) hands\n * the axes a new object when this turns `1`, and they measure again. A chart\n * that mounts with the font ready never changes, and nothing runs where\n * `document.fonts` is missing (SSR, old browsers).\n */\nexport const useFontsLoaded = (): 0 | 1 => {\n const [loaded, setLoaded] = useState<0 | 1>(0);\n useEffect(() => {\n const fonts = typeof document === 'undefined' ? undefined : document.fonts;\n if (!fonts?.addEventListener) return;\n let active = true;\n const done = () => {\n if (active) setLoaded(1);\n };\n fonts.addEventListener('loadingdone', done);\n // A font already loading when the chart mounts: its event may be on its way\n // or already gone, `ready` settles once it has loaded.\n if (fonts.status === 'loading') void fonts.ready.then(done);\n return () => {\n active = false;\n fonts.removeEventListener('loadingdone', done);\n };\n }, []);\n return loaded;\n};\n\ntype EmptyProps = ChartSize & {\n /** Plain text. An empty string draws nothing. */\n message: string;\n ariaLabel: string;\n};\n\n/** What a chart with no data draws in place of its plot: the message, centered, and nothing around it. */\nexport const ChartEmpty = ({ message, ariaLabel, height, width = '100%' }: EmptyProps) => (\n <div\n role=\"group\"\n aria-label={ariaLabel}\n data-chart-empty=\"\"\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width,\n height,\n maxWidth: '100%',\n color: MUTED,\n fontSize: 'var(--text-sm, 0.875rem)',\n textAlign: 'center',\n }}\n >\n {message}\n </div>\n);\n"]}
@@ -2,7 +2,7 @@
2
2
  import { clampTo, gaugeName } from './chunk-OCD6JIIX.js';
3
3
  import { CenterText } from './chunk-URNXLVSK.js';
4
4
  import { ANIMATION } from './chunk-5C2RLJYZ.js';
5
- import { frameProps } from './chunk-3N43QT36.js';
5
+ import { frameProps } from './chunk-56WD3OHA.js';
6
6
  import { TRACK } from './chunk-UATB2IRY.js';
7
7
  import { RadialBarChart, PolarAngleAxis, RadialBar } from 'recharts';
8
8
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -57,5 +57,5 @@ var RadialGauge = ({
57
57
  );
58
58
 
59
59
  export { RadialGauge };
60
- //# sourceMappingURL=chunk-YWYF5CCJ.js.map
61
- //# sourceMappingURL=chunk-YWYF5CCJ.js.map
60
+ //# sourceMappingURL=chunk-6FGJZBTC.js.map
61
+ //# sourceMappingURL=chunk-6FGJZBTC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/RadialGauge.tsx"],"names":[],"mappings":";;;;;;;;;AAkCO,IAAM,cAAc,CAAC;AAAA,EAC1B,KAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,qBACE,IAAA;AAAA,EAAC,cAAA;AAAA,EAAA;AAAA,IACE,GAAG,UAAA,CAAW;AAAA,MACb,MAAA;AAAA,MACA,KAAA;AAAA,MACA,SAAA,EAAW,SAAA,CAAU,SAAA,KAAc,KAAA,IAAS,UAAU,IAAI,CAAA;AAAA,MAC1D,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,IAAA,EAAM,CAAC,EAAE,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,OAAA,CAAQ,KAAA,EAAO,GAAA,EAAK,GAAG,CAAA,EAAG,CAAA;AAAA,IACvD,UAAA,EAAY,EAAA;AAAA,IACZ,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,MAAA;AAAA,IACb,WAAA,EAAY,MAAA;AAAA,IAEZ,cAAA,EAAgB,CAAA;AAAA,IAChB,MAAA,EAAQ,EAAE,GAAA,EAAK,CAAA,EAAG,OAAO,CAAA,EAAG,MAAA,EAAQ,CAAA,EAAG,IAAA,EAAM,CAAA,EAAE;AAAA,IAE9C,QAAA,EAAA;AAAA,MAAA,IAAA,oBAAQ,GAAA,CAAC,UAAM,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,sBACrB,GAAA,CAAC,cAAA,EAAA,EAAe,IAAA,EAAK,QAAA,EAAS,MAAA,EAAQ,CAAC,GAAA,EAAK,GAAG,CAAA,EAAG,IAAA,EAAM,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,CAAA;AAAA,sBAChF,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,OAAA;AAAA,UACR,IAAA;AAAA,UACA,KAAA;AAAA,UAGA,UAAA,EAAY,KAAA,GAAQ,KAAA,GAAQ,EAAE,MAAM,KAAA,EAAM;AAAA,UACzC,GAAG;AAAA;AAAA,OACN;AAAA,0BACC,UAAA,EAAA,EAAW,KAAA,EAAO,IAAA,EAAM,KAAA,EAAc,WAAU,2BAAA,EAA4B,CAAA;AAAA,MAC5E;AAAA;AAAA;AACH","file":"chunk-YWYF5CCJ.js","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { PolarAngleAxis, RadialBar, RadialBarChart } from 'recharts';\nimport type { SectorProps } from 'recharts';\nimport { ANIMATION } from './animation';\nimport { TRACK } from './colors';\nimport { frameProps } from './frame';\nimport { clampTo, gaugeName } from './gauge';\nimport { CenterText } from './radial';\nimport type { ChartSize } from '../types';\n\ntype RadialGaugeProps = ChartSize & {\n value: number;\n label: string;\n min: number;\n max: number;\n /** The value, formatted: the text in the middle and the end of the name. */\n text: string;\n ariaLabel?: string;\n /** The share of the radius the ring leaves empty in the middle. */\n hollow: string;\n /** The fill of the arc: a color, or a `url(#…)` to what `defs` defines. */\n fill?: string;\n /** Draws the arc, and the track under it, in place of the filled sectors. */\n shape?: (props: SectorProps) => ReactElement;\n /** What the chart defines for `fill`, such as a gradient. */\n defs?: ReactNode;\n children?: ReactNode;\n};\n\n/**\n * A full circle with one arc from the top, clockwise, on a neutral track, the\n * value in the middle over its label: the frame of `GradientRadial` and\n * `StrokedGauge`, which draw the arc and the track their own way. It is an image (out of the tab order) named by its value.\n */\nexport const RadialGauge = ({\n value,\n label,\n min,\n max,\n text,\n ariaLabel,\n hollow,\n fill,\n shape,\n defs,\n children,\n height,\n width,\n}: RadialGaugeProps) => (\n <RadialBarChart\n {...frameProps({\n height,\n width,\n ariaLabel: gaugeName(ariaLabel ?? (label || 'Gauge'), text),\n keyboard: false,\n })}\n data={[{ name: label, value: clampTo(value, min, max) }]}\n startAngle={90}\n endAngle={-270}\n innerRadius={hollow}\n outerRadius=\"100%\"\n // The arc is as thick as the ring: no gap between the bar and its band.\n barCategoryGap={0}\n margin={{ top: 0, right: 0, bottom: 0, left: 0 }}\n >\n {defs && <defs>{defs}</defs>}\n <PolarAngleAxis type=\"number\" domain={[min, max]} tick={false} axisLine={false} />\n <RadialBar\n dataKey=\"value\"\n fill={fill}\n shape={shape}\n // Recharts draws a background sector of its own and cannot restyle it: a\n // `shape` that draws the track too hides it.\n background={shape ? false : { fill: TRACK }}\n {...ANIMATION}\n />\n <CenterText value={text} label={label} valueSize=\"var(--text-3xl, 1.875rem)\" />\n {children}\n </RadialBarChart>\n);\n"]}
1
+ {"version":3,"sources":["../src/core/RadialGauge.tsx"],"names":[],"mappings":";;;;;;;;;AAkCO,IAAM,cAAc,CAAC;AAAA,EAC1B,KAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;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AQ,EAAE,MAAM,KAAA,EAAM;AAAA,UACzC,GAAG;AAAA;AAAA,OACN;AAAA,0BACC,UAAA,EAAA,EAAW,KAAA,EAAO,IAAA,EAAM,KAAA,EAAc,WAAU,2BAAA,EAA4B,CAAA;AAAA,MAC5E;AAAA;AAAA;AACH","file":"chunk-6FGJZBTC.js","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { PolarAngleAxis, RadialBar, RadialBarChart } from 'recharts';\nimport type { SectorProps } from 'recharts';\nimport { ANIMATION } from './animation';\nimport { TRACK } from './colors';\nimport { frameProps } from './frame';\nimport { clampTo, gaugeName } from './gauge';\nimport { CenterText } from './radial';\nimport type { ChartSize } from '../types';\n\ntype RadialGaugeProps = ChartSize & {\n value: number;\n label: string;\n min: number;\n max: number;\n /** The value, formatted: the text in the middle and the end of the name. */\n text: string;\n ariaLabel?: string;\n /** The share of the radius the ring leaves empty in the middle. */\n hollow: string;\n /** The fill of the arc: a color, or a `url(#…)` to what `defs` defines. */\n fill?: string;\n /** Draws the arc, and the track under it, in place of the filled sectors. */\n shape?: (props: SectorProps) => ReactElement;\n /** What the chart defines for `fill`, such as a gradient. */\n defs?: ReactNode;\n children?: ReactNode;\n};\n\n/**\n * A full circle with one arc from the top, clockwise, on a neutral track, the\n * value in the middle over its label: the frame of `GradientRadial` and\n * `StrokedGauge`, which draw the arc and the track their own way. It is an image (out of the tab order) named by its value.\n */\nexport const RadialGauge = ({\n value,\n label,\n min,\n max,\n text,\n ariaLabel,\n hollow,\n fill,\n shape,\n defs,\n children,\n height,\n width,\n}: RadialGaugeProps) => (\n <RadialBarChart\n {...frameProps({\n height,\n width,\n ariaLabel: gaugeName(ariaLabel ?? (label || 'Gauge'), text),\n keyboard: false,\n })}\n data={[{ name: label, value: clampTo(value, min, max) }]}\n startAngle={90}\n endAngle={-270}\n innerRadius={hollow}\n outerRadius=\"100%\"\n // The arc is as thick as the ring: no gap between the bar and its band.\n barCategoryGap={0}\n margin={{ top: 0, right: 0, bottom: 0, left: 0 }}\n >\n {defs && <defs>{defs}</defs>}\n <PolarAngleAxis type=\"number\" domain={[min, max]} tick={false} axisLine={false} />\n <RadialBar\n dataKey=\"value\"\n fill={fill}\n shape={shape}\n // Recharts draws a background sector of its own and cannot restyle it: a\n // `shape` that draws the track too hides it.\n background={shape ? false : { fill: TRACK }}\n {...ANIMATION}\n />\n <CenterText value={text} label={label} valueSize=\"var(--text-3xl, 1.875rem)\" />\n {children}\n </RadialBarChart>\n);\n"]}
@@ -4,7 +4,7 @@
4
4
  var chunkAAYHG7YK_cjs = require('./chunk-AAYHG7YK.cjs');
5
5
  var chunkX3YZP5WF_cjs = require('./chunk-X3YZP5WF.cjs');
6
6
  var chunkTYQWZR3S_cjs = require('./chunk-TYQWZR3S.cjs');
7
- var chunk6NRRABPF_cjs = require('./chunk-6NRRABPF.cjs');
7
+ var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
8
8
  var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
9
9
  var recharts = require('recharts');
10
10
  var jsxRuntime = require('react/jsx-runtime');
@@ -26,7 +26,7 @@ var RadialGauge = ({
26
26
  }) => /* @__PURE__ */ jsxRuntime.jsxs(
27
27
  recharts.RadialBarChart,
28
28
  {
29
- ...chunk6NRRABPF_cjs.frameProps({
29
+ ...chunkSR2ESX3R_cjs.frameProps({
30
30
  height,
31
31
  width,
32
32
  ariaLabel: chunkAAYHG7YK_cjs.gaugeName(ariaLabel ?? (label || "Gauge"), text),
@@ -59,5 +59,5 @@ var RadialGauge = ({
59
59
  );
60
60
 
61
61
  exports.RadialGauge = RadialGauge;
62
- //# sourceMappingURL=chunk-MN4CDVOS.cjs.map
63
- //# sourceMappingURL=chunk-MN4CDVOS.cjs.map
62
+ //# sourceMappingURL=chunk-CMBNNLIV.cjs.map
63
+ //# sourceMappingURL=chunk-CMBNNLIV.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/RadialGauge.tsx"],"names":["jsxs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A,EAAU,KAAA,EAAO,CAAA;AAAA,sBAChFD,cAAA;AAAA,QAACE,kBAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,OAAA;AAAA,UACR,IAAA;AAAA,UACA,KAAA;AAAA,UAGA,UAAA,EAAY,KAAA,GAAQ,KAAA,GAAQ,EAAE,MAAMC,uBAAA,EAAM;AAAA,UACzC,GAAGC;AAAA;AAAA,OACN;AAAA,qCACCC,4BAAA,EAAA,EAAW,KAAA,EAAO,IAAA,EAAM,KAAA,EAAc,WAAU,2BAAA,EAA4B,CAAA;AAAA,MAC5E;AAAA;AAAA;AACH","file":"chunk-MN4CDVOS.cjs","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { PolarAngleAxis, RadialBar, RadialBarChart } from 'recharts';\nimport type { SectorProps } from 'recharts';\nimport { ANIMATION } from './animation';\nimport { TRACK } from './colors';\nimport { frameProps } from './frame';\nimport { clampTo, gaugeName } from './gauge';\nimport { CenterText } from './radial';\nimport type { ChartSize } from '../types';\n\ntype RadialGaugeProps = ChartSize & {\n value: number;\n label: string;\n min: number;\n max: number;\n /** The value, formatted: the text in the middle and the end of the name. */\n text: string;\n ariaLabel?: string;\n /** The share of the radius the ring leaves empty in the middle. */\n hollow: string;\n /** The fill of the arc: a color, or a `url(#…)` to what `defs` defines. */\n fill?: string;\n /** Draws the arc, and the track under it, in place of the filled sectors. */\n shape?: (props: SectorProps) => ReactElement;\n /** What the chart defines for `fill`, such as a gradient. */\n defs?: ReactNode;\n children?: ReactNode;\n};\n\n/**\n * A full circle with one arc from the top, clockwise, on a neutral track, the\n * value in the middle over its label: the frame of `GradientRadial` and\n * `StrokedGauge`, which draw the arc and the track their own way. It is an image (out of the tab order) named by its value.\n */\nexport const RadialGauge = ({\n value,\n label,\n min,\n max,\n text,\n ariaLabel,\n hollow,\n fill,\n shape,\n defs,\n children,\n height,\n width,\n}: RadialGaugeProps) => (\n <RadialBarChart\n {...frameProps({\n height,\n width,\n ariaLabel: gaugeName(ariaLabel ?? (label || 'Gauge'), text),\n keyboard: false,\n })}\n data={[{ name: label, value: clampTo(value, min, max) }]}\n startAngle={90}\n endAngle={-270}\n innerRadius={hollow}\n outerRadius=\"100%\"\n // The arc is as thick as the ring: no gap between the bar and its band.\n barCategoryGap={0}\n margin={{ top: 0, right: 0, bottom: 0, left: 0 }}\n >\n {defs && <defs>{defs}</defs>}\n <PolarAngleAxis type=\"number\" domain={[min, max]} tick={false} axisLine={false} />\n <RadialBar\n dataKey=\"value\"\n fill={fill}\n shape={shape}\n // Recharts draws a background sector of its own and cannot restyle it: a\n // `shape` that draws the track too hides it.\n background={shape ? false : { fill: TRACK }}\n {...ANIMATION}\n />\n <CenterText value={text} label={label} valueSize=\"var(--text-3xl, 1.875rem)\" />\n {children}\n </RadialBarChart>\n);\n"]}
1
+ {"version":3,"sources":["../src/core/RadialGauge.tsx"],"names":["jsxs","RadialBarChart","frameProps","gaugeName","clampTo","jsx","PolarAngleAxis","RadialBar","TRACK","ANIMATION","CenterText"],"mappings":";;;;;;;;;;;AAkCO,IAAM,cAAc,CAAC;AAAA,EAC1B,KAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,qBACEA,eAAA;AAAA,EAACC,uBAAA;AAAA,EAAA;AAAA,IACE,GAAGC,4BAAA,CAAW;AAAA,MACb,MAAA;AAAA,MACA,KAAA;AAAA,MACA,SAAA,EAAWC,2BAAA,CAAU,SAAA,KAAc,KAAA,IAAS,UAAU,IAAI,CAAA;AAAA,MAC1D,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,IAAA,EAAM,CAAC,EAAE,IAAA,EAAM,KAAA,EAAO,KAAA,EAAOC,yBAAA,CAAQ,KAAA,EAAO,GAAA,EAAK,GAAG,CAAA,EAAG,CAAA;AAAA,IACvD,UAAA,EAAY,EAAA;AAAA,IACZ,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,MAAA;AAAA,IACb,WAAA,EAAY,MAAA;AAAA,IAEZ,cAAA,EAAgB,CAAA;AAAA,IAChB,MAAA,EAAQ,EAAE,GAAA,EAAK,CAAA,EAAG,OAAO,CAAA,EAAG,MAAA,EAAQ,CAAA,EAAG,IAAA,EAAM,CAAA,EAAE;AAAA,IAE9C,QAAA,EAAA;AAAA,MAAA,IAAA,oBAAQC,cAAA,CAAC,UAAM,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,sBACrBA,cAAA,CAACC,uBAAA,EAAA,EAAe,IAAA,EAAK,QAAA,EAAS,MAAA,EAAQ,CAAC,GAAA,EAAK,GAAG,CAAA,EAAG,IAAA,EAAM,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,CAAA;AAAA,sBAChFD,cAAA;AAAA,QAACE,kBAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,OAAA;AAAA,UACR,IAAA;AAAA,UACA,KAAA;AAAA,UAGA,UAAA,EAAY,KAAA,GAAQ,KAAA,GAAQ,EAAE,MAAMC,uBAAA,EAAM;AAAA,UACzC,GAAGC;AAAA;AAAA,OACN;AAAA,qCACCC,4BAAA,EAAA,EAAW,KAAA,EAAO,IAAA,EAAM,KAAA,EAAc,WAAU,2BAAA,EAA4B,CAAA;AAAA,MAC5E;AAAA;AAAA;AACH","file":"chunk-CMBNNLIV.cjs","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { PolarAngleAxis, RadialBar, RadialBarChart } from 'recharts';\nimport type { SectorProps } from 'recharts';\nimport { ANIMATION } from './animation';\nimport { TRACK } from './colors';\nimport { frameProps } from './frame';\nimport { clampTo, gaugeName } from './gauge';\nimport { CenterText } from './radial';\nimport type { ChartSize } from '../types';\n\ntype RadialGaugeProps = ChartSize & {\n value: number;\n label: string;\n min: number;\n max: number;\n /** The value, formatted: the text in the middle and the end of the name. */\n text: string;\n ariaLabel?: string;\n /** The share of the radius the ring leaves empty in the middle. */\n hollow: string;\n /** The fill of the arc: a color, or a `url(#…)` to what `defs` defines. */\n fill?: string;\n /** Draws the arc, and the track under it, in place of the filled sectors. */\n shape?: (props: SectorProps) => ReactElement;\n /** What the chart defines for `fill`, such as a gradient. */\n defs?: ReactNode;\n children?: ReactNode;\n};\n\n/**\n * A full circle with one arc from the top, clockwise, on a neutral track, the\n * value in the middle over its label: the frame of `GradientRadial` and\n * `StrokedGauge`, which draw the arc and the track their own way. It is an image (out of the tab order) named by its value.\n */\nexport const RadialGauge = ({\n value,\n label,\n min,\n max,\n text,\n ariaLabel,\n hollow,\n fill,\n shape,\n defs,\n children,\n height,\n width,\n}: RadialGaugeProps) => (\n <RadialBarChart\n {...frameProps({\n height,\n width,\n ariaLabel: gaugeName(ariaLabel ?? (label || 'Gauge'), text),\n keyboard: false,\n })}\n data={[{ name: label, value: clampTo(value, min, max) }]}\n startAngle={90}\n endAngle={-270}\n innerRadius={hollow}\n outerRadius=\"100%\"\n // The arc is as thick as the ring: no gap between the bar and its band.\n barCategoryGap={0}\n margin={{ top: 0, right: 0, bottom: 0, left: 0 }}\n >\n {defs && <defs>{defs}</defs>}\n <PolarAngleAxis type=\"number\" domain={[min, max]} tick={false} axisLine={false} />\n <RadialBar\n dataKey=\"value\"\n fill={fill}\n shape={shape}\n // Recharts draws a background sector of its own and cannot restyle it: a\n // `shape` that draws the track too hides it.\n background={shape ? false : { fill: TRACK }}\n {...ANIMATION}\n />\n <CenterText value={text} label={label} valueSize=\"var(--text-3xl, 1.875rem)\" />\n {children}\n </RadialBarChart>\n);\n"]}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useFontsLoaded } from './chunk-3N43QT36.js';
2
+ import { useFontsLoaded } from './chunk-56WD3OHA.js';
3
3
  import { MUTED, GRID } from './chunk-UATB2IRY.js';
4
4
 
5
5
  // src/core/axes.ts
@@ -40,5 +40,5 @@ var yAxisTitle = (title) => title ? {
40
40
  } : {};
41
41
 
42
42
  export { AXIS, GRID_PROPS, TEXT_SIZE, useAxis, xAxisTitle, yAxisTitle };
43
- //# sourceMappingURL=chunk-RILUG7JB.js.map
44
- //# sourceMappingURL=chunk-RILUG7JB.js.map
43
+ //# sourceMappingURL=chunk-DI2FBGKM.js.map
44
+ //# sourceMappingURL=chunk-DI2FBGKM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/axes.ts"],"names":[],"mappings":";;;;;AAMO,IAAM,SAAA,GAAY;AAGlB,IAAM,IAAA,GAAO;AAAA,EAClB,QAAA,EAAU,KAAA;AAAA,EACV,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY,CAAA;AAAA,EACZ,IAAA,EAAM,EAAE,IAAA,EAAM,KAAA,EAAO,OAAO,EAAE,QAAA,EAAU,WAAU;AACpD;AAMA,IAAM,gBAAA,GAAmB,EAAE,GAAG,IAAA,EAAM,MAAM,EAAE,GAAG,IAAA,CAAK,IAAA,EAAK,EAAE;AAQpD,IAAM,OAAA,GAAU,MAAO,cAAA,EAAe,GAAI,gBAAA,GAAmB;AAG7D,IAAM,UAAA,GAAa;AAAA,EACxB,QAAA,EAAU,KAAA;AAAA,EACV,MAAA,EAAQ,IAAA;AAAA,EACR,eAAA,EAAiB;AACnB;AAGA,IAAM,UAAA,GAAa,EAAE,IAAA,EAAM,KAAA,EAAO,UAAU,SAAA,EAAU;AAG/C,IAAM,UAAA,GAAa,CAAC,KAAA,KACzB,KAAA,GACK;AAAA,EACC,MAAA,EAAQ,EAAA;AAAA,EACR,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA;AAAA,IACP,QAAA,EAAU,cAAA;AAAA,IACV,MAAA,EAAQ,CAAA;AAAA,IACR,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO;AAAA;AAEX,CAAA,GACA;AAGC,IAAM,UAAA,GAAa,CAAC,KAAA,KACzB,KAAA,GACK;AAAA,EACC,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA;AAAA,IACP,KAAA,EAAO,GAAA;AAAA,IACP,QAAA,EAAU,YAAA;AAAA,IACV,MAAA,EAAQ,CAAA;AAAA,IACR,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,EAAE,GAAG,UAAA,EAAY,YAAY,QAAA;AAAS;AAEjD,CAAA,GACA","file":"chunk-RILUG7JB.js","sourcesContent":["import { GRID, MUTED } from './colors';\nimport { useFontsLoaded } from './frame';\n\n// Axis text is 12px at the normal text size and follows the text size setting:\n// `--text-xs` is rescaled on <html> by `data-text-size`. The fallback is the\n// normal size, for an app that doesn't load the theme.\nexport const TEXT_SIZE = 'var(--text-xs, 0.75rem)';\n\n/** The look of every axis: no line, no tick mark, muted text. */\nexport const AXIS = {\n axisLine: false,\n tickLine: false,\n tickMargin: 8,\n tick: { fill: MUTED, style: { fontSize: TEXT_SIZE } },\n} as const;\n\n// `AXIS` again, with a `tick` object of its own. Recharts measures a\n// `width=\"auto\"` axis when its settings change, and reads the same `tick`\n// object as no change: handing it a new one after a web font has loaded makes\n// the axis measure its labels again, in the font that is drawn.\nconst AXIS_AFTER_FONTS = { ...AXIS, tick: { ...AXIS.tick } } as const;\n\n/**\n * `AXIS` for the axes of a chart. Once a web font has finished loading after\n * the chart mounted it is another object, once: the labels were measured in\n * the fallback font, and an axis with `width=\"auto\"` makes room for them in\n * the font that is drawn (recharts 3.10.1 measures on a settings change).\n */\nexport const useAxis = () => (useFontsLoaded() ? AXIS_AFTER_FONTS : AXIS);\n\n/** The grid: horizontal dashed lines only. */\nexport const GRID_PROPS = {\n vertical: false,\n stroke: GRID,\n strokeDasharray: '4 4',\n} as const;\n\n// `fill` as an attribute too: the label's own default is gray.\nconst titleStyle = { fill: MUTED, fontSize: TEXT_SIZE } as const;\n\n/** Props for an `XAxis` with an optional title under it. The title is SVG text: markup shows as written. */\nexport const xAxisTitle = (title?: string) =>\n title\n ? ({\n height: 52,\n label: {\n value: title,\n position: 'insideBottom',\n offset: 0,\n fill: MUTED,\n style: titleStyle,\n },\n } as const)\n : {};\n\n/** Props for a `YAxis` with an optional title beside it. */\nexport const yAxisTitle = (title?: string) =>\n title\n ? ({\n label: {\n value: title,\n angle: -90,\n position: 'insideLeft',\n offset: 4,\n fill: MUTED,\n style: { ...titleStyle, textAnchor: 'middle' },\n },\n } as const)\n : {};\n"]}
1
+ {"version":3,"sources":["../src/core/axes.ts"],"names":[],"mappings":";;;;;AAMO,IAAM,SAAA,GAAY;AAGlB,IAAM,IAAA,GAAO;AAAA,EAClB,QAAA,EAAU,KAAA;AAAA,EACV,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY,CAAA;AAAA,EACZ,IAAA,EAAM,EAAE,IAAA,EAAM,KAAA,EAAO,OAAO,EAAE,QAAA,EAAU,WAAU;AACpD;AAMA,IAAM,gBAAA,GAAmB,EAAE,GAAG,IAAA,EAAM,MAAM,EAAE,GAAG,IAAA,CAAK,IAAA,EAAK,EAAE;AAQpD,IAAM,OAAA,GAAU,MAAO,cAAA,EAAe,GAAI,gBAAA,GAAmB;AAG7D,IAAM,UAAA,GAAa;AAAA,EACxB,QAAA,EAAU,KAAA;AAAA,EACV,MAAA,EAAQ,IAAA;AAAA,EACR,eAAA,EAAiB;AACnB;AAGA,IAAM,UAAA,GAAa,EAAE,IAAA,EAAM,KAAA,EAAO,UAAU,SAAA,EAAU;AAG/C,IAAM,UAAA,GAAa,CAAC,KAAA,KACzB,KAAA,GACK;AAAA,EACC,MAAA,EAAQ,EAAA;AAAA,EACR,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA;AAAA,IACP,QAAA,EAAU,cAAA;AAAA,IACV,MAAA,EAAQ,CAAA;AAAA,IACR,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO;AAAA;AAEX,CAAA,GACA;AAGC,IAAM,UAAA,GAAa,CAAC,KAAA,KACzB,KAAA,GACK;AAAA,EACC,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA;AAAA,IACP,KAAA,EAAO,GAAA;AAAA,IACP,QAAA,EAAU,YAAA;AAAA,IACV,MAAA,EAAQ,CAAA;AAAA,IACR,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,EAAE,GAAG,UAAA,EAAY,YAAY,QAAA;AAAS;AAEjD,CAAA,GACA","file":"chunk-DI2FBGKM.js","sourcesContent":["import { GRID, MUTED } from './colors';\nimport { useFontsLoaded } from './frame';\n\n// Axis text is 12px at the normal text size and follows the text size setting:\n// `--text-xs` is rescaled on <html> by `data-text-size`. The fallback is the\n// normal size, for an app that doesn't load the theme.\nexport const TEXT_SIZE = 'var(--text-xs, 0.75rem)';\n\n/** The look of every axis: no line, no tick mark, muted text. */\nexport const AXIS = {\n axisLine: false,\n tickLine: false,\n tickMargin: 8,\n tick: { fill: MUTED, style: { fontSize: TEXT_SIZE } },\n} as const;\n\n// `AXIS` again, with a `tick` object of its own. Recharts measures a\n// `width=\"auto\"` axis when its settings change, and reads the same `tick`\n// object as no change: handing it a new one after a web font has loaded makes\n// the axis measure its labels again, in the font that is drawn.\nconst AXIS_AFTER_FONTS = { ...AXIS, tick: { ...AXIS.tick } } as const;\n\n/**\n * `AXIS` for the axes of a chart. Once a web font has finished loading after\n * the chart mounted it is another object, once: the labels were measured in\n * the fallback font, and an axis with `width=\"auto\"` makes room for them in\n * the font that is drawn (recharts 3.10.1 measures on a settings change).\n */\nexport const useAxis = () => (useFontsLoaded() ? AXIS_AFTER_FONTS : AXIS);\n\n/** The grid: horizontal dashed lines only. */\nexport const GRID_PROPS = {\n vertical: false,\n stroke: GRID,\n strokeDasharray: '4 4',\n} as const;\n\n// `fill` as an attribute too: the label's own default is gray.\nconst titleStyle = { fill: MUTED, fontSize: TEXT_SIZE } as const;\n\n/** Props for an `XAxis` with an optional title under it. The title is SVG text: markup shows as written. */\nexport const xAxisTitle = (title?: string) =>\n title\n ? ({\n height: 52,\n label: {\n value: title,\n position: 'insideBottom',\n offset: 0,\n fill: MUTED,\n style: titleStyle,\n },\n } as const)\n : {};\n\n/** Props for a `YAxis` with an optional title beside it. */\nexport const yAxisTitle = (title?: string) =>\n title\n ? ({\n label: {\n value: title,\n angle: -90,\n position: 'insideLeft',\n offset: 4,\n fill: MUTED,\n style: { ...titleStyle, textAnchor: 'middle' },\n },\n } as const)\n : {};\n"]}