@adecore/charts 0.41.0 → 0.42.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.
- package/dist/Root.d.ts +3 -1
- package/dist/Root.js +410 -339
- package/dist/annotations.js +210 -85
- package/dist/axes.d.ts +3 -2
- package/dist/axes.js +541 -74
- package/dist/band.d.ts +2 -0
- package/dist/band.js +10 -0
- package/dist/context.d.ts +3 -0
- package/dist/cursor.d.ts +1 -1
- package/dist/cursor.js +5 -4
- package/dist/locales/en.d.ts +1 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/nl.d.ts +1 -0
- package/dist/locales/nl.js +1 -0
- package/dist/overlays.js +204 -132
- package/dist/series.d.ts +4 -4
- package/dist/series.js +329 -195
- package/dist/store.d.ts +2 -0
- package/dist/store.js +2 -1
- package/package.json +3 -3
- package/src/Root.tsx +137 -44
- package/src/annotations.tsx +31 -4
- package/src/axes.tsx +182 -6
- package/src/band.ts +13 -0
- package/src/context.ts +9 -0
- package/src/cursor.ts +12 -4
- package/src/locales/en.ts +1 -0
- package/src/locales/nl.ts +1 -0
- package/src/overlays.tsx +51 -1
- package/src/series.tsx +144 -28
- package/src/store.ts +5 -1
package/dist/band.js
CHANGED
|
@@ -136,8 +136,18 @@ export function endRoundedColumn(x, y, width, height, radius, upward) {
|
|
|
136
136
|
}
|
|
137
137
|
return `M${x},${y}H${x + width}V${y + height - corner}A${corner},${corner} 0 0 1 ${x + width - corner},${y + height}H${x + corner}A${corner},${corner} 0 0 1 ${x},${y + height - corner}Z`;
|
|
138
138
|
}
|
|
139
|
+
/* The outline of a bar of a horizontal chart rounded only at its end away from the ground: the right for a value rightward, else the left. */
|
|
140
|
+
export function endRoundedBar(x, y, width, height, radius, rightward) {
|
|
141
|
+
const corner = Math.max(0, Math.min(radius, width, height / 2));
|
|
142
|
+
if (rightward) {
|
|
143
|
+
return `M${x},${y}H${x + width - corner}A${corner},${corner} 0 0 1 ${x + width},${y + corner}V${y + height - corner}A${corner},${corner} 0 0 1 ${x + width - corner},${y + height}H${x}Z`;
|
|
144
|
+
}
|
|
145
|
+
return `M${x + width},${y}V${y + height}H${x + corner}A${corner},${corner} 0 0 1 ${x},${y + height - corner}V${y + corner}A${corner},${corner} 0 0 1 ${x + corner},${y}Z`;
|
|
146
|
+
}
|
|
139
147
|
/* Between the top of a column and the baseline of its value. */
|
|
140
148
|
export const LABEL_LIFT = 10;
|
|
149
|
+
/* Between the end of a bar of a horizontal chart and the start of its value. */
|
|
150
|
+
export const LABEL_INSET = 6;
|
|
141
151
|
/* The height of a row of labels and what a label is taken to measure per character until it has been drawn once, per size. */
|
|
142
152
|
const LABEL_SIZES = {
|
|
143
153
|
'2xs': {
|
package/dist/context.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface ChartSlots {
|
|
|
11
11
|
readonly left: SVGGElement | null;
|
|
12
12
|
readonly right: SVGGElement | null;
|
|
13
13
|
readonly rules: SVGGElement | null;
|
|
14
|
+
readonly rows: HTMLElement | null;
|
|
14
15
|
}
|
|
15
16
|
export interface ChartContextValue {
|
|
16
17
|
readonly store: ChartStore;
|
|
@@ -18,6 +19,8 @@ export interface ChartContextValue {
|
|
|
18
19
|
readonly data: readonly unknown[];
|
|
19
20
|
readonly xs: readonly ChartX[];
|
|
20
21
|
readonly xScale: ChartXScale;
|
|
22
|
+
readonly horizontal: boolean;
|
|
23
|
+
readonly valueRoom: number;
|
|
21
24
|
readonly height: number;
|
|
22
25
|
readonly plot: ChartRect;
|
|
23
26
|
readonly width: number;
|
package/dist/cursor.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare function nearestIndex(xs: readonly number[], x: number): number;
|
|
|
3
3
|
export declare function containingIndex(xs: readonly number[], at: number, step?: number): number;
|
|
4
4
|
export declare function keyIndexOf(xs: readonly ChartX[], x: ChartX): number;
|
|
5
5
|
export declare function snapIndex(xs: readonly ChartX[], scale: ChartXScale, x: ChartX | null, step?: number): number;
|
|
6
|
-
export declare function moveIndex(key: string, current: number, count: number, groupStarts?: readonly number[]): number | null | undefined;
|
|
6
|
+
export declare function moveIndex(key: string, current: number, count: number, groupStarts?: readonly number[], along?: 'columns' | 'rows'): number | null | undefined;
|
package/dist/cursor.js
CHANGED
|
@@ -64,16 +64,17 @@ export function snapIndex(xs, scale, x, step = 0) {
|
|
|
64
64
|
/*
|
|
65
65
|
* Where a key moves the cursor: the arrows step a bucket, Home and End go to the ends, Page Up and Page
|
|
66
66
|
* Down to the first bucket of the previous or the next group. `null` clears the cursor, `undefined`
|
|
67
|
-
* leaves the key to the page.
|
|
67
|
+
* leaves the key to the page. Buckets in `rows` step with Up and Down and leave Left and Right to the page.
|
|
68
68
|
*/
|
|
69
|
-
export function moveIndex(key, current, count, groupStarts = []) {
|
|
69
|
+
export function moveIndex(key, current, count, groupStarts = [], along = 'columns') {
|
|
70
70
|
if (count === 0) {
|
|
71
71
|
return undefined;
|
|
72
72
|
}
|
|
73
|
+
const [previous, next] = along === 'rows' ? ['ArrowUp', 'ArrowDown'] : ['ArrowLeft', 'ArrowRight'];
|
|
73
74
|
switch (key) {
|
|
74
|
-
case
|
|
75
|
+
case next:
|
|
75
76
|
return current < 0 ? 0 : Math.min(count - 1, current + 1);
|
|
76
|
-
case
|
|
77
|
+
case previous:
|
|
77
78
|
return current < 0 ? count - 1 : Math.max(0, current - 1);
|
|
78
79
|
case 'Home':
|
|
79
80
|
return 0;
|
package/dist/locales/en.d.ts
CHANGED
package/dist/locales/en.js
CHANGED
|
@@ -25,6 +25,7 @@ export default {
|
|
|
25
25
|
},
|
|
26
26
|
keyboard: {
|
|
27
27
|
move: 'Arrow keys move between values, Home and End go to the ends, Escape clears.',
|
|
28
|
+
rows: 'Up and Down move between rows, Home and End go to the first and the last, Escape clears.',
|
|
28
29
|
points: 'Left and Right move along a series, Up and Down to the next series, Home and End to its ends, Escape clears.',
|
|
29
30
|
groups: 'Page Up and Page Down move between groups.',
|
|
30
31
|
activate: 'Enter or Space picks a value.'
|
package/dist/locales/nl.d.ts
CHANGED
package/dist/locales/nl.js
CHANGED
|
@@ -25,6 +25,7 @@ export default {
|
|
|
25
25
|
},
|
|
26
26
|
keyboard: {
|
|
27
27
|
move: 'Pijltjestoetsen gaan langs de waarden, Home en End naar het begin en het eind, Escape wist.',
|
|
28
|
+
rows: 'Omhoog en omlaag gaan langs de rijen, Home en End naar de eerste en de laatste, Escape wist.',
|
|
28
29
|
points: 'Links en rechts gaan langs een reeks, omhoog en omlaag naar de volgende reeks, Home en End naar de uiteinden, Escape wist.',
|
|
29
30
|
groups: 'Page Up en Page Down gaan naar de vorige of volgende groep.',
|
|
30
31
|
activate: 'Enter of spatie kiest een waarde.'
|
package/dist/overlays.js
CHANGED
|
@@ -30,6 +30,64 @@ const bucketOf = (chart, index) => ({
|
|
|
30
30
|
}),
|
|
31
31
|
notes: chart.notesAt(index)
|
|
32
32
|
});
|
|
33
|
+
/*
|
|
34
|
+
* Where the card stands in a horizontal chart. Beside the cursor, it follows the end of the row's longest bar and its
|
|
35
|
+
* value, or goes over or under the row where that leaves no room. In a corner, it moves to the other end of the plot
|
|
36
|
+
* where it would cover the row.
|
|
37
|
+
*/
|
|
38
|
+
function rowPlace(chart, placement, card) {
|
|
39
|
+
const {
|
|
40
|
+
activeIndex,
|
|
41
|
+
plot,
|
|
42
|
+
leftAxis,
|
|
43
|
+
box,
|
|
44
|
+
height
|
|
45
|
+
} = chart;
|
|
46
|
+
const row = chart.bucketAt(activeIndex) ?? {
|
|
47
|
+
left: plot.top,
|
|
48
|
+
width: 0
|
|
49
|
+
};
|
|
50
|
+
const plotLeft = leftAxis + plot.left;
|
|
51
|
+
const plotRight = leftAxis + plot.right + chart.valueRoom;
|
|
52
|
+
if (placement !== 'cursor') {
|
|
53
|
+
const [vertical, horizontal] = placement.split('-');
|
|
54
|
+
const coversTop = row.left < plot.top + card.height;
|
|
55
|
+
const coversBottom = row.left + row.width > plot.bottom - card.height;
|
|
56
|
+
const side = vertical === 'top' ? coversTop && !coversBottom ? 'bottom' : 'top' : coversBottom && !coversTop ? 'top' : 'bottom';
|
|
57
|
+
return {
|
|
58
|
+
...(horizontal === 'left' ? {
|
|
59
|
+
left: Math.round(plotLeft)
|
|
60
|
+
} : {
|
|
61
|
+
right: Math.round(box - plotRight)
|
|
62
|
+
}),
|
|
63
|
+
top: side === 'top' ? Math.round(plot.top) : Math.round(plot.bottom - card.height),
|
|
64
|
+
maxWidth: Math.max(0, Math.round(plotRight - plotLeft))
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const ends = [...chart.series].flatMap(([id]) => {
|
|
68
|
+
const top = chart.stacked.get(id)?.top[activeIndex];
|
|
69
|
+
const pixel = top === null || top === undefined ? null : chart.pixelOfY(top);
|
|
70
|
+
return pixel === null ? [] : [pixel];
|
|
71
|
+
});
|
|
72
|
+
const end = leftAxis + Math.max(plot.left, ...ends) + chart.valueRoom + OFFSET;
|
|
73
|
+
if (end + card.width <= box - EDGE) {
|
|
74
|
+
const center = row.left + row.width / 2;
|
|
75
|
+
return {
|
|
76
|
+
left: Math.round(end),
|
|
77
|
+
top: Math.round(Math.max(0, Math.min(height - card.height, center - card.height / 2)))
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const below = row.left + row.width / 2 < height / 2;
|
|
81
|
+
return {
|
|
82
|
+
left: Math.round(plotLeft),
|
|
83
|
+
maxWidth: Math.max(0, Math.round(box - plotLeft - EDGE)),
|
|
84
|
+
...(below ? {
|
|
85
|
+
top: Math.round(row.left + row.width + EDGE)
|
|
86
|
+
} : {
|
|
87
|
+
bottom: Math.round(height - row.left + EDGE)
|
|
88
|
+
})
|
|
89
|
+
};
|
|
90
|
+
}
|
|
33
91
|
/* The swatch of a series: its icon in its color, else a dash for a line and a square for a column. */
|
|
34
92
|
function Swatch(t0) {
|
|
35
93
|
const $ = _c(15);
|
|
@@ -141,7 +199,7 @@ function NoteSwatch(t0) {
|
|
|
141
199
|
}
|
|
142
200
|
/* The card at the cursor: the x of the bucket, a row per series, then its markers and bands. */
|
|
143
201
|
export function ChartTooltip(t0) {
|
|
144
|
-
const $ = _c(
|
|
202
|
+
const $ = _c(76);
|
|
145
203
|
const {
|
|
146
204
|
total: t1,
|
|
147
205
|
format,
|
|
@@ -187,126 +245,140 @@ export function ChartTooltip(t0) {
|
|
|
187
245
|
}
|
|
188
246
|
const pixel = chart.leftAxis + t9 - chart.scroll;
|
|
189
247
|
let place;
|
|
190
|
-
if (
|
|
248
|
+
if (chart.horizontal) {
|
|
191
249
|
let t10;
|
|
192
|
-
if ($[22] !==
|
|
193
|
-
t10 =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
left: Math.round(pixel + OFFSET),
|
|
198
|
-
maxWidth: Math.max(0, Math.round(chart.box - pixel - OFFSET - EDGE))
|
|
199
|
-
};
|
|
200
|
-
$[22] = chart.box;
|
|
201
|
-
$[23] = pixel;
|
|
202
|
-
$[24] = t10;
|
|
203
|
-
} else {
|
|
204
|
-
t10 = $[24];
|
|
205
|
-
}
|
|
206
|
-
const t11 = position === null || position === undefined ? chart.plot.top : Math.max(0, Math.round(position[1]) - OFFSET);
|
|
207
|
-
let t12;
|
|
208
|
-
if ($[25] !== t10 || $[26] !== t11) {
|
|
209
|
-
t12 = {
|
|
210
|
-
...t10,
|
|
211
|
-
top: t11
|
|
212
|
-
};
|
|
250
|
+
if ($[22] !== card || $[23] !== chart || $[24] !== placement) {
|
|
251
|
+
t10 = rowPlace(chart, placement, card);
|
|
252
|
+
$[22] = card;
|
|
253
|
+
$[23] = chart;
|
|
254
|
+
$[24] = placement;
|
|
213
255
|
$[25] = t10;
|
|
214
|
-
$[26] = t11;
|
|
215
|
-
$[27] = t12;
|
|
216
256
|
} else {
|
|
217
|
-
|
|
257
|
+
t10 = $[25];
|
|
218
258
|
}
|
|
219
|
-
place =
|
|
259
|
+
place = t10;
|
|
220
260
|
} else {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
const side_0 = t11;
|
|
253
|
-
let t12;
|
|
254
|
-
if ($[39] !== chart.box || $[40] !== plotLeft || $[41] !== plotRight || $[42] !== side_0) {
|
|
255
|
-
t12 = side_0 === "left" ? {
|
|
256
|
-
left: Math.round(plotLeft)
|
|
257
|
-
} : {
|
|
258
|
-
right: Math.round(chart.box - plotRight)
|
|
259
|
-
};
|
|
260
|
-
$[39] = chart.box;
|
|
261
|
-
$[40] = plotLeft;
|
|
262
|
-
$[41] = plotRight;
|
|
263
|
-
$[42] = side_0;
|
|
264
|
-
$[43] = t12;
|
|
265
|
-
} else {
|
|
266
|
-
t12 = $[43];
|
|
267
|
-
}
|
|
268
|
-
let t13;
|
|
269
|
-
if ($[44] !== card.height || $[45] !== chart.plot.bottom || $[46] !== chart.plot.top || $[47] !== vertical) {
|
|
270
|
-
t13 = vertical === "top" ? Math.round(chart.plot.top) : Math.round(chart.plot.bottom - card.height);
|
|
271
|
-
$[44] = card.height;
|
|
272
|
-
$[45] = chart.plot.bottom;
|
|
273
|
-
$[46] = chart.plot.top;
|
|
274
|
-
$[47] = vertical;
|
|
275
|
-
$[48] = t13;
|
|
276
|
-
} else {
|
|
277
|
-
t13 = $[48];
|
|
278
|
-
}
|
|
279
|
-
let t14;
|
|
280
|
-
if ($[49] !== plotLeft || $[50] !== plotRight) {
|
|
281
|
-
t14 = Math.round(plotRight - plotLeft);
|
|
282
|
-
$[49] = plotLeft;
|
|
283
|
-
$[50] = plotRight;
|
|
284
|
-
$[51] = t14;
|
|
285
|
-
} else {
|
|
286
|
-
t14 = $[51];
|
|
287
|
-
}
|
|
288
|
-
const t15 = Math.max(0, t14);
|
|
289
|
-
let t16;
|
|
290
|
-
if ($[52] !== t12 || $[53] !== t13 || $[54] !== t15) {
|
|
291
|
-
t16 = {
|
|
292
|
-
...t12,
|
|
293
|
-
top: t13,
|
|
294
|
-
maxWidth: t15
|
|
295
|
-
};
|
|
296
|
-
$[52] = t12;
|
|
297
|
-
$[53] = t13;
|
|
298
|
-
$[54] = t15;
|
|
299
|
-
$[55] = t16;
|
|
261
|
+
if (placement === "cursor") {
|
|
262
|
+
let t10;
|
|
263
|
+
if ($[26] !== chart.box || $[27] !== pixel) {
|
|
264
|
+
t10 = pixel > chart.box / 2 ? {
|
|
265
|
+
right: Math.round(chart.box - pixel + OFFSET),
|
|
266
|
+
maxWidth: Math.max(0, Math.round(pixel - OFFSET - EDGE))
|
|
267
|
+
} : {
|
|
268
|
+
left: Math.round(pixel + OFFSET),
|
|
269
|
+
maxWidth: Math.max(0, Math.round(chart.box - pixel - OFFSET - EDGE))
|
|
270
|
+
};
|
|
271
|
+
$[26] = chart.box;
|
|
272
|
+
$[27] = pixel;
|
|
273
|
+
$[28] = t10;
|
|
274
|
+
} else {
|
|
275
|
+
t10 = $[28];
|
|
276
|
+
}
|
|
277
|
+
const t11 = position === null || position === undefined ? chart.plot.top : Math.max(0, Math.round(position[1]) - OFFSET);
|
|
278
|
+
let t12;
|
|
279
|
+
if ($[29] !== t10 || $[30] !== t11) {
|
|
280
|
+
t12 = {
|
|
281
|
+
...t10,
|
|
282
|
+
top: t11
|
|
283
|
+
};
|
|
284
|
+
$[29] = t10;
|
|
285
|
+
$[30] = t11;
|
|
286
|
+
$[31] = t12;
|
|
287
|
+
} else {
|
|
288
|
+
t12 = $[31];
|
|
289
|
+
}
|
|
290
|
+
place = t12;
|
|
300
291
|
} else {
|
|
301
|
-
|
|
292
|
+
const plotLeft = chart.leftAxis + Math.max(0, chart.plot.left - chart.scroll);
|
|
293
|
+
const plotRight = Math.min(chart.box - chart.rightAxis, chart.leftAxis + chart.plot.right - chart.scroll);
|
|
294
|
+
let t10;
|
|
295
|
+
if ($[32] !== activeIndex || $[33] !== chart) {
|
|
296
|
+
t10 = chart.bucketAt(activeIndex)?.width ?? 2 * POINT_ROOM;
|
|
297
|
+
$[32] = activeIndex;
|
|
298
|
+
$[33] = chart;
|
|
299
|
+
$[34] = t10;
|
|
300
|
+
} else {
|
|
301
|
+
t10 = $[34];
|
|
302
|
+
}
|
|
303
|
+
const reach = t10 / 2;
|
|
304
|
+
let t11;
|
|
305
|
+
let vertical;
|
|
306
|
+
if ($[35] !== card.width || $[36] !== pixel || $[37] !== placement || $[38] !== plotLeft || $[39] !== plotRight || $[40] !== reach) {
|
|
307
|
+
const [t12, horizontal] = placement.split("-");
|
|
308
|
+
vertical = t12;
|
|
309
|
+
const covers = side => side === "left" ? pixel - reach < plotLeft + card.width : pixel + reach > plotRight - card.width;
|
|
310
|
+
t11 = covers(horizontal) && !covers(horizontal === "left" ? "right" : "left") ? horizontal === "left" ? "right" : "left" : horizontal;
|
|
311
|
+
$[35] = card.width;
|
|
312
|
+
$[36] = pixel;
|
|
313
|
+
$[37] = placement;
|
|
314
|
+
$[38] = plotLeft;
|
|
315
|
+
$[39] = plotRight;
|
|
316
|
+
$[40] = reach;
|
|
317
|
+
$[41] = t11;
|
|
318
|
+
$[42] = vertical;
|
|
319
|
+
} else {
|
|
320
|
+
t11 = $[41];
|
|
321
|
+
vertical = $[42];
|
|
322
|
+
}
|
|
323
|
+
const side_0 = t11;
|
|
324
|
+
let t12;
|
|
325
|
+
if ($[43] !== chart.box || $[44] !== plotLeft || $[45] !== plotRight || $[46] !== side_0) {
|
|
326
|
+
t12 = side_0 === "left" ? {
|
|
327
|
+
left: Math.round(plotLeft)
|
|
328
|
+
} : {
|
|
329
|
+
right: Math.round(chart.box - plotRight)
|
|
330
|
+
};
|
|
331
|
+
$[43] = chart.box;
|
|
332
|
+
$[44] = plotLeft;
|
|
333
|
+
$[45] = plotRight;
|
|
334
|
+
$[46] = side_0;
|
|
335
|
+
$[47] = t12;
|
|
336
|
+
} else {
|
|
337
|
+
t12 = $[47];
|
|
338
|
+
}
|
|
339
|
+
let t13;
|
|
340
|
+
if ($[48] !== card.height || $[49] !== chart.plot.bottom || $[50] !== chart.plot.top || $[51] !== vertical) {
|
|
341
|
+
t13 = vertical === "top" ? Math.round(chart.plot.top) : Math.round(chart.plot.bottom - card.height);
|
|
342
|
+
$[48] = card.height;
|
|
343
|
+
$[49] = chart.plot.bottom;
|
|
344
|
+
$[50] = chart.plot.top;
|
|
345
|
+
$[51] = vertical;
|
|
346
|
+
$[52] = t13;
|
|
347
|
+
} else {
|
|
348
|
+
t13 = $[52];
|
|
349
|
+
}
|
|
350
|
+
let t14;
|
|
351
|
+
if ($[53] !== plotLeft || $[54] !== plotRight) {
|
|
352
|
+
t14 = Math.round(plotRight - plotLeft);
|
|
353
|
+
$[53] = plotLeft;
|
|
354
|
+
$[54] = plotRight;
|
|
355
|
+
$[55] = t14;
|
|
356
|
+
} else {
|
|
357
|
+
t14 = $[55];
|
|
358
|
+
}
|
|
359
|
+
const t15 = Math.max(0, t14);
|
|
360
|
+
let t16;
|
|
361
|
+
if ($[56] !== t12 || $[57] !== t13 || $[58] !== t15) {
|
|
362
|
+
t16 = {
|
|
363
|
+
...t12,
|
|
364
|
+
top: t13,
|
|
365
|
+
maxWidth: t15
|
|
366
|
+
};
|
|
367
|
+
$[56] = t12;
|
|
368
|
+
$[57] = t13;
|
|
369
|
+
$[58] = t15;
|
|
370
|
+
$[59] = t16;
|
|
371
|
+
} else {
|
|
372
|
+
t16 = $[59];
|
|
373
|
+
}
|
|
374
|
+
place = t16;
|
|
302
375
|
}
|
|
303
|
-
place = t16;
|
|
304
376
|
}
|
|
305
377
|
const sum = bucket.values.reduce(_temp, 0);
|
|
306
378
|
const heading = chart.points ? [bucket.groupLabel, chart.rowLabels?.[activeIndex]].filter(Boolean).join(" \xB7 ") || chart.formatX(bucket.x) : [bucket.groupLabel, chart.rowLabels?.[activeIndex] ?? chart.formatX(bucket.x)].filter(Boolean).join(" \xB7 ");
|
|
307
379
|
t8 = createPortal;
|
|
308
380
|
T0 = Surface;
|
|
309
|
-
if ($[
|
|
381
|
+
if ($[60] !== measure || $[61] !== ref) {
|
|
310
382
|
t3 = node => {
|
|
311
383
|
measure(node);
|
|
312
384
|
if (typeof ref === "function") {
|
|
@@ -317,19 +389,19 @@ export function ChartTooltip(t0) {
|
|
|
317
389
|
}
|
|
318
390
|
}
|
|
319
391
|
};
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
392
|
+
$[60] = measure;
|
|
393
|
+
$[61] = ref;
|
|
394
|
+
$[62] = t3;
|
|
323
395
|
} else {
|
|
324
|
-
t3 = $[
|
|
396
|
+
t3 = $[62];
|
|
325
397
|
}
|
|
326
398
|
t4 = true;
|
|
327
|
-
if ($[
|
|
399
|
+
if ($[63] !== className) {
|
|
328
400
|
t5 = clsx("absolute flex w-max min-w-36 flex-col gap-1 rounded-lg px-2.5 py-2 text-xs", className);
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
401
|
+
$[63] = className;
|
|
402
|
+
$[64] = t5;
|
|
331
403
|
} else {
|
|
332
|
-
t5 = $[
|
|
404
|
+
t5 = $[64];
|
|
333
405
|
}
|
|
334
406
|
t6 = place;
|
|
335
407
|
t7 = children !== undefined ? children(bucket) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -398,7 +470,7 @@ export function ChartTooltip(t0) {
|
|
|
398
470
|
t8 = $[17];
|
|
399
471
|
}
|
|
400
472
|
let t9;
|
|
401
|
-
if ($[
|
|
473
|
+
if ($[65] !== T0 || $[66] !== t3 || $[67] !== t4 || $[68] !== t5 || $[69] !== t6 || $[70] !== t7) {
|
|
402
474
|
t9 = /*#__PURE__*/_jsx(T0, {
|
|
403
475
|
ref: t3,
|
|
404
476
|
"aria-hidden": t4,
|
|
@@ -406,25 +478,25 @@ export function ChartTooltip(t0) {
|
|
|
406
478
|
style: t6,
|
|
407
479
|
children: t7
|
|
408
480
|
});
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
481
|
+
$[65] = T0;
|
|
482
|
+
$[66] = t3;
|
|
483
|
+
$[67] = t4;
|
|
484
|
+
$[68] = t5;
|
|
485
|
+
$[69] = t6;
|
|
486
|
+
$[70] = t7;
|
|
487
|
+
$[71] = t9;
|
|
416
488
|
} else {
|
|
417
|
-
t9 = $[
|
|
489
|
+
t9 = $[71];
|
|
418
490
|
}
|
|
419
491
|
let t10;
|
|
420
|
-
if ($[
|
|
492
|
+
if ($[72] !== elements.tooltip || $[73] !== t8 || $[74] !== t9) {
|
|
421
493
|
t10 = t8(t9, elements.tooltip);
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
494
|
+
$[72] = elements.tooltip;
|
|
495
|
+
$[73] = t8;
|
|
496
|
+
$[74] = t9;
|
|
497
|
+
$[75] = t10;
|
|
426
498
|
} else {
|
|
427
|
-
t10 = $[
|
|
499
|
+
t10 = $[75];
|
|
428
500
|
}
|
|
429
501
|
return t10;
|
|
430
502
|
}
|
package/dist/series.d.ts
CHANGED
|
@@ -53,8 +53,8 @@ export interface ChartBarsProps {
|
|
|
53
53
|
readonly ref?: Ref<SVGGElement>;
|
|
54
54
|
}
|
|
55
55
|
export declare const DIMMED_POINT = 0.25;
|
|
56
|
-
export declare function ChartLine<Row>({ value, label, tone, icon, curve, dashed, dots, width, className, ref }: ChartLineProps<Row>): import("react").JSX.Element;
|
|
57
|
-
export declare function ChartPoint<Row>({ value, label, tone, icon, className, ref }: ChartPointProps<Row>): import("react").JSX.Element;
|
|
58
|
-
export declare function ChartArea<Row>({ value, label, tone, icon, curve, dashed, dots, stack, width, fill: fillKind, className, ref }: ChartAreaProps<Row>): import("react").JSX.Element;
|
|
56
|
+
export declare function ChartLine<Row>({ value, label, tone, icon, curve, dashed, dots, width, className, ref }: ChartLineProps<Row>): import("react").JSX.Element | null;
|
|
57
|
+
export declare function ChartPoint<Row>({ value, label, tone, icon, className, ref }: ChartPointProps<Row>): import("react").JSX.Element | null;
|
|
58
|
+
export declare function ChartArea<Row>({ value, label, tone, icon, curve, dashed, dots, stack, width, fill: fillKind, className, ref }: ChartAreaProps<Row>): import("react").JSX.Element | null;
|
|
59
59
|
export declare function ChartBars({ stack, children, className, ref }: ChartBarsProps): import("react").JSX.Element;
|
|
60
|
-
export declare function ChartBar<Row>({ value, label, tone, icon, opacity, hoverOpacity, dimOpacity, columnWidth, radius, minHeight, rounded, valueLabels, valueLabelSize, animate, className, ref }: ChartBarProps<Row>): import("react").JSX.Element;
|
|
60
|
+
export declare function ChartBar<Row>({ value, label, tone, icon, opacity, hoverOpacity, dimOpacity, columnWidth, radius, minHeight, rounded, valueLabels, valueLabelSize: labelSize, animate, className, ref }: ChartBarProps<Row>): import("react").JSX.Element;
|