orn-ui 0.2.8 → 0.2.10

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 (80) hide show
  1. package/AGENTS.md +6 -2
  2. package/README.md +6 -6
  3. package/lib/commonjs/atoms/ShinyText.js +188 -0
  4. package/lib/commonjs/atoms/ShinyText.js.map +1 -0
  5. package/lib/commonjs/atoms/index.js +7 -0
  6. package/lib/commonjs/atoms/index.js.map +1 -1
  7. package/lib/commonjs/organisms/Chart.js +968 -0
  8. package/lib/commonjs/organisms/Chart.js.map +1 -0
  9. package/lib/commonjs/organisms/OptionWheel.js +408 -0
  10. package/lib/commonjs/organisms/OptionWheel.js.map +1 -0
  11. package/lib/commonjs/organisms/Timeline.js +420 -0
  12. package/lib/commonjs/organisms/Timeline.js.map +1 -0
  13. package/lib/commonjs/organisms/chart/frame.js +373 -0
  14. package/lib/commonjs/organisms/chart/frame.js.map +1 -0
  15. package/lib/commonjs/organisms/chart/marks.js +316 -0
  16. package/lib/commonjs/organisms/chart/marks.js.map +1 -0
  17. package/lib/commonjs/organisms/chart/math.js +468 -0
  18. package/lib/commonjs/organisms/chart/math.js.map +1 -0
  19. package/lib/commonjs/organisms/chart/palette.js +120 -0
  20. package/lib/commonjs/organisms/chart/palette.js.map +1 -0
  21. package/lib/commonjs/organisms/index.js +21 -0
  22. package/lib/commonjs/organisms/index.js.map +1 -1
  23. package/lib/module/atoms/ShinyText.js +183 -0
  24. package/lib/module/atoms/ShinyText.js.map +1 -0
  25. package/lib/module/atoms/index.js +1 -0
  26. package/lib/module/atoms/index.js.map +1 -1
  27. package/lib/module/organisms/Chart.js +963 -0
  28. package/lib/module/organisms/Chart.js.map +1 -0
  29. package/lib/module/organisms/OptionWheel.js +403 -0
  30. package/lib/module/organisms/OptionWheel.js.map +1 -0
  31. package/lib/module/organisms/Timeline.js +415 -0
  32. package/lib/module/organisms/Timeline.js.map +1 -0
  33. package/lib/module/organisms/chart/frame.js +367 -0
  34. package/lib/module/organisms/chart/frame.js.map +1 -0
  35. package/lib/module/organisms/chart/marks.js +310 -0
  36. package/lib/module/organisms/chart/marks.js.map +1 -0
  37. package/lib/module/organisms/chart/math.js +445 -0
  38. package/lib/module/organisms/chart/math.js.map +1 -0
  39. package/lib/module/organisms/chart/palette.js +114 -0
  40. package/lib/module/organisms/chart/palette.js.map +1 -0
  41. package/lib/module/organisms/index.js +3 -0
  42. package/lib/module/organisms/index.js.map +1 -1
  43. package/lib/typescript/atoms/ShinyText.d.ts +48 -0
  44. package/lib/typescript/atoms/ShinyText.d.ts.map +1 -0
  45. package/lib/typescript/atoms/index.d.ts +2 -0
  46. package/lib/typescript/atoms/index.d.ts.map +1 -1
  47. package/lib/typescript/organisms/Chart.d.ts +208 -0
  48. package/lib/typescript/organisms/Chart.d.ts.map +1 -0
  49. package/lib/typescript/organisms/OptionWheel.d.ts +78 -0
  50. package/lib/typescript/organisms/OptionWheel.d.ts.map +1 -0
  51. package/lib/typescript/organisms/Timeline.d.ts +61 -0
  52. package/lib/typescript/organisms/Timeline.d.ts.map +1 -0
  53. package/lib/typescript/organisms/chart/frame.d.ts +85 -0
  54. package/lib/typescript/organisms/chart/frame.d.ts.map +1 -0
  55. package/lib/typescript/organisms/chart/marks.d.ts +88 -0
  56. package/lib/typescript/organisms/chart/marks.d.ts.map +1 -0
  57. package/lib/typescript/organisms/chart/math.d.ts +161 -0
  58. package/lib/typescript/organisms/chart/math.d.ts.map +1 -0
  59. package/lib/typescript/organisms/chart/palette.d.ts +6 -0
  60. package/lib/typescript/organisms/chart/palette.d.ts.map +1 -0
  61. package/lib/typescript/organisms/index.d.ts +6 -0
  62. package/lib/typescript/organisms/index.d.ts.map +1 -1
  63. package/llms.txt +3 -3
  64. package/package.json +23 -2
  65. package/registry/chart.json +35 -0
  66. package/registry/index.json +53 -0
  67. package/registry/manifest.json +28 -0
  68. package/registry/option-wheel.json +19 -0
  69. package/registry/shiny-text.json +19 -0
  70. package/registry/timeline.json +20 -0
  71. package/src/atoms/ShinyText.tsx +226 -0
  72. package/src/atoms/index.ts +2 -0
  73. package/src/organisms/Chart.tsx +1252 -0
  74. package/src/organisms/OptionWheel.tsx +476 -0
  75. package/src/organisms/Timeline.tsx +467 -0
  76. package/src/organisms/chart/frame.tsx +349 -0
  77. package/src/organisms/chart/marks.tsx +295 -0
  78. package/src/organisms/chart/math.ts +475 -0
  79. package/src/organisms/chart/palette.ts +112 -0
  80. package/src/organisms/index.ts +14 -0
@@ -0,0 +1,963 @@
1
+ "use strict";
2
+
3
+ import React, { memo, useCallback, useMemo, useRef, useState } from 'react';
4
+ import { Pressable, Text, View } from 'react-native';
5
+ import { contrast } from '../theme/colors';
6
+ import { createStyles } from '../theme/createStyles';
7
+ import { useAllowFontScaling, useLabels, useTheme } from '../theme/UIProvider';
8
+ import { SegmentedControl } from '../molecules/SegmentedControl';
9
+ import { Bar, Dot, Polyline, Wedge } from './chart/marks';
10
+ import { AxisLabels, CartesianGrid, Legend, RadarGrid, Tooltip } from './chart/frame';
11
+ import { seriesPalette } from './chart/palette';
12
+ import { angleOf, arcAt, arcsFor, clamp, exactTicks, extent, fanStrips, formatNumber, growExtent, linearScale, lttbIndices, niceScale, polar, radarAngles, sampleY, smoothPoints, stackRow, toNumber } from './chart/math';
13
+
14
+ /**
15
+ * Un filtro de la barra superior. Chart no filtra nada por su cuenta: muestra
16
+ * el control y avisa. Quien tiene los datos decide qué significa "últimos 7
17
+ * días", y eso no se puede adivinar desde acá.
18
+ */
19
+
20
+ // 'pie' y 'donut' van separados aunque compartan todo: con un solo miembro
21
+ // cuyo `type` fuera `'pie' | 'donut'`, TypeScript no saca ese miembro de la
22
+ // unión al descartarlo, y el resto del componente deja de estrecharse.
23
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
+ const DEFAULT_HEIGHT = 220;
25
+ const DEFAULT_TICKS = 4;
26
+ /** Piso del canal de las etiquetas de valor, a la izquierda. */
27
+ const VALUE_GUTTER = 38;
28
+ /**
29
+ * Ancho estimado de un caracter de etiqueta. React Native no mide texto sin
30
+ * renderizarlo, y medir para decidir el layout haría aparecer el chart
31
+ * corrido un frame; a `fontSize.xs` un dígito ronda 0.6em, y de más es mejor
32
+ * que de menos — sobra aire, no se corta el número.
33
+ */
34
+ const VALUE_CHAR = 6.5;
35
+ /** Tope del canal: un eje ancho no puede comerse el plot. */
36
+ const VALUE_GUTTER_MAX = 0.3;
37
+ /** Canal de las categorías cuando van a la izquierda (barras horizontales). */
38
+ const CATEGORY_GUTTER = 64;
39
+ /** Canal de las etiquetas de abajo. */
40
+ const BOTTOM_GUTTER = 16;
41
+ /** Fracción del ancho de banda que ocupan las barras; el resto es aire. */
42
+ const BAND_FILL = 0.7;
43
+ /** Aire alrededor del radar para que entren las etiquetas de los ejes. */
44
+ const RADAR_INSET = 26;
45
+ const DIM_OPACITY = 0.3;
46
+ const useStyles = createStyles(theme => ({
47
+ root: {
48
+ alignSelf: 'stretch'
49
+ },
50
+ filters: {
51
+ gap: theme.tokens.spacing.sm,
52
+ marginBottom: theme.tokens.spacing.md
53
+ },
54
+ plot: {
55
+ position: 'relative',
56
+ overflow: 'visible'
57
+ },
58
+ empty: {
59
+ position: 'absolute',
60
+ left: 0,
61
+ right: 0,
62
+ top: 0,
63
+ bottom: 0,
64
+ alignItems: 'center',
65
+ justifyContent: 'center'
66
+ },
67
+ emptyText: {
68
+ fontSize: theme.tokens.fontSize.sm,
69
+ color: theme.colors.textLight
70
+ },
71
+ sliceLabel: {
72
+ position: 'absolute',
73
+ fontSize: theme.tokens.fontSize.xs,
74
+ fontWeight: theme.tokens.fontWeight.semibold,
75
+ textAlign: 'center'
76
+ },
77
+ radarAxisLabel: {
78
+ position: 'absolute',
79
+ fontSize: theme.tokens.fontSize.xs,
80
+ color: theme.colors.textLight,
81
+ textAlign: 'center'
82
+ }
83
+ }));
84
+
85
+ /** Estado controlado o propio, con el mismo contrato en los dos casos. */
86
+ function useControlled(controlled, fallback) {
87
+ const [own, setOwn] = useState(fallback);
88
+ const isControlled = controlled !== undefined;
89
+ return [isControlled ? controlled : own, setOwn, isControlled];
90
+ }
91
+
92
+ /**
93
+ * Resuelve el dominio del eje de valores a partir de lo que pidió el
94
+ * consumidor. En 'sticky' la referencia vive en un ref: lo que importa no es
95
+ * el dominio de este render sino el más ancho que se haya visto, y guardarlo
96
+ * en estado dispararía un render de más por cada tick que ensancha el eje.
97
+ */
98
+ function useDomain(measured, domain) {
99
+ const widest = useRef(null);
100
+ if (domain === 'sticky') {
101
+ widest.current = growExtent(widest.current, measured);
102
+ return widest.current;
103
+ }
104
+ widest.current = null;
105
+ return domain ?? measured;
106
+ }
107
+
108
+ /**
109
+ * Chart
110
+ * Barras (verticales, horizontales, agrupadas, apiladas), línea, área, torta,
111
+ * dona y radar en un solo componente, porque lo que cambia entre ellos es la
112
+ * marca que se dibuja y no el resto: datos, escala, ejes, leyenda, tooltip,
113
+ * selección y filtros son los mismos seis mecanismos en todos.
114
+ *
115
+ * Se dibuja con `View`: React Native no trae lienzo vectorial y la librería no
116
+ * puede agregar uno. Las tres primitivas están en `chart/marks.tsx` y la
117
+ * geometría entera, sin React, en `chart/math.ts`.
118
+ *
119
+ * Gestalt: destino común — al tocar una categoría, todo lo que no es ella baja
120
+ * a {@link DIM_OPACITY} a la vez, así que lo resaltado se lee como un grupo y
121
+ * no como una marca suelta. La leyenda usa similitud: el mismo color que la
122
+ * serie, y por eso puede apagarla sin que haga falta explicar qué apaga.
123
+ */
124
+ export function Chart(props) {
125
+ const {
126
+ data,
127
+ series,
128
+ xKey = 'x',
129
+ selectBy,
130
+ window: windowSize,
131
+ height = DEFAULT_HEIGHT,
132
+ legend = 'auto',
133
+ hiddenKeys,
134
+ defaultHiddenKeys,
135
+ onHiddenKeysChange,
136
+ filters,
137
+ selected,
138
+ onSelect,
139
+ tooltip = true,
140
+ formatValue = formatNumber,
141
+ animate = true,
142
+ duration,
143
+ emptyText,
144
+ accessibilityLabel,
145
+ style,
146
+ testID
147
+ } = props;
148
+ const theme = useTheme();
149
+ const styles = useStyles();
150
+ const allowFontScaling = useAllowFontScaling();
151
+ const uiLabels = useLabels();
152
+ const [width, setWidth] = useState(0);
153
+ const [hidden, setHidden, hiddenIsControlled] = useControlled(hiddenKeys, defaultHiddenKeys ?? []);
154
+ const [pick, setPick, selectionIsControlled] = useControlled(selected, null);
155
+ const isPie = props.type === 'pie' || props.type === 'donut';
156
+ const polyline = props.type === 'line' || props.type === 'area';
157
+ const decimate = polyline ? props.decimate : false;
158
+
159
+ /**
160
+ * Lo que se dibuja: la ventana de `data`, y de ahí los puntos que caben.
161
+ * El diezmado corre sobre la fila entera, elegida con la primera serie
162
+ * visible: las series comparten eje x, así que quedarse con índices
163
+ * distintos por serie rompería la alineación, la capa de toque y el tooltip.
164
+ */
165
+ const rows = useMemo(() => {
166
+ const windowed = windowSize && windowSize > 0 ? data.slice(-windowSize) : data;
167
+ if (!polyline || decimate === false || width === 0) return windowed;
168
+ // Un punto cada dos píxeles: más no se ve y sí se paga.
169
+ const target = typeof decimate === 'number' ? decimate : Math.floor(width / 2);
170
+ if (windowed.length <= target) return windowed;
171
+ const lead = series.find(item => !hidden.includes(item.key))?.key ?? series[0]?.key;
172
+ const values = windowed.map(row => lead ? toNumber(row[lead]) : null);
173
+ return lttbIndices(values, target).map(index => windowed[index]);
174
+ }, [data, windowSize, polyline, decimate, width, series, hidden]);
175
+ const labels = useMemo(() => rows.map(row => String(row[xKey] ?? '')), [rows, xKey]);
176
+ const ids = useMemo(() => rows.map((row, index) => selectBy ? selectBy(row, index) : String(index)), [rows, selectBy]);
177
+
178
+ /**
179
+ * La selección se guarda por `id` y se resuelve contra las filas de ahora:
180
+ * si el dato se corrió, el resaltado lo sigue; si salió de la ventana,
181
+ * desaparece. Reusar el índice a ciegas señalaría el dato que quedó en ese
182
+ * lugar, que no es el que nadie eligió.
183
+ */
184
+ const selection = useMemo(() => {
185
+ if (!pick) return null;
186
+ const index = ids.indexOf(pick.id);
187
+ if (index === -1) return null;
188
+ const row = rows[index];
189
+ return {
190
+ ...pick,
191
+ index,
192
+ row,
193
+ label: labels[index] ?? pick.label,
194
+ value: toNumber(row[pick.seriesKey]) ?? pick.value
195
+ };
196
+ }, [pick, ids, rows, labels]);
197
+
198
+ // En torta las categorías son las filas; en el resto, las columnas. De eso
199
+ // dependen el color, la leyenda y qué apaga un toque en ella.
200
+ const palette = seriesPalette(theme, Math.max(1, isPie ? rows.length : series.length));
201
+ const entries = useMemo(() => isPie ? labels.map((label, index) => ({
202
+ key: label,
203
+ label,
204
+ color: series[0]?.color ?? palette[index] ?? theme.colors.primary
205
+ })) : series.map((item, index) => ({
206
+ key: item.key,
207
+ label: item.label ?? item.key,
208
+ color: item.color ?? palette[index] ?? theme.colors.primary
209
+ })), [isPie, labels, series, palette, theme.colors.primary]);
210
+ const visible = useMemo(() => entries.filter(entry => !hidden.includes(entry.key)), [entries, hidden]);
211
+ const duration_ = duration ?? theme.tokens.duration.slow * 2;
212
+ const applyHidden = useCallback(key => {
213
+ const next = hidden.includes(key) ? hidden.filter(k => k !== key) : [...hidden, key];
214
+ if (!hiddenIsControlled) setHidden(next);
215
+ onHiddenKeysChange?.(next);
216
+ }, [hidden, hiddenIsControlled, setHidden, onHiddenKeysChange]);
217
+
218
+ /**
219
+ * Los plots avisan qué se tocó —fila y serie— y la selección entera se
220
+ * arma acá: es el único lugar que conoce `selectBy`, las etiquetas y las
221
+ * filas de verdad, y así los tres no repiten el armado.
222
+ */
223
+ const applySelection = useCallback(hit => {
224
+ const row = hit ? rows[hit.index] : undefined;
225
+ const next = hit && row ? {
226
+ id: ids[hit.index] ?? String(hit.index),
227
+ index: hit.index,
228
+ row,
229
+ label: labels[hit.index] ?? '',
230
+ seriesKey: hit.seriesKey,
231
+ value: toNumber(row[hit.seriesKey]) ?? 0
232
+ } : null;
233
+ // Tocar lo ya elegido lo suelta: sin eso no habría forma de volver al
234
+ // chart entero sin tocar afuera, y "afuera" en una pantalla con scroll
235
+ // no siempre existe.
236
+ const same = next && selection && next.id === selection.id && next.seriesKey === selection.seriesKey;
237
+ const value = same ? null : next;
238
+ if (!selectionIsControlled) setPick(value);
239
+ onSelect?.(value);
240
+ }, [rows, ids, labels, selection, selectionIsControlled, setPick, onSelect]);
241
+ const onLayout = useCallback(event => setWidth(event.nativeEvent.layout.width), []);
242
+ const showLegend = legend === 'toggle' || legend === 'static' || legend === 'auto' && entries.length > 1;
243
+ const toggleable = legend === 'toggle' || legend === 'auto' && entries.length > 1;
244
+ const empty = rows.length === 0 || visible.length === 0;
245
+ const shared = {
246
+ rows,
247
+ labels,
248
+ entries,
249
+ visible,
250
+ width,
251
+ height,
252
+ formatValue,
253
+ animate,
254
+ duration: duration_,
255
+ selection,
256
+ onPick: applySelection,
257
+ tooltip,
258
+ testID
259
+ };
260
+ return /*#__PURE__*/_jsxs(View, {
261
+ style: [styles.root, style],
262
+ testID: testID,
263
+ accessible: false,
264
+ children: [filters && filters.length > 0 ? /*#__PURE__*/_jsx(View, {
265
+ style: styles.filters,
266
+ children: filters.map(filter => /*#__PURE__*/_jsx(SegmentedControl, {
267
+ options: filter.options,
268
+ value: filter.value,
269
+ onChange: filter.onChange,
270
+ testID: testID && `${testID}-filter-${filter.key}`
271
+ }, filter.key))
272
+ }) : null, /*#__PURE__*/_jsxs(View, {
273
+ style: [styles.plot, {
274
+ height
275
+ }],
276
+ onLayout: onLayout,
277
+ accessible: true,
278
+ accessibilityRole: "image",
279
+ accessibilityLabel: accessibilityLabel,
280
+ testID: testID && `${testID}-plot`,
281
+ children: [width === 0 || empty ? null : props.type === 'pie' || props.type === 'donut' ? /*#__PURE__*/_jsx(PiePlot, {
282
+ ...shared,
283
+ donut: props.type === 'donut',
284
+ innerRadius: props.innerRadius,
285
+ sliceLabels: props.sliceLabels ?? 'percent',
286
+ valueKey: series[0]?.key ?? ''
287
+ }) : props.type === 'radar' ? /*#__PURE__*/_jsx(RadarPlot, {
288
+ ...shared,
289
+ domain: props.domain,
290
+ levels: props.levels ?? 4,
291
+ fill: props.fill ?? true,
292
+ thickness: props.thickness ?? 2,
293
+ dots: props.dots ?? true
294
+ }) : /*#__PURE__*/_jsx(CartesianPlot, {
295
+ ...shared,
296
+ type: props.type,
297
+ orientation: props.type === 'bar' ? props.orientation ?? 'vertical' : 'vertical',
298
+ stacked: props.type === 'bar' || props.type === 'area' ? props.stacked ?? false : false,
299
+ barRadius: props.type === 'bar' ? props.barRadius ?? theme.tokens.radius.xs : 0,
300
+ smooth: props.type !== 'bar' ? props.smooth ?? false : false,
301
+ thickness: props.type !== 'bar' ? props.thickness ?? 2 : 0,
302
+ dots: props.type === 'line' ? props.dots ?? true : props.type === 'area' ? props.dots ?? false : false,
303
+ fillOpacity: props.type === 'area' ? props.fillOpacity ?? 0.22 : 0,
304
+ domain: props.domain,
305
+ grid: props.grid ?? true,
306
+ ticks: props.ticks ?? DEFAULT_TICKS,
307
+ xAxis: props.xAxis ?? true,
308
+ yAxis: props.yAxis ?? true
309
+ }), empty ? /*#__PURE__*/_jsx(View, {
310
+ style: styles.empty,
311
+ testID: testID && `${testID}-empty`,
312
+ children: /*#__PURE__*/_jsx(Text, {
313
+ allowFontScaling: allowFontScaling,
314
+ style: styles.emptyText,
315
+ children: emptyText ?? uiLabels.noResultsTitle
316
+ })
317
+ }) : null]
318
+ }), showLegend ? /*#__PURE__*/_jsx(Legend, {
319
+ items: entries,
320
+ hidden: hidden,
321
+ onToggle: toggleable ? applyHidden : undefined,
322
+ testID: testID && `${testID}-legend`
323
+ }) : null]
324
+ });
325
+ }
326
+ Chart.displayName = 'Chart';
327
+
328
+ // ── lo que comparten los tres plots ────────────────────────────────────────
329
+
330
+ /** Filas del tooltip para una categoría del eje x. */
331
+ function tooltipRowsAt(rows, index, visible, format) {
332
+ const row = rows[index];
333
+ if (!row) return [];
334
+ return visible.map(entry => {
335
+ const value = toNumber(row[entry.key]);
336
+ return value === null ? null : {
337
+ key: entry.key,
338
+ label: entry.label,
339
+ value: format(value),
340
+ color: entry.color
341
+ };
342
+ }).filter(item => item !== null);
343
+ }
344
+
345
+ // ── barras, línea y área ───────────────────────────────────────────────────
346
+
347
+ /** Ancho de una tira del relleno de área, en píxeles. Más fino = más vistas. */
348
+ const STRIP_WIDTH = 4;
349
+ const MAX_STRIPS = 140;
350
+ /** Aire entre dos barras del mismo grupo. */
351
+ const GROUP_GAP = 2;
352
+ const CartesianPlot = /*#__PURE__*/memo(props => {
353
+ const {
354
+ rows,
355
+ labels,
356
+ visible,
357
+ width,
358
+ height,
359
+ formatValue,
360
+ animate,
361
+ duration,
362
+ selection,
363
+ onPick,
364
+ tooltip,
365
+ testID,
366
+ type,
367
+ orientation,
368
+ stacked,
369
+ barRadius,
370
+ smooth,
371
+ thickness,
372
+ dots,
373
+ fillOpacity,
374
+ domain,
375
+ grid,
376
+ ticks: tickCount,
377
+ xAxis,
378
+ yAxis
379
+ } = props;
380
+ const theme = useTheme();
381
+ const horizontal = type === 'bar' && orientation === 'horizontal';
382
+ const keys = useMemo(() => visible.map(entry => entry.key), [visible]);
383
+ const bottomGutter = xAxis ? BOTTOM_GUTTER : 0;
384
+
385
+ // La línea puede no tocar el cero (una temperatura, un ranking); una barra
386
+ // sí tiene que hacerlo, porque su largo es el que dice el valor.
387
+ const measured = useMemo(() => extent(rows, keys, {
388
+ stacked,
389
+ includeZero: type !== 'line'
390
+ }), [rows, keys, stacked, type]);
391
+ const [low, high] = useDomain(measured, domain);
392
+
393
+ // Un dominio a mano se respeta tal cual; uno medido (o 'sticky') se
394
+ // redondea, que es lo que hace legible el eje.
395
+ const nice = useMemo(() => Array.isArray(domain) ? exactTicks(low, high, tickCount) : niceScale(low, high, tickCount), [domain, low, high, tickCount]);
396
+
397
+ /**
398
+ * El canal sale de la etiqueta más larga, no de una constante: con un
399
+ * `formatValue` propio ("$3000", "1.250 ms") un ancho fijo corta el número
400
+ * y el eje pasa a decir "$30…". Los ticks no dependen del ancho del plot,
401
+ * así que se pueden medir antes de repartirlo.
402
+ */
403
+ const leftGutter = useMemo(() => {
404
+ if (!yAxis) return 0;
405
+ if (horizontal) return CATEGORY_GUTTER;
406
+ const longest = nice.values.reduce((widest, value) => Math.max(widest, formatValue(value).length), 0);
407
+ const wanted = Math.ceil(longest * VALUE_CHAR) + theme.tokens.spacing.sm;
408
+ return Math.max(VALUE_GUTTER, Math.min(wanted, Math.floor(width * VALUE_GUTTER_MAX)));
409
+ }, [yAxis, horizontal, nice, formatValue, width, theme.tokens.spacing.sm]);
410
+ const plotW = Math.max(1, width - leftGutter);
411
+ const plotH = Math.max(1, height - bottomGutter);
412
+ const toPixel = useMemo(() => horizontal ? linearScale([nice.min, nice.max], [0, plotW]) : linearScale([nice.min, nice.max], [plotH, 0]), [horizontal, nice, plotW, plotH]);
413
+ const scale = useMemo(() => ({
414
+ nice,
415
+ toPixel
416
+ }), [nice, toPixel]);
417
+ const band = (horizontal ? plotH : plotW) / Math.max(1, rows.length);
418
+ const centerOf = useCallback(index => (index + 0.5) * band, [band]);
419
+ const baseline = scale.toPixel(clamp(0, scale.nice.min, scale.nice.max));
420
+ const stacks = useMemo(() => stacked ? rows.map(row => stackRow(row, keys)) : null, [stacked, rows, keys]);
421
+
422
+ /** Puntos de una serie: `to` es el valor, `from` el piso desde donde se rellena. */
423
+ const pointsFor = useCallback((key, edge) => {
424
+ const out = [];
425
+ rows.forEach((row, index) => {
426
+ if (stacks) {
427
+ const stackBand = stacks[index].find(item => item.key === key);
428
+ if (!stackBand) return;
429
+ out.push({
430
+ x: centerOf(index),
431
+ y: scale.toPixel(stackBand[edge])
432
+ });
433
+ return;
434
+ }
435
+ const value = toNumber(row[key]);
436
+ if (value === null) return;
437
+ out.push({
438
+ x: centerOf(index),
439
+ y: edge === 'to' ? scale.toPixel(value) : baseline
440
+ });
441
+ });
442
+ return out;
443
+ }, [rows, stacks, centerOf, scale, baseline]);
444
+ const pickAt = useCallback((index, event) => {
445
+ // Sobre qué serie cayó el dedo: la que tiene su marca más cerca del
446
+ // toque en el eje de valores. Con una sola serie es siempre esa.
447
+ const touch = (horizontal ? event?.nativeEvent?.locationX : event?.nativeEvent?.locationY) ?? 0;
448
+ let bestKey = keys[0] ?? '';
449
+ let bestDistance = Infinity;
450
+ for (const key of keys) {
451
+ const value = toNumber(rows[index]?.[key]);
452
+ if (value === null) continue;
453
+ const distance = Math.abs(scale.toPixel(value) - touch);
454
+ if (distance < bestDistance) {
455
+ bestDistance = distance;
456
+ bestKey = key;
457
+ }
458
+ }
459
+ onPick({
460
+ index,
461
+ seriesKey: bestKey
462
+ });
463
+ }, [horizontal, keys, rows, scale, onPick]);
464
+ const gridLines = scale.nice.values.map(value => scale.toPixel(value));
465
+ const zeroIndex = scale.nice.values.findIndex(value => value === 0);
466
+ const rowsForTooltip = selection ? tooltipRowsAt(rows, selection.index, visible, formatValue) : [];
467
+ const anchor = !selection ? null : horizontal ? {
468
+ x: leftGutter + Math.max(...visible.map(entry => scale.toPixel(toNumber(rows[selection.index]?.[entry.key]) ?? 0))),
469
+ y: centerOf(selection.index)
470
+ } : {
471
+ x: leftGutter + centerOf(selection.index),
472
+ y: Math.min(...visible.map(entry => scale.toPixel(toNumber(rows[selection.index]?.[entry.key]) ?? 0)))
473
+ };
474
+ return /*#__PURE__*/_jsxs(_Fragment, {
475
+ children: [/*#__PURE__*/_jsxs(View, {
476
+ style: {
477
+ position: 'absolute',
478
+ left: leftGutter,
479
+ top: 0,
480
+ width: plotW,
481
+ height: plotH
482
+ },
483
+ children: [grid ? /*#__PURE__*/_jsx(CartesianGrid, {
484
+ width: plotW,
485
+ height: plotH,
486
+ lines: gridLines,
487
+ orientation: horizontal ? 'vertical' : 'horizontal',
488
+ zeroIndex: zeroIndex === -1 ? undefined : zeroIndex,
489
+ testID: testID && `${testID}-grid`
490
+ }) : null, type === 'bar' ? rows.map((row, rowIndex) => {
491
+ const fill = band * BAND_FILL;
492
+ const slot = fill / (stacked ? 1 : Math.max(1, keys.length));
493
+ const bands = stacks ? stacks[rowIndex].filter(item => keys.includes(item.key)) : keys.map(key => {
494
+ const value = toNumber(row[key]);
495
+ return value === null ? null : {
496
+ key,
497
+ from: 0,
498
+ to: value,
499
+ value
500
+ };
501
+ }).filter(item => item !== null);
502
+ return bands.map(item => {
503
+ const seriesIndex = keys.indexOf(item.key);
504
+ const color = visible[seriesIndex]?.color ?? theme.colors.primary;
505
+ const start = centerOf(rowIndex) - fill / 2 + (stacked ? 0 : seriesIndex * slot);
506
+ const thicknessOfBar = Math.max(1, slot - (stacked || keys.length === 1 ? 0 : GROUP_GAP));
507
+ const near = scale.toPixel(item.from);
508
+ const far = scale.toPixel(item.to);
509
+ const size = Math.abs(far - near);
510
+ const positive = item.value >= 0;
511
+ const dim = !!selection && selection.index !== rowIndex;
512
+ return horizontal ? /*#__PURE__*/_jsx(Bar, {
513
+ x: positive ? near : plotW - near,
514
+ y: start,
515
+ width: size,
516
+ height: thicknessOfBar,
517
+ from: positive ? 'left' : 'right',
518
+ color: color,
519
+ radius: barRadius,
520
+ dim: dim,
521
+ animate: animate,
522
+ duration: duration,
523
+ testID: testID && `${testID}-bar-${rowIndex}-${item.key}`
524
+ }, `${rowIndex}-${item.key}`) : /*#__PURE__*/_jsx(Bar, {
525
+ x: start,
526
+ y: positive ? plotH - near : near,
527
+ width: thicknessOfBar,
528
+ height: size,
529
+ from: positive ? 'bottom' : 'top',
530
+ color: color,
531
+ radius: barRadius,
532
+ dim: dim,
533
+ animate: animate,
534
+ duration: duration,
535
+ testID: testID && `${testID}-bar-${rowIndex}-${item.key}`
536
+ }, `${rowIndex}-${item.key}`);
537
+ });
538
+ }) : visible.map(entry => {
539
+ const raw = pointsFor(entry.key, 'to');
540
+ const line = smooth ? smoothPoints(raw) : raw;
541
+ const base = smooth ? smoothPoints(pointsFor(entry.key, 'from')) : pointsFor(entry.key, 'from');
542
+ const stripCount = Math.min(MAX_STRIPS, Math.max(8, Math.round(plotW / STRIP_WIDTH)));
543
+ const stripWidth = plotW / stripCount;
544
+ return /*#__PURE__*/_jsxs(View, {
545
+ style: {
546
+ position: 'absolute',
547
+ left: 0,
548
+ top: 0,
549
+ width: plotW,
550
+ height: plotH
551
+ },
552
+ children: [type === 'area' ?
553
+ /*#__PURE__*/
554
+ // La opacidad va en el grupo, no en cada tira: el medio
555
+ // píxel de solape que tapa la costura del antialias se
556
+ // compone dos veces y deja una raya vertical cada cuatro
557
+ // píxeles. Atenuado el grupo entero, se pinta una sola vez.
558
+ _jsx(View, {
559
+ pointerEvents: "none",
560
+ style: {
561
+ position: 'absolute',
562
+ left: 0,
563
+ top: 0,
564
+ width: plotW,
565
+ height: plotH,
566
+ opacity: fillOpacity
567
+ },
568
+ children: Array.from({
569
+ length: stripCount
570
+ }, (_, strip) => {
571
+ const x = (strip + 0.5) * stripWidth;
572
+ const top = sampleY(line, x);
573
+ const bottom = sampleY(base, x);
574
+ if (top === null || bottom === null) return null;
575
+ return /*#__PURE__*/_jsx(View, {
576
+ style: {
577
+ position: 'absolute',
578
+ left: strip * stripWidth,
579
+ width: stripWidth + 0.5,
580
+ top: Math.min(top, bottom),
581
+ height: Math.abs(bottom - top),
582
+ backgroundColor: entry.color
583
+ }
584
+ }, strip);
585
+ })
586
+ }) : null, /*#__PURE__*/_jsx(Polyline, {
587
+ points: line,
588
+ color: entry.color,
589
+ thickness: thickness,
590
+ testID: testID && `${testID}-line-${entry.key}`
591
+ }), dots ? raw.map((point, index) => /*#__PURE__*/_jsx(Dot, {
592
+ point: point,
593
+ color: entry.color,
594
+ ringColor: theme.colors.surface,
595
+ size: selection?.index === index ? 8 : 6,
596
+ testID: testID && `${testID}-dot-${entry.key}-${index}`
597
+ }, index)) : null]
598
+ }, entry.key);
599
+ }), rows.map((row, index) => /*#__PURE__*/_jsx(Pressable, {
600
+ onPress: event => pickAt(index, event),
601
+ accessibilityRole: "button",
602
+ accessibilityState: {
603
+ selected: selection?.index === index
604
+ },
605
+ accessibilityLabel: [labels[index], ...tooltipRowsAt(rows, index, visible, formatValue).map(item => `${item.label} ${item.value}`)].join(', '),
606
+ style: horizontal ? {
607
+ position: 'absolute',
608
+ left: 0,
609
+ width: plotW,
610
+ top: index * band,
611
+ height: band
612
+ } : {
613
+ position: 'absolute',
614
+ top: 0,
615
+ height: plotH,
616
+ left: index * band,
617
+ width: band
618
+ },
619
+ testID: testID && `${testID}-band-${index}`
620
+ }, index))]
621
+ }), yAxis ? /*#__PURE__*/_jsx(View, {
622
+ style: {
623
+ position: 'absolute',
624
+ left: 0,
625
+ top: 0,
626
+ width: leftGutter,
627
+ height: plotH
628
+ },
629
+ children: /*#__PURE__*/_jsx(AxisLabels, {
630
+ axis: "y",
631
+ gutter: Math.max(0, leftGutter - 6),
632
+ span: plotH,
633
+ labels: horizontal ? labels.map((text, index) => ({
634
+ text,
635
+ position: centerOf(index)
636
+ })) : scale.nice.values.map(value => ({
637
+ text: formatValue(value),
638
+ position: scale.toPixel(value)
639
+ })),
640
+ testID: testID && `${testID}-y-axis`
641
+ })
642
+ }) : null, xAxis ? /*#__PURE__*/_jsx(View, {
643
+ style: {
644
+ position: 'absolute',
645
+ left: leftGutter,
646
+ top: plotH + 2,
647
+ width: plotW,
648
+ height: bottomGutter
649
+ },
650
+ children: /*#__PURE__*/_jsx(AxisLabels, {
651
+ axis: "x",
652
+ gutter: 0,
653
+ span: plotW,
654
+ labels: horizontal ? scale.nice.values.map(value => ({
655
+ text: formatValue(value),
656
+ position: scale.toPixel(value)
657
+ })) : labels.map((text, index) => ({
658
+ text,
659
+ position: centerOf(index)
660
+ })),
661
+ testID: testID && `${testID}-x-axis`
662
+ })
663
+ }) : null, tooltip && selection && anchor && rowsForTooltip.length > 0 ? /*#__PURE__*/_jsx(Tooltip, {
664
+ title: selection.label,
665
+ rows: rowsForTooltip,
666
+ anchor: anchor,
667
+ containerWidth: width,
668
+ testID: testID && `${testID}-tooltip`
669
+ }) : null]
670
+ });
671
+ });
672
+ CartesianPlot.displayName = 'CartesianPlot';
673
+
674
+ // ── torta y dona ───────────────────────────────────────────────────────────
675
+
676
+ const DONUT_RADIUS = 0.6;
677
+ /** Cuánto sale la porción elegida, en píxeles. */
678
+ const EXPLODE = 8;
679
+ /** Dónde cae la etiqueta, como fracción entre el agujero y el borde. */
680
+ const LABEL_AT = 0.62;
681
+
682
+ /** Blanco o negro, el que se lea encima del color. Un color raro no rompe: cae en `text`. */
683
+ function inkOn(background, theme) {
684
+ try {
685
+ return contrast(background, theme.colors.white) >= contrast(background, theme.colors.black) ? theme.colors.white : theme.colors.black;
686
+ } catch {
687
+ return theme.colors.text;
688
+ }
689
+ }
690
+ const PiePlot = /*#__PURE__*/memo(props => {
691
+ const {
692
+ rows,
693
+ labels,
694
+ entries,
695
+ visible,
696
+ width,
697
+ height,
698
+ formatValue,
699
+ selection,
700
+ onPick,
701
+ tooltip,
702
+ testID,
703
+ donut,
704
+ innerRadius,
705
+ sliceLabels,
706
+ valueKey
707
+ } = props;
708
+ const theme = useTheme();
709
+ const styles = useStyles();
710
+ const allowFontScaling = useAllowFontScaling();
711
+ const center = {
712
+ x: width / 2,
713
+ y: height / 2
714
+ };
715
+ const radius = Math.max(0, Math.min(width, height) / 2 - 2);
716
+ const hole = clamp(innerRadius ?? (donut ? DONUT_RADIUS : 0), 0, 0.9) * radius;
717
+ const arcs = useMemo(() => {
718
+ // Una categoría apagada vale 0: sale de la torta y el resto se reparte el
719
+ // 100%, que es lo que espera quien la apagó desde la leyenda.
720
+ const values = rows.map((row, index) => visible.some(entry => entry.key === labels[index]) ? toNumber(row[valueKey]) ?? 0 : 0);
721
+ return arcsFor(values);
722
+ }, [rows, labels, visible, valueKey]);
723
+ const pickAt = useCallback(event => {
724
+ const point = {
725
+ x: event?.nativeEvent?.locationX ?? 0,
726
+ y: event?.nativeEvent?.locationY ?? 0
727
+ };
728
+ const distance = Math.hypot(point.x - center.x, point.y - center.y);
729
+ // El agujero de una dona no es parte de ninguna porción, y afuera del
730
+ // círculo tampoco: los dos sueltan la selección.
731
+ if (distance > radius || distance < hole) return onPick(null);
732
+ const index = arcAt(arcs, angleOf(center, point));
733
+ if (index === -1) return onPick(null);
734
+ onPick({
735
+ index,
736
+ seriesKey: labels[index] ?? ''
737
+ });
738
+ }, [center.x, center.y, radius, hole, arcs, labels, onPick]);
739
+ const chosen = selection ? arcs.find(arc => arc.index === selection.index) : undefined;
740
+ return /*#__PURE__*/_jsxs(_Fragment, {
741
+ children: [arcs.map(arc => {
742
+ const dim = !!selection && selection.index !== arc.index;
743
+ return /*#__PURE__*/_jsx(Wedge, {
744
+ size: radius * 2,
745
+ center: center,
746
+ start: arc.start,
747
+ sweep: arc.sweep,
748
+ color: entries[arc.index]?.color ?? theme.colors.primary,
749
+ opacity: dim ? DIM_OPACITY : 1,
750
+ explode: selection?.index === arc.index ? EXPLODE : 0,
751
+ testID: testID && `${testID}-slice-${arc.index}`
752
+ }, arc.index);
753
+ }), hole > 0 ? /*#__PURE__*/_jsx(View, {
754
+ pointerEvents: "none",
755
+ style: {
756
+ position: 'absolute',
757
+ left: center.x - hole,
758
+ top: center.y - hole,
759
+ width: hole * 2,
760
+ height: hole * 2,
761
+ borderRadius: hole,
762
+ backgroundColor: theme.colors.surface
763
+ }
764
+ }) : null, sliceLabels === 'none' ? null : arcs.map(arc => {
765
+ // Una porción muy fina no tiene dónde escribir: la etiqueta se
766
+ // saldría encima de las vecinas y no se leería ninguna.
767
+ if (arc.sweep < 18) return null;
768
+ const at = polar(center, hole + (radius - hole) * LABEL_AT, arc.start + arc.sweep / 2);
769
+ const color = entries[arc.index]?.color ?? theme.colors.primary;
770
+ return /*#__PURE__*/_jsx(Text, {
771
+ allowFontScaling: allowFontScaling,
772
+ style: [styles.sliceLabel, {
773
+ left: at.x - 28,
774
+ top: at.y - 8,
775
+ width: 56,
776
+ color: inkOn(color, theme)
777
+ }],
778
+ testID: testID && `${testID}-slice-label-${arc.index}`,
779
+ children: sliceLabels === 'percent' ? `${Math.round(arc.ratio * 100)}%` : formatValue(arc.value)
780
+ }, arc.index);
781
+ }), /*#__PURE__*/_jsx(Pressable, {
782
+ onPress: pickAt,
783
+ accessibilityRole: "adjustable",
784
+ accessibilityLabel: arcs.map(arc => `${labels[arc.index]} ${Math.round(arc.ratio * 100)}%`).join(', '),
785
+ style: {
786
+ position: 'absolute',
787
+ left: 0,
788
+ top: 0,
789
+ width,
790
+ height
791
+ },
792
+ testID: testID && `${testID}-hit`
793
+ }), tooltip && selection && chosen ? /*#__PURE__*/_jsx(Tooltip, {
794
+ title: selection.label,
795
+ rows: [{
796
+ key: selection.seriesKey,
797
+ label: `${Math.round(chosen.ratio * 100)}%`,
798
+ value: formatValue(selection.value),
799
+ color: entries[selection.index]?.color ?? theme.colors.primary
800
+ }],
801
+ anchor: polar(center, radius * 0.9, chosen.start + chosen.sweep / 2),
802
+ containerWidth: width,
803
+ testID: testID && `${testID}-tooltip`
804
+ }) : null]
805
+ });
806
+ });
807
+ PiePlot.displayName = 'PiePlot';
808
+
809
+ // ── radar ──────────────────────────────────────────────────────────────────
810
+
811
+ /** Tiras por lado del polígono cuando se rellena. Más = borde más limpio, más vistas. */
812
+ const RADAR_STEPS = 5;
813
+ const RADAR_FILL_OPACITY = 0.18;
814
+ const RADAR_LABEL_WIDTH = 56;
815
+ const RadarPlot = /*#__PURE__*/memo(props => {
816
+ const {
817
+ rows,
818
+ labels,
819
+ visible,
820
+ width,
821
+ height,
822
+ formatValue,
823
+ selection,
824
+ onPick,
825
+ tooltip,
826
+ testID,
827
+ domain,
828
+ levels,
829
+ fill,
830
+ thickness,
831
+ dots
832
+ } = props;
833
+ const theme = useTheme();
834
+ const styles = useStyles();
835
+ const allowFontScaling = useAllowFontScaling();
836
+ const center = {
837
+ x: width / 2,
838
+ y: height / 2
839
+ };
840
+ const radius = Math.max(0, Math.min(width, height) / 2 - RADAR_INSET);
841
+ const angles = useMemo(() => radarAngles(rows.length), [rows.length]);
842
+ const keys = useMemo(() => visible.map(entry => entry.key), [visible]);
843
+
844
+ // El radar mide desde el centro, y el centro es 0: un mínimo distinto de
845
+ // cero haría que dos valores parecidos se vean lejísimos.
846
+ const measured = useMemo(() => [0, extent(rows, keys, {
847
+ includeZero: true
848
+ })[1]], [rows, keys]);
849
+ const [, top] = useDomain(measured, domain);
850
+ const scale = useMemo(() => {
851
+ const nice = Array.isArray(domain) ? exactTicks(0, top, levels) : niceScale(0, top, levels);
852
+ return {
853
+ nice,
854
+ toRadius: linearScale([0, nice.max], [0, radius])
855
+ };
856
+ }, [domain, top, levels, radius]);
857
+ const pointsOf = useCallback(key => rows.map((row, index) => polar(center, scale.toRadius(Math.max(0, toNumber(row[key]) ?? 0)), angles[index] ?? 0)), [rows, center, scale, angles]);
858
+ const pickAt = useCallback(event => {
859
+ if (rows.length === 0) return;
860
+ const angle = angleOf(center, {
861
+ x: event?.nativeEvent?.locationX ?? 0,
862
+ y: event?.nativeEvent?.locationY ?? 0
863
+ });
864
+ const index = Math.round(angle / (360 / rows.length)) % rows.length;
865
+ const key = keys[0] ?? '';
866
+ onPick({
867
+ index,
868
+ seriesKey: key
869
+ });
870
+ }, [rows, center, keys, onPick]);
871
+ return /*#__PURE__*/_jsxs(_Fragment, {
872
+ children: [/*#__PURE__*/_jsx(RadarGrid, {
873
+ center: center,
874
+ radius: radius,
875
+ angles: angles,
876
+ levels: levels,
877
+ testID: testID && `${testID}-grid`
878
+ }), visible.map(entry => {
879
+ const points = pointsOf(entry.key);
880
+ return /*#__PURE__*/_jsxs(View, {
881
+ style: {
882
+ position: 'absolute',
883
+ left: 0,
884
+ top: 0,
885
+ width,
886
+ height
887
+ },
888
+ children: [fill ?
889
+ /*#__PURE__*/
890
+ // La opacidad va en el grupo, no en cada tira. Por tira, el
891
+ // solape de 0.4° que tapa la costura del antialias se compone
892
+ // dos veces y deja un radio más oscuro por corte: el relleno
893
+ // termina pareciendo una telaraña. Aplicada al grupo, las tiras
894
+ // se pintan opacas entre sí y el conjunto se atenúa una vez.
895
+ _jsx(View, {
896
+ pointerEvents: "none",
897
+ style: {
898
+ position: 'absolute',
899
+ left: 0,
900
+ top: 0,
901
+ width,
902
+ height,
903
+ opacity: RADAR_FILL_OPACITY
904
+ },
905
+ testID: testID && `${testID}-fill-${entry.key}`,
906
+ children: fanStrips(center, points, RADAR_STEPS).map((strip, index) => /*#__PURE__*/_jsx(Wedge, {
907
+ size: strip.radius * 2,
908
+ center: center,
909
+ start: strip.start,
910
+ sweep: strip.sweep,
911
+ color: entry.color
912
+ }, index))
913
+ }) : null, /*#__PURE__*/_jsx(Polyline, {
914
+ points: points,
915
+ color: entry.color,
916
+ thickness: thickness,
917
+ closed: true,
918
+ testID: testID && `${testID}-outline-${entry.key}`
919
+ }), dots ? points.map((point, index) => /*#__PURE__*/_jsx(Dot, {
920
+ point: point,
921
+ color: entry.color,
922
+ ringColor: theme.colors.surface,
923
+ size: selection?.index === index ? 8 : 6
924
+ }, index)) : null]
925
+ }, entry.key);
926
+ }), labels.map((label, index) => {
927
+ const at = polar(center, radius + RADAR_INSET / 2, angles[index] ?? 0);
928
+ return /*#__PURE__*/_jsx(Text, {
929
+ numberOfLines: 1,
930
+ allowFontScaling: allowFontScaling,
931
+ style: [styles.radarAxisLabel, {
932
+ left: at.x - RADAR_LABEL_WIDTH / 2,
933
+ top: at.y - 7,
934
+ width: RADAR_LABEL_WIDTH
935
+ }, selection?.index === index && {
936
+ color: theme.colors.text
937
+ }],
938
+ testID: testID && `${testID}-axis-${index}`,
939
+ children: label
940
+ }, `${label}-${index}`);
941
+ }), /*#__PURE__*/_jsx(Pressable, {
942
+ onPress: pickAt,
943
+ accessibilityRole: "adjustable",
944
+ accessibilityLabel: labels.join(', '),
945
+ style: {
946
+ position: 'absolute',
947
+ left: 0,
948
+ top: 0,
949
+ width,
950
+ height
951
+ },
952
+ testID: testID && `${testID}-hit`
953
+ }), tooltip && selection ? /*#__PURE__*/_jsx(Tooltip, {
954
+ title: selection.label,
955
+ rows: tooltipRowsAt(rows, selection.index, visible, formatValue),
956
+ anchor: polar(center, radius, angles[selection.index] ?? 0),
957
+ containerWidth: width,
958
+ testID: testID && `${testID}-tooltip`
959
+ }) : null]
960
+ });
961
+ });
962
+ RadarPlot.displayName = 'RadarPlot';
963
+ //# sourceMappingURL=Chart.js.map