@cratis/scene.blueprint.default 4.32.0 → 4.33.0

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 (122) hide show
  1. package/ComponentName.ts +12 -0
  2. package/defaultBlueprintComponents.ts +5 -1
  3. package/dist/cjs/ComponentName.js +4 -0
  4. package/dist/cjs/ComponentName.js.map +1 -1
  5. package/dist/cjs/defaultBlueprint.js +1 -1
  6. package/dist/cjs/defaultBlueprintComponentMetadata.js +2 -2
  7. package/dist/cjs/defaultBlueprintComponents.js +10 -2
  8. package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
  9. package/dist/cjs/foundation/ChartWrapper.js +520 -0
  10. package/dist/cjs/foundation/ChartWrapper.js.map +1 -0
  11. package/dist/cjs/foundation/ColumnChooser.js +156 -0
  12. package/dist/cjs/foundation/ColumnChooser.js.map +1 -0
  13. package/dist/cjs/foundation/FilterBuilder.js +307 -0
  14. package/dist/cjs/foundation/FilterBuilder.js.map +1 -0
  15. package/dist/cjs/foundation/SavedViewsMenu.js +199 -0
  16. package/dist/cjs/foundation/SavedViewsMenu.js.map +1 -0
  17. package/dist/cjs/foundation/chartGeometry.js +101 -0
  18. package/dist/cjs/foundation/chartGeometry.js.map +1 -0
  19. package/dist/cjs/foundation/columnModel.js +43 -0
  20. package/dist/cjs/foundation/columnModel.js.map +1 -0
  21. package/dist/cjs/foundation/filterModel.js +123 -0
  22. package/dist/cjs/foundation/filterModel.js.map +1 -0
  23. package/dist/cjs/foundation/foundationComponentMetadata.js +28 -0
  24. package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
  25. package/dist/cjs/foundation/foundationDescriptors.js +153 -0
  26. package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
  27. package/dist/cjs/foundation/foundationSamples.js +130 -0
  28. package/dist/cjs/foundation/foundationSamples.js.map +1 -1
  29. package/dist/cjs/foundation/foundationStrings.js +25 -0
  30. package/dist/cjs/foundation/foundationStrings.js.map +1 -1
  31. package/dist/cjs/foundation/useElementWidth.js +31 -0
  32. package/dist/cjs/foundation/useElementWidth.js.map +1 -0
  33. package/dist/cjs/foundation/viewModel.js +24 -0
  34. package/dist/cjs/foundation/viewModel.js.map +1 -0
  35. package/dist/cjs/index.js +38 -0
  36. package/dist/cjs/index.js.map +1 -1
  37. package/dist/esm/ComponentName.d.ts +5 -1
  38. package/dist/esm/ComponentName.d.ts.map +1 -1
  39. package/dist/esm/ComponentName.js +4 -0
  40. package/dist/esm/ComponentName.js.map +1 -1
  41. package/dist/esm/defaultBlueprint.js +1 -1
  42. package/dist/esm/defaultBlueprintComponentMetadata.js +2 -2
  43. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
  44. package/dist/esm/defaultBlueprintComponents.js +10 -2
  45. package/dist/esm/defaultBlueprintComponents.js.map +1 -1
  46. package/dist/esm/foundation/ChartWrapper.d.ts +5 -0
  47. package/dist/esm/foundation/ChartWrapper.d.ts.map +1 -0
  48. package/dist/esm/foundation/ChartWrapper.js +517 -0
  49. package/dist/esm/foundation/ChartWrapper.js.map +1 -0
  50. package/dist/esm/foundation/ColumnChooser.d.ts +3 -0
  51. package/dist/esm/foundation/ColumnChooser.d.ts.map +1 -0
  52. package/dist/esm/foundation/ColumnChooser.js +154 -0
  53. package/dist/esm/foundation/ColumnChooser.js.map +1 -0
  54. package/dist/esm/foundation/FilterBuilder.d.ts +3 -0
  55. package/dist/esm/foundation/FilterBuilder.d.ts.map +1 -0
  56. package/dist/esm/foundation/FilterBuilder.js +305 -0
  57. package/dist/esm/foundation/FilterBuilder.js.map +1 -0
  58. package/dist/esm/foundation/Foundation.stories.d.ts +16 -0
  59. package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -1
  60. package/dist/esm/foundation/Foundation.stories.js +16 -0
  61. package/dist/esm/foundation/Foundation.stories.js.map +1 -1
  62. package/dist/esm/foundation/SavedViewsMenu.d.ts +4 -0
  63. package/dist/esm/foundation/SavedViewsMenu.d.ts.map +1 -0
  64. package/dist/esm/foundation/SavedViewsMenu.js +196 -0
  65. package/dist/esm/foundation/SavedViewsMenu.js.map +1 -0
  66. package/dist/esm/foundation/chartGeometry.d.ts +34 -0
  67. package/dist/esm/foundation/chartGeometry.d.ts.map +1 -0
  68. package/dist/esm/foundation/chartGeometry.js +93 -0
  69. package/dist/esm/foundation/chartGeometry.js.map +1 -0
  70. package/dist/esm/foundation/columnModel.d.ts +11 -0
  71. package/dist/esm/foundation/columnModel.d.ts.map +1 -0
  72. package/dist/esm/foundation/columnModel.js +38 -0
  73. package/dist/esm/foundation/columnModel.js.map +1 -0
  74. package/dist/esm/foundation/filterModel.d.ts +33 -0
  75. package/dist/esm/foundation/filterModel.d.ts.map +1 -0
  76. package/dist/esm/foundation/filterModel.js +112 -0
  77. package/dist/esm/foundation/filterModel.js.map +1 -0
  78. package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
  79. package/dist/esm/foundation/foundationComponentMetadata.js +28 -0
  80. package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
  81. package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
  82. package/dist/esm/foundation/foundationDescriptors.js +154 -1
  83. package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
  84. package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
  85. package/dist/esm/foundation/foundationSamples.js +130 -0
  86. package/dist/esm/foundation/foundationSamples.js.map +1 -1
  87. package/dist/esm/foundation/foundationStrings.d.ts +25 -0
  88. package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
  89. package/dist/esm/foundation/foundationStrings.js +25 -0
  90. package/dist/esm/foundation/foundationStrings.js.map +1 -1
  91. package/dist/esm/foundation/index.d.ts +9 -0
  92. package/dist/esm/foundation/index.d.ts.map +1 -1
  93. package/dist/esm/foundation/index.js +9 -0
  94. package/dist/esm/foundation/index.js.map +1 -1
  95. package/dist/esm/foundation/useElementWidth.d.ts +3 -0
  96. package/dist/esm/foundation/useElementWidth.d.ts.map +1 -0
  97. package/dist/esm/foundation/useElementWidth.js +29 -0
  98. package/dist/esm/foundation/useElementWidth.js.map +1 -0
  99. package/dist/esm/foundation/viewModel.d.ts +7 -0
  100. package/dist/esm/foundation/viewModel.d.ts.map +1 -0
  101. package/dist/esm/foundation/viewModel.js +22 -0
  102. package/dist/esm/foundation/viewModel.js.map +1 -0
  103. package/dist/esm/index.js +9 -0
  104. package/dist/esm/index.js.map +1 -1
  105. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  106. package/foundation/ChartWrapper.tsx +252 -0
  107. package/foundation/ColumnChooser.tsx +73 -0
  108. package/foundation/FilterBuilder.tsx +144 -0
  109. package/foundation/Foundation.stories.tsx +16 -0
  110. package/foundation/SavedViewsMenu.tsx +94 -0
  111. package/foundation/chartGeometry.ts +108 -0
  112. package/foundation/columnModel.ts +39 -0
  113. package/foundation/filterModel.ts +111 -0
  114. package/foundation/foundationComponentMetadata.ts +4 -0
  115. package/foundation/foundationDescriptors.ts +86 -1
  116. package/foundation/foundationSamples.ts +19 -0
  117. package/foundation/foundationStrings.ts +25 -0
  118. package/foundation/index.ts +9 -0
  119. package/foundation/useElementWidth.ts +31 -0
  120. package/foundation/viewModel.ts +21 -0
  121. package/package.json +8 -8
  122. package/shell/layout.css +285 -0
@@ -0,0 +1,520 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var elementProperties = require('../shell/elementProperties.js');
6
+ var chartGeometry = require('./chartGeometry.js');
7
+ var ComponentState = require('./ComponentState.js');
8
+ var formatting = require('./formatting.js');
9
+ var foundationStrings = require('./foundationStrings.js');
10
+ var StateFrame = require('./StateFrame.js');
11
+ var useElementWidth = require('./useElementWidth.js');
12
+
13
+ /** Reads the chart kind, defaulting to a line chart. */ function readChartKind(value) {
14
+ return Object.values(chartGeometry.ChartKind).includes(value) ? value : chartGeometry.ChartKind.Line;
15
+ }
16
+ /** The theme tokens series are drawn in, in order; a series is never told apart by color alone - see `markers` and `patterns`. */ const seriesColors = [
17
+ 'var(--foundation-primary)',
18
+ 'var(--foundation-success)',
19
+ 'var(--foundation-warning)',
20
+ 'var(--foundation-danger)',
21
+ 'var(--foundation-info)',
22
+ 'var(--foundation-muted)'
23
+ ];
24
+ const markers = [
25
+ 'circle',
26
+ 'square',
27
+ 'triangle',
28
+ 'diamond',
29
+ 'cross',
30
+ 'ring'
31
+ ];
32
+ const dashes = [
33
+ '',
34
+ '6 3',
35
+ '2 3',
36
+ '8 3 2 3',
37
+ '',
38
+ '4 4'
39
+ ];
40
+ const margin = {
41
+ top: 12,
42
+ right: 12,
43
+ bottom: 28,
44
+ left: 48
45
+ };
46
+ function MarkerShape({ kind, x, y, color }) {
47
+ const r = 4;
48
+ switch(kind){
49
+ case 'square':
50
+ return /*#__PURE__*/ jsxRuntime.jsx("rect", {
51
+ x: x - r,
52
+ y: y - r,
53
+ width: r * 2,
54
+ height: r * 2,
55
+ fill: color
56
+ });
57
+ case 'triangle':
58
+ return /*#__PURE__*/ jsxRuntime.jsx("polygon", {
59
+ points: `${x},${y - r - 1} ${x + r + 1},${y + r} ${x - r - 1},${y + r}`,
60
+ fill: color
61
+ });
62
+ case 'diamond':
63
+ return /*#__PURE__*/ jsxRuntime.jsx("polygon", {
64
+ points: `${x},${y - r - 1} ${x + r + 1},${y} ${x},${y + r + 1} ${x - r - 1},${y}`,
65
+ fill: color
66
+ });
67
+ case 'cross':
68
+ return /*#__PURE__*/ jsxRuntime.jsx("path", {
69
+ d: `M ${x - r} ${y - r} L ${x + r} ${y + r} M ${x + r} ${y - r} L ${x - r} ${y + r}`,
70
+ stroke: color,
71
+ strokeWidth: 2,
72
+ fill: "none"
73
+ });
74
+ case 'ring':
75
+ return /*#__PURE__*/ jsxRuntime.jsx("circle", {
76
+ cx: x,
77
+ cy: y,
78
+ r: r,
79
+ fill: "none",
80
+ stroke: color,
81
+ strokeWidth: 2
82
+ });
83
+ default:
84
+ return /*#__PURE__*/ jsxRuntime.jsx("circle", {
85
+ cx: x,
86
+ cy: y,
87
+ r: r,
88
+ fill: color
89
+ });
90
+ }
91
+ }
92
+ function CartesianPlot({ kind, categories, series, width, locale, format, currency }) {
93
+ const height = Math.max(180, Math.min(320, Math.round(width * 0.55)));
94
+ const plotWidth = width - margin.left - margin.right;
95
+ const plotHeight = height - margin.top - margin.bottom;
96
+ const scale = chartGeometry.niceScale(chartGeometry.dataMaximum(kind, series, categories.length));
97
+ const y = (value)=>margin.top + plotHeight - value / scale.maximum * plotHeight;
98
+ const slot = plotWidth / Math.max(1, categories.length);
99
+ const patternId = react.useId();
100
+ const label = (value)=>formatting.formatNumber(value, locale, format === formatting.NumberFormat.Number ? formatting.NumberFormat.Compact : format, currency);
101
+ return /*#__PURE__*/ jsxRuntime.jsxs("svg", {
102
+ className: "foundation-chart-plot",
103
+ viewBox: `0 0 ${width} ${height}`,
104
+ width: width,
105
+ height: height,
106
+ "aria-hidden": "true",
107
+ focusable: "false",
108
+ children: [
109
+ /*#__PURE__*/ jsxRuntime.jsx("defs", {
110
+ children: series.map((_, index)=>index > 0 && index % 3 !== 0 && /*#__PURE__*/ jsxRuntime.jsxs("pattern", {
111
+ id: `${patternId}-${index}`,
112
+ width: "6",
113
+ height: "6",
114
+ patternUnits: "userSpaceOnUse",
115
+ patternTransform: `rotate(${index % 2 === 0 ? 45 : -45})`,
116
+ children: [
117
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
118
+ width: "6",
119
+ height: "6",
120
+ fill: seriesColors[index % seriesColors.length],
121
+ opacity: "0.35"
122
+ }),
123
+ /*#__PURE__*/ jsxRuntime.jsx("line", {
124
+ x1: "0",
125
+ y1: "0",
126
+ x2: "0",
127
+ y2: "6",
128
+ stroke: seriesColors[index % seriesColors.length],
129
+ strokeWidth: "2.5"
130
+ })
131
+ ]
132
+ }, index))
133
+ }),
134
+ scale.ticks.map((tick)=>/*#__PURE__*/ jsxRuntime.jsxs("g", {
135
+ children: [
136
+ /*#__PURE__*/ jsxRuntime.jsx("line", {
137
+ className: "foundation-chart-grid",
138
+ x1: margin.left,
139
+ x2: width - margin.right,
140
+ y1: y(tick),
141
+ y2: y(tick)
142
+ }),
143
+ /*#__PURE__*/ jsxRuntime.jsx("text", {
144
+ className: "foundation-chart-tick",
145
+ x: margin.left - 6,
146
+ y: y(tick),
147
+ textAnchor: "end",
148
+ dominantBaseline: "middle",
149
+ children: label(tick)
150
+ })
151
+ ]
152
+ }, tick)),
153
+ categories.map((category, index)=>/*#__PURE__*/ jsxRuntime.jsx("text", {
154
+ className: "foundation-chart-tick",
155
+ x: margin.left + slot * index + slot / 2,
156
+ y: height - 8,
157
+ textAnchor: "middle",
158
+ children: category
159
+ }, category + index)),
160
+ kind === chartGeometry.ChartKind.Line && series.map((item, seriesIndex)=>{
161
+ const color = seriesColors[seriesIndex % seriesColors.length];
162
+ const points = categories.map((_, index)=>({
163
+ x: margin.left + slot * index + slot / 2,
164
+ y: y(item.values[index] ?? 0)
165
+ }));
166
+ return /*#__PURE__*/ jsxRuntime.jsxs("g", {
167
+ children: [
168
+ /*#__PURE__*/ jsxRuntime.jsx("polyline", {
169
+ points: points.map((point)=>`${point.x},${point.y}`).join(' '),
170
+ fill: "none",
171
+ stroke: color,
172
+ strokeWidth: "2.5",
173
+ strokeDasharray: dashes[seriesIndex % dashes.length]
174
+ }),
175
+ points.map((point, index)=>/*#__PURE__*/ jsxRuntime.jsx(MarkerShape, {
176
+ kind: markers[seriesIndex % markers.length],
177
+ x: point.x,
178
+ y: point.y,
179
+ color: color
180
+ }, index))
181
+ ]
182
+ }, item.name);
183
+ }),
184
+ kind === chartGeometry.ChartKind.Bar && series.map((item, seriesIndex)=>{
185
+ const group = slot * 0.7;
186
+ const bar = group / series.length;
187
+ return /*#__PURE__*/ jsxRuntime.jsx("g", {
188
+ children: categories.map((_, index)=>{
189
+ const value = Math.max(0, item.values[index] ?? 0);
190
+ return /*#__PURE__*/ jsxRuntime.jsx("rect", {
191
+ className: "foundation-chart-bar",
192
+ x: margin.left + slot * index + (slot - group) / 2 + bar * seriesIndex,
193
+ y: y(value),
194
+ width: Math.max(1, bar - 2),
195
+ height: margin.top + plotHeight - y(value),
196
+ fill: fillFor(seriesIndex, patternId),
197
+ stroke: seriesColors[seriesIndex % seriesColors.length],
198
+ strokeWidth: "1.5"
199
+ }, index);
200
+ })
201
+ }, item.name);
202
+ }),
203
+ kind === chartGeometry.ChartKind.Stacked && categories.map((_, index)=>{
204
+ let base = 0;
205
+ return /*#__PURE__*/ jsxRuntime.jsx("g", {
206
+ children: series.map((item, seriesIndex)=>{
207
+ const value = Math.max(0, item.values[index] ?? 0);
208
+ const top = y(base + value);
209
+ const rect = /*#__PURE__*/ jsxRuntime.jsx("rect", {
210
+ className: "foundation-chart-bar",
211
+ x: margin.left + slot * index + slot * 0.15,
212
+ y: top,
213
+ width: slot * 0.7,
214
+ height: Math.max(0, y(base) - top),
215
+ fill: fillFor(seriesIndex, patternId),
216
+ stroke: seriesColors[seriesIndex % seriesColors.length],
217
+ strokeWidth: "1.5"
218
+ }, item.name);
219
+ base += value;
220
+ return rect;
221
+ })
222
+ }, index);
223
+ })
224
+ ]
225
+ });
226
+ }
227
+ function fillFor(seriesIndex, patternId) {
228
+ return seriesIndex === 0 || seriesIndex % 3 === 0 ? seriesColors[seriesIndex % seriesColors.length] : `url(#${patternId}-${seriesIndex})`;
229
+ }
230
+ function DonutPlot({ categories, values, width, locale }) {
231
+ const size = Math.max(160, Math.min(280, width));
232
+ const radius = size / 2 - 4;
233
+ const slices = chartGeometry.donutSlices(values);
234
+ const patternId = react.useId();
235
+ return /*#__PURE__*/ jsxRuntime.jsxs("svg", {
236
+ className: "foundation-chart-plot",
237
+ viewBox: `0 0 ${size} ${size}`,
238
+ width: size,
239
+ height: size,
240
+ "aria-hidden": "true",
241
+ focusable: "false",
242
+ children: [
243
+ /*#__PURE__*/ jsxRuntime.jsx("defs", {
244
+ children: values.map((_, index)=>index > 0 && index % 3 !== 0 && /*#__PURE__*/ jsxRuntime.jsxs("pattern", {
245
+ id: `${patternId}-${index}`,
246
+ width: "6",
247
+ height: "6",
248
+ patternUnits: "userSpaceOnUse",
249
+ patternTransform: `rotate(${index % 2 === 0 ? 45 : -45})`,
250
+ children: [
251
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
252
+ width: "6",
253
+ height: "6",
254
+ fill: seriesColors[index % seriesColors.length],
255
+ opacity: "0.35"
256
+ }),
257
+ /*#__PURE__*/ jsxRuntime.jsx("line", {
258
+ x1: "0",
259
+ y1: "0",
260
+ x2: "0",
261
+ y2: "6",
262
+ stroke: seriesColors[index % seriesColors.length],
263
+ strokeWidth: "2.5"
264
+ })
265
+ ]
266
+ }, index))
267
+ }),
268
+ slices.map((slice)=>/*#__PURE__*/ jsxRuntime.jsx("path", {
269
+ className: "foundation-chart-slice",
270
+ d: chartGeometry.ringPath(size / 2, size / 2, radius, radius * 0.6, slice.start, slice.end),
271
+ fill: fillFor(slice.index, patternId),
272
+ stroke: seriesColors[slice.index % seriesColors.length],
273
+ strokeWidth: "1.5",
274
+ "data-share": formatting.formatNumber(slice.share * 100, locale, formatting.NumberFormat.Percent),
275
+ children: /*#__PURE__*/ jsxRuntime.jsx("title", {
276
+ children: `${categories[slice.index] ?? ''}: ${formatting.formatNumber(slice.share * 100, locale, formatting.NumberFormat.Percent)}`
277
+ })
278
+ }, slice.index))
279
+ ]
280
+ });
281
+ }
282
+ function FunnelPlot({ categories, values, width, locale, format, currency }) {
283
+ const stages = chartGeometry.funnelStages(values);
284
+ const barHeight = 34;
285
+ const gap = 6;
286
+ const height = stages.length * (barHeight + gap);
287
+ const patternId = react.useId();
288
+ return /*#__PURE__*/ jsxRuntime.jsxs("svg", {
289
+ className: "foundation-chart-plot",
290
+ viewBox: `0 0 ${width} ${height}`,
291
+ width: width,
292
+ height: height,
293
+ "aria-hidden": "true",
294
+ focusable: "false",
295
+ children: [
296
+ /*#__PURE__*/ jsxRuntime.jsx("defs", {
297
+ children: stages.map((stage)=>stage.index > 0 && stage.index % 3 !== 0 && /*#__PURE__*/ jsxRuntime.jsxs("pattern", {
298
+ id: `${patternId}-${stage.index}`,
299
+ width: "6",
300
+ height: "6",
301
+ patternUnits: "userSpaceOnUse",
302
+ patternTransform: "rotate(45)",
303
+ children: [
304
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
305
+ width: "6",
306
+ height: "6",
307
+ fill: seriesColors[stage.index % seriesColors.length],
308
+ opacity: "0.35"
309
+ }),
310
+ /*#__PURE__*/ jsxRuntime.jsx("line", {
311
+ x1: "0",
312
+ y1: "0",
313
+ x2: "0",
314
+ y2: "6",
315
+ stroke: seriesColors[stage.index % seriesColors.length],
316
+ strokeWidth: "2.5"
317
+ })
318
+ ]
319
+ }, stage.index))
320
+ }),
321
+ stages.map((stage)=>{
322
+ const stageWidth = Math.max(2, width * stage.widthRatio);
323
+ return /*#__PURE__*/ jsxRuntime.jsxs("g", {
324
+ children: [
325
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
326
+ className: "foundation-chart-bar",
327
+ x: (width - stageWidth) / 2,
328
+ y: stage.index * (barHeight + gap),
329
+ width: stageWidth,
330
+ height: barHeight,
331
+ rx: "4",
332
+ fill: fillFor(stage.index, patternId),
333
+ stroke: seriesColors[stage.index % seriesColors.length],
334
+ strokeWidth: "1.5"
335
+ }),
336
+ /*#__PURE__*/ jsxRuntime.jsx("text", {
337
+ className: "foundation-chart-stage",
338
+ x: width / 2,
339
+ y: stage.index * (barHeight + gap) + barHeight / 2,
340
+ textAnchor: "middle",
341
+ dominantBaseline: "middle",
342
+ children: `${categories[stage.index] ?? ''} · ${formatting.formatNumber(stage.value, locale, format, currency)}`
343
+ })
344
+ ]
345
+ }, stage.index);
346
+ })
347
+ ]
348
+ });
349
+ }
350
+ /**
351
+ * The `chartWrapper` component: one chart - line, bar, stacked, donut or funnel - drawn as scalable vector graphics from the
352
+ * theme's tokens, with its own title, legend and a data table.
353
+ *
354
+ * `categories` name the points and `series` give a list of values for each. A donut and a funnel draw the first series, one slice or
355
+ * stage per category. The chart is never the only way to read the data: the figure is labelled, the drawing is hidden from assistive
356
+ * technology, and a table of the same numbers follows it - open it with "Chart data". Series are told apart by marker, dash or hatch as
357
+ * well as color, and the legend names each.
358
+ */ function ChartWrapper({ element, interactions }) {
359
+ const kind = readChartKind(element.properties.kind);
360
+ const categories = elementProperties.readStrings(element, 'categories');
361
+ const series = chartGeometry.readSeries(element.properties.series);
362
+ const hasData = series.some((item)=>item.values.length > 0) && categories.length > 0;
363
+ const state = ComponentState.readComponentState(element, hasData);
364
+ const locale = formatting.readLocale(element);
365
+ const format = formatting.readNumberFormat(element);
366
+ const currency = elementProperties.readOptionalString(element, 'currency');
367
+ const strings = foundationStrings.readFoundationStrings(element);
368
+ const container = react.useRef(null);
369
+ const width = useElementWidth.useElementWidth(container, 480);
370
+ const title = elementProperties.readOptionalString(element, 'title') ?? elementProperties.readOptionalString(element, 'label');
371
+ const first = series[0]?.values ?? [];
372
+ const single = kind === chartGeometry.ChartKind.Donut || kind === chartGeometry.ChartKind.Funnel;
373
+ const legend = single ? categories.map((name, index)=>({
374
+ name,
375
+ index
376
+ })) : series.map((item, index)=>({
377
+ name: item.name,
378
+ index
379
+ }));
380
+ const dataTableId = react.useId();
381
+ return /*#__PURE__*/ jsxRuntime.jsx(StateFrame.FoundationFrame, {
382
+ element: {
383
+ ...element,
384
+ properties: {
385
+ ...element.properties,
386
+ label: title
387
+ }
388
+ },
389
+ interactions: interactions,
390
+ name: "chart",
391
+ state: state,
392
+ skeleton: [
393
+ 30,
394
+ 100,
395
+ 100,
396
+ 60
397
+ ],
398
+ children: (state === ComponentState.ComponentState.Ready || state === ComponentState.ComponentState.Partial) && /*#__PURE__*/ jsxRuntime.jsxs("figure", {
399
+ className: "foundation-chart-figure",
400
+ "data-kind": kind,
401
+ children: [
402
+ title && /*#__PURE__*/ jsxRuntime.jsx("figcaption", {
403
+ className: "foundation-chart-title",
404
+ children: title
405
+ }),
406
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
407
+ ref: container,
408
+ className: "foundation-chart-canvas",
409
+ children: kind === chartGeometry.ChartKind.Donut ? /*#__PURE__*/ jsxRuntime.jsx(DonutPlot, {
410
+ categories: categories,
411
+ values: first,
412
+ width: width,
413
+ locale: locale
414
+ }) : kind === chartGeometry.ChartKind.Funnel ? /*#__PURE__*/ jsxRuntime.jsx(FunnelPlot, {
415
+ categories: categories,
416
+ values: first,
417
+ width: width,
418
+ locale: locale,
419
+ format: format,
420
+ currency: currency
421
+ }) : /*#__PURE__*/ jsxRuntime.jsx(CartesianPlot, {
422
+ kind: kind,
423
+ categories: categories,
424
+ series: series,
425
+ width: width,
426
+ locale: locale,
427
+ format: format,
428
+ currency: currency
429
+ })
430
+ }),
431
+ /*#__PURE__*/ jsxRuntime.jsx("ul", {
432
+ className: "foundation-chart-legend",
433
+ "aria-label": strings.chartSeries,
434
+ children: legend.map((entry)=>/*#__PURE__*/ jsxRuntime.jsxs("li", {
435
+ children: [
436
+ /*#__PURE__*/ jsxRuntime.jsx("svg", {
437
+ width: "14",
438
+ height: "14",
439
+ viewBox: "0 0 14 14",
440
+ "aria-hidden": "true",
441
+ children: kind === chartGeometry.ChartKind.Line ? /*#__PURE__*/ jsxRuntime.jsx(MarkerShape, {
442
+ kind: markers[entry.index % markers.length],
443
+ x: 7,
444
+ y: 7,
445
+ color: seriesColors[entry.index % seriesColors.length]
446
+ }) : /*#__PURE__*/ jsxRuntime.jsx("rect", {
447
+ x: "1",
448
+ y: "1",
449
+ width: "12",
450
+ height: "12",
451
+ fill: seriesColors[entry.index % seriesColors.length],
452
+ opacity: entry.index === 0 || entry.index % 3 === 0 ? 1 : 0.5,
453
+ stroke: seriesColors[entry.index % seriesColors.length],
454
+ strokeWidth: "2"
455
+ })
456
+ }),
457
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
458
+ children: entry.name
459
+ })
460
+ ]
461
+ }, entry.index))
462
+ }),
463
+ /*#__PURE__*/ jsxRuntime.jsxs("details", {
464
+ className: "foundation-chart-data",
465
+ children: [
466
+ /*#__PURE__*/ jsxRuntime.jsx("summary", {
467
+ children: strings.chartDataTable
468
+ }),
469
+ /*#__PURE__*/ jsxRuntime.jsxs("table", {
470
+ id: dataTableId,
471
+ children: [
472
+ /*#__PURE__*/ jsxRuntime.jsx("caption", {
473
+ className: "foundation-visually-hidden",
474
+ children: title ?? strings.chartDataTable
475
+ }),
476
+ /*#__PURE__*/ jsxRuntime.jsx("thead", {
477
+ children: /*#__PURE__*/ jsxRuntime.jsxs("tr", {
478
+ children: [
479
+ /*#__PURE__*/ jsxRuntime.jsx("th", {
480
+ scope: "col",
481
+ children: strings.chartCategory
482
+ }),
483
+ (single ? [
484
+ {
485
+ name: series[0]?.name ?? strings.chartSeries
486
+ }
487
+ ] : series).map((item)=>/*#__PURE__*/ jsxRuntime.jsx("th", {
488
+ scope: "col",
489
+ children: item.name
490
+ }, item.name))
491
+ ]
492
+ })
493
+ }),
494
+ /*#__PURE__*/ jsxRuntime.jsx("tbody", {
495
+ children: categories.map((category, index)=>/*#__PURE__*/ jsxRuntime.jsxs("tr", {
496
+ children: [
497
+ /*#__PURE__*/ jsxRuntime.jsx("th", {
498
+ scope: "row",
499
+ children: category
500
+ }),
501
+ (single ? [
502
+ series[0]
503
+ ] : series).map((item)=>/*#__PURE__*/ jsxRuntime.jsx("td", {
504
+ children: formatting.formatNumber(item?.values[index] ?? 0, locale, format, currency)
505
+ }, item?.name))
506
+ ]
507
+ }, category + index))
508
+ })
509
+ ]
510
+ })
511
+ ]
512
+ })
513
+ ]
514
+ })
515
+ });
516
+ }
517
+
518
+ exports.ChartWrapper = ChartWrapper;
519
+ exports.readChartKind = readChartKind;
520
+ //# sourceMappingURL=ChartWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartWrapper.js","sources":["../../../foundation/ChartWrapper.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useId, useRef } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { readOptionalString, readStrings } from '../shell/elementProperties';\nimport { ChartKind, ChartSeries, dataMaximum, donutSlices, funnelStages, niceScale, readSeries, ringPath } from './chartGeometry';\nimport { ComponentState, readComponentState } from './ComponentState';\nimport { formatNumber, NumberFormat, readLocale, readNumberFormat } from './formatting';\nimport { readFoundationStrings } from './foundationStrings';\nimport { FoundationFrame } from './StateFrame';\nimport { useElementWidth } from './useElementWidth';\n\n/** Reads the chart kind, defaulting to a line chart. */\nexport function readChartKind(value: unknown): ChartKind {\n return (Object.values(ChartKind) as string[]).includes(value as string) ? (value as ChartKind) : ChartKind.Line;\n}\n\n/** The theme tokens series are drawn in, in order; a series is never told apart by color alone - see `markers` and `patterns`. */\nconst seriesColors = ['var(--foundation-primary)', 'var(--foundation-success)', 'var(--foundation-warning)', 'var(--foundation-danger)', 'var(--foundation-info)', 'var(--foundation-muted)'];\nconst markers = ['circle', 'square', 'triangle', 'diamond', 'cross', 'ring'] as const;\nconst dashes = ['', '6 3', '2 3', '8 3 2 3', '', '4 4'];\nconst margin = { top: 12, right: 12, bottom: 28, left: 48 };\n\ntype Marker = (typeof markers)[number];\n\nfunction MarkerShape({ kind, x, y, color }: { kind: Marker; x: number; y: number; color: string }) {\n const r = 4;\n switch (kind) {\n case 'square': return <rect x={x - r} y={y - r} width={r * 2} height={r * 2} fill={color} />;\n case 'triangle': return <polygon points={`${x},${y - r - 1} ${x + r + 1},${y + r} ${x - r - 1},${y + r}`} fill={color} />;\n case 'diamond': return <polygon points={`${x},${y - r - 1} ${x + r + 1},${y} ${x},${y + r + 1} ${x - r - 1},${y}`} fill={color} />;\n case 'cross': return <path d={`M ${x - r} ${y - r} L ${x + r} ${y + r} M ${x + r} ${y - r} L ${x - r} ${y + r}`} stroke={color} strokeWidth={2} fill='none' />;\n case 'ring': return <circle cx={x} cy={y} r={r} fill='none' stroke={color} strokeWidth={2} />;\n default: return <circle cx={x} cy={y} r={r} fill={color} />;\n }\n}\n\ninterface PlotProps {\n kind: ChartKind;\n categories: string[];\n series: ChartSeries[];\n width: number;\n locale: string;\n format: NumberFormat;\n currency?: string;\n}\n\nfunction CartesianPlot({ kind, categories, series, width, locale, format, currency }: PlotProps) {\n const height = Math.max(180, Math.min(320, Math.round(width * 0.55)));\n const plotWidth = width - margin.left - margin.right;\n const plotHeight = height - margin.top - margin.bottom;\n const scale = niceScale(dataMaximum(kind, series, categories.length));\n const y = (value: number) => margin.top + plotHeight - (value / scale.maximum) * plotHeight;\n const slot = plotWidth / Math.max(1, categories.length);\n const patternId = useId();\n const label = (value: number) => formatNumber(value, locale, format === NumberFormat.Number ? NumberFormat.Compact : format, currency);\n\n return (\n <svg className='foundation-chart-plot' viewBox={`0 0 ${width} ${height}`} width={width} height={height} aria-hidden='true' focusable='false'>\n <defs>\n {series.map((_, index) => index > 0 && index % 3 !== 0 && (\n <pattern key={index} id={`${patternId}-${index}`} width='6' height='6' patternUnits='userSpaceOnUse' patternTransform={`rotate(${index % 2 === 0 ? 45 : -45})`}>\n <rect width='6' height='6' fill={seriesColors[index % seriesColors.length]} opacity='0.35' />\n <line x1='0' y1='0' x2='0' y2='6' stroke={seriesColors[index % seriesColors.length]} strokeWidth='2.5' />\n </pattern>\n ))}\n </defs>\n {scale.ticks.map(tick => (\n <g key={tick}>\n <line className='foundation-chart-grid' x1={margin.left} x2={width - margin.right} y1={y(tick)} y2={y(tick)} />\n <text className='foundation-chart-tick' x={margin.left - 6} y={y(tick)} textAnchor='end' dominantBaseline='middle'>{label(tick)}</text>\n </g>\n ))}\n {categories.map((category, index) => (\n <text key={category + index} className='foundation-chart-tick' x={margin.left + slot * index + slot / 2} y={height - 8} textAnchor='middle'>{category}</text>\n ))}\n {kind === ChartKind.Line && series.map((item, seriesIndex) => {\n const color = seriesColors[seriesIndex % seriesColors.length];\n const points = categories.map((_, index) => ({ x: margin.left + slot * index + slot / 2, y: y(item.values[index] ?? 0) }));\n return (\n <g key={item.name}>\n <polyline points={points.map(point => `${point.x},${point.y}`).join(' ')} fill='none' stroke={color} strokeWidth='2.5' strokeDasharray={dashes[seriesIndex % dashes.length]} />\n {points.map((point, index) => <MarkerShape key={index} kind={markers[seriesIndex % markers.length]} x={point.x} y={point.y} color={color} />)}\n </g>\n );\n })}\n {kind === ChartKind.Bar && series.map((item, seriesIndex) => {\n const group = slot * 0.7;\n const bar = group / series.length;\n return (\n <g key={item.name}>\n {categories.map((_, index) => {\n const value = Math.max(0, item.values[index] ?? 0);\n return <rect key={index} className='foundation-chart-bar' x={margin.left + slot * index + (slot - group) / 2 + bar * seriesIndex} y={y(value)} width={Math.max(1, bar - 2)} height={margin.top + plotHeight - y(value)}\n fill={fillFor(seriesIndex, patternId)} stroke={seriesColors[seriesIndex % seriesColors.length]} strokeWidth='1.5' />;\n })}\n </g>\n );\n })}\n {kind === ChartKind.Stacked && categories.map((_, index) => {\n let base = 0;\n return (\n <g key={index}>\n {series.map((item, seriesIndex) => {\n const value = Math.max(0, item.values[index] ?? 0);\n const top = y(base + value);\n const rect = <rect key={item.name} className='foundation-chart-bar' x={margin.left + slot * index + slot * 0.15} y={top} width={slot * 0.7} height={Math.max(0, y(base) - top)}\n fill={fillFor(seriesIndex, patternId)} stroke={seriesColors[seriesIndex % seriesColors.length]} strokeWidth='1.5' />;\n base += value;\n return rect;\n })}\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction fillFor(seriesIndex: number, patternId: string): string {\n return seriesIndex === 0 || seriesIndex % 3 === 0 ? seriesColors[seriesIndex % seriesColors.length] : `url(#${patternId}-${seriesIndex})`;\n}\n\nfunction DonutPlot({ categories, values, width, locale }: { categories: string[]; values: number[]; width: number; locale: string }) {\n const size = Math.max(160, Math.min(280, width));\n const radius = size / 2 - 4;\n const slices = donutSlices(values);\n const patternId = useId();\n\n return (\n <svg className='foundation-chart-plot' viewBox={`0 0 ${size} ${size}`} width={size} height={size} aria-hidden='true' focusable='false'>\n <defs>\n {values.map((_, index) => index > 0 && index % 3 !== 0 && (\n <pattern key={index} id={`${patternId}-${index}`} width='6' height='6' patternUnits='userSpaceOnUse' patternTransform={`rotate(${index % 2 === 0 ? 45 : -45})`}>\n <rect width='6' height='6' fill={seriesColors[index % seriesColors.length]} opacity='0.35' />\n <line x1='0' y1='0' x2='0' y2='6' stroke={seriesColors[index % seriesColors.length]} strokeWidth='2.5' />\n </pattern>\n ))}\n </defs>\n {slices.map(slice => (\n <path key={slice.index} className='foundation-chart-slice' d={ringPath(size / 2, size / 2, radius, radius * 0.6, slice.start, slice.end)} fill={fillFor(slice.index, patternId)}\n stroke={seriesColors[slice.index % seriesColors.length]} strokeWidth='1.5' data-share={formatNumber(slice.share * 100, locale, NumberFormat.Percent)}>\n <title>{`${categories[slice.index] ?? ''}: ${formatNumber(slice.share * 100, locale, NumberFormat.Percent)}`}</title>\n </path>\n ))}\n </svg>\n );\n}\n\nfunction FunnelPlot({ categories, values, width, locale, format, currency }: { categories: string[]; values: number[]; width: number; locale: string; format: NumberFormat; currency?: string }) {\n const stages = funnelStages(values);\n const barHeight = 34;\n const gap = 6;\n const height = stages.length * (barHeight + gap);\n const patternId = useId();\n\n return (\n <svg className='foundation-chart-plot' viewBox={`0 0 ${width} ${height}`} width={width} height={height} aria-hidden='true' focusable='false'>\n <defs>\n {stages.map(stage => stage.index > 0 && stage.index % 3 !== 0 && (\n <pattern key={stage.index} id={`${patternId}-${stage.index}`} width='6' height='6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'>\n <rect width='6' height='6' fill={seriesColors[stage.index % seriesColors.length]} opacity='0.35' />\n <line x1='0' y1='0' x2='0' y2='6' stroke={seriesColors[stage.index % seriesColors.length]} strokeWidth='2.5' />\n </pattern>\n ))}\n </defs>\n {stages.map(stage => {\n const stageWidth = Math.max(2, width * stage.widthRatio);\n return (\n <g key={stage.index}>\n <rect className='foundation-chart-bar' x={(width - stageWidth) / 2} y={stage.index * (barHeight + gap)} width={stageWidth} height={barHeight} rx='4'\n fill={fillFor(stage.index, patternId)} stroke={seriesColors[stage.index % seriesColors.length]} strokeWidth='1.5' />\n <text className='foundation-chart-stage' x={width / 2} y={stage.index * (barHeight + gap) + barHeight / 2} textAnchor='middle' dominantBaseline='middle'>\n {`${categories[stage.index] ?? ''} · ${formatNumber(stage.value, locale, format, currency)}`}\n </text>\n </g>\n );\n })}\n </svg>\n );\n}\n\n/**\n * The `chartWrapper` component: one chart - line, bar, stacked, donut or funnel - drawn as scalable vector graphics from the\n * theme's tokens, with its own title, legend and a data table.\n *\n * `categories` name the points and `series` give a list of values for each. A donut and a funnel draw the first series, one slice or\n * stage per category. The chart is never the only way to read the data: the figure is labelled, the drawing is hidden from assistive\n * technology, and a table of the same numbers follows it - open it with \"Chart data\". Series are told apart by marker, dash or hatch as\n * well as color, and the legend names each.\n */\nexport function ChartWrapper({ element, interactions }: RegisteredComponentProps) {\n const kind = readChartKind(element.properties.kind);\n const categories = readStrings(element, 'categories');\n const series = readSeries(element.properties.series);\n const hasData = series.some(item => item.values.length > 0) && categories.length > 0;\n const state = readComponentState(element, hasData);\n const locale = readLocale(element);\n const format = readNumberFormat(element);\n const currency = readOptionalString(element, 'currency');\n const strings = readFoundationStrings(element);\n const container = useRef<HTMLDivElement>(null);\n const width = useElementWidth(container, 480);\n const title = readOptionalString(element, 'title') ?? readOptionalString(element, 'label');\n const first = series[0]?.values ?? [];\n const single = kind === ChartKind.Donut || kind === ChartKind.Funnel;\n const legend = single ? categories.map((name, index) => ({ name, index })) : series.map((item, index) => ({ name: item.name, index }));\n const dataTableId = useId();\n\n return (\n <FoundationFrame element={{ ...element, properties: { ...element.properties, label: title } }} interactions={interactions} name='chart' state={state} skeleton={[30, 100, 100, 60]}>\n {(state === ComponentState.Ready || state === ComponentState.Partial) && (\n <figure className='foundation-chart-figure' data-kind={kind}>\n {title && <figcaption className='foundation-chart-title'>{title}</figcaption>}\n <div ref={container} className='foundation-chart-canvas'>\n {kind === ChartKind.Donut ? <DonutPlot categories={categories} values={first} width={width} locale={locale} />\n : kind === ChartKind.Funnel ? <FunnelPlot categories={categories} values={first} width={width} locale={locale} format={format} currency={currency} />\n : <CartesianPlot kind={kind} categories={categories} series={series} width={width} locale={locale} format={format} currency={currency} />}\n </div>\n <ul className='foundation-chart-legend' aria-label={strings.chartSeries}>\n {legend.map(entry => (\n <li key={entry.index}>\n <svg width='14' height='14' viewBox='0 0 14 14' aria-hidden='true'>\n {kind === ChartKind.Line ? <MarkerShape kind={markers[entry.index % markers.length]} x={7} y={7} color={seriesColors[entry.index % seriesColors.length]} />\n : <rect x='1' y='1' width='12' height='12' fill={seriesColors[entry.index % seriesColors.length]} opacity={entry.index === 0 || entry.index % 3 === 0 ? 1 : 0.5} stroke={seriesColors[entry.index % seriesColors.length]} strokeWidth='2' />}\n </svg>\n <span>{entry.name}</span>\n </li>\n ))}\n </ul>\n <details className='foundation-chart-data'>\n <summary>{strings.chartDataTable}</summary>\n <table id={dataTableId}>\n <caption className='foundation-visually-hidden'>{title ?? strings.chartDataTable}</caption>\n <thead>\n <tr><th scope='col'>{strings.chartCategory}</th>{(single ? [{ name: series[0]?.name ?? strings.chartSeries }] : series).map(item => <th key={item.name} scope='col'>{item.name}</th>)}</tr>\n </thead>\n <tbody>\n {categories.map((category, index) => (\n <tr key={category + index}>\n <th scope='row'>{category}</th>\n {(single ? [series[0]] : series).map(item => <td key={item?.name}>{formatNumber(item?.values[index] ?? 0, locale, format, currency)}</td>)}\n </tr>\n ))}\n </tbody>\n </table>\n </details>\n </figure>\n )}\n </FoundationFrame>\n );\n}\n"],"names":["readChartKind","value","Object","values","ChartKind","includes","Line","seriesColors","markers","dashes","margin","top","right","bottom","left","MarkerShape","kind","x","y","color","r","_jsx","rect","width","height","fill","polygon","points","path","d","stroke","strokeWidth","circle","cx","cy","CartesianPlot","categories","series","locale","format","currency","Math","max","min","round","plotWidth","plotHeight","scale","niceScale","dataMaximum","length","maximum","slot","patternId","useId","label","formatNumber","NumberFormat","Number","Compact","_jsxs","svg","className","viewBox","aria-hidden","focusable","defs","map","_","index","pattern","id","patternUnits","patternTransform","opacity","line","x1","y1","x2","y2","ticks","tick","g","text","textAnchor","dominantBaseline","category","item","seriesIndex","polyline","point","join","strokeDasharray","name","Bar","group","bar","fillFor","Stacked","base","DonutPlot","size","radius","slices","donutSlices","slice","ringPath","start","end","data-share","share","Percent","title","FunnelPlot","stages","funnelStages","barHeight","gap","stage","stageWidth","widthRatio","rx","ChartWrapper","element","interactions","properties","readStrings","readSeries","hasData","some","state","readComponentState","readLocale","readNumberFormat","readOptionalString","strings","readFoundationStrings","container","useRef","useElementWidth","first","single","Donut","Funnel","legend","dataTableId","FoundationFrame","skeleton","ComponentState","Ready","Partial","figure","data-kind","figcaption","div","ref","ul","aria-label","chartSeries","entry","li","span","details","summary","chartDataTable","table","caption","thead","tr","th","scope","chartCategory","tbody","td"],"mappings":";;;;;;;;;;;;AAaA,yDACO,SAASA,aAAAA,CAAcC,KAAc,EAAA;IACxC,OAAQC,MAAAA,CAAOC,MAAM,CAACC,uBAAAA,CAAAA,CAAwBC,QAAQ,CAACJ,KAAAA,CAAAA,GAAoBA,KAAAA,GAAsBG,uBAAAA,CAAUE,IAAI;AACnH;AAEA,mIACA,MAAMC,YAAAA,GAAe;AAAC,IAAA,2BAAA;AAA6B,IAAA,2BAAA;AAA6B,IAAA,2BAAA;AAA6B,IAAA,0BAAA;AAA4B,IAAA,wBAAA;AAA0B,IAAA;AAA0B,CAAA;AAC7L,MAAMC,OAAAA,GAAU;AAAC,IAAA,QAAA;AAAU,IAAA,QAAA;AAAU,IAAA,UAAA;AAAY,IAAA,SAAA;AAAW,IAAA,OAAA;AAAS,IAAA;AAAO,CAAA;AAC5E,MAAMC,MAAAA,GAAS;AAAC,IAAA,EAAA;AAAI,IAAA,KAAA;AAAO,IAAA,KAAA;AAAO,IAAA,SAAA;AAAW,IAAA,EAAA;AAAI,IAAA;AAAM,CAAA;AACvD,MAAMC,MAAAA,GAAS;IAAEC,GAAAA,EAAK,EAAA;IAAIC,KAAAA,EAAO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