@stealthscale/component-charts 0.2.1 → 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 +29 -13
  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 +9 -8
  123. /package/dist/{recipe-BbGw00ut.js → recipes-BbGw00ut.js} +0 -0
@@ -0,0 +1,1585 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { ht as BoxPlot } 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/box-plot/examples/regions.ts
11
+ /**
12
+ * Lists the response times in milliseconds of a checkout API's requests in four regions, which the
13
+ * box plot's examples share: about 40 requests each, every region with a slow tail.
14
+ */
15
+ /**
16
+ * Lists Frankfurt's 42 response times.
17
+ */
18
+ const FRANKFURT = [
19
+ 51,
20
+ 58,
21
+ 53,
22
+ 59,
23
+ 39,
24
+ 56,
25
+ 72,
26
+ 54,
27
+ 134,
28
+ 84,
29
+ 52,
30
+ 42,
31
+ 48,
32
+ 57,
33
+ 63,
34
+ 74,
35
+ 95,
36
+ 68,
37
+ 93,
38
+ 52,
39
+ 59,
40
+ 94,
41
+ 54,
42
+ 87,
43
+ 55,
44
+ 59,
45
+ 70,
46
+ 85,
47
+ 89,
48
+ 108,
49
+ 83,
50
+ 56,
51
+ 49,
52
+ 94,
53
+ 30,
54
+ 47,
55
+ 111,
56
+ 53,
57
+ 79,
58
+ 79,
59
+ 158,
60
+ 176
61
+ ];
62
+ /**
63
+ * Lists Amsterdam's 41 response times.
64
+ */
65
+ const AMSTERDAM = [
66
+ 71,
67
+ 69,
68
+ 82,
69
+ 70,
70
+ 67,
71
+ 73,
72
+ 57,
73
+ 75,
74
+ 82,
75
+ 84,
76
+ 56,
77
+ 70,
78
+ 52,
79
+ 51,
80
+ 83,
81
+ 57,
82
+ 54,
83
+ 89,
84
+ 122,
85
+ 42,
86
+ 41,
87
+ 97,
88
+ 52,
89
+ 50,
90
+ 55,
91
+ 46,
92
+ 74,
93
+ 63,
94
+ 64,
95
+ 84,
96
+ 66,
97
+ 87,
98
+ 93,
99
+ 54,
100
+ 78,
101
+ 71,
102
+ 73,
103
+ 53,
104
+ 46,
105
+ 67,
106
+ 214
107
+ ];
108
+ /**
109
+ * Lists Virginia's 43 response times.
110
+ */
111
+ const VIRGINIA = [
112
+ 137,
113
+ 96,
114
+ 129,
115
+ 129,
116
+ 87,
117
+ 111,
118
+ 95,
119
+ 92,
120
+ 141,
121
+ 124,
122
+ 84,
123
+ 109,
124
+ 158,
125
+ 171,
126
+ 103,
127
+ 132,
128
+ 106,
129
+ 156,
130
+ 114,
131
+ 136,
132
+ 170,
133
+ 106,
134
+ 137,
135
+ 110,
136
+ 72,
137
+ 131,
138
+ 139,
139
+ 111,
140
+ 135,
141
+ 95,
142
+ 124,
143
+ 155,
144
+ 105,
145
+ 133,
146
+ 125,
147
+ 79,
148
+ 142,
149
+ 139,
150
+ 99,
151
+ 126,
152
+ 262,
153
+ 301,
154
+ 344
155
+ ];
156
+ /**
157
+ * Lists Singapore's 41 response times.
158
+ */
159
+ const SINGAPORE = [
160
+ 165,
161
+ 199,
162
+ 128,
163
+ 151,
164
+ 114,
165
+ 207,
166
+ 170,
167
+ 230,
168
+ 165,
169
+ 205,
170
+ 199,
171
+ 147,
172
+ 150,
173
+ 260,
174
+ 229,
175
+ 175,
176
+ 144,
177
+ 141,
178
+ 141,
179
+ 179,
180
+ 182,
181
+ 122,
182
+ 157,
183
+ 159,
184
+ 129,
185
+ 267,
186
+ 120,
187
+ 158,
188
+ 238,
189
+ 202,
190
+ 124,
191
+ 179,
192
+ 186,
193
+ 137,
194
+ 158,
195
+ 208,
196
+ 197,
197
+ 134,
198
+ 114,
199
+ 179,
200
+ 388
201
+ ];
202
+ //#endregion
203
+ //#region src/box-plot/examples/far.example.tsx
204
+ var far_example_exports = /* @__PURE__ */ __exportAll({
205
+ FarOut: () => FarOut,
206
+ source: () => source$7
207
+ });
208
+ function FarOut() {
209
+ const $ = c(33);
210
+ const { t } = useWords("box-plot");
211
+ let t0;
212
+ if ($[0] !== t) {
213
+ t0 = t("far.caption");
214
+ $[0] = t;
215
+ $[1] = t0;
216
+ } else t0 = $[1];
217
+ let t1;
218
+ if ($[2] !== t) {
219
+ t1 = t("requests");
220
+ $[2] = t;
221
+ $[3] = t1;
222
+ } else t1 = $[3];
223
+ let t2;
224
+ if ($[4] !== t) {
225
+ t2 = t("regions.frankfurt");
226
+ $[4] = t;
227
+ $[5] = t2;
228
+ } else t2 = $[5];
229
+ let t3;
230
+ if ($[6] !== t2) {
231
+ t3 = {
232
+ key: "frankfurt",
233
+ label: t2,
234
+ values: FRANKFURT
235
+ };
236
+ $[6] = t2;
237
+ $[7] = t3;
238
+ } else t3 = $[7];
239
+ let t4;
240
+ if ($[8] !== t) {
241
+ t4 = t("regions.amsterdam");
242
+ $[8] = t;
243
+ $[9] = t4;
244
+ } else t4 = $[9];
245
+ let t5;
246
+ if ($[10] !== t4) {
247
+ t5 = {
248
+ key: "amsterdam",
249
+ label: t4,
250
+ values: AMSTERDAM
251
+ };
252
+ $[10] = t4;
253
+ $[11] = t5;
254
+ } else t5 = $[11];
255
+ let t6;
256
+ if ($[12] !== t) {
257
+ t6 = t("regions.virginia");
258
+ $[12] = t;
259
+ $[13] = t6;
260
+ } else t6 = $[13];
261
+ let t7;
262
+ if ($[14] !== t6) {
263
+ t7 = {
264
+ key: "virginia",
265
+ label: t6,
266
+ values: VIRGINIA
267
+ };
268
+ $[14] = t6;
269
+ $[15] = t7;
270
+ } else t7 = $[15];
271
+ let t8;
272
+ if ($[16] !== t) {
273
+ t8 = t("regions.singapore");
274
+ $[16] = t;
275
+ $[17] = t8;
276
+ } else t8 = $[17];
277
+ let t9;
278
+ if ($[18] !== t8) {
279
+ t9 = {
280
+ key: "singapore",
281
+ label: t8,
282
+ values: SINGAPORE
283
+ };
284
+ $[18] = t8;
285
+ $[19] = t9;
286
+ } else t9 = $[19];
287
+ let t10;
288
+ if ($[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t9) {
289
+ t10 = [
290
+ t3,
291
+ t5,
292
+ t7,
293
+ t9
294
+ ];
295
+ $[20] = t3;
296
+ $[21] = t5;
297
+ $[22] = t7;
298
+ $[23] = t9;
299
+ $[24] = t10;
300
+ } else t10 = $[24];
301
+ let t11;
302
+ if ($[25] !== t) {
303
+ t11 = t("regions.label");
304
+ $[25] = t;
305
+ $[26] = t11;
306
+ } else t11 = $[26];
307
+ let t12;
308
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
309
+ t12 = {
310
+ style: "unit",
311
+ unit: "millisecond",
312
+ unitDisplay: "narrow"
313
+ };
314
+ $[27] = t12;
315
+ } else t12 = $[27];
316
+ let t13;
317
+ if ($[28] !== t0 || $[29] !== t1 || $[30] !== t10 || $[31] !== t11) {
318
+ t13 = /* @__PURE__ */ jsx(BoxPlot, {
319
+ caption: t0,
320
+ countLabel: t1,
321
+ groups: t10,
322
+ label: t11,
323
+ valueOptions: t12,
324
+ whisker: 3
325
+ });
326
+ $[28] = t0;
327
+ $[29] = t1;
328
+ $[30] = t10;
329
+ $[31] = t11;
330
+ $[32] = t13;
331
+ } else t13 = $[32];
332
+ return t13;
333
+ }
334
+ const source$7 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { BoxPlot } from \"@stealthscale/component-charts\";\n\nimport { AMSTERDAM, FRANKFURT, SINGAPORE, VIRGINIA } from \"./regions.ts\";\n\nexport function FarOut(): ReactElement {\n const { t } = useWords(\"box-plot\");\n\n return (\n <BoxPlot\n caption={t(\"far.caption\")}\n countLabel={t(\"requests\")}\n groups={[\n { key: \"frankfurt\", label: t(\"regions.frankfurt\"), values: FRANKFURT },\n { key: \"amsterdam\", label: t(\"regions.amsterdam\"), values: AMSTERDAM },\n { key: \"virginia\", label: t(\"regions.virginia\"), values: VIRGINIA },\n { key: \"singapore\", label: t(\"regions.singapore\"), values: SINGAPORE },\n ]}\n label={t(\"regions.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n whisker={3}\n />\n );\n}\n";
335
+ //#endregion
336
+ //#region src/box-plot/examples/quiet.example.tsx
337
+ var quiet_example_exports = /* @__PURE__ */ __exportAll({
338
+ Quiet: () => Quiet,
339
+ source: () => source$6
340
+ });
341
+ const NONE = [];
342
+ function Quiet() {
343
+ const $ = c(35);
344
+ const { t } = useWords("box-plot");
345
+ let t0;
346
+ if ($[0] !== t) {
347
+ t0 = t("quiet.caption");
348
+ $[0] = t;
349
+ $[1] = t0;
350
+ } else t0 = $[1];
351
+ let t1;
352
+ if ($[2] !== t) {
353
+ t1 = t("requests");
354
+ $[2] = t;
355
+ $[3] = t1;
356
+ } else t1 = $[3];
357
+ let t2;
358
+ if ($[4] !== t) {
359
+ t2 = t("quiet.empty");
360
+ $[4] = t;
361
+ $[5] = t2;
362
+ } else t2 = $[5];
363
+ let t3;
364
+ if ($[6] !== t) {
365
+ t3 = t("regions.frankfurt");
366
+ $[6] = t;
367
+ $[7] = t3;
368
+ } else t3 = $[7];
369
+ let t4;
370
+ if ($[8] !== t3) {
371
+ t4 = {
372
+ key: "frankfurt",
373
+ label: t3,
374
+ values: NONE
375
+ };
376
+ $[8] = t3;
377
+ $[9] = t4;
378
+ } else t4 = $[9];
379
+ let t5;
380
+ if ($[10] !== t) {
381
+ t5 = t("regions.amsterdam");
382
+ $[10] = t;
383
+ $[11] = t5;
384
+ } else t5 = $[11];
385
+ let t6;
386
+ if ($[12] !== t5) {
387
+ t6 = {
388
+ key: "amsterdam",
389
+ label: t5,
390
+ values: NONE
391
+ };
392
+ $[12] = t5;
393
+ $[13] = t6;
394
+ } else t6 = $[13];
395
+ let t7;
396
+ if ($[14] !== t) {
397
+ t7 = t("regions.virginia");
398
+ $[14] = t;
399
+ $[15] = t7;
400
+ } else t7 = $[15];
401
+ let t8;
402
+ if ($[16] !== t7) {
403
+ t8 = {
404
+ key: "virginia",
405
+ label: t7,
406
+ values: NONE
407
+ };
408
+ $[16] = t7;
409
+ $[17] = t8;
410
+ } else t8 = $[17];
411
+ let t9;
412
+ if ($[18] !== t) {
413
+ t9 = t("regions.singapore");
414
+ $[18] = t;
415
+ $[19] = t9;
416
+ } else t9 = $[19];
417
+ let t10;
418
+ if ($[20] !== t9) {
419
+ t10 = {
420
+ key: "singapore",
421
+ label: t9,
422
+ values: NONE
423
+ };
424
+ $[20] = t9;
425
+ $[21] = t10;
426
+ } else t10 = $[21];
427
+ let t11;
428
+ if ($[22] !== t10 || $[23] !== t4 || $[24] !== t6 || $[25] !== t8) {
429
+ t11 = [
430
+ t4,
431
+ t6,
432
+ t8,
433
+ t10
434
+ ];
435
+ $[22] = t10;
436
+ $[23] = t4;
437
+ $[24] = t6;
438
+ $[25] = t8;
439
+ $[26] = t11;
440
+ } else t11 = $[26];
441
+ let t12;
442
+ if ($[27] !== t) {
443
+ t12 = t("regions.label");
444
+ $[27] = t;
445
+ $[28] = t12;
446
+ } else t12 = $[28];
447
+ let t13;
448
+ if ($[29] !== t0 || $[30] !== t1 || $[31] !== t11 || $[32] !== t12 || $[33] !== t2) {
449
+ t13 = /* @__PURE__ */ jsx(BoxPlot, {
450
+ caption: t0,
451
+ countLabel: t1,
452
+ empty: t2,
453
+ groups: t11,
454
+ label: t12
455
+ });
456
+ $[29] = t0;
457
+ $[30] = t1;
458
+ $[31] = t11;
459
+ $[32] = t12;
460
+ $[33] = t2;
461
+ $[34] = t13;
462
+ } else t13 = $[34];
463
+ return t13;
464
+ }
465
+ const source$6 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { BoxPlot } from \"@stealthscale/component-charts\";\n\nconst NONE: number[] = [];\n\nexport function Quiet(): ReactElement {\n const { t } = useWords(\"box-plot\");\n\n return (\n <BoxPlot\n caption={t(\"quiet.caption\")}\n countLabel={t(\"requests\")}\n empty={t(\"quiet.empty\")}\n groups={[\n { key: \"frankfurt\", label: t(\"regions.frankfurt\"), values: NONE },\n { key: \"amsterdam\", label: t(\"regions.amsterdam\"), values: NONE },\n { key: \"virginia\", label: t(\"regions.virginia\"), values: NONE },\n { key: \"singapore\", label: t(\"regions.singapore\"), values: NONE },\n ]}\n label={t(\"regions.label\")}\n />\n );\n}\n";
466
+ //#endregion
467
+ //#region src/box-plot/examples/regions.example.tsx
468
+ var regions_example_exports = /* @__PURE__ */ __exportAll({
469
+ Regions: () => Regions,
470
+ source: () => source$5
471
+ });
472
+ function Regions() {
473
+ const $ = c(33);
474
+ const { t } = useWords("box-plot");
475
+ let t0;
476
+ if ($[0] !== t) {
477
+ t0 = t("regions.caption");
478
+ $[0] = t;
479
+ $[1] = t0;
480
+ } else t0 = $[1];
481
+ let t1;
482
+ if ($[2] !== t) {
483
+ t1 = t("requests");
484
+ $[2] = t;
485
+ $[3] = t1;
486
+ } else t1 = $[3];
487
+ let t2;
488
+ if ($[4] !== t) {
489
+ t2 = t("regions.frankfurt");
490
+ $[4] = t;
491
+ $[5] = t2;
492
+ } else t2 = $[5];
493
+ let t3;
494
+ if ($[6] !== t2) {
495
+ t3 = {
496
+ key: "frankfurt",
497
+ label: t2,
498
+ values: FRANKFURT
499
+ };
500
+ $[6] = t2;
501
+ $[7] = t3;
502
+ } else t3 = $[7];
503
+ let t4;
504
+ if ($[8] !== t) {
505
+ t4 = t("regions.amsterdam");
506
+ $[8] = t;
507
+ $[9] = t4;
508
+ } else t4 = $[9];
509
+ let t5;
510
+ if ($[10] !== t4) {
511
+ t5 = {
512
+ key: "amsterdam",
513
+ label: t4,
514
+ values: AMSTERDAM
515
+ };
516
+ $[10] = t4;
517
+ $[11] = t5;
518
+ } else t5 = $[11];
519
+ let t6;
520
+ if ($[12] !== t) {
521
+ t6 = t("regions.virginia");
522
+ $[12] = t;
523
+ $[13] = t6;
524
+ } else t6 = $[13];
525
+ let t7;
526
+ if ($[14] !== t6) {
527
+ t7 = {
528
+ key: "virginia",
529
+ label: t6,
530
+ values: VIRGINIA
531
+ };
532
+ $[14] = t6;
533
+ $[15] = t7;
534
+ } else t7 = $[15];
535
+ let t8;
536
+ if ($[16] !== t) {
537
+ t8 = t("regions.singapore");
538
+ $[16] = t;
539
+ $[17] = t8;
540
+ } else t8 = $[17];
541
+ let t9;
542
+ if ($[18] !== t8) {
543
+ t9 = {
544
+ key: "singapore",
545
+ label: t8,
546
+ values: SINGAPORE
547
+ };
548
+ $[18] = t8;
549
+ $[19] = t9;
550
+ } else t9 = $[19];
551
+ let t10;
552
+ if ($[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t9) {
553
+ t10 = [
554
+ t3,
555
+ t5,
556
+ t7,
557
+ t9
558
+ ];
559
+ $[20] = t3;
560
+ $[21] = t5;
561
+ $[22] = t7;
562
+ $[23] = t9;
563
+ $[24] = t10;
564
+ } else t10 = $[24];
565
+ let t11;
566
+ if ($[25] !== t) {
567
+ t11 = t("regions.label");
568
+ $[25] = t;
569
+ $[26] = t11;
570
+ } else t11 = $[26];
571
+ let t12;
572
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
573
+ t12 = {
574
+ style: "unit",
575
+ unit: "millisecond",
576
+ unitDisplay: "narrow"
577
+ };
578
+ $[27] = t12;
579
+ } else t12 = $[27];
580
+ let t13;
581
+ if ($[28] !== t0 || $[29] !== t1 || $[30] !== t10 || $[31] !== t11) {
582
+ t13 = /* @__PURE__ */ jsx(BoxPlot, {
583
+ caption: t0,
584
+ countLabel: t1,
585
+ groups: t10,
586
+ label: t11,
587
+ valueOptions: t12
588
+ });
589
+ $[28] = t0;
590
+ $[29] = t1;
591
+ $[30] = t10;
592
+ $[31] = t11;
593
+ $[32] = t13;
594
+ } else t13 = $[32];
595
+ return t13;
596
+ }
597
+ const source$5 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { BoxPlot } from \"@stealthscale/component-charts\";\n\nimport { AMSTERDAM, FRANKFURT, SINGAPORE, VIRGINIA } from \"./regions.ts\";\n\nexport function Regions(): ReactElement {\n const { t } = useWords(\"box-plot\");\n\n return (\n <BoxPlot\n caption={t(\"regions.caption\")}\n countLabel={t(\"requests\")}\n groups={[\n { key: \"frankfurt\", label: t(\"regions.frankfurt\"), values: FRANKFURT },\n { key: \"amsterdam\", label: t(\"regions.amsterdam\"), values: AMSTERDAM },\n { key: \"virginia\", label: t(\"regions.virginia\"), values: VIRGINIA },\n { key: \"singapore\", label: t(\"regions.singapore\"), values: SINGAPORE },\n ]}\n label={t(\"regions.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n />\n );\n}\n";
598
+ //#endregion
599
+ //#region src/box-plot/examples/replay.example.tsx
600
+ var replay_example_exports = /* @__PURE__ */ __exportAll({
601
+ Replay: () => Replay,
602
+ source: () => source$4
603
+ });
604
+ function Replay() {
605
+ const $ = c(45);
606
+ const { t } = useWords("box-plot");
607
+ const [run, setRun] = useState(0);
608
+ let t0;
609
+ if ($[0] !== t) {
610
+ t0 = t("regions.caption");
611
+ $[0] = t;
612
+ $[1] = t0;
613
+ } else t0 = $[1];
614
+ let t1;
615
+ if ($[2] !== t) {
616
+ t1 = t("requests");
617
+ $[2] = t;
618
+ $[3] = t1;
619
+ } else t1 = $[3];
620
+ let t2;
621
+ if ($[4] !== t) {
622
+ t2 = t("regions.frankfurt");
623
+ $[4] = t;
624
+ $[5] = t2;
625
+ } else t2 = $[5];
626
+ let t3;
627
+ if ($[6] !== t2) {
628
+ t3 = {
629
+ key: "frankfurt",
630
+ label: t2,
631
+ values: FRANKFURT
632
+ };
633
+ $[6] = t2;
634
+ $[7] = t3;
635
+ } else t3 = $[7];
636
+ let t4;
637
+ if ($[8] !== t) {
638
+ t4 = t("regions.amsterdam");
639
+ $[8] = t;
640
+ $[9] = t4;
641
+ } else t4 = $[9];
642
+ let t5;
643
+ if ($[10] !== t4) {
644
+ t5 = {
645
+ key: "amsterdam",
646
+ label: t4,
647
+ values: AMSTERDAM
648
+ };
649
+ $[10] = t4;
650
+ $[11] = t5;
651
+ } else t5 = $[11];
652
+ let t6;
653
+ if ($[12] !== t) {
654
+ t6 = t("regions.virginia");
655
+ $[12] = t;
656
+ $[13] = t6;
657
+ } else t6 = $[13];
658
+ let t7;
659
+ if ($[14] !== t6) {
660
+ t7 = {
661
+ key: "virginia",
662
+ label: t6,
663
+ values: VIRGINIA
664
+ };
665
+ $[14] = t6;
666
+ $[15] = t7;
667
+ } else t7 = $[15];
668
+ let t8;
669
+ if ($[16] !== t) {
670
+ t8 = t("regions.singapore");
671
+ $[16] = t;
672
+ $[17] = t8;
673
+ } else t8 = $[17];
674
+ let t9;
675
+ if ($[18] !== t8) {
676
+ t9 = {
677
+ key: "singapore",
678
+ label: t8,
679
+ values: SINGAPORE
680
+ };
681
+ $[18] = t8;
682
+ $[19] = t9;
683
+ } else t9 = $[19];
684
+ let t10;
685
+ if ($[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t9) {
686
+ t10 = [
687
+ t3,
688
+ t5,
689
+ t7,
690
+ t9
691
+ ];
692
+ $[20] = t3;
693
+ $[21] = t5;
694
+ $[22] = t7;
695
+ $[23] = t9;
696
+ $[24] = t10;
697
+ } else t10 = $[24];
698
+ let t11;
699
+ if ($[25] !== t) {
700
+ t11 = t("regions.label");
701
+ $[25] = t;
702
+ $[26] = t11;
703
+ } else t11 = $[26];
704
+ let t12;
705
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
706
+ t12 = {
707
+ style: "unit",
708
+ unit: "millisecond",
709
+ unitDisplay: "narrow"
710
+ };
711
+ $[27] = t12;
712
+ } else t12 = $[27];
713
+ let t13;
714
+ if ($[28] !== run || $[29] !== t0 || $[30] !== t1 || $[31] !== t10 || $[32] !== t11) {
715
+ t13 = /* @__PURE__ */ jsx(BoxPlot, {
716
+ animate: true,
717
+ caption: t0,
718
+ countLabel: t1,
719
+ groups: t10,
720
+ label: t11,
721
+ valueOptions: t12
722
+ }, run);
723
+ $[28] = run;
724
+ $[29] = t0;
725
+ $[30] = t1;
726
+ $[31] = t10;
727
+ $[32] = t11;
728
+ $[33] = t13;
729
+ } else t13 = $[33];
730
+ let t14;
731
+ if ($[34] !== run) {
732
+ t14 = () => {
733
+ setRun(run + 1);
734
+ };
735
+ $[34] = run;
736
+ $[35] = t14;
737
+ } else t14 = $[35];
738
+ let t15;
739
+ if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
740
+ t15 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
741
+ $[36] = t15;
742
+ } else t15 = $[36];
743
+ let t16;
744
+ if ($[37] !== t) {
745
+ t16 = t("replay.replay");
746
+ $[37] = t;
747
+ $[38] = t16;
748
+ } else t16 = $[38];
749
+ let t17;
750
+ if ($[39] !== t14 || $[40] !== t16) {
751
+ t17 = /* @__PURE__ */ jsxs(Button, {
752
+ onClick: t14,
753
+ size: "sm",
754
+ variant: "outline",
755
+ children: [t15, t16]
756
+ });
757
+ $[39] = t14;
758
+ $[40] = t16;
759
+ $[41] = t17;
760
+ } else t17 = $[41];
761
+ let t18;
762
+ if ($[42] !== t13 || $[43] !== t17) {
763
+ t18 = /* @__PURE__ */ jsxs(Stack, {
764
+ align: "flex-start",
765
+ children: [t13, t17]
766
+ });
767
+ $[42] = t13;
768
+ $[43] = t17;
769
+ $[44] = t18;
770
+ } else t18 = $[44];
771
+ return t18;
772
+ }
773
+ const source$4 = "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 { BoxPlot } from \"@stealthscale/component-charts\";\n\nimport { AMSTERDAM, FRANKFURT, SINGAPORE, VIRGINIA } from \"./regions.ts\";\n\nexport function Replay(): ReactElement {\n const { t } = useWords(\"box-plot\");\n const [run, setRun] = useState(0);\n\n return (\n <Stack align=\"flex-start\">\n <BoxPlot\n animate\n caption={t(\"regions.caption\")}\n countLabel={t(\"requests\")}\n groups={[\n { key: \"frankfurt\", label: t(\"regions.frankfurt\"), values: FRANKFURT },\n { key: \"amsterdam\", label: t(\"regions.amsterdam\"), values: AMSTERDAM },\n { key: \"virginia\", label: t(\"regions.virginia\"), values: VIRGINIA },\n { key: \"singapore\", label: t(\"regions.singapore\"), values: SINGAPORE },\n ]}\n key={run}\n label={t(\"regions.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\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";
774
+ //#endregion
775
+ //#region src/box-plot/examples/methods.ts
776
+ /**
777
+ * Lists the delivery times in days of a shop's orders by shipping method, which the box plot's
778
+ * examples share: about 30 orders each, in half days.
779
+ */
780
+ /**
781
+ * Lists the delivery times of 31 express orders.
782
+ */
783
+ const EXPRESS = [
784
+ 2,
785
+ .5,
786
+ 2,
787
+ 2.5,
788
+ .5,
789
+ 1,
790
+ 2,
791
+ 1.5,
792
+ 1,
793
+ 1,
794
+ 2,
795
+ 1.5,
796
+ 2,
797
+ 2,
798
+ 1.5,
799
+ 1,
800
+ .5,
801
+ 1,
802
+ 2,
803
+ 1,
804
+ 3,
805
+ 1,
806
+ 1.5,
807
+ 2,
808
+ 1.5,
809
+ 2,
810
+ 1.5,
811
+ 1.5,
812
+ 1,
813
+ 1.5,
814
+ 5
815
+ ];
816
+ /**
817
+ * Lists the delivery times of 31 standard orders.
818
+ */
819
+ const STANDARD = [
820
+ 4,
821
+ 3.5,
822
+ 3,
823
+ 2,
824
+ 2.5,
825
+ 2.5,
826
+ 3.5,
827
+ 3,
828
+ 2.5,
829
+ 3.5,
830
+ 3.5,
831
+ 2.5,
832
+ 3,
833
+ 2.5,
834
+ 2,
835
+ 2.5,
836
+ 4,
837
+ 3,
838
+ 3.5,
839
+ 2.5,
840
+ 3.5,
841
+ 2.5,
842
+ 5.5,
843
+ 4,
844
+ 3.5,
845
+ 2.5,
846
+ 2,
847
+ 2.5,
848
+ 2.5,
849
+ 2.5,
850
+ 6.5
851
+ ];
852
+ /**
853
+ * Lists the delivery times of 30 economy orders.
854
+ */
855
+ const ECONOMY = [
856
+ 5,
857
+ 7,
858
+ 5,
859
+ 5,
860
+ 5,
861
+ 5,
862
+ 3,
863
+ 4.5,
864
+ 4,
865
+ 5,
866
+ 5.5,
867
+ 7,
868
+ 6,
869
+ 4.5,
870
+ 5,
871
+ 6.5,
872
+ 6,
873
+ 5.5,
874
+ 5,
875
+ 3,
876
+ 5,
877
+ 6,
878
+ 4,
879
+ 5,
880
+ 6.5,
881
+ 5,
882
+ 4.5,
883
+ 7.5,
884
+ 4.5,
885
+ 5
886
+ ];
887
+ //#endregion
888
+ //#region src/box-plot/examples/shipping.example.tsx
889
+ var shipping_example_exports = /* @__PURE__ */ __exportAll({
890
+ Shipping: () => Shipping,
891
+ source: () => source$3
892
+ });
893
+ function Shipping() {
894
+ const $ = c(29);
895
+ const { t } = useWords("box-plot");
896
+ let t0;
897
+ if ($[0] !== t) {
898
+ t0 = t("shipping.caption");
899
+ $[0] = t;
900
+ $[1] = t0;
901
+ } else t0 = $[1];
902
+ let t1;
903
+ if ($[2] !== t) {
904
+ t1 = t("shipping.orders");
905
+ $[2] = t;
906
+ $[3] = t1;
907
+ } else t1 = $[3];
908
+ let t2;
909
+ if ($[4] !== t) {
910
+ t2 = t("shipping.express");
911
+ $[4] = t;
912
+ $[5] = t2;
913
+ } else t2 = $[5];
914
+ let t3;
915
+ if ($[6] !== t2) {
916
+ t3 = {
917
+ key: "express",
918
+ label: t2,
919
+ values: EXPRESS
920
+ };
921
+ $[6] = t2;
922
+ $[7] = t3;
923
+ } else t3 = $[7];
924
+ let t4;
925
+ if ($[8] !== t) {
926
+ t4 = t("shipping.standard");
927
+ $[8] = t;
928
+ $[9] = t4;
929
+ } else t4 = $[9];
930
+ let t5;
931
+ if ($[10] !== t4) {
932
+ t5 = {
933
+ key: "standard",
934
+ label: t4,
935
+ values: STANDARD
936
+ };
937
+ $[10] = t4;
938
+ $[11] = t5;
939
+ } else t5 = $[11];
940
+ let t6;
941
+ if ($[12] !== t) {
942
+ t6 = t("shipping.economy");
943
+ $[12] = t;
944
+ $[13] = t6;
945
+ } else t6 = $[13];
946
+ let t7;
947
+ if ($[14] !== t6) {
948
+ t7 = {
949
+ key: "economy",
950
+ label: t6,
951
+ values: ECONOMY
952
+ };
953
+ $[14] = t6;
954
+ $[15] = t7;
955
+ } else t7 = $[15];
956
+ let t8;
957
+ if ($[16] !== t3 || $[17] !== t5 || $[18] !== t7) {
958
+ t8 = [
959
+ t3,
960
+ t5,
961
+ t7
962
+ ];
963
+ $[16] = t3;
964
+ $[17] = t5;
965
+ $[18] = t7;
966
+ $[19] = t8;
967
+ } else t8 = $[19];
968
+ let t9;
969
+ if ($[20] !== t) {
970
+ t9 = t("shipping.label");
971
+ $[20] = t;
972
+ $[21] = t9;
973
+ } else t9 = $[21];
974
+ let t10;
975
+ let t11;
976
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
977
+ t10 = [0, 12];
978
+ t11 = {
979
+ style: "unit",
980
+ unit: "day",
981
+ unitDisplay: "narrow"
982
+ };
983
+ $[22] = t10;
984
+ $[23] = t11;
985
+ } else {
986
+ t10 = $[22];
987
+ t11 = $[23];
988
+ }
989
+ let t12;
990
+ if ($[24] !== t0 || $[25] !== t1 || $[26] !== t8 || $[27] !== t9) {
991
+ t12 = /* @__PURE__ */ jsx(BoxPlot, {
992
+ caption: t0,
993
+ color: "teal",
994
+ countLabel: t1,
995
+ groups: t8,
996
+ label: t9,
997
+ valueDomain: t10,
998
+ valueOptions: t11
999
+ });
1000
+ $[24] = t0;
1001
+ $[25] = t1;
1002
+ $[26] = t8;
1003
+ $[27] = t9;
1004
+ $[28] = t12;
1005
+ } else t12 = $[28];
1006
+ return t12;
1007
+ }
1008
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { BoxPlot } from \"@stealthscale/component-charts\";\n\nimport { ECONOMY, EXPRESS, STANDARD } from \"./methods.ts\";\n\nexport function Shipping(): ReactElement {\n const { t } = useWords(\"box-plot\");\n\n return (\n <BoxPlot\n caption={t(\"shipping.caption\")}\n color=\"teal\"\n countLabel={t(\"shipping.orders\")}\n groups={[\n { key: \"express\", label: t(\"shipping.express\"), values: EXPRESS },\n { key: \"standard\", label: t(\"shipping.standard\"), values: STANDARD },\n { key: \"economy\", label: t(\"shipping.economy\"), values: ECONOMY },\n ]}\n label={t(\"shipping.label\")}\n valueDomain={[0, 12]}\n valueOptions={{ style: \"unit\", unit: \"day\", unitDisplay: \"narrow\" }}\n />\n );\n}\n";
1009
+ //#endregion
1010
+ //#region src/box-plot/examples/slowest.example.tsx
1011
+ var slowest_example_exports = /* @__PURE__ */ __exportAll({
1012
+ Slowest: () => Slowest,
1013
+ source: () => source$2
1014
+ });
1015
+ function Slowest() {
1016
+ const $ = c(33);
1017
+ const { t } = useWords("box-plot");
1018
+ let t0;
1019
+ if ($[0] !== t) {
1020
+ t0 = t("slowest.caption");
1021
+ $[0] = t;
1022
+ $[1] = t0;
1023
+ } else t0 = $[1];
1024
+ let t1;
1025
+ if ($[2] !== t) {
1026
+ t1 = t("requests");
1027
+ $[2] = t;
1028
+ $[3] = t1;
1029
+ } else t1 = $[3];
1030
+ let t2;
1031
+ if ($[4] !== t) {
1032
+ t2 = t("regions.frankfurt");
1033
+ $[4] = t;
1034
+ $[5] = t2;
1035
+ } else t2 = $[5];
1036
+ let t3;
1037
+ if ($[6] !== t2) {
1038
+ t3 = {
1039
+ key: "frankfurt",
1040
+ label: t2,
1041
+ values: FRANKFURT
1042
+ };
1043
+ $[6] = t2;
1044
+ $[7] = t3;
1045
+ } else t3 = $[7];
1046
+ let t4;
1047
+ if ($[8] !== t) {
1048
+ t4 = t("regions.amsterdam");
1049
+ $[8] = t;
1050
+ $[9] = t4;
1051
+ } else t4 = $[9];
1052
+ let t5;
1053
+ if ($[10] !== t4) {
1054
+ t5 = {
1055
+ key: "amsterdam",
1056
+ label: t4,
1057
+ values: AMSTERDAM
1058
+ };
1059
+ $[10] = t4;
1060
+ $[11] = t5;
1061
+ } else t5 = $[11];
1062
+ let t6;
1063
+ if ($[12] !== t) {
1064
+ t6 = t("regions.virginia");
1065
+ $[12] = t;
1066
+ $[13] = t6;
1067
+ } else t6 = $[13];
1068
+ let t7;
1069
+ if ($[14] !== t6) {
1070
+ t7 = {
1071
+ key: "virginia",
1072
+ label: t6,
1073
+ values: VIRGINIA
1074
+ };
1075
+ $[14] = t6;
1076
+ $[15] = t7;
1077
+ } else t7 = $[15];
1078
+ let t8;
1079
+ if ($[16] !== t) {
1080
+ t8 = t("regions.singapore");
1081
+ $[16] = t;
1082
+ $[17] = t8;
1083
+ } else t8 = $[17];
1084
+ let t9;
1085
+ if ($[18] !== t8) {
1086
+ t9 = {
1087
+ key: "singapore",
1088
+ label: t8,
1089
+ values: SINGAPORE
1090
+ };
1091
+ $[18] = t8;
1092
+ $[19] = t9;
1093
+ } else t9 = $[19];
1094
+ let t10;
1095
+ if ($[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t9) {
1096
+ t10 = [
1097
+ t3,
1098
+ t5,
1099
+ t7,
1100
+ t9
1101
+ ];
1102
+ $[20] = t3;
1103
+ $[21] = t5;
1104
+ $[22] = t7;
1105
+ $[23] = t9;
1106
+ $[24] = t10;
1107
+ } else t10 = $[24];
1108
+ let t11;
1109
+ if ($[25] !== t) {
1110
+ t11 = t("regions.label");
1111
+ $[25] = t;
1112
+ $[26] = t11;
1113
+ } else t11 = $[26];
1114
+ let t12;
1115
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
1116
+ t12 = {
1117
+ style: "unit",
1118
+ unit: "millisecond",
1119
+ unitDisplay: "narrow"
1120
+ };
1121
+ $[27] = t12;
1122
+ } else t12 = $[27];
1123
+ let t13;
1124
+ if ($[28] !== t0 || $[29] !== t1 || $[30] !== t10 || $[31] !== t11) {
1125
+ t13 = /* @__PURE__ */ jsx(BoxPlot, {
1126
+ caption: t0,
1127
+ countLabel: t1,
1128
+ defaultIndex: 3,
1129
+ groups: t10,
1130
+ label: t11,
1131
+ valueOptions: t12
1132
+ });
1133
+ $[28] = t0;
1134
+ $[29] = t1;
1135
+ $[30] = t10;
1136
+ $[31] = t11;
1137
+ $[32] = t13;
1138
+ } else t13 = $[32];
1139
+ return t13;
1140
+ }
1141
+ const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { BoxPlot } from \"@stealthscale/component-charts\";\n\nimport { AMSTERDAM, FRANKFURT, SINGAPORE, VIRGINIA } from \"./regions.ts\";\n\nexport function Slowest(): ReactElement {\n const { t } = useWords(\"box-plot\");\n\n return (\n <BoxPlot\n caption={t(\"slowest.caption\")}\n countLabel={t(\"requests\")}\n defaultIndex={3}\n groups={[\n { key: \"frankfurt\", label: t(\"regions.frankfurt\"), values: FRANKFURT },\n { key: \"amsterdam\", label: t(\"regions.amsterdam\"), values: AMSTERDAM },\n { key: \"virginia\", label: t(\"regions.virginia\"), values: VIRGINIA },\n { key: \"singapore\", label: t(\"regions.singapore\"), values: SINGAPORE },\n ]}\n label={t(\"regions.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n />\n );\n}\n";
1142
+ //#endregion
1143
+ //#region src/box-plot/examples/tile.example.tsx
1144
+ var tile_example_exports = /* @__PURE__ */ __exportAll({
1145
+ Tile: () => Tile,
1146
+ source: () => source$1
1147
+ });
1148
+ function Tile() {
1149
+ const $ = c(33);
1150
+ const { t } = useWords("box-plot");
1151
+ let t0;
1152
+ if ($[0] !== t) {
1153
+ t0 = t("tile.caption");
1154
+ $[0] = t;
1155
+ $[1] = t0;
1156
+ } else t0 = $[1];
1157
+ let t1;
1158
+ if ($[2] !== t) {
1159
+ t1 = t("requests");
1160
+ $[2] = t;
1161
+ $[3] = t1;
1162
+ } else t1 = $[3];
1163
+ let t2;
1164
+ if ($[4] !== t) {
1165
+ t2 = t("regions.frankfurt");
1166
+ $[4] = t;
1167
+ $[5] = t2;
1168
+ } else t2 = $[5];
1169
+ let t3;
1170
+ if ($[6] !== t2) {
1171
+ t3 = {
1172
+ key: "frankfurt",
1173
+ label: t2,
1174
+ values: FRANKFURT
1175
+ };
1176
+ $[6] = t2;
1177
+ $[7] = t3;
1178
+ } else t3 = $[7];
1179
+ let t4;
1180
+ if ($[8] !== t) {
1181
+ t4 = t("regions.amsterdam");
1182
+ $[8] = t;
1183
+ $[9] = t4;
1184
+ } else t4 = $[9];
1185
+ let t5;
1186
+ if ($[10] !== t4) {
1187
+ t5 = {
1188
+ key: "amsterdam",
1189
+ label: t4,
1190
+ values: AMSTERDAM
1191
+ };
1192
+ $[10] = t4;
1193
+ $[11] = t5;
1194
+ } else t5 = $[11];
1195
+ let t6;
1196
+ if ($[12] !== t) {
1197
+ t6 = t("regions.virginia");
1198
+ $[12] = t;
1199
+ $[13] = t6;
1200
+ } else t6 = $[13];
1201
+ let t7;
1202
+ if ($[14] !== t6) {
1203
+ t7 = {
1204
+ key: "virginia",
1205
+ label: t6,
1206
+ values: VIRGINIA
1207
+ };
1208
+ $[14] = t6;
1209
+ $[15] = t7;
1210
+ } else t7 = $[15];
1211
+ let t8;
1212
+ if ($[16] !== t) {
1213
+ t8 = t("regions.singapore");
1214
+ $[16] = t;
1215
+ $[17] = t8;
1216
+ } else t8 = $[17];
1217
+ let t9;
1218
+ if ($[18] !== t8) {
1219
+ t9 = {
1220
+ key: "singapore",
1221
+ label: t8,
1222
+ values: SINGAPORE
1223
+ };
1224
+ $[18] = t8;
1225
+ $[19] = t9;
1226
+ } else t9 = $[19];
1227
+ let t10;
1228
+ if ($[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t9) {
1229
+ t10 = [
1230
+ t3,
1231
+ t5,
1232
+ t7,
1233
+ t9
1234
+ ];
1235
+ $[20] = t3;
1236
+ $[21] = t5;
1237
+ $[22] = t7;
1238
+ $[23] = t9;
1239
+ $[24] = t10;
1240
+ } else t10 = $[24];
1241
+ let t11;
1242
+ if ($[25] !== t) {
1243
+ t11 = t("regions.label");
1244
+ $[25] = t;
1245
+ $[26] = t11;
1246
+ } else t11 = $[26];
1247
+ let t12;
1248
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
1249
+ t12 = {
1250
+ style: "unit",
1251
+ unit: "millisecond",
1252
+ unitDisplay: "narrow"
1253
+ };
1254
+ $[27] = t12;
1255
+ } else t12 = $[27];
1256
+ let t13;
1257
+ if ($[28] !== t0 || $[29] !== t1 || $[30] !== t10 || $[31] !== t11) {
1258
+ t13 = /* @__PURE__ */ jsx(BoxPlot, {
1259
+ caption: t0,
1260
+ countLabel: t1,
1261
+ groups: t10,
1262
+ label: t11,
1263
+ legend: false,
1264
+ outliers: false,
1265
+ valueOptions: t12
1266
+ });
1267
+ $[28] = t0;
1268
+ $[29] = t1;
1269
+ $[30] = t10;
1270
+ $[31] = t11;
1271
+ $[32] = t13;
1272
+ } else t13 = $[32];
1273
+ return t13;
1274
+ }
1275
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { BoxPlot } from \"@stealthscale/component-charts\";\n\nimport { AMSTERDAM, FRANKFURT, SINGAPORE, VIRGINIA } from \"./regions.ts\";\n\nexport function Tile(): ReactElement {\n const { t } = useWords(\"box-plot\");\n\n return (\n <BoxPlot\n caption={t(\"tile.caption\")}\n countLabel={t(\"requests\")}\n groups={[\n { key: \"frankfurt\", label: t(\"regions.frankfurt\"), values: FRANKFURT },\n { key: \"amsterdam\", label: t(\"regions.amsterdam\"), values: AMSTERDAM },\n { key: \"virginia\", label: t(\"regions.virginia\"), values: VIRGINIA },\n { key: \"singapore\", label: t(\"regions.singapore\"), values: SINGAPORE },\n ]}\n label={t(\"regions.label\")}\n legend={false}\n outliers={false}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n />\n );\n}\n";
1276
+ //#endregion
1277
+ //#region src/box-plot/examples/paints.ts
1278
+ /**
1279
+ * Summarises 1,284,310 loads on desktops.
1280
+ */
1281
+ const DESKTOP = {
1282
+ count: 1284310,
1283
+ iqr: .7,
1284
+ max: 5.2,
1285
+ median: 1.2,
1286
+ min: .4,
1287
+ outliers: [
1288
+ 3.4,
1289
+ 4.1,
1290
+ 5.2
1291
+ ],
1292
+ q1: .9,
1293
+ q3: 1.6,
1294
+ whiskerHigh: 2.6,
1295
+ whiskerLow: .4
1296
+ };
1297
+ /**
1298
+ * Summarises 212,904 loads on tablets.
1299
+ */
1300
+ const TABLET = {
1301
+ count: 212904,
1302
+ iqr: 1.1,
1303
+ max: 6.3,
1304
+ median: 1.8,
1305
+ min: .6,
1306
+ outliers: [5.1, 6.3],
1307
+ q1: 1.3,
1308
+ q3: 2.4,
1309
+ whiskerHigh: 4,
1310
+ whiskerLow: .6
1311
+ };
1312
+ /**
1313
+ * Summarises 2,730,518 loads on phones.
1314
+ */
1315
+ const MOBILE = {
1316
+ count: 2730518,
1317
+ iqr: 1.6,
1318
+ max: 9.6,
1319
+ median: 2.4,
1320
+ min: .8,
1321
+ outliers: [
1322
+ 7.2,
1323
+ 8.4,
1324
+ 9.6
1325
+ ],
1326
+ q1: 1.7,
1327
+ q3: 3.3,
1328
+ whiskerHigh: 5.7,
1329
+ whiskerLow: .8
1330
+ };
1331
+ //#endregion
1332
+ //#region src/box-plot/examples/warehouse.example.tsx
1333
+ var warehouse_example_exports = /* @__PURE__ */ __exportAll({
1334
+ Warehouse: () => Warehouse,
1335
+ source: () => source
1336
+ });
1337
+ function Warehouse() {
1338
+ const $ = c(28);
1339
+ const { t } = useWords("box-plot");
1340
+ let t0;
1341
+ if ($[0] !== t) {
1342
+ t0 = t("warehouse.caption");
1343
+ $[0] = t;
1344
+ $[1] = t0;
1345
+ } else t0 = $[1];
1346
+ let t1;
1347
+ if ($[2] !== t) {
1348
+ t1 = t("warehouse.loads");
1349
+ $[2] = t;
1350
+ $[3] = t1;
1351
+ } else t1 = $[3];
1352
+ let t2;
1353
+ if ($[4] !== t) {
1354
+ t2 = t("warehouse.desktop");
1355
+ $[4] = t;
1356
+ $[5] = t2;
1357
+ } else t2 = $[5];
1358
+ let t3;
1359
+ if ($[6] !== t2) {
1360
+ t3 = {
1361
+ key: "desktop",
1362
+ label: t2,
1363
+ summary: DESKTOP
1364
+ };
1365
+ $[6] = t2;
1366
+ $[7] = t3;
1367
+ } else t3 = $[7];
1368
+ let t4;
1369
+ if ($[8] !== t) {
1370
+ t4 = t("warehouse.tablet");
1371
+ $[8] = t;
1372
+ $[9] = t4;
1373
+ } else t4 = $[9];
1374
+ let t5;
1375
+ if ($[10] !== t4) {
1376
+ t5 = {
1377
+ key: "tablet",
1378
+ label: t4,
1379
+ summary: TABLET
1380
+ };
1381
+ $[10] = t4;
1382
+ $[11] = t5;
1383
+ } else t5 = $[11];
1384
+ let t6;
1385
+ if ($[12] !== t) {
1386
+ t6 = t("warehouse.mobile");
1387
+ $[12] = t;
1388
+ $[13] = t6;
1389
+ } else t6 = $[13];
1390
+ let t7;
1391
+ if ($[14] !== t6) {
1392
+ t7 = {
1393
+ key: "mobile",
1394
+ label: t6,
1395
+ summary: MOBILE
1396
+ };
1397
+ $[14] = t6;
1398
+ $[15] = t7;
1399
+ } else t7 = $[15];
1400
+ let t8;
1401
+ if ($[16] !== t3 || $[17] !== t5 || $[18] !== t7) {
1402
+ t8 = [
1403
+ t3,
1404
+ t5,
1405
+ t7
1406
+ ];
1407
+ $[16] = t3;
1408
+ $[17] = t5;
1409
+ $[18] = t7;
1410
+ $[19] = t8;
1411
+ } else t8 = $[19];
1412
+ let t9;
1413
+ if ($[20] !== t) {
1414
+ t9 = t("warehouse.label");
1415
+ $[20] = t;
1416
+ $[21] = t9;
1417
+ } else t9 = $[21];
1418
+ let t10;
1419
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
1420
+ t10 = {
1421
+ style: "unit",
1422
+ unit: "second",
1423
+ unitDisplay: "narrow"
1424
+ };
1425
+ $[22] = t10;
1426
+ } else t10 = $[22];
1427
+ let t11;
1428
+ if ($[23] !== t0 || $[24] !== t1 || $[25] !== t8 || $[26] !== t9) {
1429
+ t11 = /* @__PURE__ */ jsx(BoxPlot, {
1430
+ caption: t0,
1431
+ countLabel: t1,
1432
+ groups: t8,
1433
+ label: t9,
1434
+ valueOptions: t10
1435
+ });
1436
+ $[23] = t0;
1437
+ $[24] = t1;
1438
+ $[25] = t8;
1439
+ $[26] = t9;
1440
+ $[27] = t11;
1441
+ } else t11 = $[27];
1442
+ return t11;
1443
+ }
1444
+ const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { BoxPlot } from \"@stealthscale/component-charts\";\n\nimport { DESKTOP, MOBILE, TABLET } from \"./paints.ts\";\n\nexport function Warehouse(): ReactElement {\n const { t } = useWords(\"box-plot\");\n\n return (\n <BoxPlot\n caption={t(\"warehouse.caption\")}\n countLabel={t(\"warehouse.loads\")}\n groups={[\n { key: \"desktop\", label: t(\"warehouse.desktop\"), summary: DESKTOP },\n { key: \"tablet\", label: t(\"warehouse.tablet\"), summary: TABLET },\n { key: \"mobile\", label: t(\"warehouse.mobile\"), summary: MOBILE },\n ]}\n label={t(\"warehouse.label\")}\n valueOptions={{ style: \"unit\", unit: \"second\", unitDisplay: \"narrow\" }}\n />\n );\n}\n";
1445
+ //#endregion
1446
+ //#region src/box-plot/box-plot.specimen.tsx
1447
+ /**
1448
+ * Catalogue page for the box plot.
1449
+ *
1450
+ * @remarks
1451
+ * The box plot has no recipe of its own: the chart's recipe styles its figure and the box's
1452
+ * parts, so every scene is hand-written. The scenes render response times in four regions, the
1453
+ * tooltip open at a region, summaries a warehouse query returned, whiskers at 3 interquartile
1454
+ * ranges, delivery times in the teal palette on a fixed axis, a tile without points or key, the
1455
+ * boxes animated in with a replay, the regions at a phone's width, and a box plot without values.
1456
+ * Every scene renders a component from `examples/` and shows that file as its source. The words
1457
+ * are keys under `box-plot` in `locales/en/specimen/box-plot.json`.
1458
+ */
1459
+ /**
1460
+ * Hand-written scene for response times in four regions.
1461
+ */
1462
+ const automatic = {
1463
+ about: "box-plot.regions.about",
1464
+ draw: () => /* @__PURE__ */ jsx(Room, {
1465
+ size: "lg",
1466
+ children: /* @__PURE__ */ jsx(Regions, {})
1467
+ }),
1468
+ example: regions_example_exports,
1469
+ title: "box-plot.regions.title"
1470
+ };
1471
+ /**
1472
+ * Hand-written scene for the tooltip open at a group.
1473
+ */
1474
+ const tooltip = {
1475
+ about: "box-plot.slowest.about",
1476
+ draw: () => /* @__PURE__ */ jsx(Room, {
1477
+ size: "lg",
1478
+ children: /* @__PURE__ */ jsx(Slowest, {})
1479
+ }),
1480
+ example: slowest_example_exports,
1481
+ title: "box-plot.slowest.title"
1482
+ };
1483
+ /**
1484
+ * Hand-written scene for groups given as summaries.
1485
+ */
1486
+ const summaries = {
1487
+ about: "box-plot.warehouse.about",
1488
+ draw: () => /* @__PURE__ */ jsx(Room, {
1489
+ size: "lg",
1490
+ children: /* @__PURE__ */ jsx(Warehouse, {})
1491
+ }),
1492
+ example: warehouse_example_exports,
1493
+ title: "box-plot.warehouse.title"
1494
+ };
1495
+ /**
1496
+ * Hand-written scene for whiskers at 3 interquartile ranges.
1497
+ */
1498
+ const farOut = {
1499
+ about: "box-plot.far.about",
1500
+ draw: () => /* @__PURE__ */ jsx(Room, {
1501
+ size: "lg",
1502
+ children: /* @__PURE__ */ jsx(FarOut, {})
1503
+ }),
1504
+ example: far_example_exports,
1505
+ title: "box-plot.far.title"
1506
+ };
1507
+ /**
1508
+ * Hand-written scene for delivery times in a palette's color on a fixed axis.
1509
+ */
1510
+ const colored = {
1511
+ about: "box-plot.shipping.about",
1512
+ draw: () => /* @__PURE__ */ jsx(Room, {
1513
+ size: "lg",
1514
+ children: /* @__PURE__ */ jsx(Shipping, {})
1515
+ }),
1516
+ example: shipping_example_exports,
1517
+ title: "box-plot.shipping.title"
1518
+ };
1519
+ /**
1520
+ * Hand-written scene for a tile without outlier points or key.
1521
+ */
1522
+ const bare = {
1523
+ about: "box-plot.tile.about",
1524
+ draw: () => /* @__PURE__ */ jsx(Room, {
1525
+ size: "md",
1526
+ children: /* @__PURE__ */ jsx(Tile, {})
1527
+ }),
1528
+ example: tile_example_exports,
1529
+ title: "box-plot.tile.title"
1530
+ };
1531
+ /**
1532
+ * Hand-written scene for the boxes animated in, with a replay.
1533
+ */
1534
+ const animated = {
1535
+ about: "box-plot.replay.about",
1536
+ draw: () => /* @__PURE__ */ jsx(Room, {
1537
+ size: "lg",
1538
+ children: /* @__PURE__ */ jsx(Replay, {})
1539
+ }),
1540
+ example: replay_example_exports,
1541
+ title: "box-plot.replay.title"
1542
+ };
1543
+ /**
1544
+ * Hand-written scene for the regions at a phone's width.
1545
+ */
1546
+ const narrow = {
1547
+ about: "box-plot.narrow.about",
1548
+ draw: () => /* @__PURE__ */ jsx(Room, {
1549
+ size: "xs",
1550
+ children: /* @__PURE__ */ jsx(Regions, {})
1551
+ }),
1552
+ example: regions_example_exports,
1553
+ title: "box-plot.narrow.title"
1554
+ };
1555
+ /**
1556
+ * Hand-written scene for a box plot without values.
1557
+ */
1558
+ const empty = {
1559
+ about: "box-plot.quiet.about",
1560
+ draw: () => /* @__PURE__ */ jsx(Room, {
1561
+ size: "md",
1562
+ children: /* @__PURE__ */ jsx(Quiet, {})
1563
+ }),
1564
+ example: quiet_example_exports,
1565
+ title: "box-plot.quiet.title"
1566
+ };
1567
+ var box_plot_specimen_default = specimen({
1568
+ about: "box-plot.about",
1569
+ id: "components/charts/box-plot",
1570
+ imports: "import { BoxPlot, boxStats, quantile } from \"@stealthscale/component-charts\";",
1571
+ scenes: [
1572
+ automatic,
1573
+ tooltip,
1574
+ summaries,
1575
+ farOut,
1576
+ colored,
1577
+ bare,
1578
+ animated,
1579
+ narrow,
1580
+ empty
1581
+ ],
1582
+ title: "box-plot.title"
1583
+ });
1584
+ //#endregion
1585
+ export { animated, automatic, bare, colored, box_plot_specimen_default as default, empty, farOut, narrow, summaries, tooltip };