@stealthscale/component-charts 0.2.2 → 0.2.3

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 (123) hide show
  1. package/dist/cyclonedx/bom.json +1 -1
  2. package/dist/index.js +1 -14710
  3. package/dist/pages/area-chart/area-chart.js +1151 -0
  4. package/dist/pages/area-chart/area-chart.props.js +3 -0
  5. package/dist/pages/bar-chart/bar-chart.js +990 -0
  6. package/dist/pages/bar-chart/bar-chart.props.js +3 -0
  7. package/dist/pages/box-plot/box-plot.js +1585 -0
  8. package/dist/pages/box-plot/box-plot.props.js +3 -0
  9. package/dist/pages/bubble-chart/bubble-chart.js +938 -0
  10. package/dist/pages/bubble-chart/bubble-chart.props.js +3 -0
  11. package/dist/pages/burndown-chart/burndown-chart.js +805 -0
  12. package/dist/pages/burndown-chart/burndown-chart.props.js +3 -0
  13. package/dist/pages/candlestick-chart/candlestick-chart.js +853 -0
  14. package/dist/pages/candlestick-chart/candlestick-chart.props.js +3 -0
  15. package/dist/pages/chart/chart.js +1190 -0
  16. package/dist/pages/chart/chart.props.js +3 -0
  17. package/dist/pages/chord-diagram/chord-diagram.js +891 -0
  18. package/dist/pages/chord-diagram/chord-diagram.props.js +3 -0
  19. package/dist/pages/combo-chart/combo-chart.js +873 -0
  20. package/dist/pages/combo-chart/combo-chart.props.js +3 -0
  21. package/dist/pages/distribution-chart/distribution-chart.js +1066 -0
  22. package/dist/pages/distribution-chart/distribution-chart.props.js +3 -0
  23. package/dist/pages/donut-chart/donut-chart.js +726 -0
  24. package/dist/pages/donut-chart/donut-chart.props.js +3 -0
  25. package/dist/pages/funnel-chart/funnel-chart.js +1094 -0
  26. package/dist/pages/funnel-chart/funnel-chart.props.js +3 -0
  27. package/dist/pages/gauge-chart/gauge-chart.js +767 -0
  28. package/dist/pages/gauge-chart/gauge-chart.props.js +3 -0
  29. package/dist/pages/heatmap/heatmap.js +1967 -0
  30. package/dist/pages/heatmap/heatmap.props.js +3 -0
  31. package/dist/pages/histogram-chart/histogram-chart.js +768 -0
  32. package/dist/pages/histogram-chart/histogram-chart.props.js +3 -0
  33. package/dist/pages/horizontal-bar-chart/horizontal-bar-chart.js +701 -0
  34. package/dist/pages/horizontal-bar-chart/horizontal-bar-chart.props.js +3 -0
  35. package/dist/pages/line-chart/line-chart.js +1882 -0
  36. package/dist/pages/line-chart/line-chart.props.js +3 -0
  37. package/dist/pages/pages.json +393 -0
  38. package/dist/pages/pareto-chart/pareto-chart.js +669 -0
  39. package/dist/pages/pareto-chart/pareto-chart.props.js +3 -0
  40. package/dist/pages/percent-stacked-bar/percent-stacked-bar.js +662 -0
  41. package/dist/pages/percent-stacked-bar/percent-stacked-bar.props.js +3 -0
  42. package/dist/pages/pie-chart/pie-chart.js +1007 -0
  43. package/dist/pages/pie-chart/pie-chart.props.js +3 -0
  44. package/dist/pages/polar-area-chart/polar-area-chart.js +812 -0
  45. package/dist/pages/polar-area-chart/polar-area-chart.props.js +3 -0
  46. package/dist/pages/radar-chart/radar-chart.js +1101 -0
  47. package/dist/pages/radar-chart/radar-chart.props.js +3 -0
  48. package/dist/pages/radial-bar-chart/radial-bar-chart.js +766 -0
  49. package/dist/pages/radial-bar-chart/radial-bar-chart.props.js +3 -0
  50. package/dist/pages/range-chart/range-chart.js +914 -0
  51. package/dist/pages/range-chart/range-chart.props.js +3 -0
  52. package/dist/pages/regression-overlay/regression-overlay.js +494 -0
  53. package/dist/pages/regression-overlay/regression-overlay.props.js +3 -0
  54. package/dist/pages/sankey-chart/sankey-chart.js +700 -0
  55. package/dist/pages/sankey-chart/sankey-chart.props.js +3 -0
  56. package/dist/pages/scatter-plot/scatter-plot.js +1248 -0
  57. package/dist/pages/scatter-plot/scatter-plot.props.js +3 -0
  58. package/dist/pages/sparkbar/sparkbar.js +629 -0
  59. package/dist/pages/sparkbar/sparkbar.props.js +3 -0
  60. package/dist/pages/sparkline/sparkline.js +960 -0
  61. package/dist/pages/sparkline/sparkline.props.js +3 -0
  62. package/dist/pages/spend-5xQ76WSj.js +185 -0
  63. package/dist/pages/stacked-area-chart/stacked-area-chart.js +912 -0
  64. package/dist/pages/stacked-area-chart/stacked-area-chart.props.js +3 -0
  65. package/dist/pages/stacked-bar-chart/stacked-bar-chart.js +722 -0
  66. package/dist/pages/stacked-bar-chart/stacked-bar-chart.props.js +3 -0
  67. package/dist/pages/step-line-chart/step-line-chart.js +573 -0
  68. package/dist/pages/step-line-chart/step-line-chart.props.js +3 -0
  69. package/dist/pages/stream-graph/stream-graph.js +1662 -0
  70. package/dist/pages/stream-graph/stream-graph.props.js +3 -0
  71. package/dist/pages/sunburst-chart/sunburst-chart.js +1051 -0
  72. package/dist/pages/sunburst-chart/sunburst-chart.props.js +3 -0
  73. package/dist/pages/timeline-chart/timeline-chart.js +1124 -0
  74. package/dist/pages/timeline-chart/timeline-chart.props.js +3 -0
  75. package/dist/pages/treemap-chart/treemap-chart.js +904 -0
  76. package/dist/pages/treemap-chart/treemap-chart.props.js +3 -0
  77. package/dist/pages/violin-plot/violin-plot.js +1303 -0
  78. package/dist/pages/violin-plot/violin-plot.props.js +3 -0
  79. package/dist/pages/visitors-oFFVcbIZ.js +248 -0
  80. package/dist/pages/waterfall-chart/waterfall-chart.js +1195 -0
  81. package/dist/pages/waterfall-chart/waterfall-chart.props.js +3 -0
  82. package/dist/shared-DVZJ2nST.js +14711 -0
  83. package/dist/theme.js +1 -1
  84. package/locales/en/specimen/area-chart.json +56 -0
  85. package/locales/en/specimen/bar-chart.json +56 -0
  86. package/locales/en/specimen/box-plot.json +65 -0
  87. package/locales/en/specimen/bubble-chart.json +47 -0
  88. package/locales/en/specimen/burndown-chart.json +46 -0
  89. package/locales/en/specimen/candlestick-chart.json +42 -0
  90. package/locales/en/specimen/chart.json +53 -0
  91. package/locales/en/specimen/chord-diagram.json +69 -0
  92. package/locales/en/specimen/combo-chart.json +41 -0
  93. package/locales/en/specimen/distribution-chart.json +47 -0
  94. package/locales/en/specimen/donut-chart.json +63 -0
  95. package/locales/en/specimen/funnel-chart.json +84 -0
  96. package/locales/en/specimen/gauge-chart.json +68 -0
  97. package/locales/en/specimen/heatmap.json +187 -0
  98. package/locales/en/specimen/histogram-chart.json +48 -0
  99. package/locales/en/specimen/horizontal-bar-chart.json +54 -0
  100. package/locales/en/specimen/line-chart.json +106 -0
  101. package/locales/en/specimen/pareto-chart.json +43 -0
  102. package/locales/en/specimen/percent-stacked-bar.json +37 -0
  103. package/locales/en/specimen/pie-chart.json +80 -0
  104. package/locales/en/specimen/polar-area-chart.json +90 -0
  105. package/locales/en/specimen/radar-chart.json +82 -0
  106. package/locales/en/specimen/radial-bar-chart.json +62 -0
  107. package/locales/en/specimen/range-chart.json +42 -0
  108. package/locales/en/specimen/regression-overlay.json +36 -0
  109. package/locales/en/specimen/sankey-chart.json +89 -0
  110. package/locales/en/specimen/scatter-plot.json +88 -0
  111. package/locales/en/specimen/sparkbar.json +51 -0
  112. package/locales/en/specimen/sparkline.json +70 -0
  113. package/locales/en/specimen/stacked-area-chart.json +44 -0
  114. package/locales/en/specimen/stacked-bar-chart.json +34 -0
  115. package/locales/en/specimen/step-line-chart.json +33 -0
  116. package/locales/en/specimen/stream-graph.json +54 -0
  117. package/locales/en/specimen/sunburst-chart.json +110 -0
  118. package/locales/en/specimen/timeline-chart.json +77 -0
  119. package/locales/en/specimen/treemap-chart.json +107 -0
  120. package/locales/en/specimen/violin-plot.json +54 -0
  121. package/locales/en/specimen/waterfall-chart.json +71 -0
  122. package/package.json +8 -7
  123. /package/dist/{recipe-BbGw00ut.js → recipes-BbGw00ut.js} +0 -0
@@ -0,0 +1,812 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { E as PolarAreaChart } from "../../shared-DVZJ2nST.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Room, specimen, useWords } from "@stealthscale/specimen";
7
+ import { RotateCcwIcon } from "lucide-react";
8
+ import { Button } from "@stealthscale/component-actions";
9
+ import { Stack } from "@stealthscale/component-layout";
10
+ //#region src/polar-area-chart/examples/cycles.ts
11
+ /**
12
+ * Lists a day of requests a minute to an API, averaged over three hours from midnight. The load
13
+ * builds from 06:00, peaks at 1,180 at noon and falls by 21:00.
14
+ */
15
+ const HOURS = [
16
+ {
17
+ key: "00",
18
+ value: 120
19
+ },
20
+ {
21
+ key: "03",
22
+ value: 60
23
+ },
24
+ {
25
+ key: "06",
26
+ value: 210
27
+ },
28
+ {
29
+ key: "09",
30
+ value: 940
31
+ },
32
+ {
33
+ key: "12",
34
+ value: 1180
35
+ },
36
+ {
37
+ key: "15",
38
+ value: 1020
39
+ },
40
+ {
41
+ key: "18",
42
+ value: 640
43
+ },
44
+ {
45
+ key: "21",
46
+ value: 300
47
+ }
48
+ ];
49
+ /**
50
+ * Requests a minute the API is sized for.
51
+ */
52
+ const CAPACITY = 2e3;
53
+ /**
54
+ * Lists a year of rainfall by month in millimetres. October is the wettest month at 87mm, and April
55
+ * the driest at 42mm.
56
+ */
57
+ const RAINFALL = [
58
+ {
59
+ key: "jan",
60
+ value: 66
61
+ },
62
+ {
63
+ key: "feb",
64
+ value: 51
65
+ },
66
+ {
67
+ key: "mar",
68
+ value: 55
69
+ },
70
+ {
71
+ key: "apr",
72
+ value: 42
73
+ },
74
+ {
75
+ key: "may",
76
+ value: 53
77
+ },
78
+ {
79
+ key: "jun",
80
+ value: 62
81
+ },
82
+ {
83
+ key: "jul",
84
+ value: 76
85
+ },
86
+ {
87
+ key: "aug",
88
+ value: 83
89
+ },
90
+ {
91
+ key: "sep",
92
+ value: 78
93
+ },
94
+ {
95
+ key: "oct",
96
+ value: 87
97
+ },
98
+ {
99
+ key: "nov",
100
+ value: 84
101
+ },
102
+ {
103
+ key: "dec",
104
+ value: 77
105
+ }
106
+ ];
107
+ /**
108
+ * Lists the hours a month's wind blew from each compass point, from north clockwise. It blew from
109
+ * the south-west for 212 of the 720 hours.
110
+ */
111
+ const WIND = [
112
+ {
113
+ key: "n",
114
+ value: 48
115
+ },
116
+ {
117
+ key: "ne",
118
+ value: 36
119
+ },
120
+ {
121
+ key: "e",
122
+ value: 42
123
+ },
124
+ {
125
+ key: "se",
126
+ value: 58
127
+ },
128
+ {
129
+ key: "s",
130
+ value: 96
131
+ },
132
+ {
133
+ key: "sw",
134
+ value: 212
135
+ },
136
+ {
137
+ key: "w",
138
+ value: 164
139
+ },
140
+ {
141
+ key: "nw",
142
+ value: 64
143
+ }
144
+ ];
145
+ //#endregion
146
+ //#region src/polar-area-chart/examples/bare.example.tsx
147
+ var bare_example_exports = /* @__PURE__ */ __exportAll({
148
+ Bare: () => Bare,
149
+ source: () => source$8
150
+ });
151
+ function Bare() {
152
+ const $ = c(10);
153
+ const { t } = useWords("polar-area-chart");
154
+ let t0;
155
+ if ($[0] !== t) {
156
+ t0 = t("requests.caption");
157
+ $[0] = t;
158
+ $[1] = t0;
159
+ } else t0 = $[1];
160
+ let t1;
161
+ if ($[2] !== t) {
162
+ t1 = t("requests.label");
163
+ $[2] = t;
164
+ $[3] = t1;
165
+ } else t1 = $[3];
166
+ let t2;
167
+ if ($[4] !== t) {
168
+ t2 = HOURS.map((t3) => {
169
+ const { key, value } = t3;
170
+ return {
171
+ key,
172
+ label: t(`hours.${key}`),
173
+ value
174
+ };
175
+ });
176
+ $[4] = t;
177
+ $[5] = t2;
178
+ } else t2 = $[5];
179
+ let t3;
180
+ if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2) {
181
+ t3 = /* @__PURE__ */ jsx(PolarAreaChart, {
182
+ caption: t0,
183
+ label: t1,
184
+ names: false,
185
+ slices: t2
186
+ });
187
+ $[6] = t0;
188
+ $[7] = t1;
189
+ $[8] = t2;
190
+ $[9] = t3;
191
+ } else t3 = $[9];
192
+ return t3;
193
+ }
194
+ const source$8 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { HOURS } from \"./cycles.ts\";\n\nexport function Bare(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"requests.caption\")}\n label={t(\"requests.label\")}\n names={false}\n slices={HOURS.map(({ key, value }) => ({ key, label: t(`hours.${key}`), value }))}\n />\n );\n}\n";
195
+ //#endregion
196
+ //#region src/polar-area-chart/examples/capacity.example.tsx
197
+ var capacity_example_exports = /* @__PURE__ */ __exportAll({
198
+ Capacity: () => Capacity,
199
+ source: () => source$7
200
+ });
201
+ function Capacity() {
202
+ const $ = c(10);
203
+ const { t } = useWords("polar-area-chart");
204
+ let t0;
205
+ if ($[0] !== t) {
206
+ t0 = t("capacity.caption");
207
+ $[0] = t;
208
+ $[1] = t0;
209
+ } else t0 = $[1];
210
+ let t1;
211
+ if ($[2] !== t) {
212
+ t1 = t("requests.label");
213
+ $[2] = t;
214
+ $[3] = t1;
215
+ } else t1 = $[3];
216
+ let t2;
217
+ if ($[4] !== t) {
218
+ t2 = HOURS.map((t3) => {
219
+ const { key, value } = t3;
220
+ return {
221
+ key,
222
+ label: t(`hours.${key}`),
223
+ value
224
+ };
225
+ });
226
+ $[4] = t;
227
+ $[5] = t2;
228
+ } else t2 = $[5];
229
+ let t3;
230
+ if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2) {
231
+ t3 = /* @__PURE__ */ jsx(PolarAreaChart, {
232
+ caption: t0,
233
+ label: t1,
234
+ max: CAPACITY,
235
+ slices: t2
236
+ });
237
+ $[6] = t0;
238
+ $[7] = t1;
239
+ $[8] = t2;
240
+ $[9] = t3;
241
+ } else t3 = $[9];
242
+ return t3;
243
+ }
244
+ const source$7 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { CAPACITY, HOURS } from \"./cycles.ts\";\n\nexport function Capacity(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"capacity.caption\")}\n label={t(\"requests.label\")}\n max={CAPACITY}\n slices={HOURS.map(({ key, value }) => ({ key, label: t(`hours.${key}`), value }))}\n />\n );\n}\n";
245
+ //#endregion
246
+ //#region src/polar-area-chart/examples/hidden.example.tsx
247
+ var hidden_example_exports = /* @__PURE__ */ __exportAll({
248
+ Hidden: () => Hidden,
249
+ source: () => source$6
250
+ });
251
+ function Hidden() {
252
+ const $ = c(11);
253
+ const { t } = useWords("polar-area-chart");
254
+ let t0;
255
+ if ($[0] !== t) {
256
+ t0 = t("hidden.caption");
257
+ $[0] = t;
258
+ $[1] = t0;
259
+ } else t0 = $[1];
260
+ let t1;
261
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
262
+ t1 = ["12"];
263
+ $[2] = t1;
264
+ } else t1 = $[2];
265
+ let t2;
266
+ if ($[3] !== t) {
267
+ t2 = t("requests.label");
268
+ $[3] = t;
269
+ $[4] = t2;
270
+ } else t2 = $[4];
271
+ let t3;
272
+ if ($[5] !== t) {
273
+ t3 = HOURS.map((t4) => {
274
+ const { key, value } = t4;
275
+ return {
276
+ key,
277
+ label: t(`hours.${key}`),
278
+ value
279
+ };
280
+ });
281
+ $[5] = t;
282
+ $[6] = t3;
283
+ } else t3 = $[6];
284
+ let t4;
285
+ if ($[7] !== t0 || $[8] !== t2 || $[9] !== t3) {
286
+ t4 = /* @__PURE__ */ jsx(PolarAreaChart, {
287
+ caption: t0,
288
+ defaultHiddenKeys: t1,
289
+ label: t2,
290
+ slices: t3
291
+ });
292
+ $[7] = t0;
293
+ $[8] = t2;
294
+ $[9] = t3;
295
+ $[10] = t4;
296
+ } else t4 = $[10];
297
+ return t4;
298
+ }
299
+ const source$6 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { HOURS } from \"./cycles.ts\";\n\nexport function Hidden(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"hidden.caption\")}\n defaultHiddenKeys={[\"12\"]}\n label={t(\"requests.label\")}\n slices={HOURS.map(({ key, value }) => ({ key, label: t(`hours.${key}`), value }))}\n />\n );\n}\n";
300
+ //#endregion
301
+ //#region src/polar-area-chart/examples/noon.example.tsx
302
+ var noon_example_exports = /* @__PURE__ */ __exportAll({
303
+ Noon: () => Noon,
304
+ source: () => source$5
305
+ });
306
+ function Noon() {
307
+ const $ = c(10);
308
+ const { t } = useWords("polar-area-chart");
309
+ let t0;
310
+ if ($[0] !== t) {
311
+ t0 = t("noon.caption");
312
+ $[0] = t;
313
+ $[1] = t0;
314
+ } else t0 = $[1];
315
+ let t1;
316
+ if ($[2] !== t) {
317
+ t1 = t("requests.label");
318
+ $[2] = t;
319
+ $[3] = t1;
320
+ } else t1 = $[3];
321
+ let t2;
322
+ if ($[4] !== t) {
323
+ t2 = HOURS.map((t3) => {
324
+ const { key, value } = t3;
325
+ return {
326
+ key,
327
+ label: t(`hours.${key}`),
328
+ value
329
+ };
330
+ });
331
+ $[4] = t;
332
+ $[5] = t2;
333
+ } else t2 = $[5];
334
+ let t3;
335
+ if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2) {
336
+ t3 = /* @__PURE__ */ jsx(PolarAreaChart, {
337
+ caption: t0,
338
+ defaultIndex: 4,
339
+ label: t1,
340
+ slices: t2
341
+ });
342
+ $[6] = t0;
343
+ $[7] = t1;
344
+ $[8] = t2;
345
+ $[9] = t3;
346
+ } else t3 = $[9];
347
+ return t3;
348
+ }
349
+ const source$5 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { HOURS } from \"./cycles.ts\";\n\nexport function Noon(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"noon.caption\")}\n defaultIndex={4}\n label={t(\"requests.label\")}\n slices={HOURS.map(({ key, value }) => ({ key, label: t(`hours.${key}`), value }))}\n />\n );\n}\n";
350
+ //#endregion
351
+ //#region src/polar-area-chart/examples/quiet.example.tsx
352
+ var quiet_example_exports = /* @__PURE__ */ __exportAll({
353
+ Quiet: () => Quiet,
354
+ source: () => source$4
355
+ });
356
+ function Quiet() {
357
+ const $ = c(11);
358
+ const { t } = useWords("polar-area-chart");
359
+ let t0;
360
+ if ($[0] !== t) {
361
+ t0 = t("quiet.caption");
362
+ $[0] = t;
363
+ $[1] = t0;
364
+ } else t0 = $[1];
365
+ let t1;
366
+ if ($[2] !== t) {
367
+ t1 = t("quiet.empty");
368
+ $[2] = t;
369
+ $[3] = t1;
370
+ } else t1 = $[3];
371
+ let t2;
372
+ if ($[4] !== t) {
373
+ t2 = t("requests.label");
374
+ $[4] = t;
375
+ $[5] = t2;
376
+ } else t2 = $[5];
377
+ let t3;
378
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
379
+ t3 = [];
380
+ $[6] = t3;
381
+ } else t3 = $[6];
382
+ let t4;
383
+ if ($[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
384
+ t4 = /* @__PURE__ */ jsx(PolarAreaChart, {
385
+ caption: t0,
386
+ empty: t1,
387
+ label: t2,
388
+ slices: t3
389
+ });
390
+ $[7] = t0;
391
+ $[8] = t1;
392
+ $[9] = t2;
393
+ $[10] = t4;
394
+ } else t4 = $[10];
395
+ return t4;
396
+ }
397
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nexport function Quiet(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"quiet.caption\")}\n empty={t(\"quiet.empty\")}\n label={t(\"requests.label\")}\n slices={[]}\n />\n );\n}\n";
398
+ //#endregion
399
+ //#region src/polar-area-chart/examples/rainfall.example.tsx
400
+ var rainfall_example_exports = /* @__PURE__ */ __exportAll({
401
+ Rainfall: () => Rainfall,
402
+ source: () => source$3
403
+ });
404
+ function Rainfall() {
405
+ const $ = c(11);
406
+ const { t } = useWords("polar-area-chart");
407
+ let t0;
408
+ if ($[0] !== t) {
409
+ t0 = t("rainfall.caption");
410
+ $[0] = t;
411
+ $[1] = t0;
412
+ } else t0 = $[1];
413
+ let t1;
414
+ if ($[2] !== t) {
415
+ t1 = t("rainfall.label");
416
+ $[2] = t;
417
+ $[3] = t1;
418
+ } else t1 = $[3];
419
+ let t2;
420
+ if ($[4] !== t) {
421
+ t2 = RAINFALL.map((t3) => {
422
+ const { key, value } = t3;
423
+ return {
424
+ key,
425
+ label: t(`months.${key}`),
426
+ value
427
+ };
428
+ });
429
+ $[4] = t;
430
+ $[5] = t2;
431
+ } else t2 = $[5];
432
+ let t3;
433
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
434
+ t3 = {
435
+ style: "unit",
436
+ unit: "millimeter",
437
+ unitDisplay: "narrow"
438
+ };
439
+ $[6] = t3;
440
+ } else t3 = $[6];
441
+ let t4;
442
+ if ($[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
443
+ t4 = /* @__PURE__ */ jsx(PolarAreaChart, {
444
+ caption: t0,
445
+ label: t1,
446
+ slices: t2,
447
+ valueOptions: t3
448
+ });
449
+ $[7] = t0;
450
+ $[8] = t1;
451
+ $[9] = t2;
452
+ $[10] = t4;
453
+ } else t4 = $[10];
454
+ return t4;
455
+ }
456
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { RAINFALL } from \"./cycles.ts\";\n\nexport function Rainfall(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"rainfall.caption\")}\n label={t(\"rainfall.label\")}\n slices={RAINFALL.map(({ key, value }) => ({ key, label: t(`months.${key}`), value }))}\n valueOptions={{ style: \"unit\", unit: \"millimeter\", unitDisplay: \"narrow\" }}\n />\n );\n}\n";
457
+ //#endregion
458
+ //#region src/polar-area-chart/examples/replay.example.tsx
459
+ var replay_example_exports = /* @__PURE__ */ __exportAll({
460
+ Replay: () => Replay,
461
+ source: () => source$2
462
+ });
463
+ function Replay() {
464
+ const $ = c(22);
465
+ const { t } = useWords("polar-area-chart");
466
+ const [run, setRun] = useState(0);
467
+ let t0;
468
+ if ($[0] !== t) {
469
+ t0 = t("requests.caption");
470
+ $[0] = t;
471
+ $[1] = t0;
472
+ } else t0 = $[1];
473
+ let t1;
474
+ if ($[2] !== t) {
475
+ t1 = t("requests.label");
476
+ $[2] = t;
477
+ $[3] = t1;
478
+ } else t1 = $[3];
479
+ let t2;
480
+ if ($[4] !== t) {
481
+ t2 = HOURS.map((t3) => {
482
+ const { key, value } = t3;
483
+ return {
484
+ key,
485
+ label: t(`hours.${key}`),
486
+ value
487
+ };
488
+ });
489
+ $[4] = t;
490
+ $[5] = t2;
491
+ } else t2 = $[5];
492
+ let t3;
493
+ if ($[6] !== run || $[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
494
+ t3 = /* @__PURE__ */ jsx(PolarAreaChart, {
495
+ animate: true,
496
+ caption: t0,
497
+ label: t1,
498
+ slices: t2
499
+ }, run);
500
+ $[6] = run;
501
+ $[7] = t0;
502
+ $[8] = t1;
503
+ $[9] = t2;
504
+ $[10] = t3;
505
+ } else t3 = $[10];
506
+ let t4;
507
+ if ($[11] !== run) {
508
+ t4 = () => {
509
+ setRun(run + 1);
510
+ };
511
+ $[11] = run;
512
+ $[12] = t4;
513
+ } else t4 = $[12];
514
+ let t5;
515
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
516
+ t5 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
517
+ $[13] = t5;
518
+ } else t5 = $[13];
519
+ let t6;
520
+ if ($[14] !== t) {
521
+ t6 = t("replay.replay");
522
+ $[14] = t;
523
+ $[15] = t6;
524
+ } else t6 = $[15];
525
+ let t7;
526
+ if ($[16] !== t4 || $[17] !== t6) {
527
+ t7 = /* @__PURE__ */ jsxs(Button, {
528
+ onClick: t4,
529
+ size: "sm",
530
+ variant: "outline",
531
+ children: [t5, t6]
532
+ });
533
+ $[16] = t4;
534
+ $[17] = t6;
535
+ $[18] = t7;
536
+ } else t7 = $[18];
537
+ let t8;
538
+ if ($[19] !== t3 || $[20] !== t7) {
539
+ t8 = /* @__PURE__ */ jsxs(Stack, {
540
+ align: "flex-start",
541
+ children: [t3, t7]
542
+ });
543
+ $[19] = t3;
544
+ $[20] = t7;
545
+ $[21] = t8;
546
+ } else t8 = $[21];
547
+ return t8;
548
+ }
549
+ const source$2 = "import { type ReactElement, useState } from \"react\";\n\nimport { RotateCcwIcon } from \"lucide-react\";\n\nimport { Button } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { HOURS } from \"./cycles.ts\";\n\nexport function Replay(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n const [run, setRun] = useState(0);\n\n return (\n <Stack align=\"flex-start\">\n <PolarAreaChart\n animate\n caption={t(\"requests.caption\")}\n key={run}\n label={t(\"requests.label\")}\n slices={HOURS.map(({ key, value }) => ({ key, label: t(`hours.${key}`), value }))}\n />\n <Button\n onClick={() => {\n setRun(run + 1);\n }}\n size=\"sm\"\n variant=\"outline\"\n >\n <RotateCcwIcon />\n {t(\"replay.replay\")}\n </Button>\n </Stack>\n );\n}\n";
550
+ //#endregion
551
+ //#region src/polar-area-chart/examples/requests.example.tsx
552
+ var requests_example_exports = /* @__PURE__ */ __exportAll({
553
+ Requests: () => Requests,
554
+ source: () => source$1
555
+ });
556
+ function Requests() {
557
+ const $ = c(10);
558
+ const { t } = useWords("polar-area-chart");
559
+ let t0;
560
+ if ($[0] !== t) {
561
+ t0 = t("requests.caption");
562
+ $[0] = t;
563
+ $[1] = t0;
564
+ } else t0 = $[1];
565
+ let t1;
566
+ if ($[2] !== t) {
567
+ t1 = t("requests.label");
568
+ $[2] = t;
569
+ $[3] = t1;
570
+ } else t1 = $[3];
571
+ let t2;
572
+ if ($[4] !== t) {
573
+ t2 = HOURS.map((t3) => {
574
+ const { key, value } = t3;
575
+ return {
576
+ key,
577
+ label: t(`hours.${key}`),
578
+ value
579
+ };
580
+ });
581
+ $[4] = t;
582
+ $[5] = t2;
583
+ } else t2 = $[5];
584
+ let t3;
585
+ if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2) {
586
+ t3 = /* @__PURE__ */ jsx(PolarAreaChart, {
587
+ caption: t0,
588
+ label: t1,
589
+ slices: t2
590
+ });
591
+ $[6] = t0;
592
+ $[7] = t1;
593
+ $[8] = t2;
594
+ $[9] = t3;
595
+ } else t3 = $[9];
596
+ return t3;
597
+ }
598
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { HOURS } from \"./cycles.ts\";\n\nexport function Requests(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"requests.caption\")}\n label={t(\"requests.label\")}\n slices={HOURS.map(({ key, value }) => ({ key, label: t(`hours.${key}`), value }))}\n />\n );\n}\n";
599
+ //#endregion
600
+ //#region src/polar-area-chart/examples/wind.example.tsx
601
+ var wind_example_exports = /* @__PURE__ */ __exportAll({
602
+ Wind: () => Wind,
603
+ source: () => source
604
+ });
605
+ function Wind() {
606
+ const $ = c(11);
607
+ const { t } = useWords("polar-area-chart");
608
+ let t0;
609
+ if ($[0] !== t) {
610
+ t0 = t("wind.caption");
611
+ $[0] = t;
612
+ $[1] = t0;
613
+ } else t0 = $[1];
614
+ let t1;
615
+ if ($[2] !== t) {
616
+ t1 = t("wind.label");
617
+ $[2] = t;
618
+ $[3] = t1;
619
+ } else t1 = $[3];
620
+ let t2;
621
+ if ($[4] !== t) {
622
+ t2 = WIND.map((t3) => {
623
+ const { key, value } = t3;
624
+ return {
625
+ key,
626
+ label: t(`points.${key}`),
627
+ value
628
+ };
629
+ });
630
+ $[4] = t;
631
+ $[5] = t2;
632
+ } else t2 = $[5];
633
+ let t3;
634
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
635
+ t3 = {
636
+ style: "unit",
637
+ unit: "hour",
638
+ unitDisplay: "narrow"
639
+ };
640
+ $[6] = t3;
641
+ } else t3 = $[6];
642
+ let t4;
643
+ if ($[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
644
+ t4 = /* @__PURE__ */ jsx(PolarAreaChart, {
645
+ caption: t0,
646
+ color: "teal",
647
+ label: t1,
648
+ slices: t2,
649
+ valueOptions: t3
650
+ });
651
+ $[7] = t0;
652
+ $[8] = t1;
653
+ $[9] = t2;
654
+ $[10] = t4;
655
+ } else t4 = $[10];
656
+ return t4;
657
+ }
658
+ const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { PolarAreaChart } from \"@stealthscale/component-charts\";\n\nimport { WIND } from \"./cycles.ts\";\n\nexport function Wind(): ReactElement {\n const { t } = useWords(\"polar-area-chart\");\n\n return (\n <PolarAreaChart\n caption={t(\"wind.caption\")}\n color=\"teal\"\n label={t(\"wind.label\")}\n slices={WIND.map(({ key, value }) => ({ key, label: t(`points.${key}`), value }))}\n valueOptions={{ style: \"unit\", unit: \"hour\", unitDisplay: \"narrow\" }}\n />\n );\n}\n";
659
+ //#endregion
660
+ //#region src/polar-area-chart/polar-area-chart.specimen.tsx
661
+ /**
662
+ * Catalogue page for the polar area chart.
663
+ *
664
+ * @remarks
665
+ * The polar area chart has no recipe of its own: the chart's recipe styles its figure, so every
666
+ * scene is hand-written. The scenes render a day of requests, the tooltip open at noon, the day
667
+ * against a capacity, a year of rainfall, a month of wind in the teal palette, the rose without
668
+ * names, a hidden wedge, the wedges animated in with a replay, the day at a phone's width, and a
669
+ * day without requests. Every scene renders a component from `examples/` and shows that file as
670
+ * its source. The words are keys under `polar-area-chart` in
671
+ * `locales/en/specimen/polar-area-chart.json`.
672
+ */
673
+ /**
674
+ * Hand-written scene for a day of requests.
675
+ */
676
+ const day = {
677
+ about: "polar-area-chart.requests.about",
678
+ draw: () => /* @__PURE__ */ jsx(Room, {
679
+ size: "md",
680
+ children: /* @__PURE__ */ jsx(Requests, {})
681
+ }),
682
+ example: requests_example_exports,
683
+ title: "polar-area-chart.requests.title"
684
+ };
685
+ /**
686
+ * Hand-written scene for the tooltip open at noon.
687
+ */
688
+ const tooltip = {
689
+ about: "polar-area-chart.noon.about",
690
+ draw: () => /* @__PURE__ */ jsx(Room, {
691
+ size: "md",
692
+ children: /* @__PURE__ */ jsx(Noon, {})
693
+ }),
694
+ example: noon_example_exports,
695
+ title: "polar-area-chart.noon.title"
696
+ };
697
+ /**
698
+ * Hand-written scene for a full radius fixed at a capacity.
699
+ */
700
+ const capped = {
701
+ about: "polar-area-chart.capacity.about",
702
+ draw: () => /* @__PURE__ */ jsx(Room, {
703
+ size: "md",
704
+ children: /* @__PURE__ */ jsx(Capacity, {})
705
+ }),
706
+ example: capacity_example_exports,
707
+ title: "polar-area-chart.capacity.title"
708
+ };
709
+ /**
710
+ * Hand-written scene for twelve months.
711
+ */
712
+ const year = {
713
+ about: "polar-area-chart.rainfall.about",
714
+ draw: () => /* @__PURE__ */ jsx(Room, {
715
+ size: "md",
716
+ children: /* @__PURE__ */ jsx(Rainfall, {})
717
+ }),
718
+ example: rainfall_example_exports,
719
+ title: "polar-area-chart.rainfall.title"
720
+ };
721
+ /**
722
+ * Hand-written scene for the compass in the teal palette.
723
+ */
724
+ const colors = {
725
+ about: "polar-area-chart.wind.about",
726
+ draw: () => /* @__PURE__ */ jsx(Room, {
727
+ size: "md",
728
+ children: /* @__PURE__ */ jsx(Wind, {})
729
+ }),
730
+ example: wind_example_exports,
731
+ title: "polar-area-chart.wind.title"
732
+ };
733
+ /**
734
+ * Hand-written scene for the rose without names.
735
+ */
736
+ const nameless = {
737
+ about: "polar-area-chart.bare.about",
738
+ draw: () => /* @__PURE__ */ jsx(Room, {
739
+ size: "md",
740
+ children: /* @__PURE__ */ jsx(Bare, {})
741
+ }),
742
+ example: bare_example_exports,
743
+ title: "polar-area-chart.bare.title"
744
+ };
745
+ /**
746
+ * Hand-written scene for a wedge the legend hides.
747
+ */
748
+ const hiding = {
749
+ about: "polar-area-chart.hidden.about",
750
+ draw: () => /* @__PURE__ */ jsx(Room, {
751
+ size: "md",
752
+ children: /* @__PURE__ */ jsx(Hidden, {})
753
+ }),
754
+ example: hidden_example_exports,
755
+ title: "polar-area-chart.hidden.title"
756
+ };
757
+ /**
758
+ * Hand-written scene for the wedges animated in, with a replay.
759
+ */
760
+ const animated = {
761
+ about: "polar-area-chart.replay.about",
762
+ draw: () => /* @__PURE__ */ jsx(Room, {
763
+ size: "md",
764
+ children: /* @__PURE__ */ jsx(Replay, {})
765
+ }),
766
+ example: replay_example_exports,
767
+ title: "polar-area-chart.replay.title"
768
+ };
769
+ /**
770
+ * Hand-written scene for the day at a phone's width.
771
+ */
772
+ const narrow = {
773
+ about: "polar-area-chart.narrow.about",
774
+ draw: () => /* @__PURE__ */ jsx(Room, {
775
+ size: "xs",
776
+ children: /* @__PURE__ */ jsx(Requests, {})
777
+ }),
778
+ example: requests_example_exports,
779
+ title: "polar-area-chart.narrow.title"
780
+ };
781
+ /**
782
+ * Hand-written scene for a day without requests.
783
+ */
784
+ const empty = {
785
+ about: "polar-area-chart.quiet.about",
786
+ draw: () => /* @__PURE__ */ jsx(Room, {
787
+ size: "md",
788
+ children: /* @__PURE__ */ jsx(Quiet, {})
789
+ }),
790
+ example: quiet_example_exports,
791
+ title: "polar-area-chart.quiet.title"
792
+ };
793
+ var polar_area_chart_specimen_default = specimen({
794
+ about: "polar-area-chart.about",
795
+ id: "components/charts/polar-area-chart",
796
+ imports: "import { PolarAreaChart } from \"@stealthscale/component-charts\";",
797
+ scenes: [
798
+ day,
799
+ tooltip,
800
+ capped,
801
+ year,
802
+ colors,
803
+ nameless,
804
+ hiding,
805
+ animated,
806
+ narrow,
807
+ empty
808
+ ],
809
+ title: "polar-area-chart.title"
810
+ });
811
+ //#endregion
812
+ export { animated, capped, colors, day, polar_area_chart_specimen_default as default, empty, hiding, nameless, narrow, tooltip, year };