@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,873 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { Y as ComboChart } 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/combo-chart/examples/orders.example.tsx
11
+ var orders_example_exports = /* @__PURE__ */ __exportAll({
12
+ Orders: () => Orders,
13
+ source: () => source$4
14
+ });
15
+ const ORDERS = [
16
+ 412,
17
+ 438,
18
+ 451,
19
+ 429,
20
+ 470,
21
+ 318,
22
+ 296,
23
+ 425,
24
+ 447,
25
+ 462,
26
+ 441,
27
+ 488,
28
+ 331,
29
+ 305
30
+ ];
31
+ const DAYS = ORDERS.map((orders, index) => ({
32
+ average: index < 6 ? void 0 : Math.round(ORDERS.slice(index - 6, index + 1).reduce((sum, each) => sum + each, 0) / 7),
33
+ day: `2026-09-${String(14 + index)}`,
34
+ orders
35
+ }));
36
+ function Orders() {
37
+ const $ = c(23);
38
+ const { t } = useWords("combo-chart");
39
+ let t0;
40
+ if ($[0] !== t) {
41
+ t0 = t("orders.caption");
42
+ $[0] = t;
43
+ $[1] = t0;
44
+ } else t0 = $[1];
45
+ let t1;
46
+ if ($[2] !== t) {
47
+ t1 = t("orders.label");
48
+ $[2] = t;
49
+ $[3] = t1;
50
+ } else t1 = $[3];
51
+ let t2;
52
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
53
+ t2 = {
54
+ day: "numeric",
55
+ month: "short",
56
+ timeZone: "UTC"
57
+ };
58
+ $[4] = t2;
59
+ } else t2 = $[4];
60
+ let t3;
61
+ if ($[5] !== t) {
62
+ t3 = t("series");
63
+ $[5] = t;
64
+ $[6] = t3;
65
+ } else t3 = $[6];
66
+ let t4;
67
+ if ($[7] !== t) {
68
+ t4 = t("orders.orders");
69
+ $[7] = t;
70
+ $[8] = t4;
71
+ } else t4 = $[8];
72
+ let t5;
73
+ if ($[9] !== t4) {
74
+ t5 = {
75
+ key: "orders",
76
+ label: t4,
77
+ mark: "bar"
78
+ };
79
+ $[9] = t4;
80
+ $[10] = t5;
81
+ } else t5 = $[10];
82
+ let t6;
83
+ if ($[11] !== t) {
84
+ t6 = t("orders.average");
85
+ $[11] = t;
86
+ $[12] = t6;
87
+ } else t6 = $[12];
88
+ let t7;
89
+ if ($[13] !== t6) {
90
+ t7 = {
91
+ key: "average",
92
+ label: t6,
93
+ mark: "line"
94
+ };
95
+ $[13] = t6;
96
+ $[14] = t7;
97
+ } else t7 = $[14];
98
+ let t8;
99
+ if ($[15] !== t5 || $[16] !== t7) {
100
+ t8 = [t5, t7];
101
+ $[15] = t5;
102
+ $[16] = t7;
103
+ $[17] = t8;
104
+ } else t8 = $[17];
105
+ let t9;
106
+ if ($[18] !== t0 || $[19] !== t1 || $[20] !== t3 || $[21] !== t8) {
107
+ t9 = /* @__PURE__ */ jsx(ComboChart, {
108
+ caption: t0,
109
+ categoryKey: "day",
110
+ curve: "linear",
111
+ data: DAYS,
112
+ label: t1,
113
+ labelOptions: t2,
114
+ legendLabel: t3,
115
+ series: t8
116
+ });
117
+ $[18] = t0;
118
+ $[19] = t1;
119
+ $[20] = t3;
120
+ $[21] = t8;
121
+ $[22] = t9;
122
+ } else t9 = $[22];
123
+ return t9;
124
+ }
125
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ComboChart } from \"@stealthscale/component-charts\";\n\nconst ORDERS = [412, 438, 451, 429, 470, 318, 296, 425, 447, 462, 441, 488, 331, 305];\n\nconst DAYS = ORDERS.map((orders, index) => ({\n average:\n index < 6\n ? undefined\n : Math.round(ORDERS.slice(index - 6, index + 1).reduce((sum, each) => sum + each, 0) / 7),\n day: `2026-09-${String(14 + index)}`,\n orders,\n}));\n\nexport function Orders(): ReactElement {\n const { t } = useWords(\"combo-chart\");\n\n return (\n <ComboChart\n caption={t(\"orders.caption\")}\n categoryKey=\"day\"\n curve=\"linear\"\n data={DAYS}\n label={t(\"orders.label\")}\n labelOptions={{ day: \"numeric\", month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"orders\", label: t(\"orders.orders\"), mark: \"bar\" },\n { key: \"average\", label: t(\"orders.average\"), mark: \"line\" },\n ]}\n />\n );\n}\n";
126
+ //#endregion
127
+ //#region src/combo-chart/examples/peak.example.tsx
128
+ var peak_example_exports = /* @__PURE__ */ __exportAll({
129
+ Peak: () => Peak,
130
+ source: () => source$3
131
+ });
132
+ const MONTHS$3 = [
133
+ {
134
+ margin: .61,
135
+ month: "2026-01-01",
136
+ revenue: 182e3
137
+ },
138
+ {
139
+ margin: .63,
140
+ month: "2026-02-01",
141
+ revenue: 176e3
142
+ },
143
+ {
144
+ margin: .6,
145
+ month: "2026-03-01",
146
+ revenue: 205e3
147
+ },
148
+ {
149
+ margin: .58,
150
+ month: "2026-04-01",
151
+ revenue: 214e3
152
+ },
153
+ {
154
+ margin: .57,
155
+ month: "2026-05-01",
156
+ revenue: 231e3
157
+ },
158
+ {
159
+ margin: .55,
160
+ month: "2026-06-01",
161
+ revenue: 248e3
162
+ },
163
+ {
164
+ margin: .56,
165
+ month: "2026-07-01",
166
+ revenue: 239e3
167
+ },
168
+ {
169
+ margin: .59,
170
+ month: "2026-08-01",
171
+ revenue: 226e3
172
+ },
173
+ {
174
+ margin: .62,
175
+ month: "2026-09-01",
176
+ revenue: 254e3
177
+ }
178
+ ];
179
+ function Peak() {
180
+ const $ = c(26);
181
+ const { t } = useWords("combo-chart");
182
+ let t0;
183
+ if ($[0] !== t) {
184
+ t0 = t("peak.caption");
185
+ $[0] = t;
186
+ $[1] = t0;
187
+ } else t0 = $[1];
188
+ let t1;
189
+ let t2;
190
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
191
+ t1 = [0, 1];
192
+ t2 = {
193
+ maximumFractionDigits: 0,
194
+ style: "percent"
195
+ };
196
+ $[2] = t1;
197
+ $[3] = t2;
198
+ } else {
199
+ t1 = $[2];
200
+ t2 = $[3];
201
+ }
202
+ let t3;
203
+ if ($[4] !== t) {
204
+ t3 = t("revenue.label");
205
+ $[4] = t;
206
+ $[5] = t3;
207
+ } else t3 = $[5];
208
+ let t4;
209
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
210
+ t4 = {
211
+ month: "short",
212
+ timeZone: "UTC"
213
+ };
214
+ $[6] = t4;
215
+ } else t4 = $[6];
216
+ let t5;
217
+ if ($[7] !== t) {
218
+ t5 = t("series");
219
+ $[7] = t;
220
+ $[8] = t5;
221
+ } else t5 = $[8];
222
+ let t6;
223
+ if ($[9] !== t) {
224
+ t6 = t("revenue.revenue");
225
+ $[9] = t;
226
+ $[10] = t6;
227
+ } else t6 = $[10];
228
+ let t7;
229
+ if ($[11] !== t6) {
230
+ t7 = {
231
+ key: "revenue",
232
+ label: t6,
233
+ mark: "bar"
234
+ };
235
+ $[11] = t6;
236
+ $[12] = t7;
237
+ } else t7 = $[12];
238
+ let t8;
239
+ if ($[13] !== t) {
240
+ t8 = t("revenue.margin");
241
+ $[13] = t;
242
+ $[14] = t8;
243
+ } else t8 = $[14];
244
+ let t9;
245
+ if ($[15] !== t8) {
246
+ t9 = {
247
+ axis: "end",
248
+ key: "margin",
249
+ label: t8,
250
+ mark: "line"
251
+ };
252
+ $[15] = t8;
253
+ $[16] = t9;
254
+ } else t9 = $[16];
255
+ let t10;
256
+ if ($[17] !== t7 || $[18] !== t9) {
257
+ t10 = [t7, t9];
258
+ $[17] = t7;
259
+ $[18] = t9;
260
+ $[19] = t10;
261
+ } else t10 = $[19];
262
+ let t11;
263
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
264
+ t11 = {
265
+ currency: "EUR",
266
+ maximumFractionDigits: 0,
267
+ notation: "compact",
268
+ style: "currency"
269
+ };
270
+ $[20] = t11;
271
+ } else t11 = $[20];
272
+ let t12;
273
+ if ($[21] !== t0 || $[22] !== t10 || $[23] !== t3 || $[24] !== t5) {
274
+ t12 = /* @__PURE__ */ jsx(ComboChart, {
275
+ caption: t0,
276
+ categoryKey: "month",
277
+ data: MONTHS$3,
278
+ defaultIndex: 8,
279
+ endDomain: t1,
280
+ endOptions: t2,
281
+ label: t3,
282
+ labelOptions: t4,
283
+ legendLabel: t5,
284
+ series: t10,
285
+ valueOptions: t11
286
+ });
287
+ $[21] = t0;
288
+ $[22] = t10;
289
+ $[23] = t3;
290
+ $[24] = t5;
291
+ $[25] = t12;
292
+ } else t12 = $[25];
293
+ return t12;
294
+ }
295
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ComboChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS = [\n { margin: 0.61, month: \"2026-01-01\", revenue: 182_000 },\n { margin: 0.63, month: \"2026-02-01\", revenue: 176_000 },\n { margin: 0.6, month: \"2026-03-01\", revenue: 205_000 },\n { margin: 0.58, month: \"2026-04-01\", revenue: 214_000 },\n { margin: 0.57, month: \"2026-05-01\", revenue: 231_000 },\n { margin: 0.55, month: \"2026-06-01\", revenue: 248_000 },\n { margin: 0.56, month: \"2026-07-01\", revenue: 239_000 },\n { margin: 0.59, month: \"2026-08-01\", revenue: 226_000 },\n { margin: 0.62, month: \"2026-09-01\", revenue: 254_000 },\n];\n\nexport function Peak(): ReactElement {\n const { t } = useWords(\"combo-chart\");\n\n return (\n <ComboChart\n caption={t(\"peak.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n defaultIndex={8}\n endDomain={[0, 1]}\n endOptions={{ maximumFractionDigits: 0, style: \"percent\" }}\n label={t(\"revenue.label\")}\n labelOptions={{ month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"revenue\", label: t(\"revenue.revenue\"), mark: \"bar\" },\n { axis: \"end\", key: \"margin\", label: t(\"revenue.margin\"), mark: \"line\" },\n ]}\n valueOptions={{\n currency: \"EUR\",\n maximumFractionDigits: 0,\n notation: \"compact\",\n style: \"currency\",\n }}\n />\n );\n}\n";
296
+ //#endregion
297
+ //#region src/combo-chart/examples/quiet.example.tsx
298
+ var quiet_example_exports = /* @__PURE__ */ __exportAll({
299
+ Quiet: () => Quiet,
300
+ source: () => source$2
301
+ });
302
+ const MONTHS$2 = [];
303
+ function Quiet() {
304
+ const $ = c(25);
305
+ const { t } = useWords("combo-chart");
306
+ let t0;
307
+ if ($[0] !== t) {
308
+ t0 = t("quiet.caption");
309
+ $[0] = t;
310
+ $[1] = t0;
311
+ } else t0 = $[1];
312
+ let t1;
313
+ if ($[2] !== t) {
314
+ t1 = t("quiet.empty");
315
+ $[2] = t;
316
+ $[3] = t1;
317
+ } else t1 = $[3];
318
+ let t2;
319
+ if ($[4] !== t) {
320
+ t2 = t("revenue.label");
321
+ $[4] = t;
322
+ $[5] = t2;
323
+ } else t2 = $[5];
324
+ let t3;
325
+ if ($[6] !== t) {
326
+ t3 = t("series");
327
+ $[6] = t;
328
+ $[7] = t3;
329
+ } else t3 = $[7];
330
+ let t4;
331
+ if ($[8] !== t) {
332
+ t4 = t("revenue.revenue");
333
+ $[8] = t;
334
+ $[9] = t4;
335
+ } else t4 = $[9];
336
+ let t5;
337
+ if ($[10] !== t4) {
338
+ t5 = {
339
+ key: "revenue",
340
+ label: t4,
341
+ mark: "bar"
342
+ };
343
+ $[10] = t4;
344
+ $[11] = t5;
345
+ } else t5 = $[11];
346
+ let t6;
347
+ if ($[12] !== t) {
348
+ t6 = t("revenue.margin");
349
+ $[12] = t;
350
+ $[13] = t6;
351
+ } else t6 = $[13];
352
+ let t7;
353
+ if ($[14] !== t6) {
354
+ t7 = {
355
+ axis: "end",
356
+ key: "margin",
357
+ label: t6,
358
+ mark: "line"
359
+ };
360
+ $[14] = t6;
361
+ $[15] = t7;
362
+ } else t7 = $[15];
363
+ let t8;
364
+ if ($[16] !== t5 || $[17] !== t7) {
365
+ t8 = [t5, t7];
366
+ $[16] = t5;
367
+ $[17] = t7;
368
+ $[18] = t8;
369
+ } else t8 = $[18];
370
+ let t9;
371
+ if ($[19] !== t0 || $[20] !== t1 || $[21] !== t2 || $[22] !== t3 || $[23] !== t8) {
372
+ t9 = /* @__PURE__ */ jsx(ComboChart, {
373
+ caption: t0,
374
+ categoryKey: "month",
375
+ data: MONTHS$2,
376
+ empty: t1,
377
+ label: t2,
378
+ legendLabel: t3,
379
+ series: t8
380
+ });
381
+ $[19] = t0;
382
+ $[20] = t1;
383
+ $[21] = t2;
384
+ $[22] = t3;
385
+ $[23] = t8;
386
+ $[24] = t9;
387
+ } else t9 = $[24];
388
+ return t9;
389
+ }
390
+ const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ComboChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS: Array<{ margin: number; month: string; revenue: number }> = [];\n\nexport function Quiet(): ReactElement {\n const { t } = useWords(\"combo-chart\");\n\n return (\n <ComboChart\n caption={t(\"quiet.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n empty={t(\"quiet.empty\")}\n label={t(\"revenue.label\")}\n legendLabel={t(\"series\")}\n series={[\n { key: \"revenue\", label: t(\"revenue.revenue\"), mark: \"bar\" },\n { axis: \"end\", key: \"margin\", label: t(\"revenue.margin\"), mark: \"line\" },\n ]}\n />\n );\n}\n";
391
+ //#endregion
392
+ //#region src/combo-chart/examples/replay.example.tsx
393
+ var replay_example_exports = /* @__PURE__ */ __exportAll({
394
+ Replay: () => Replay,
395
+ source: () => source$1
396
+ });
397
+ const MONTHS$1 = [
398
+ {
399
+ margin: .61,
400
+ month: "2026-01-01",
401
+ revenue: 182e3
402
+ },
403
+ {
404
+ margin: .63,
405
+ month: "2026-02-01",
406
+ revenue: 176e3
407
+ },
408
+ {
409
+ margin: .6,
410
+ month: "2026-03-01",
411
+ revenue: 205e3
412
+ },
413
+ {
414
+ margin: .58,
415
+ month: "2026-04-01",
416
+ revenue: 214e3
417
+ },
418
+ {
419
+ margin: .57,
420
+ month: "2026-05-01",
421
+ revenue: 231e3
422
+ },
423
+ {
424
+ margin: .55,
425
+ month: "2026-06-01",
426
+ revenue: 248e3
427
+ },
428
+ {
429
+ margin: .56,
430
+ month: "2026-07-01",
431
+ revenue: 239e3
432
+ },
433
+ {
434
+ margin: .59,
435
+ month: "2026-08-01",
436
+ revenue: 226e3
437
+ },
438
+ {
439
+ margin: .62,
440
+ month: "2026-09-01",
441
+ revenue: 254e3
442
+ }
443
+ ];
444
+ function Replay() {
445
+ const $ = c(38);
446
+ const { t } = useWords("combo-chart");
447
+ const [run, setRun] = useState(0);
448
+ let t0;
449
+ if ($[0] !== t) {
450
+ t0 = t("revenue.caption");
451
+ $[0] = t;
452
+ $[1] = t0;
453
+ } else t0 = $[1];
454
+ let t1;
455
+ let t2;
456
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
457
+ t1 = [0, 1];
458
+ t2 = {
459
+ maximumFractionDigits: 0,
460
+ style: "percent"
461
+ };
462
+ $[2] = t1;
463
+ $[3] = t2;
464
+ } else {
465
+ t1 = $[2];
466
+ t2 = $[3];
467
+ }
468
+ let t3;
469
+ if ($[4] !== t) {
470
+ t3 = t("revenue.label");
471
+ $[4] = t;
472
+ $[5] = t3;
473
+ } else t3 = $[5];
474
+ let t4;
475
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
476
+ t4 = {
477
+ month: "short",
478
+ timeZone: "UTC"
479
+ };
480
+ $[6] = t4;
481
+ } else t4 = $[6];
482
+ let t5;
483
+ if ($[7] !== t) {
484
+ t5 = t("series");
485
+ $[7] = t;
486
+ $[8] = t5;
487
+ } else t5 = $[8];
488
+ let t6;
489
+ if ($[9] !== t) {
490
+ t6 = t("revenue.revenue");
491
+ $[9] = t;
492
+ $[10] = t6;
493
+ } else t6 = $[10];
494
+ let t7;
495
+ if ($[11] !== t6) {
496
+ t7 = {
497
+ key: "revenue",
498
+ label: t6,
499
+ mark: "bar"
500
+ };
501
+ $[11] = t6;
502
+ $[12] = t7;
503
+ } else t7 = $[12];
504
+ let t8;
505
+ if ($[13] !== t) {
506
+ t8 = t("revenue.margin");
507
+ $[13] = t;
508
+ $[14] = t8;
509
+ } else t8 = $[14];
510
+ let t9;
511
+ if ($[15] !== t8) {
512
+ t9 = {
513
+ axis: "end",
514
+ key: "margin",
515
+ label: t8,
516
+ mark: "line"
517
+ };
518
+ $[15] = t8;
519
+ $[16] = t9;
520
+ } else t9 = $[16];
521
+ let t10;
522
+ if ($[17] !== t7 || $[18] !== t9) {
523
+ t10 = [t7, t9];
524
+ $[17] = t7;
525
+ $[18] = t9;
526
+ $[19] = t10;
527
+ } else t10 = $[19];
528
+ let t11;
529
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
530
+ t11 = {
531
+ currency: "EUR",
532
+ maximumFractionDigits: 0,
533
+ notation: "compact",
534
+ style: "currency"
535
+ };
536
+ $[20] = t11;
537
+ } else t11 = $[20];
538
+ let t12;
539
+ if ($[21] !== run || $[22] !== t0 || $[23] !== t10 || $[24] !== t3 || $[25] !== t5) {
540
+ t12 = /* @__PURE__ */ jsx(ComboChart, {
541
+ animate: true,
542
+ caption: t0,
543
+ categoryKey: "month",
544
+ data: MONTHS$1,
545
+ endDomain: t1,
546
+ endOptions: t2,
547
+ label: t3,
548
+ labelOptions: t4,
549
+ legendLabel: t5,
550
+ series: t10,
551
+ valueOptions: t11
552
+ }, run);
553
+ $[21] = run;
554
+ $[22] = t0;
555
+ $[23] = t10;
556
+ $[24] = t3;
557
+ $[25] = t5;
558
+ $[26] = t12;
559
+ } else t12 = $[26];
560
+ let t13;
561
+ if ($[27] !== run) {
562
+ t13 = () => {
563
+ setRun(run + 1);
564
+ };
565
+ $[27] = run;
566
+ $[28] = t13;
567
+ } else t13 = $[28];
568
+ let t14;
569
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
570
+ t14 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
571
+ $[29] = t14;
572
+ } else t14 = $[29];
573
+ let t15;
574
+ if ($[30] !== t) {
575
+ t15 = t("replay.replay");
576
+ $[30] = t;
577
+ $[31] = t15;
578
+ } else t15 = $[31];
579
+ let t16;
580
+ if ($[32] !== t13 || $[33] !== t15) {
581
+ t16 = /* @__PURE__ */ jsxs(Button, {
582
+ onClick: t13,
583
+ size: "sm",
584
+ variant: "outline",
585
+ children: [t14, t15]
586
+ });
587
+ $[32] = t13;
588
+ $[33] = t15;
589
+ $[34] = t16;
590
+ } else t16 = $[34];
591
+ let t17;
592
+ if ($[35] !== t12 || $[36] !== t16) {
593
+ t17 = /* @__PURE__ */ jsxs(Stack, {
594
+ align: "flex-start",
595
+ children: [t12, t16]
596
+ });
597
+ $[35] = t12;
598
+ $[36] = t16;
599
+ $[37] = t17;
600
+ } else t17 = $[37];
601
+ return t17;
602
+ }
603
+ const source$1 = "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 { ComboChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS = [\n { margin: 0.61, month: \"2026-01-01\", revenue: 182_000 },\n { margin: 0.63, month: \"2026-02-01\", revenue: 176_000 },\n { margin: 0.6, month: \"2026-03-01\", revenue: 205_000 },\n { margin: 0.58, month: \"2026-04-01\", revenue: 214_000 },\n { margin: 0.57, month: \"2026-05-01\", revenue: 231_000 },\n { margin: 0.55, month: \"2026-06-01\", revenue: 248_000 },\n { margin: 0.56, month: \"2026-07-01\", revenue: 239_000 },\n { margin: 0.59, month: \"2026-08-01\", revenue: 226_000 },\n { margin: 0.62, month: \"2026-09-01\", revenue: 254_000 },\n];\n\nexport function Replay(): ReactElement {\n const { t } = useWords(\"combo-chart\");\n const [run, setRun] = useState(0);\n\n return (\n <Stack align=\"flex-start\">\n <ComboChart\n animate\n caption={t(\"revenue.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n endDomain={[0, 1]}\n endOptions={{ maximumFractionDigits: 0, style: \"percent\" }}\n key={run}\n label={t(\"revenue.label\")}\n labelOptions={{ month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"revenue\", label: t(\"revenue.revenue\"), mark: \"bar\" },\n { axis: \"end\", key: \"margin\", label: t(\"revenue.margin\"), mark: \"line\" },\n ]}\n valueOptions={{\n currency: \"EUR\",\n maximumFractionDigits: 0,\n notation: \"compact\",\n style: \"currency\",\n }}\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";
604
+ //#endregion
605
+ //#region src/combo-chart/examples/revenue.example.tsx
606
+ var revenue_example_exports = /* @__PURE__ */ __exportAll({
607
+ Revenue: () => Revenue,
608
+ source: () => source
609
+ });
610
+ const MONTHS = [
611
+ {
612
+ margin: .61,
613
+ month: "2026-01-01",
614
+ revenue: 182e3
615
+ },
616
+ {
617
+ margin: .63,
618
+ month: "2026-02-01",
619
+ revenue: 176e3
620
+ },
621
+ {
622
+ margin: .6,
623
+ month: "2026-03-01",
624
+ revenue: 205e3
625
+ },
626
+ {
627
+ margin: .58,
628
+ month: "2026-04-01",
629
+ revenue: 214e3
630
+ },
631
+ {
632
+ margin: .57,
633
+ month: "2026-05-01",
634
+ revenue: 231e3
635
+ },
636
+ {
637
+ margin: .55,
638
+ month: "2026-06-01",
639
+ revenue: 248e3
640
+ },
641
+ {
642
+ margin: .56,
643
+ month: "2026-07-01",
644
+ revenue: 239e3
645
+ },
646
+ {
647
+ margin: .59,
648
+ month: "2026-08-01",
649
+ revenue: 226e3
650
+ },
651
+ {
652
+ margin: .62,
653
+ month: "2026-09-01",
654
+ revenue: 254e3
655
+ }
656
+ ];
657
+ function Revenue() {
658
+ const $ = c(26);
659
+ const { t } = useWords("combo-chart");
660
+ let t0;
661
+ if ($[0] !== t) {
662
+ t0 = t("revenue.caption");
663
+ $[0] = t;
664
+ $[1] = t0;
665
+ } else t0 = $[1];
666
+ let t1;
667
+ let t2;
668
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
669
+ t1 = [0, 1];
670
+ t2 = {
671
+ maximumFractionDigits: 0,
672
+ style: "percent"
673
+ };
674
+ $[2] = t1;
675
+ $[3] = t2;
676
+ } else {
677
+ t1 = $[2];
678
+ t2 = $[3];
679
+ }
680
+ let t3;
681
+ if ($[4] !== t) {
682
+ t3 = t("revenue.label");
683
+ $[4] = t;
684
+ $[5] = t3;
685
+ } else t3 = $[5];
686
+ let t4;
687
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
688
+ t4 = {
689
+ month: "short",
690
+ timeZone: "UTC"
691
+ };
692
+ $[6] = t4;
693
+ } else t4 = $[6];
694
+ let t5;
695
+ if ($[7] !== t) {
696
+ t5 = t("series");
697
+ $[7] = t;
698
+ $[8] = t5;
699
+ } else t5 = $[8];
700
+ let t6;
701
+ if ($[9] !== t) {
702
+ t6 = t("revenue.revenue");
703
+ $[9] = t;
704
+ $[10] = t6;
705
+ } else t6 = $[10];
706
+ let t7;
707
+ if ($[11] !== t6) {
708
+ t7 = {
709
+ key: "revenue",
710
+ label: t6,
711
+ mark: "bar"
712
+ };
713
+ $[11] = t6;
714
+ $[12] = t7;
715
+ } else t7 = $[12];
716
+ let t8;
717
+ if ($[13] !== t) {
718
+ t8 = t("revenue.margin");
719
+ $[13] = t;
720
+ $[14] = t8;
721
+ } else t8 = $[14];
722
+ let t9;
723
+ if ($[15] !== t8) {
724
+ t9 = {
725
+ axis: "end",
726
+ key: "margin",
727
+ label: t8,
728
+ mark: "line"
729
+ };
730
+ $[15] = t8;
731
+ $[16] = t9;
732
+ } else t9 = $[16];
733
+ let t10;
734
+ if ($[17] !== t7 || $[18] !== t9) {
735
+ t10 = [t7, t9];
736
+ $[17] = t7;
737
+ $[18] = t9;
738
+ $[19] = t10;
739
+ } else t10 = $[19];
740
+ let t11;
741
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
742
+ t11 = {
743
+ currency: "EUR",
744
+ maximumFractionDigits: 0,
745
+ notation: "compact",
746
+ style: "currency"
747
+ };
748
+ $[20] = t11;
749
+ } else t11 = $[20];
750
+ let t12;
751
+ if ($[21] !== t0 || $[22] !== t10 || $[23] !== t3 || $[24] !== t5) {
752
+ t12 = /* @__PURE__ */ jsx(ComboChart, {
753
+ caption: t0,
754
+ categoryKey: "month",
755
+ data: MONTHS,
756
+ endDomain: t1,
757
+ endOptions: t2,
758
+ label: t3,
759
+ labelOptions: t4,
760
+ legendLabel: t5,
761
+ series: t10,
762
+ valueOptions: t11
763
+ });
764
+ $[21] = t0;
765
+ $[22] = t10;
766
+ $[23] = t3;
767
+ $[24] = t5;
768
+ $[25] = t12;
769
+ } else t12 = $[25];
770
+ return t12;
771
+ }
772
+ const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ComboChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS = [\n { margin: 0.61, month: \"2026-01-01\", revenue: 182_000 },\n { margin: 0.63, month: \"2026-02-01\", revenue: 176_000 },\n { margin: 0.6, month: \"2026-03-01\", revenue: 205_000 },\n { margin: 0.58, month: \"2026-04-01\", revenue: 214_000 },\n { margin: 0.57, month: \"2026-05-01\", revenue: 231_000 },\n { margin: 0.55, month: \"2026-06-01\", revenue: 248_000 },\n { margin: 0.56, month: \"2026-07-01\", revenue: 239_000 },\n { margin: 0.59, month: \"2026-08-01\", revenue: 226_000 },\n { margin: 0.62, month: \"2026-09-01\", revenue: 254_000 },\n];\n\nexport function Revenue(): ReactElement {\n const { t } = useWords(\"combo-chart\");\n\n return (\n <ComboChart\n caption={t(\"revenue.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n endDomain={[0, 1]}\n endOptions={{ maximumFractionDigits: 0, style: \"percent\" }}\n label={t(\"revenue.label\")}\n labelOptions={{ month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"revenue\", label: t(\"revenue.revenue\"), mark: \"bar\" },\n { axis: \"end\", key: \"margin\", label: t(\"revenue.margin\"), mark: \"line\" },\n ]}\n valueOptions={{\n currency: \"EUR\",\n maximumFractionDigits: 0,\n notation: \"compact\",\n style: \"currency\",\n }}\n />\n );\n}\n";
773
+ //#endregion
774
+ //#region src/combo-chart/combo-chart.specimen.tsx
775
+ /**
776
+ * Catalogue page for the combo chart.
777
+ *
778
+ * @remarks
779
+ * The combo chart has no recipe of its own: the chart's recipe styles its figure, so every scene
780
+ * is hand-written. The scenes render revenue as bars with its margin on an end axis, orders with
781
+ * their 7-day average on one axis, the tooltip open at the best month, the marks animated in with
782
+ * a replay, the revenue at a phone's width, and a range without rows. Every scene renders a
783
+ * component from `examples/` and shows that file as its source. The words are keys under
784
+ * `combo-chart` in `locales/en/specimen/combo-chart.json`.
785
+ */
786
+ /**
787
+ * Hand-written scene for two value axes.
788
+ */
789
+ const ended = {
790
+ about: "combo-chart.revenue.about",
791
+ draw: () => /* @__PURE__ */ jsx(Room, {
792
+ size: "lg",
793
+ children: /* @__PURE__ */ jsx(Revenue, {})
794
+ }),
795
+ example: revenue_example_exports,
796
+ title: "combo-chart.revenue.title"
797
+ };
798
+ /**
799
+ * Hand-written scene for two marks on one value axis.
800
+ */
801
+ const shared = {
802
+ about: "combo-chart.orders.about",
803
+ draw: () => /* @__PURE__ */ jsx(Room, {
804
+ size: "lg",
805
+ children: /* @__PURE__ */ jsx(Orders, {})
806
+ }),
807
+ example: orders_example_exports,
808
+ title: "combo-chart.orders.title"
809
+ };
810
+ /**
811
+ * Hand-written scene for the tooltip open at a row.
812
+ */
813
+ const tooltip = {
814
+ about: "combo-chart.peak.about",
815
+ draw: () => /* @__PURE__ */ jsx(Room, {
816
+ size: "lg",
817
+ children: /* @__PURE__ */ jsx(Peak, {})
818
+ }),
819
+ example: peak_example_exports,
820
+ title: "combo-chart.peak.title"
821
+ };
822
+ /**
823
+ * Hand-written scene for the marks animated in, with a replay.
824
+ */
825
+ const animated = {
826
+ about: "combo-chart.replay.about",
827
+ draw: () => /* @__PURE__ */ jsx(Room, {
828
+ size: "lg",
829
+ children: /* @__PURE__ */ jsx(Replay, {})
830
+ }),
831
+ example: replay_example_exports,
832
+ title: "combo-chart.replay.title"
833
+ };
834
+ /**
835
+ * Hand-written scene for two value axes at a phone's width.
836
+ */
837
+ const narrow = {
838
+ about: "combo-chart.narrow.about",
839
+ draw: () => /* @__PURE__ */ jsx(Room, {
840
+ size: "xs",
841
+ children: /* @__PURE__ */ jsx(Revenue, {})
842
+ }),
843
+ example: revenue_example_exports,
844
+ title: "combo-chart.narrow.title"
845
+ };
846
+ /**
847
+ * Hand-written scene for a range without rows.
848
+ */
849
+ const empty = {
850
+ about: "combo-chart.quiet.about",
851
+ draw: () => /* @__PURE__ */ jsx(Room, {
852
+ size: "md",
853
+ children: /* @__PURE__ */ jsx(Quiet, {})
854
+ }),
855
+ example: quiet_example_exports,
856
+ title: "combo-chart.quiet.title"
857
+ };
858
+ var combo_chart_specimen_default = specimen({
859
+ about: "combo-chart.about",
860
+ id: "components/charts/combo-chart",
861
+ imports: "import { ComboChart } from \"@stealthscale/component-charts\";",
862
+ scenes: [
863
+ ended,
864
+ shared,
865
+ tooltip,
866
+ animated,
867
+ narrow,
868
+ empty
869
+ ],
870
+ title: "combo-chart.title"
871
+ });
872
+ //#endregion
873
+ export { animated, combo_chart_specimen_default as default, empty, ended, narrow, shared, tooltip };