@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,768 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { F as HistogramChart } 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/histogram-chart/examples/latencies.ts
11
+ /**
12
+ * Lists the response times of 140 requests to a checkout API in milliseconds, which the histogram's
13
+ * examples share: most requests take 20 to 60ms, and a slow tail runs to 460ms.
14
+ */
15
+ const LATENCIES$1 = [
16
+ 14,
17
+ 33,
18
+ 45,
19
+ 63,
20
+ 22,
21
+ 35,
22
+ 48,
23
+ 71,
24
+ 26,
25
+ 38,
26
+ 51,
27
+ 84,
28
+ 29,
29
+ 40,
30
+ 55,
31
+ 190,
32
+ 31,
33
+ 43,
34
+ 59,
35
+ 19,
36
+ 34,
37
+ 46,
38
+ 65,
39
+ 24,
40
+ 36,
41
+ 49,
42
+ 75,
43
+ 27,
44
+ 39,
45
+ 52,
46
+ 95,
47
+ 30,
48
+ 41,
49
+ 56,
50
+ 380,
51
+ 32,
52
+ 44,
53
+ 61,
54
+ 21,
55
+ 35,
56
+ 47,
57
+ 68,
58
+ 25,
59
+ 37,
60
+ 50,
61
+ 80,
62
+ 28,
63
+ 40,
64
+ 54,
65
+ 129,
66
+ 31,
67
+ 42,
68
+ 58,
69
+ 16,
70
+ 33,
71
+ 45,
72
+ 64,
73
+ 23,
74
+ 36,
75
+ 48,
76
+ 72,
77
+ 26,
78
+ 38,
79
+ 51,
80
+ 87,
81
+ 29,
82
+ 41,
83
+ 55,
84
+ 240,
85
+ 32,
86
+ 43,
87
+ 60,
88
+ 19,
89
+ 34,
90
+ 46,
91
+ 66,
92
+ 24,
93
+ 37,
94
+ 49,
95
+ 76,
96
+ 27,
97
+ 39,
98
+ 53,
99
+ 101,
100
+ 30,
101
+ 42,
102
+ 57,
103
+ 460,
104
+ 33,
105
+ 44,
106
+ 62,
107
+ 22,
108
+ 35,
109
+ 47,
110
+ 69,
111
+ 25,
112
+ 37,
113
+ 50,
114
+ 82,
115
+ 28,
116
+ 40,
117
+ 54,
118
+ 150,
119
+ 31,
120
+ 42,
121
+ 59,
122
+ 18,
123
+ 33,
124
+ 45,
125
+ 65,
126
+ 23,
127
+ 36,
128
+ 48,
129
+ 73,
130
+ 27,
131
+ 38,
132
+ 52,
133
+ 91,
134
+ 29,
135
+ 41,
136
+ 56,
137
+ 310,
138
+ 32,
139
+ 44,
140
+ 61,
141
+ 20,
142
+ 34,
143
+ 46,
144
+ 67,
145
+ 25,
146
+ 37,
147
+ 50,
148
+ 78,
149
+ 28,
150
+ 39,
151
+ 53,
152
+ 110,
153
+ 30,
154
+ 42,
155
+ 57
156
+ ];
157
+ //#endregion
158
+ //#region src/histogram-chart/examples/clipped.example.tsx
159
+ var clipped_example_exports = /* @__PURE__ */ __exportAll({
160
+ Clipped: () => Clipped,
161
+ source: () => source$6
162
+ });
163
+ function Clipped() {
164
+ const $ = c(12);
165
+ const { t } = useWords("histogram-chart");
166
+ let t0;
167
+ if ($[0] !== t) {
168
+ t0 = t("clipped.caption");
169
+ $[0] = t;
170
+ $[1] = t0;
171
+ } else t0 = $[1];
172
+ let t1;
173
+ if ($[2] !== t) {
174
+ t1 = t("requests");
175
+ $[2] = t;
176
+ $[3] = t1;
177
+ } else t1 = $[3];
178
+ let t2;
179
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
180
+ t2 = [0, 150];
181
+ $[4] = t2;
182
+ } else t2 = $[4];
183
+ let t3;
184
+ if ($[5] !== t) {
185
+ t3 = t("latency.label");
186
+ $[5] = t;
187
+ $[6] = t3;
188
+ } else t3 = $[6];
189
+ let t4;
190
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
191
+ t4 = {
192
+ style: "unit",
193
+ unit: "millisecond",
194
+ unitDisplay: "narrow"
195
+ };
196
+ $[7] = t4;
197
+ } else t4 = $[7];
198
+ let t5;
199
+ if ($[8] !== t0 || $[9] !== t1 || $[10] !== t3) {
200
+ t5 = /* @__PURE__ */ jsx(HistogramChart, {
201
+ caption: t0,
202
+ countLabel: t1,
203
+ domain: t2,
204
+ label: t3,
205
+ valueOptions: t4,
206
+ values: LATENCIES$1
207
+ });
208
+ $[8] = t0;
209
+ $[9] = t1;
210
+ $[10] = t3;
211
+ $[11] = t5;
212
+ } else t5 = $[11];
213
+ return t5;
214
+ }
215
+ const source$6 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { HistogramChart } from \"@stealthscale/component-charts\";\n\nimport { LATENCIES } from \"./latencies.ts\";\n\nexport function Clipped(): ReactElement {\n const { t } = useWords(\"histogram-chart\");\n\n return (\n <HistogramChart\n caption={t(\"clipped.caption\")}\n countLabel={t(\"requests\")}\n domain={[0, 150]}\n label={t(\"latency.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n values={LATENCIES}\n />\n );\n}\n";
216
+ //#endregion
217
+ //#region src/histogram-chart/examples/coarse.example.tsx
218
+ var coarse_example_exports = /* @__PURE__ */ __exportAll({
219
+ Coarse: () => Coarse,
220
+ source: () => source$5
221
+ });
222
+ function Coarse() {
223
+ const $ = c(11);
224
+ const { t } = useWords("histogram-chart");
225
+ let t0;
226
+ if ($[0] !== t) {
227
+ t0 = t("coarse.caption");
228
+ $[0] = t;
229
+ $[1] = t0;
230
+ } else t0 = $[1];
231
+ let t1;
232
+ if ($[2] !== t) {
233
+ t1 = t("requests");
234
+ $[2] = t;
235
+ $[3] = t1;
236
+ } else t1 = $[3];
237
+ let t2;
238
+ if ($[4] !== t) {
239
+ t2 = t("latency.label");
240
+ $[4] = t;
241
+ $[5] = t2;
242
+ } else t2 = $[5];
243
+ let t3;
244
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
245
+ t3 = {
246
+ style: "unit",
247
+ unit: "millisecond",
248
+ unitDisplay: "narrow"
249
+ };
250
+ $[6] = t3;
251
+ } else t3 = $[6];
252
+ let t4;
253
+ if ($[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
254
+ t4 = /* @__PURE__ */ jsx(HistogramChart, {
255
+ bins: 6,
256
+ caption: t0,
257
+ countLabel: t1,
258
+ label: t2,
259
+ valueOptions: t3,
260
+ values: LATENCIES$1
261
+ });
262
+ $[7] = t0;
263
+ $[8] = t1;
264
+ $[9] = t2;
265
+ $[10] = t4;
266
+ } else t4 = $[10];
267
+ return t4;
268
+ }
269
+ const source$5 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { HistogramChart } from \"@stealthscale/component-charts\";\n\nimport { LATENCIES } from \"./latencies.ts\";\n\nexport function Coarse(): ReactElement {\n const { t } = useWords(\"histogram-chart\");\n\n return (\n <HistogramChart\n bins={6}\n caption={t(\"coarse.caption\")}\n countLabel={t(\"requests\")}\n label={t(\"latency.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n values={LATENCIES}\n />\n );\n}\n";
270
+ //#endregion
271
+ //#region src/histogram-chart/examples/latency.example.tsx
272
+ var latency_example_exports = /* @__PURE__ */ __exportAll({
273
+ Latency: () => Latency,
274
+ source: () => source$4
275
+ });
276
+ function Latency() {
277
+ const $ = c(11);
278
+ const { t } = useWords("histogram-chart");
279
+ let t0;
280
+ if ($[0] !== t) {
281
+ t0 = t("latency.caption");
282
+ $[0] = t;
283
+ $[1] = t0;
284
+ } else t0 = $[1];
285
+ let t1;
286
+ if ($[2] !== t) {
287
+ t1 = t("requests");
288
+ $[2] = t;
289
+ $[3] = t1;
290
+ } else t1 = $[3];
291
+ let t2;
292
+ if ($[4] !== t) {
293
+ t2 = t("latency.label");
294
+ $[4] = t;
295
+ $[5] = t2;
296
+ } else t2 = $[5];
297
+ let t3;
298
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
299
+ t3 = {
300
+ style: "unit",
301
+ unit: "millisecond",
302
+ unitDisplay: "narrow"
303
+ };
304
+ $[6] = t3;
305
+ } else t3 = $[6];
306
+ let t4;
307
+ if ($[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
308
+ t4 = /* @__PURE__ */ jsx(HistogramChart, {
309
+ caption: t0,
310
+ countLabel: t1,
311
+ label: t2,
312
+ valueOptions: t3,
313
+ values: LATENCIES$1
314
+ });
315
+ $[7] = t0;
316
+ $[8] = t1;
317
+ $[9] = t2;
318
+ $[10] = t4;
319
+ } else t4 = $[10];
320
+ return t4;
321
+ }
322
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { HistogramChart } from \"@stealthscale/component-charts\";\n\nimport { LATENCIES } from \"./latencies.ts\";\n\nexport function Latency(): ReactElement {\n const { t } = useWords(\"histogram-chart\");\n\n return (\n <HistogramChart\n caption={t(\"latency.caption\")}\n countLabel={t(\"requests\")}\n label={t(\"latency.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n values={LATENCIES}\n />\n );\n}\n";
323
+ //#endregion
324
+ //#region src/histogram-chart/examples/orders.example.tsx
325
+ var orders_example_exports = /* @__PURE__ */ __exportAll({
326
+ Orders: () => Orders,
327
+ source: () => source$3
328
+ });
329
+ const ORDERS = [
330
+ 14,
331
+ 56,
332
+ 33,
333
+ 88,
334
+ 46,
335
+ 24,
336
+ 64,
337
+ 38,
338
+ 151,
339
+ 51,
340
+ 29,
341
+ 75,
342
+ 42,
343
+ 17,
344
+ 58,
345
+ 34,
346
+ 93,
347
+ 47,
348
+ 25,
349
+ 66,
350
+ 38,
351
+ 215,
352
+ 53,
353
+ 30,
354
+ 77,
355
+ 43,
356
+ 20,
357
+ 59,
358
+ 35,
359
+ 100,
360
+ 48,
361
+ 26,
362
+ 68,
363
+ 39,
364
+ 260,
365
+ 54,
366
+ 31,
367
+ 80,
368
+ 44,
369
+ 21,
370
+ 61,
371
+ 36,
372
+ 108,
373
+ 49,
374
+ 27,
375
+ 70,
376
+ 40,
377
+ 340,
378
+ 55,
379
+ 32,
380
+ 84,
381
+ 45,
382
+ 23,
383
+ 62,
384
+ 37,
385
+ 121,
386
+ 50,
387
+ 28,
388
+ 72,
389
+ 41
390
+ ];
391
+ function Orders() {
392
+ const $ = c(11);
393
+ const { t } = useWords("histogram-chart");
394
+ let t0;
395
+ if ($[0] !== t) {
396
+ t0 = t("orders.caption");
397
+ $[0] = t;
398
+ $[1] = t0;
399
+ } else t0 = $[1];
400
+ let t1;
401
+ if ($[2] !== t) {
402
+ t1 = t("orders.orders");
403
+ $[2] = t;
404
+ $[3] = t1;
405
+ } else t1 = $[3];
406
+ let t2;
407
+ if ($[4] !== t) {
408
+ t2 = t("orders.label");
409
+ $[4] = t;
410
+ $[5] = t2;
411
+ } else t2 = $[5];
412
+ let t3;
413
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
414
+ t3 = {
415
+ currency: "EUR",
416
+ maximumFractionDigits: 0,
417
+ style: "currency"
418
+ };
419
+ $[6] = t3;
420
+ } else t3 = $[6];
421
+ let t4;
422
+ if ($[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
423
+ t4 = /* @__PURE__ */ jsx(HistogramChart, {
424
+ caption: t0,
425
+ color: "teal",
426
+ countLabel: t1,
427
+ label: t2,
428
+ valueOptions: t3,
429
+ values: ORDERS
430
+ });
431
+ $[7] = t0;
432
+ $[8] = t1;
433
+ $[9] = t2;
434
+ $[10] = t4;
435
+ } else t4 = $[10];
436
+ return t4;
437
+ }
438
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { HistogramChart } from \"@stealthscale/component-charts\";\n\nconst ORDERS = [\n 14, 56, 33, 88, 46, 24, 64, 38, 151, 51, 29, 75, 42, 17, 58, 34, 93, 47, 25, 66, 38, 215, 53, 30,\n 77, 43, 20, 59, 35, 100, 48, 26, 68, 39, 260, 54, 31, 80, 44, 21, 61, 36, 108, 49, 27, 70, 40,\n 340, 55, 32, 84, 45, 23, 62, 37, 121, 50, 28, 72, 41,\n];\n\nexport function Orders(): ReactElement {\n const { t } = useWords(\"histogram-chart\");\n\n return (\n <HistogramChart\n caption={t(\"orders.caption\")}\n color=\"teal\"\n countLabel={t(\"orders.orders\")}\n label={t(\"orders.label\")}\n valueOptions={{ currency: \"EUR\", maximumFractionDigits: 0, style: \"currency\" }}\n values={ORDERS}\n />\n );\n}\n";
439
+ //#endregion
440
+ //#region src/histogram-chart/examples/peak.example.tsx
441
+ var peak_example_exports = /* @__PURE__ */ __exportAll({
442
+ Peak: () => Peak,
443
+ source: () => source$2
444
+ });
445
+ function Peak() {
446
+ const $ = c(11);
447
+ const { t } = useWords("histogram-chart");
448
+ let t0;
449
+ if ($[0] !== t) {
450
+ t0 = t("peak.caption");
451
+ $[0] = t;
452
+ $[1] = t0;
453
+ } else t0 = $[1];
454
+ let t1;
455
+ if ($[2] !== t) {
456
+ t1 = t("requests");
457
+ $[2] = t;
458
+ $[3] = t1;
459
+ } else t1 = $[3];
460
+ let t2;
461
+ if ($[4] !== t) {
462
+ t2 = t("latency.label");
463
+ $[4] = t;
464
+ $[5] = t2;
465
+ } else t2 = $[5];
466
+ let t3;
467
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
468
+ t3 = {
469
+ style: "unit",
470
+ unit: "millisecond",
471
+ unitDisplay: "narrow"
472
+ };
473
+ $[6] = t3;
474
+ } else t3 = $[6];
475
+ let t4;
476
+ if ($[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
477
+ t4 = /* @__PURE__ */ jsx(HistogramChart, {
478
+ caption: t0,
479
+ countLabel: t1,
480
+ defaultIndex: 1,
481
+ label: t2,
482
+ valueOptions: t3,
483
+ values: LATENCIES$1
484
+ });
485
+ $[7] = t0;
486
+ $[8] = t1;
487
+ $[9] = t2;
488
+ $[10] = t4;
489
+ } else t4 = $[10];
490
+ return t4;
491
+ }
492
+ const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { HistogramChart } from \"@stealthscale/component-charts\";\n\nimport { LATENCIES } from \"./latencies.ts\";\n\nexport function Peak(): ReactElement {\n const { t } = useWords(\"histogram-chart\");\n\n return (\n <HistogramChart\n caption={t(\"peak.caption\")}\n countLabel={t(\"requests\")}\n defaultIndex={1}\n label={t(\"latency.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n values={LATENCIES}\n />\n );\n}\n";
493
+ //#endregion
494
+ //#region src/histogram-chart/examples/quiet.example.tsx
495
+ var quiet_example_exports = /* @__PURE__ */ __exportAll({
496
+ Quiet: () => Quiet,
497
+ source: () => source$1
498
+ });
499
+ const LATENCIES = [];
500
+ function Quiet() {
501
+ const $ = c(13);
502
+ const { t } = useWords("histogram-chart");
503
+ let t0;
504
+ if ($[0] !== t) {
505
+ t0 = t("quiet.caption");
506
+ $[0] = t;
507
+ $[1] = t0;
508
+ } else t0 = $[1];
509
+ let t1;
510
+ if ($[2] !== t) {
511
+ t1 = t("requests");
512
+ $[2] = t;
513
+ $[3] = t1;
514
+ } else t1 = $[3];
515
+ let t2;
516
+ if ($[4] !== t) {
517
+ t2 = t("quiet.empty");
518
+ $[4] = t;
519
+ $[5] = t2;
520
+ } else t2 = $[5];
521
+ let t3;
522
+ if ($[6] !== t) {
523
+ t3 = t("latency.label");
524
+ $[6] = t;
525
+ $[7] = t3;
526
+ } else t3 = $[7];
527
+ let t4;
528
+ if ($[8] !== t0 || $[9] !== t1 || $[10] !== t2 || $[11] !== t3) {
529
+ t4 = /* @__PURE__ */ jsx(HistogramChart, {
530
+ caption: t0,
531
+ countLabel: t1,
532
+ empty: t2,
533
+ label: t3,
534
+ values: LATENCIES
535
+ });
536
+ $[8] = t0;
537
+ $[9] = t1;
538
+ $[10] = t2;
539
+ $[11] = t3;
540
+ $[12] = t4;
541
+ } else t4 = $[12];
542
+ return t4;
543
+ }
544
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { HistogramChart } from \"@stealthscale/component-charts\";\n\nconst LATENCIES: number[] = [];\n\nexport function Quiet(): ReactElement {\n const { t } = useWords(\"histogram-chart\");\n\n return (\n <HistogramChart\n caption={t(\"quiet.caption\")}\n countLabel={t(\"requests\")}\n empty={t(\"quiet.empty\")}\n label={t(\"latency.label\")}\n values={LATENCIES}\n />\n );\n}\n";
545
+ //#endregion
546
+ //#region src/histogram-chart/examples/replay.example.tsx
547
+ var replay_example_exports = /* @__PURE__ */ __exportAll({
548
+ Replay: () => Replay,
549
+ source: () => source
550
+ });
551
+ function Replay() {
552
+ const $ = c(23);
553
+ const { t } = useWords("histogram-chart");
554
+ const [run, setRun] = useState(0);
555
+ let t0;
556
+ if ($[0] !== t) {
557
+ t0 = t("latency.caption");
558
+ $[0] = t;
559
+ $[1] = t0;
560
+ } else t0 = $[1];
561
+ let t1;
562
+ if ($[2] !== t) {
563
+ t1 = t("requests");
564
+ $[2] = t;
565
+ $[3] = t1;
566
+ } else t1 = $[3];
567
+ let t2;
568
+ if ($[4] !== t) {
569
+ t2 = t("latency.label");
570
+ $[4] = t;
571
+ $[5] = t2;
572
+ } else t2 = $[5];
573
+ let t3;
574
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
575
+ t3 = {
576
+ style: "unit",
577
+ unit: "millisecond",
578
+ unitDisplay: "narrow"
579
+ };
580
+ $[6] = t3;
581
+ } else t3 = $[6];
582
+ let t4;
583
+ if ($[7] !== run || $[8] !== t0 || $[9] !== t1 || $[10] !== t2) {
584
+ t4 = /* @__PURE__ */ jsx(HistogramChart, {
585
+ animate: true,
586
+ caption: t0,
587
+ countLabel: t1,
588
+ label: t2,
589
+ valueOptions: t3,
590
+ values: LATENCIES$1
591
+ }, run);
592
+ $[7] = run;
593
+ $[8] = t0;
594
+ $[9] = t1;
595
+ $[10] = t2;
596
+ $[11] = t4;
597
+ } else t4 = $[11];
598
+ let t5;
599
+ if ($[12] !== run) {
600
+ t5 = () => {
601
+ setRun(run + 1);
602
+ };
603
+ $[12] = run;
604
+ $[13] = t5;
605
+ } else t5 = $[13];
606
+ let t6;
607
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
608
+ t6 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
609
+ $[14] = t6;
610
+ } else t6 = $[14];
611
+ let t7;
612
+ if ($[15] !== t) {
613
+ t7 = t("replay.replay");
614
+ $[15] = t;
615
+ $[16] = t7;
616
+ } else t7 = $[16];
617
+ let t8;
618
+ if ($[17] !== t5 || $[18] !== t7) {
619
+ t8 = /* @__PURE__ */ jsxs(Button, {
620
+ onClick: t5,
621
+ size: "sm",
622
+ variant: "outline",
623
+ children: [t6, t7]
624
+ });
625
+ $[17] = t5;
626
+ $[18] = t7;
627
+ $[19] = t8;
628
+ } else t8 = $[19];
629
+ let t9;
630
+ if ($[20] !== t4 || $[21] !== t8) {
631
+ t9 = /* @__PURE__ */ jsxs(Stack, {
632
+ align: "flex-start",
633
+ children: [t4, t8]
634
+ });
635
+ $[20] = t4;
636
+ $[21] = t8;
637
+ $[22] = t9;
638
+ } else t9 = $[22];
639
+ return t9;
640
+ }
641
+ const source = "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 { HistogramChart } from \"@stealthscale/component-charts\";\n\nimport { LATENCIES } from \"./latencies.ts\";\n\nexport function Replay(): ReactElement {\n const { t } = useWords(\"histogram-chart\");\n const [run, setRun] = useState(0);\n\n return (\n <Stack align=\"flex-start\">\n <HistogramChart\n animate\n caption={t(\"latency.caption\")}\n countLabel={t(\"requests\")}\n key={run}\n label={t(\"latency.label\")}\n valueOptions={{ style: \"unit\", unit: \"millisecond\", unitDisplay: \"narrow\" }}\n values={LATENCIES}\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";
642
+ //#endregion
643
+ //#region src/histogram-chart/histogram-chart.specimen.tsx
644
+ /**
645
+ * Catalogue page for the histogram.
646
+ *
647
+ * @remarks
648
+ * The histogram has no recipe of its own: the chart's recipe styles its figure, so every scene is
649
+ * hand-written. The scenes render response times in Freedman–Diaconis' bins, the tooltip open at
650
+ * the tallest bin, fewer bins, a clipped range, order values in the teal palette, the bars
651
+ * animated in with a replay, the response times at a phone's width, and a histogram without
652
+ * values. Every scene renders a component from `examples/` and shows that file as its source.
653
+ * The words are keys under `histogram-chart` in `locales/en/specimen/histogram-chart.json`.
654
+ */
655
+ /**
656
+ * Hand-written scene for response times in the automatic bins.
657
+ */
658
+ const automatic = {
659
+ about: "histogram-chart.latency.about",
660
+ draw: () => /* @__PURE__ */ jsx(Room, {
661
+ size: "lg",
662
+ children: /* @__PURE__ */ jsx(Latency, {})
663
+ }),
664
+ example: latency_example_exports,
665
+ title: "histogram-chart.latency.title"
666
+ };
667
+ /**
668
+ * Hand-written scene for the tooltip open at a bin.
669
+ */
670
+ const tooltip = {
671
+ about: "histogram-chart.peak.about",
672
+ draw: () => /* @__PURE__ */ jsx(Room, {
673
+ size: "lg",
674
+ children: /* @__PURE__ */ jsx(Peak, {})
675
+ }),
676
+ example: peak_example_exports,
677
+ title: "histogram-chart.peak.title"
678
+ };
679
+ /**
680
+ * Hand-written scene for fewer bins.
681
+ */
682
+ const fewer = {
683
+ about: "histogram-chart.coarse.about",
684
+ draw: () => /* @__PURE__ */ jsx(Room, {
685
+ size: "lg",
686
+ children: /* @__PURE__ */ jsx(Coarse, {})
687
+ }),
688
+ example: coarse_example_exports,
689
+ title: "histogram-chart.coarse.title"
690
+ };
691
+ /**
692
+ * Hand-written scene for a clipped range.
693
+ */
694
+ const ranged = {
695
+ about: "histogram-chart.clipped.about",
696
+ draw: () => /* @__PURE__ */ jsx(Room, {
697
+ size: "lg",
698
+ children: /* @__PURE__ */ jsx(Clipped, {})
699
+ }),
700
+ example: clipped_example_exports,
701
+ title: "histogram-chart.clipped.title"
702
+ };
703
+ /**
704
+ * Hand-written scene for order values in a palette's color.
705
+ */
706
+ const colored = {
707
+ about: "histogram-chart.orders.about",
708
+ draw: () => /* @__PURE__ */ jsx(Room, {
709
+ size: "lg",
710
+ children: /* @__PURE__ */ jsx(Orders, {})
711
+ }),
712
+ example: orders_example_exports,
713
+ title: "histogram-chart.orders.title"
714
+ };
715
+ /**
716
+ * Hand-written scene for the bars animated in, with a replay.
717
+ */
718
+ const animated = {
719
+ about: "histogram-chart.replay.about",
720
+ draw: () => /* @__PURE__ */ jsx(Room, {
721
+ size: "lg",
722
+ children: /* @__PURE__ */ jsx(Replay, {})
723
+ }),
724
+ example: replay_example_exports,
725
+ title: "histogram-chart.replay.title"
726
+ };
727
+ /**
728
+ * Hand-written scene for the response times at a phone's width.
729
+ */
730
+ const narrow = {
731
+ about: "histogram-chart.narrow.about",
732
+ draw: () => /* @__PURE__ */ jsx(Room, {
733
+ size: "xs",
734
+ children: /* @__PURE__ */ jsx(Latency, {})
735
+ }),
736
+ example: latency_example_exports,
737
+ title: "histogram-chart.narrow.title"
738
+ };
739
+ /**
740
+ * Hand-written scene for a histogram without values.
741
+ */
742
+ const empty = {
743
+ about: "histogram-chart.quiet.about",
744
+ draw: () => /* @__PURE__ */ jsx(Room, {
745
+ size: "md",
746
+ children: /* @__PURE__ */ jsx(Quiet, {})
747
+ }),
748
+ example: quiet_example_exports,
749
+ title: "histogram-chart.quiet.title"
750
+ };
751
+ var histogram_chart_specimen_default = specimen({
752
+ about: "histogram-chart.about",
753
+ id: "components/charts/histogram-chart",
754
+ imports: "import { binValues, HistogramChart } from \"@stealthscale/component-charts\";",
755
+ scenes: [
756
+ automatic,
757
+ tooltip,
758
+ fewer,
759
+ ranged,
760
+ colored,
761
+ animated,
762
+ narrow,
763
+ empty
764
+ ],
765
+ title: "histogram-chart.title"
766
+ });
767
+ //#endregion
768
+ export { animated, automatic, colored, histogram_chart_specimen_default as default, empty, fewer, narrow, ranged, tooltip };