@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,1248 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { ft as ScatterPlot, mt as spreadPoints } 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/scatter-plot/examples/deals.example.tsx
11
+ var deals_example_exports = /* @__PURE__ */ __exportAll({
12
+ Deals: () => Deals,
13
+ source: () => source$6
14
+ });
15
+ const MID_MARKET$2 = [
16
+ [12, 28],
17
+ [18, 22],
18
+ [25, 41],
19
+ [9, 19],
20
+ [30, 38],
21
+ [15, 33],
22
+ [22, 26],
23
+ [27, 49],
24
+ [11, 15],
25
+ [19, 37],
26
+ [33, 44],
27
+ [24, 31]
28
+ ].map(([size = 0, days = 0]) => ({
29
+ days,
30
+ size: size * 1e3
31
+ }));
32
+ const ENTERPRISE$2 = [
33
+ [85, 120],
34
+ [120, 104],
35
+ [64, 97],
36
+ [150, 178],
37
+ [98, 141],
38
+ [110, 96],
39
+ [72, 131],
40
+ [135, 156],
41
+ [160, 149],
42
+ [90, 88]
43
+ ].map(([size = 0, days = 0]) => ({
44
+ days,
45
+ size: size * 1e3
46
+ }));
47
+ function Deals() {
48
+ const $ = c(29);
49
+ const { t } = useWords("scatter-plot");
50
+ let t0;
51
+ if ($[0] !== t) {
52
+ t0 = t("deals.caption");
53
+ $[0] = t;
54
+ $[1] = t0;
55
+ } else t0 = $[1];
56
+ let t1;
57
+ if ($[2] !== t) {
58
+ t1 = t("deals.label");
59
+ $[2] = t;
60
+ $[3] = t1;
61
+ } else t1 = $[3];
62
+ let t2;
63
+ if ($[4] !== t) {
64
+ t2 = t("segments");
65
+ $[4] = t;
66
+ $[5] = t2;
67
+ } else t2 = $[5];
68
+ let t3;
69
+ if ($[6] !== t) {
70
+ t3 = t("deals.mid");
71
+ $[6] = t;
72
+ $[7] = t3;
73
+ } else t3 = $[7];
74
+ let t4;
75
+ if ($[8] !== t3) {
76
+ t4 = {
77
+ key: "mid",
78
+ label: t3,
79
+ points: MID_MARKET$2
80
+ };
81
+ $[8] = t3;
82
+ $[9] = t4;
83
+ } else t4 = $[9];
84
+ let t5;
85
+ if ($[10] !== t) {
86
+ t5 = t("deals.enterprise");
87
+ $[10] = t;
88
+ $[11] = t5;
89
+ } else t5 = $[11];
90
+ let t6;
91
+ if ($[12] !== t5) {
92
+ t6 = {
93
+ key: "enterprise",
94
+ label: t5,
95
+ points: ENTERPRISE$2
96
+ };
97
+ $[12] = t5;
98
+ $[13] = t6;
99
+ } else t6 = $[13];
100
+ let t7;
101
+ if ($[14] !== t4 || $[15] !== t6) {
102
+ t7 = [t4, t6];
103
+ $[14] = t4;
104
+ $[15] = t6;
105
+ $[16] = t7;
106
+ } else t7 = $[16];
107
+ let t8;
108
+ if ($[17] !== t) {
109
+ t8 = t("deals.size");
110
+ $[17] = t;
111
+ $[18] = t8;
112
+ } else t8 = $[18];
113
+ let t9;
114
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
115
+ t9 = {
116
+ currency: "EUR",
117
+ notation: "compact",
118
+ style: "currency"
119
+ };
120
+ $[19] = t9;
121
+ } else t9 = $[19];
122
+ let t10;
123
+ if ($[20] !== t) {
124
+ t10 = t("deals.days");
125
+ $[20] = t;
126
+ $[21] = t10;
127
+ } else t10 = $[21];
128
+ let t11;
129
+ if ($[22] !== t0 || $[23] !== t1 || $[24] !== t10 || $[25] !== t2 || $[26] !== t7 || $[27] !== t8) {
130
+ t11 = /* @__PURE__ */ jsx(ScatterPlot, {
131
+ caption: t0,
132
+ label: t1,
133
+ legendLabel: t2,
134
+ series: t7,
135
+ xKey: "size",
136
+ xLabel: t8,
137
+ xOptions: t9,
138
+ yKey: "days",
139
+ yLabel: t10
140
+ });
141
+ $[22] = t0;
142
+ $[23] = t1;
143
+ $[24] = t10;
144
+ $[25] = t2;
145
+ $[26] = t7;
146
+ $[27] = t8;
147
+ $[28] = t11;
148
+ } else t11 = $[28];
149
+ return t11;
150
+ }
151
+ const source$6 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ScatterPlot } from \"@stealthscale/component-charts\";\n\nconst MID_MARKET = [\n [12, 28],\n [18, 22],\n [25, 41],\n [9, 19],\n [30, 38],\n [15, 33],\n [22, 26],\n [27, 49],\n [11, 15],\n [19, 37],\n [33, 44],\n [24, 31],\n].map(([size = 0, days = 0]) => ({ days, size: size * 1000 }));\n\nconst ENTERPRISE = [\n [85, 120],\n [120, 104],\n [64, 97],\n [150, 178],\n [98, 141],\n [110, 96],\n [72, 131],\n [135, 156],\n [160, 149],\n [90, 88],\n].map(([size = 0, days = 0]) => ({ days, size: size * 1000 }));\n\nexport function Deals(): ReactElement {\n const { t } = useWords(\"scatter-plot\");\n\n return (\n <ScatterPlot\n caption={t(\"deals.caption\")}\n label={t(\"deals.label\")}\n legendLabel={t(\"segments\")}\n series={[\n { key: \"mid\", label: t(\"deals.mid\"), points: MID_MARKET },\n { key: \"enterprise\", label: t(\"deals.enterprise\"), points: ENTERPRISE },\n ]}\n xKey=\"size\"\n xLabel={t(\"deals.size\")}\n xOptions={{ currency: \"EUR\", notation: \"compact\", style: \"currency\" }}\n yKey=\"days\"\n yLabel={t(\"deals.days\")}\n />\n );\n}\n";
152
+ //#endregion
153
+ //#region src/scatter-plot/examples/orders.example.tsx
154
+ var orders_example_exports = /* @__PURE__ */ __exportAll({
155
+ Orders: () => Orders,
156
+ source: () => source$5
157
+ });
158
+ const ORDERS = [
159
+ [1, 22],
160
+ [1, 19],
161
+ [2, 41],
162
+ [2, 35],
163
+ [2, 48],
164
+ [3, 52],
165
+ [3, 61],
166
+ [3, 57],
167
+ [4, 70],
168
+ [4, 82],
169
+ [4, 66],
170
+ [5, 95],
171
+ [5, 88],
172
+ [5, 101],
173
+ [6, 104],
174
+ [6, 119],
175
+ [6, 97],
176
+ [7, 131],
177
+ [7, 122],
178
+ [8, 140],
179
+ [8, 151],
180
+ [8, 136],
181
+ [9, 168],
182
+ [9, 158],
183
+ [10, 172],
184
+ [10, 190],
185
+ [11, 197],
186
+ [11, 184],
187
+ [12, 215],
188
+ [12, 206]
189
+ ].map(([items = 0, value = 0]) => ({
190
+ items,
191
+ value
192
+ }));
193
+ function Orders() {
194
+ const $ = c(19);
195
+ const { t } = useWords("scatter-plot");
196
+ let t0;
197
+ if ($[0] !== t) {
198
+ t0 = t("orders.caption");
199
+ $[0] = t;
200
+ $[1] = t0;
201
+ } else t0 = $[1];
202
+ let t1;
203
+ if ($[2] !== t) {
204
+ t1 = t("orders.label");
205
+ $[2] = t;
206
+ $[3] = t1;
207
+ } else t1 = $[3];
208
+ let t2;
209
+ if ($[4] !== t) {
210
+ t2 = t("orders.orders");
211
+ $[4] = t;
212
+ $[5] = t2;
213
+ } else t2 = $[5];
214
+ let t3;
215
+ if ($[6] !== t2) {
216
+ t3 = [{
217
+ key: "orders",
218
+ label: t2,
219
+ points: ORDERS
220
+ }];
221
+ $[6] = t2;
222
+ $[7] = t3;
223
+ } else t3 = $[7];
224
+ let t4;
225
+ if ($[8] !== t) {
226
+ t4 = t("orders.items");
227
+ $[8] = t;
228
+ $[9] = t4;
229
+ } else t4 = $[9];
230
+ let t5;
231
+ if ($[10] !== t) {
232
+ t5 = t("orders.value");
233
+ $[10] = t;
234
+ $[11] = t5;
235
+ } else t5 = $[11];
236
+ let t6;
237
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
238
+ t6 = {
239
+ currency: "EUR",
240
+ maximumFractionDigits: 0,
241
+ style: "currency"
242
+ };
243
+ $[12] = t6;
244
+ } else t6 = $[12];
245
+ let t7;
246
+ if ($[13] !== t0 || $[14] !== t1 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5) {
247
+ t7 = /* @__PURE__ */ jsx(ScatterPlot, {
248
+ caption: t0,
249
+ label: t1,
250
+ series: t3,
251
+ size: 30,
252
+ xKey: "items",
253
+ xLabel: t4,
254
+ yKey: "value",
255
+ yLabel: t5,
256
+ yOptions: t6
257
+ });
258
+ $[13] = t0;
259
+ $[14] = t1;
260
+ $[15] = t3;
261
+ $[16] = t4;
262
+ $[17] = t5;
263
+ $[18] = t7;
264
+ } else t7 = $[18];
265
+ return t7;
266
+ }
267
+ const source$5 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ScatterPlot } from \"@stealthscale/component-charts\";\n\nconst ORDERS = [\n [1, 22],\n [1, 19],\n [2, 41],\n [2, 35],\n [2, 48],\n [3, 52],\n [3, 61],\n [3, 57],\n [4, 70],\n [4, 82],\n [4, 66],\n [5, 95],\n [5, 88],\n [5, 101],\n [6, 104],\n [6, 119],\n [6, 97],\n [7, 131],\n [7, 122],\n [8, 140],\n [8, 151],\n [8, 136],\n [9, 168],\n [9, 158],\n [10, 172],\n [10, 190],\n [11, 197],\n [11, 184],\n [12, 215],\n [12, 206],\n].map(([items = 0, value = 0]) => ({ items, value }));\n\nexport function Orders(): ReactElement {\n const { t } = useWords(\"scatter-plot\");\n\n return (\n <ScatterPlot\n caption={t(\"orders.caption\")}\n label={t(\"orders.label\")}\n series={[{ key: \"orders\", label: t(\"orders.orders\"), points: ORDERS }]}\n size={30}\n xKey=\"items\"\n xLabel={t(\"orders.items\")}\n yKey=\"value\"\n yLabel={t(\"orders.value\")}\n yOptions={{ currency: \"EUR\", maximumFractionDigits: 0, style: \"currency\" }}\n />\n );\n}\n";
268
+ //#endregion
269
+ //#region src/scatter-plot/examples/quadrants.example.tsx
270
+ var quadrants_example_exports = /* @__PURE__ */ __exportAll({
271
+ Quadrants: () => Quadrants,
272
+ source: () => source$4
273
+ });
274
+ const VENDORS = [
275
+ {
276
+ execution: .82,
277
+ name: "Alder",
278
+ vision: .76
279
+ },
280
+ {
281
+ execution: .71,
282
+ name: "Birch",
283
+ vision: .34
284
+ },
285
+ {
286
+ execution: .63,
287
+ name: "Cedar",
288
+ vision: .61
289
+ },
290
+ {
291
+ execution: .34,
292
+ name: "Hazel",
293
+ vision: .26
294
+ },
295
+ {
296
+ execution: .18,
297
+ name: "Larch",
298
+ vision: .45
299
+ },
300
+ {
301
+ execution: .4,
302
+ name: "Maple",
303
+ vision: .85
304
+ },
305
+ {
306
+ execution: .24,
307
+ name: "Rowan",
308
+ vision: .66
309
+ },
310
+ {
311
+ execution: .56,
312
+ name: "Spruce",
313
+ vision: .17
314
+ }
315
+ ];
316
+ function Quadrants() {
317
+ const $ = c(50);
318
+ const { t } = useWords("scatter-plot");
319
+ let t0;
320
+ if ($[0] !== t) {
321
+ t0 = t("quadrants.caption");
322
+ $[0] = t;
323
+ $[1] = t0;
324
+ } else t0 = $[1];
325
+ let t1;
326
+ if ($[2] !== t) {
327
+ t1 = t("quadrants.label");
328
+ $[2] = t;
329
+ $[3] = t1;
330
+ } else t1 = $[3];
331
+ let t2;
332
+ if ($[4] !== t) {
333
+ t2 = t("quadrants.visionaries");
334
+ $[4] = t;
335
+ $[5] = t2;
336
+ } else t2 = $[5];
337
+ let t3;
338
+ if ($[6] !== t) {
339
+ t3 = t("quadrants.niche");
340
+ $[6] = t;
341
+ $[7] = t3;
342
+ } else t3 = $[7];
343
+ let t4;
344
+ if ($[8] !== t) {
345
+ t4 = t("quadrants.leaders");
346
+ $[8] = t;
347
+ $[9] = t4;
348
+ } else t4 = $[9];
349
+ let t5;
350
+ if ($[10] !== t) {
351
+ t5 = t("quadrants.challengers");
352
+ $[10] = t;
353
+ $[11] = t5;
354
+ } else t5 = $[11];
355
+ let t6;
356
+ if ($[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5) {
357
+ t6 = { names: {
358
+ bottomEnd: t2,
359
+ bottomStart: t3,
360
+ topEnd: t4,
361
+ topStart: t5
362
+ } };
363
+ $[12] = t2;
364
+ $[13] = t3;
365
+ $[14] = t4;
366
+ $[15] = t5;
367
+ $[16] = t6;
368
+ } else t6 = $[16];
369
+ let t7;
370
+ if ($[17] !== t) {
371
+ t7 = t("quadrants.vendors");
372
+ $[17] = t;
373
+ $[18] = t7;
374
+ } else t7 = $[18];
375
+ let t8;
376
+ if ($[19] !== t7) {
377
+ t8 = [{
378
+ key: "vendors",
379
+ label: t7,
380
+ points: VENDORS
381
+ }];
382
+ $[19] = t7;
383
+ $[20] = t8;
384
+ } else t8 = $[20];
385
+ let t9;
386
+ if ($[21] !== t) {
387
+ t9 = t("quadrants.low");
388
+ $[21] = t;
389
+ $[22] = t9;
390
+ } else t9 = $[22];
391
+ let t10;
392
+ if ($[23] !== t) {
393
+ t10 = t("quadrants.high");
394
+ $[23] = t;
395
+ $[24] = t10;
396
+ } else t10 = $[24];
397
+ let t11;
398
+ if ($[25] !== t10 || $[26] !== t9) {
399
+ t11 = [t9, t10];
400
+ $[25] = t10;
401
+ $[26] = t9;
402
+ $[27] = t11;
403
+ } else t11 = $[27];
404
+ let t12;
405
+ if ($[28] !== t) {
406
+ t12 = t("quadrants.vision");
407
+ $[28] = t;
408
+ $[29] = t12;
409
+ } else t12 = $[29];
410
+ let t13;
411
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
412
+ t13 = { style: "percent" };
413
+ $[30] = t13;
414
+ } else t13 = $[30];
415
+ let t14;
416
+ if ($[31] !== t) {
417
+ t14 = t("quadrants.low");
418
+ $[31] = t;
419
+ $[32] = t14;
420
+ } else t14 = $[32];
421
+ let t15;
422
+ if ($[33] !== t) {
423
+ t15 = t("quadrants.high");
424
+ $[33] = t;
425
+ $[34] = t15;
426
+ } else t15 = $[34];
427
+ let t16;
428
+ if ($[35] !== t14 || $[36] !== t15) {
429
+ t16 = [t14, t15];
430
+ $[35] = t14;
431
+ $[36] = t15;
432
+ $[37] = t16;
433
+ } else t16 = $[37];
434
+ let t17;
435
+ if ($[38] !== t) {
436
+ t17 = t("quadrants.execution");
437
+ $[38] = t;
438
+ $[39] = t17;
439
+ } else t17 = $[39];
440
+ let t18;
441
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
442
+ t18 = { style: "percent" };
443
+ $[40] = t18;
444
+ } else t18 = $[40];
445
+ let t19;
446
+ if ($[41] !== t0 || $[42] !== t1 || $[43] !== t11 || $[44] !== t12 || $[45] !== t16 || $[46] !== t17 || $[47] !== t6 || $[48] !== t8) {
447
+ t19 = /* @__PURE__ */ jsx(ScatterPlot, {
448
+ caption: t0,
449
+ label: t1,
450
+ labelKey: "name",
451
+ quadrants: t6,
452
+ series: t8,
453
+ xEnds: t11,
454
+ xKey: "vision",
455
+ xLabel: t12,
456
+ xOptions: t13,
457
+ yEnds: t16,
458
+ yKey: "execution",
459
+ yLabel: t17,
460
+ yOptions: t18
461
+ });
462
+ $[41] = t0;
463
+ $[42] = t1;
464
+ $[43] = t11;
465
+ $[44] = t12;
466
+ $[45] = t16;
467
+ $[46] = t17;
468
+ $[47] = t6;
469
+ $[48] = t8;
470
+ $[49] = t19;
471
+ } else t19 = $[49];
472
+ return t19;
473
+ }
474
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ScatterPlot } from \"@stealthscale/component-charts\";\n\nconst VENDORS = [\n { execution: 0.82, name: \"Alder\", vision: 0.76 },\n { execution: 0.71, name: \"Birch\", vision: 0.34 },\n { execution: 0.63, name: \"Cedar\", vision: 0.61 },\n { execution: 0.34, name: \"Hazel\", vision: 0.26 },\n { execution: 0.18, name: \"Larch\", vision: 0.45 },\n { execution: 0.4, name: \"Maple\", vision: 0.85 },\n { execution: 0.24, name: \"Rowan\", vision: 0.66 },\n { execution: 0.56, name: \"Spruce\", vision: 0.17 },\n];\n\nexport function Quadrants(): ReactElement {\n const { t } = useWords(\"scatter-plot\");\n\n return (\n <ScatterPlot\n caption={t(\"quadrants.caption\")}\n label={t(\"quadrants.label\")}\n labelKey=\"name\"\n quadrants={{\n names: {\n bottomEnd: t(\"quadrants.visionaries\"),\n bottomStart: t(\"quadrants.niche\"),\n topEnd: t(\"quadrants.leaders\"),\n topStart: t(\"quadrants.challengers\"),\n },\n }}\n series={[{ key: \"vendors\", label: t(\"quadrants.vendors\"), points: VENDORS }]}\n xEnds={[t(\"quadrants.low\"), t(\"quadrants.high\")]}\n xKey=\"vision\"\n xLabel={t(\"quadrants.vision\")}\n xOptions={{ style: \"percent\" }}\n yEnds={[t(\"quadrants.low\"), t(\"quadrants.high\")]}\n yKey=\"execution\"\n yLabel={t(\"quadrants.execution\")}\n yOptions={{ style: \"percent\" }}\n />\n );\n}\n";
475
+ //#endregion
476
+ //#region src/scatter-plot/examples/quiet.example.tsx
477
+ var quiet_example_exports = /* @__PURE__ */ __exportAll({
478
+ Quiet: () => Quiet,
479
+ source: () => source$3
480
+ });
481
+ const DEALS = [];
482
+ function Quiet() {
483
+ const $ = c(21);
484
+ const { t } = useWords("scatter-plot");
485
+ let t0;
486
+ if ($[0] !== t) {
487
+ t0 = t("quiet.caption");
488
+ $[0] = t;
489
+ $[1] = t0;
490
+ } else t0 = $[1];
491
+ let t1;
492
+ if ($[2] !== t) {
493
+ t1 = t("quiet.empty");
494
+ $[2] = t;
495
+ $[3] = t1;
496
+ } else t1 = $[3];
497
+ let t2;
498
+ if ($[4] !== t) {
499
+ t2 = t("deals.label");
500
+ $[4] = t;
501
+ $[5] = t2;
502
+ } else t2 = $[5];
503
+ let t3;
504
+ if ($[6] !== t) {
505
+ t3 = t("quiet.deals");
506
+ $[6] = t;
507
+ $[7] = t3;
508
+ } else t3 = $[7];
509
+ let t4;
510
+ if ($[8] !== t3) {
511
+ t4 = [{
512
+ key: "deals",
513
+ label: t3,
514
+ points: DEALS
515
+ }];
516
+ $[8] = t3;
517
+ $[9] = t4;
518
+ } else t4 = $[9];
519
+ let t5;
520
+ if ($[10] !== t) {
521
+ t5 = t("deals.size");
522
+ $[10] = t;
523
+ $[11] = t5;
524
+ } else t5 = $[11];
525
+ let t6;
526
+ if ($[12] !== t) {
527
+ t6 = t("deals.days");
528
+ $[12] = t;
529
+ $[13] = t6;
530
+ } else t6 = $[13];
531
+ let t7;
532
+ if ($[14] !== t0 || $[15] !== t1 || $[16] !== t2 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6) {
533
+ t7 = /* @__PURE__ */ jsx(ScatterPlot, {
534
+ caption: t0,
535
+ empty: t1,
536
+ label: t2,
537
+ series: t4,
538
+ xKey: "size",
539
+ xLabel: t5,
540
+ yKey: "days",
541
+ yLabel: t6
542
+ });
543
+ $[14] = t0;
544
+ $[15] = t1;
545
+ $[16] = t2;
546
+ $[17] = t4;
547
+ $[18] = t5;
548
+ $[19] = t6;
549
+ $[20] = t7;
550
+ } else t7 = $[20];
551
+ return t7;
552
+ }
553
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ScatterPlot } from \"@stealthscale/component-charts\";\n\nconst DEALS: Array<{ days: number; size: number }> = [];\n\nexport function Quiet(): ReactElement {\n const { t } = useWords(\"scatter-plot\");\n\n return (\n <ScatterPlot\n caption={t(\"quiet.caption\")}\n empty={t(\"quiet.empty\")}\n label={t(\"deals.label\")}\n series={[{ key: \"deals\", label: t(\"quiet.deals\"), points: DEALS }]}\n xKey=\"size\"\n xLabel={t(\"deals.size\")}\n yKey=\"days\"\n yLabel={t(\"deals.days\")}\n />\n );\n}\n";
554
+ //#endregion
555
+ //#region src/scatter-plot/examples/replay.example.tsx
556
+ var replay_example_exports = /* @__PURE__ */ __exportAll({
557
+ Replay: () => Replay,
558
+ source: () => source$2
559
+ });
560
+ const MID_MARKET$1 = [
561
+ [12, 28],
562
+ [18, 22],
563
+ [25, 41],
564
+ [9, 19],
565
+ [30, 38],
566
+ [15, 33],
567
+ [22, 26],
568
+ [27, 49],
569
+ [11, 15],
570
+ [19, 37],
571
+ [33, 44],
572
+ [24, 31]
573
+ ].map(([size = 0, days = 0]) => ({
574
+ days,
575
+ size: size * 1e3
576
+ }));
577
+ const ENTERPRISE$1 = [
578
+ [85, 120],
579
+ [120, 104],
580
+ [64, 97],
581
+ [150, 178],
582
+ [98, 141],
583
+ [110, 96],
584
+ [72, 131],
585
+ [135, 156],
586
+ [160, 149],
587
+ [90, 88]
588
+ ].map(([size = 0, days = 0]) => ({
589
+ days,
590
+ size: size * 1e3
591
+ }));
592
+ function Replay() {
593
+ const $ = c(41);
594
+ const { t } = useWords("scatter-plot");
595
+ const [run, setRun] = useState(0);
596
+ let t0;
597
+ if ($[0] !== t) {
598
+ t0 = t("deals.caption");
599
+ $[0] = t;
600
+ $[1] = t0;
601
+ } else t0 = $[1];
602
+ let t1;
603
+ if ($[2] !== t) {
604
+ t1 = t("deals.label");
605
+ $[2] = t;
606
+ $[3] = t1;
607
+ } else t1 = $[3];
608
+ let t2;
609
+ if ($[4] !== t) {
610
+ t2 = t("segments");
611
+ $[4] = t;
612
+ $[5] = t2;
613
+ } else t2 = $[5];
614
+ let t3;
615
+ if ($[6] !== t) {
616
+ t3 = t("deals.mid");
617
+ $[6] = t;
618
+ $[7] = t3;
619
+ } else t3 = $[7];
620
+ let t4;
621
+ if ($[8] !== t3) {
622
+ t4 = {
623
+ key: "mid",
624
+ label: t3,
625
+ points: MID_MARKET$1
626
+ };
627
+ $[8] = t3;
628
+ $[9] = t4;
629
+ } else t4 = $[9];
630
+ let t5;
631
+ if ($[10] !== t) {
632
+ t5 = t("deals.enterprise");
633
+ $[10] = t;
634
+ $[11] = t5;
635
+ } else t5 = $[11];
636
+ let t6;
637
+ if ($[12] !== t5) {
638
+ t6 = {
639
+ key: "enterprise",
640
+ label: t5,
641
+ points: ENTERPRISE$1
642
+ };
643
+ $[12] = t5;
644
+ $[13] = t6;
645
+ } else t6 = $[13];
646
+ let t7;
647
+ if ($[14] !== t4 || $[15] !== t6) {
648
+ t7 = [t4, t6];
649
+ $[14] = t4;
650
+ $[15] = t6;
651
+ $[16] = t7;
652
+ } else t7 = $[16];
653
+ let t8;
654
+ if ($[17] !== t) {
655
+ t8 = t("deals.size");
656
+ $[17] = t;
657
+ $[18] = t8;
658
+ } else t8 = $[18];
659
+ let t9;
660
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
661
+ t9 = {
662
+ currency: "EUR",
663
+ notation: "compact",
664
+ style: "currency"
665
+ };
666
+ $[19] = t9;
667
+ } else t9 = $[19];
668
+ let t10;
669
+ if ($[20] !== t) {
670
+ t10 = t("deals.days");
671
+ $[20] = t;
672
+ $[21] = t10;
673
+ } else t10 = $[21];
674
+ let t11;
675
+ if ($[22] !== run || $[23] !== t0 || $[24] !== t1 || $[25] !== t10 || $[26] !== t2 || $[27] !== t7 || $[28] !== t8) {
676
+ t11 = /* @__PURE__ */ jsx(ScatterPlot, {
677
+ animate: true,
678
+ caption: t0,
679
+ label: t1,
680
+ legendLabel: t2,
681
+ series: t7,
682
+ xKey: "size",
683
+ xLabel: t8,
684
+ xOptions: t9,
685
+ yKey: "days",
686
+ yLabel: t10
687
+ }, run);
688
+ $[22] = run;
689
+ $[23] = t0;
690
+ $[24] = t1;
691
+ $[25] = t10;
692
+ $[26] = t2;
693
+ $[27] = t7;
694
+ $[28] = t8;
695
+ $[29] = t11;
696
+ } else t11 = $[29];
697
+ let t12;
698
+ if ($[30] !== run) {
699
+ t12 = () => {
700
+ setRun(run + 1);
701
+ };
702
+ $[30] = run;
703
+ $[31] = t12;
704
+ } else t12 = $[31];
705
+ let t13;
706
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
707
+ t13 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
708
+ $[32] = t13;
709
+ } else t13 = $[32];
710
+ let t14;
711
+ if ($[33] !== t) {
712
+ t14 = t("replay.replay");
713
+ $[33] = t;
714
+ $[34] = t14;
715
+ } else t14 = $[34];
716
+ let t15;
717
+ if ($[35] !== t12 || $[36] !== t14) {
718
+ t15 = /* @__PURE__ */ jsxs(Button, {
719
+ onClick: t12,
720
+ size: "sm",
721
+ variant: "outline",
722
+ children: [t13, t14]
723
+ });
724
+ $[35] = t12;
725
+ $[36] = t14;
726
+ $[37] = t15;
727
+ } else t15 = $[37];
728
+ let t16;
729
+ if ($[38] !== t11 || $[39] !== t15) {
730
+ t16 = /* @__PURE__ */ jsxs(Stack, {
731
+ align: "flex-start",
732
+ children: [t11, t15]
733
+ });
734
+ $[38] = t11;
735
+ $[39] = t15;
736
+ $[40] = t16;
737
+ } else t16 = $[40];
738
+ return t16;
739
+ }
740
+ const source$2 = "import { type ReactElement, useState } from \"react\";\n\nimport { RotateCcwIcon } from \"lucide-react\";\n\nimport { Button } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ScatterPlot } from \"@stealthscale/component-charts\";\n\nconst MID_MARKET = [\n [12, 28],\n [18, 22],\n [25, 41],\n [9, 19],\n [30, 38],\n [15, 33],\n [22, 26],\n [27, 49],\n [11, 15],\n [19, 37],\n [33, 44],\n [24, 31],\n].map(([size = 0, days = 0]) => ({ days, size: size * 1000 }));\n\nconst ENTERPRISE = [\n [85, 120],\n [120, 104],\n [64, 97],\n [150, 178],\n [98, 141],\n [110, 96],\n [72, 131],\n [135, 156],\n [160, 149],\n [90, 88],\n].map(([size = 0, days = 0]) => ({ days, size: size * 1000 }));\n\nexport function Replay(): ReactElement {\n const { t } = useWords(\"scatter-plot\");\n const [run, setRun] = useState(0);\n\n return (\n <Stack align=\"flex-start\">\n <ScatterPlot\n animate\n caption={t(\"deals.caption\")}\n key={run}\n label={t(\"deals.label\")}\n legendLabel={t(\"segments\")}\n series={[\n { key: \"mid\", label: t(\"deals.mid\"), points: MID_MARKET },\n { key: \"enterprise\", label: t(\"deals.enterprise\"), points: ENTERPRISE },\n ]}\n xKey=\"size\"\n xLabel={t(\"deals.size\")}\n xOptions={{ currency: \"EUR\", notation: \"compact\", style: \"currency\" }}\n yKey=\"days\"\n yLabel={t(\"deals.days\")}\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";
741
+ //#endregion
742
+ //#region src/scatter-plot/examples/risks.example.tsx
743
+ var risks_example_exports = /* @__PURE__ */ __exportAll({
744
+ Risks: () => Risks,
745
+ source: () => source$1
746
+ });
747
+ const RISKS = [
748
+ {
749
+ impact: .88,
750
+ key: "breach",
751
+ likelihood: .28
752
+ },
753
+ {
754
+ impact: .8,
755
+ key: "outage",
756
+ likelihood: .66
757
+ },
758
+ {
759
+ impact: .8,
760
+ key: "fraud",
761
+ likelihood: .66
762
+ },
763
+ {
764
+ impact: .62,
765
+ key: "supplier",
766
+ likelihood: .22
767
+ },
768
+ {
769
+ impact: .32,
770
+ key: "turnover",
771
+ likelihood: .82
772
+ },
773
+ {
774
+ impact: .18,
775
+ key: "price",
776
+ likelihood: .36
777
+ },
778
+ {
779
+ impact: .42,
780
+ key: "currency",
781
+ likelihood: .58
782
+ }
783
+ ];
784
+ function Risks() {
785
+ const $ = c(53);
786
+ const { t } = useWords("scatter-plot");
787
+ let t0;
788
+ if ($[0] !== t) {
789
+ t0 = spreadPoints(RISKS.map((t1) => {
790
+ const { impact, key, likelihood } = t1;
791
+ return {
792
+ impact,
793
+ likelihood,
794
+ name: t(`risks.${key}`)
795
+ };
796
+ }), {
797
+ distance: .15,
798
+ x: [0, 1],
799
+ xKey: "likelihood",
800
+ y: [0, 1],
801
+ yKey: "impact"
802
+ });
803
+ $[0] = t;
804
+ $[1] = t0;
805
+ } else t0 = $[1];
806
+ const points = t0;
807
+ let t1;
808
+ if ($[2] !== t) {
809
+ t1 = t("risks.caption");
810
+ $[2] = t;
811
+ $[3] = t1;
812
+ } else t1 = $[3];
813
+ let t2;
814
+ if ($[4] !== t) {
815
+ t2 = t("risks.label");
816
+ $[4] = t;
817
+ $[5] = t2;
818
+ } else t2 = $[5];
819
+ let t3;
820
+ if ($[6] !== t) {
821
+ t3 = t("risks.reduce");
822
+ $[6] = t;
823
+ $[7] = t3;
824
+ } else t3 = $[7];
825
+ let t4;
826
+ if ($[8] !== t) {
827
+ t4 = t("risks.accept");
828
+ $[8] = t;
829
+ $[9] = t4;
830
+ } else t4 = $[9];
831
+ let t5;
832
+ if ($[10] !== t) {
833
+ t5 = t("risks.act");
834
+ $[10] = t;
835
+ $[11] = t5;
836
+ } else t5 = $[11];
837
+ let t6;
838
+ if ($[12] !== t) {
839
+ t6 = t("risks.prepare");
840
+ $[12] = t;
841
+ $[13] = t6;
842
+ } else t6 = $[13];
843
+ let t7;
844
+ if ($[14] !== t3 || $[15] !== t4 || $[16] !== t5 || $[17] !== t6) {
845
+ t7 = { names: {
846
+ bottomEnd: t3,
847
+ bottomStart: t4,
848
+ topEnd: t5,
849
+ topStart: t6
850
+ } };
851
+ $[14] = t3;
852
+ $[15] = t4;
853
+ $[16] = t5;
854
+ $[17] = t6;
855
+ $[18] = t7;
856
+ } else t7 = $[18];
857
+ let t8;
858
+ if ($[19] !== t) {
859
+ t8 = t("risks.risks");
860
+ $[19] = t;
861
+ $[20] = t8;
862
+ } else t8 = $[20];
863
+ let t9;
864
+ if ($[21] !== points || $[22] !== t8) {
865
+ t9 = [{
866
+ key: "risks",
867
+ label: t8,
868
+ points
869
+ }];
870
+ $[21] = points;
871
+ $[22] = t8;
872
+ $[23] = t9;
873
+ } else t9 = $[23];
874
+ let t10;
875
+ if ($[24] !== t) {
876
+ t10 = t("risks.rare");
877
+ $[24] = t;
878
+ $[25] = t10;
879
+ } else t10 = $[25];
880
+ let t11;
881
+ if ($[26] !== t) {
882
+ t11 = t("risks.certain");
883
+ $[26] = t;
884
+ $[27] = t11;
885
+ } else t11 = $[27];
886
+ let t12;
887
+ if ($[28] !== t10 || $[29] !== t11) {
888
+ t12 = [t10, t11];
889
+ $[28] = t10;
890
+ $[29] = t11;
891
+ $[30] = t12;
892
+ } else t12 = $[30];
893
+ let t13;
894
+ if ($[31] !== t) {
895
+ t13 = t("risks.likelihood");
896
+ $[31] = t;
897
+ $[32] = t13;
898
+ } else t13 = $[32];
899
+ let t14;
900
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
901
+ t14 = { style: "percent" };
902
+ $[33] = t14;
903
+ } else t14 = $[33];
904
+ let t15;
905
+ if ($[34] !== t) {
906
+ t15 = t("risks.minor");
907
+ $[34] = t;
908
+ $[35] = t15;
909
+ } else t15 = $[35];
910
+ let t16;
911
+ if ($[36] !== t) {
912
+ t16 = t("risks.severe");
913
+ $[36] = t;
914
+ $[37] = t16;
915
+ } else t16 = $[37];
916
+ let t17;
917
+ if ($[38] !== t15 || $[39] !== t16) {
918
+ t17 = [t15, t16];
919
+ $[38] = t15;
920
+ $[39] = t16;
921
+ $[40] = t17;
922
+ } else t17 = $[40];
923
+ let t18;
924
+ if ($[41] !== t) {
925
+ t18 = t("risks.impact");
926
+ $[41] = t;
927
+ $[42] = t18;
928
+ } else t18 = $[42];
929
+ let t19;
930
+ if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
931
+ t19 = { style: "percent" };
932
+ $[43] = t19;
933
+ } else t19 = $[43];
934
+ let t20;
935
+ if ($[44] !== t1 || $[45] !== t12 || $[46] !== t13 || $[47] !== t17 || $[48] !== t18 || $[49] !== t2 || $[50] !== t7 || $[51] !== t9) {
936
+ t20 = /* @__PURE__ */ jsx(ScatterPlot, {
937
+ caption: t1,
938
+ label: t2,
939
+ labelKey: "name",
940
+ quadrants: t7,
941
+ series: t9,
942
+ xEnds: t12,
943
+ xKey: "likelihood",
944
+ xLabel: t13,
945
+ xOptions: t14,
946
+ yEnds: t17,
947
+ yKey: "impact",
948
+ yLabel: t18,
949
+ yOptions: t19
950
+ });
951
+ $[44] = t1;
952
+ $[45] = t12;
953
+ $[46] = t13;
954
+ $[47] = t17;
955
+ $[48] = t18;
956
+ $[49] = t2;
957
+ $[50] = t7;
958
+ $[51] = t9;
959
+ $[52] = t20;
960
+ } else t20 = $[52];
961
+ return t20;
962
+ }
963
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ScatterPlot, spreadPoints } from \"@stealthscale/component-charts\";\n\nconst RISKS = [\n { impact: 0.88, key: \"breach\", likelihood: 0.28 },\n { impact: 0.8, key: \"outage\", likelihood: 0.66 },\n { impact: 0.8, key: \"fraud\", likelihood: 0.66 },\n { impact: 0.62, key: \"supplier\", likelihood: 0.22 },\n { impact: 0.32, key: \"turnover\", likelihood: 0.82 },\n { impact: 0.18, key: \"price\", likelihood: 0.36 },\n { impact: 0.42, key: \"currency\", likelihood: 0.58 },\n];\n\nexport function Risks(): ReactElement {\n const { t } = useWords(\"scatter-plot\");\n const points = spreadPoints(\n RISKS.map(({ impact, key, likelihood }) => ({ impact, likelihood, name: t(`risks.${key}`) })),\n { distance: 0.15, x: [0, 1], xKey: \"likelihood\", y: [0, 1], yKey: \"impact\" },\n );\n\n return (\n <ScatterPlot\n caption={t(\"risks.caption\")}\n label={t(\"risks.label\")}\n labelKey=\"name\"\n quadrants={{\n names: {\n bottomEnd: t(\"risks.reduce\"),\n bottomStart: t(\"risks.accept\"),\n topEnd: t(\"risks.act\"),\n topStart: t(\"risks.prepare\"),\n },\n }}\n series={[{ key: \"risks\", label: t(\"risks.risks\"), points }]}\n xEnds={[t(\"risks.rare\"), t(\"risks.certain\")]}\n xKey=\"likelihood\"\n xLabel={t(\"risks.likelihood\")}\n xOptions={{ style: \"percent\" }}\n yEnds={[t(\"risks.minor\"), t(\"risks.severe\")]}\n yKey=\"impact\"\n yLabel={t(\"risks.impact\")}\n yOptions={{ style: \"percent\" }}\n />\n );\n}\n";
964
+ //#endregion
965
+ //#region src/scatter-plot/examples/slowest.example.tsx
966
+ var slowest_example_exports = /* @__PURE__ */ __exportAll({
967
+ Slowest: () => Slowest,
968
+ source: () => source
969
+ });
970
+ const MID_MARKET = [
971
+ [12, 28],
972
+ [18, 22],
973
+ [25, 41],
974
+ [9, 19],
975
+ [30, 38],
976
+ [15, 33],
977
+ [22, 26],
978
+ [27, 49],
979
+ [11, 15],
980
+ [19, 37],
981
+ [33, 44],
982
+ [24, 31]
983
+ ].map(([size = 0, days = 0]) => ({
984
+ days,
985
+ size: size * 1e3
986
+ }));
987
+ const ENTERPRISE = [
988
+ [85, 120],
989
+ [120, 104],
990
+ [64, 97],
991
+ [150, 178],
992
+ [98, 141],
993
+ [110, 96],
994
+ [72, 131],
995
+ [135, 156],
996
+ [160, 149],
997
+ [90, 88]
998
+ ].map(([size = 0, days = 0]) => ({
999
+ days,
1000
+ size: size * 1e3
1001
+ }));
1002
+ function Slowest() {
1003
+ const $ = c(29);
1004
+ const { t } = useWords("scatter-plot");
1005
+ let t0;
1006
+ if ($[0] !== t) {
1007
+ t0 = t("slowest.caption");
1008
+ $[0] = t;
1009
+ $[1] = t0;
1010
+ } else t0 = $[1];
1011
+ let t1;
1012
+ if ($[2] !== t) {
1013
+ t1 = t("deals.label");
1014
+ $[2] = t;
1015
+ $[3] = t1;
1016
+ } else t1 = $[3];
1017
+ let t2;
1018
+ if ($[4] !== t) {
1019
+ t2 = t("segments");
1020
+ $[4] = t;
1021
+ $[5] = t2;
1022
+ } else t2 = $[5];
1023
+ let t3;
1024
+ if ($[6] !== t) {
1025
+ t3 = t("deals.mid");
1026
+ $[6] = t;
1027
+ $[7] = t3;
1028
+ } else t3 = $[7];
1029
+ let t4;
1030
+ if ($[8] !== t3) {
1031
+ t4 = {
1032
+ key: "mid",
1033
+ label: t3,
1034
+ points: MID_MARKET
1035
+ };
1036
+ $[8] = t3;
1037
+ $[9] = t4;
1038
+ } else t4 = $[9];
1039
+ let t5;
1040
+ if ($[10] !== t) {
1041
+ t5 = t("deals.enterprise");
1042
+ $[10] = t;
1043
+ $[11] = t5;
1044
+ } else t5 = $[11];
1045
+ let t6;
1046
+ if ($[12] !== t5) {
1047
+ t6 = {
1048
+ key: "enterprise",
1049
+ label: t5,
1050
+ points: ENTERPRISE
1051
+ };
1052
+ $[12] = t5;
1053
+ $[13] = t6;
1054
+ } else t6 = $[13];
1055
+ let t7;
1056
+ if ($[14] !== t4 || $[15] !== t6) {
1057
+ t7 = [t4, t6];
1058
+ $[14] = t4;
1059
+ $[15] = t6;
1060
+ $[16] = t7;
1061
+ } else t7 = $[16];
1062
+ let t8;
1063
+ if ($[17] !== t) {
1064
+ t8 = t("deals.size");
1065
+ $[17] = t;
1066
+ $[18] = t8;
1067
+ } else t8 = $[18];
1068
+ let t9;
1069
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
1070
+ t9 = {
1071
+ currency: "EUR",
1072
+ notation: "compact",
1073
+ style: "currency"
1074
+ };
1075
+ $[19] = t9;
1076
+ } else t9 = $[19];
1077
+ let t10;
1078
+ if ($[20] !== t) {
1079
+ t10 = t("deals.days");
1080
+ $[20] = t;
1081
+ $[21] = t10;
1082
+ } else t10 = $[21];
1083
+ let t11;
1084
+ if ($[22] !== t0 || $[23] !== t1 || $[24] !== t10 || $[25] !== t2 || $[26] !== t7 || $[27] !== t8) {
1085
+ t11 = /* @__PURE__ */ jsx(ScatterPlot, {
1086
+ caption: t0,
1087
+ defaultIndex: 7,
1088
+ label: t1,
1089
+ legendLabel: t2,
1090
+ series: t7,
1091
+ xKey: "size",
1092
+ xLabel: t8,
1093
+ xOptions: t9,
1094
+ yKey: "days",
1095
+ yLabel: t10
1096
+ });
1097
+ $[22] = t0;
1098
+ $[23] = t1;
1099
+ $[24] = t10;
1100
+ $[25] = t2;
1101
+ $[26] = t7;
1102
+ $[27] = t8;
1103
+ $[28] = t11;
1104
+ } else t11 = $[28];
1105
+ return t11;
1106
+ }
1107
+ const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ScatterPlot } from \"@stealthscale/component-charts\";\n\nconst MID_MARKET = [\n [12, 28],\n [18, 22],\n [25, 41],\n [9, 19],\n [30, 38],\n [15, 33],\n [22, 26],\n [27, 49],\n [11, 15],\n [19, 37],\n [33, 44],\n [24, 31],\n].map(([size = 0, days = 0]) => ({ days, size: size * 1000 }));\n\nconst ENTERPRISE = [\n [85, 120],\n [120, 104],\n [64, 97],\n [150, 178],\n [98, 141],\n [110, 96],\n [72, 131],\n [135, 156],\n [160, 149],\n [90, 88],\n].map(([size = 0, days = 0]) => ({ days, size: size * 1000 }));\n\nexport function Slowest(): ReactElement {\n const { t } = useWords(\"scatter-plot\");\n\n return (\n <ScatterPlot\n caption={t(\"slowest.caption\")}\n defaultIndex={7}\n label={t(\"deals.label\")}\n legendLabel={t(\"segments\")}\n series={[\n { key: \"mid\", label: t(\"deals.mid\"), points: MID_MARKET },\n { key: \"enterprise\", label: t(\"deals.enterprise\"), points: ENTERPRISE },\n ]}\n xKey=\"size\"\n xLabel={t(\"deals.size\")}\n xOptions={{ currency: \"EUR\", notation: \"compact\", style: \"currency\" }}\n yKey=\"days\"\n yLabel={t(\"deals.days\")}\n />\n );\n}\n";
1108
+ //#endregion
1109
+ //#region src/scatter-plot/scatter-plot.specimen.tsx
1110
+ /**
1111
+ * Catalogue page for the scatter plot.
1112
+ *
1113
+ * @remarks
1114
+ * The scatter plot has no recipe of its own: the chart's recipe styles its figure, so every scene
1115
+ * is hand-written. The scenes render deals of two segments, the tooltip open at the slowest
1116
+ * mid-market deal, a shop's orders as small points, vendors in four named quadrants, risks with
1117
+ * equal scores spread apart at two widths, the points animated in with a replay, the deals at a
1118
+ * phone's width, and a scatter without points. Every scene renders a component from
1119
+ * `examples/` and shows that file as its source. The words are keys under `scatter-plot` in
1120
+ * `locales/en/specimen/scatter-plot.json`.
1121
+ */
1122
+ /**
1123
+ * Hand-written scene for two series.
1124
+ */
1125
+ const two = {
1126
+ about: "scatter-plot.deals.about",
1127
+ draw: () => /* @__PURE__ */ jsx(Room, {
1128
+ size: "lg",
1129
+ children: /* @__PURE__ */ jsx(Deals, {})
1130
+ }),
1131
+ example: deals_example_exports,
1132
+ title: "scatter-plot.deals.title"
1133
+ };
1134
+ /**
1135
+ * Hand-written scene for the tooltip open at a point.
1136
+ */
1137
+ const tooltip = {
1138
+ about: "scatter-plot.slowest.about",
1139
+ draw: () => /* @__PURE__ */ jsx(Room, {
1140
+ size: "lg",
1141
+ children: /* @__PURE__ */ jsx(Slowest, {})
1142
+ }),
1143
+ example: slowest_example_exports,
1144
+ title: "scatter-plot.slowest.title"
1145
+ };
1146
+ /**
1147
+ * Hand-written scene for points of a stated size.
1148
+ */
1149
+ const sized = {
1150
+ about: "scatter-plot.orders.about",
1151
+ draw: () => /* @__PURE__ */ jsx(Room, {
1152
+ size: "lg",
1153
+ children: /* @__PURE__ */ jsx(Orders, {})
1154
+ }),
1155
+ example: orders_example_exports,
1156
+ title: "scatter-plot.orders.title"
1157
+ };
1158
+ /**
1159
+ * Hand-written scene for four named quadrants with a name beside each point.
1160
+ */
1161
+ const quadrant = {
1162
+ about: "scatter-plot.quadrants.about",
1163
+ draw: () => /* @__PURE__ */ jsx(Room, {
1164
+ size: "lg",
1165
+ children: /* @__PURE__ */ jsx(Quadrants, {})
1166
+ }),
1167
+ example: quadrants_example_exports,
1168
+ title: "scatter-plot.quadrants.title"
1169
+ };
1170
+ /**
1171
+ * Hand-written scene for two points with equal scores spread apart.
1172
+ */
1173
+ const spread = {
1174
+ about: "scatter-plot.risks.about",
1175
+ draw: () => /* @__PURE__ */ jsx(Room, {
1176
+ size: "lg",
1177
+ children: /* @__PURE__ */ jsx(Risks, {})
1178
+ }),
1179
+ example: risks_example_exports,
1180
+ title: "scatter-plot.risks.title"
1181
+ };
1182
+ /**
1183
+ * Hand-written scene for the risks at a phone's width, where close names give way.
1184
+ */
1185
+ const crowded = {
1186
+ about: "scatter-plot.crowded.about",
1187
+ draw: () => /* @__PURE__ */ jsx(Room, {
1188
+ size: "xs",
1189
+ children: /* @__PURE__ */ jsx(Risks, {})
1190
+ }),
1191
+ example: risks_example_exports,
1192
+ title: "scatter-plot.crowded.title"
1193
+ };
1194
+ /**
1195
+ * Hand-written scene for the points animated in, with a replay.
1196
+ */
1197
+ const animated = {
1198
+ about: "scatter-plot.replay.about",
1199
+ draw: () => /* @__PURE__ */ jsx(Room, {
1200
+ size: "lg",
1201
+ children: /* @__PURE__ */ jsx(Replay, {})
1202
+ }),
1203
+ example: replay_example_exports,
1204
+ title: "scatter-plot.replay.title"
1205
+ };
1206
+ /**
1207
+ * Hand-written scene for the deals at a phone's width.
1208
+ */
1209
+ const narrow = {
1210
+ about: "scatter-plot.narrow.about",
1211
+ draw: () => /* @__PURE__ */ jsx(Room, {
1212
+ size: "xs",
1213
+ children: /* @__PURE__ */ jsx(Deals, {})
1214
+ }),
1215
+ example: deals_example_exports,
1216
+ title: "scatter-plot.narrow.title"
1217
+ };
1218
+ /**
1219
+ * Hand-written scene for a scatter without points.
1220
+ */
1221
+ const empty = {
1222
+ about: "scatter-plot.quiet.about",
1223
+ draw: () => /* @__PURE__ */ jsx(Room, {
1224
+ size: "md",
1225
+ children: /* @__PURE__ */ jsx(Quiet, {})
1226
+ }),
1227
+ example: quiet_example_exports,
1228
+ title: "scatter-plot.quiet.title"
1229
+ };
1230
+ var scatter_plot_specimen_default = specimen({
1231
+ about: "scatter-plot.about",
1232
+ id: "components/charts/scatter-plot",
1233
+ imports: "import { ScatterPlot } from \"@stealthscale/component-charts\";",
1234
+ scenes: [
1235
+ two,
1236
+ tooltip,
1237
+ sized,
1238
+ quadrant,
1239
+ spread,
1240
+ crowded,
1241
+ animated,
1242
+ narrow,
1243
+ empty
1244
+ ],
1245
+ title: "scatter-plot.title"
1246
+ });
1247
+ //#endregion
1248
+ export { animated, crowded, scatter_plot_specimen_default as default, empty, narrow, quadrant, sized, spread, tooltip, two };