@adecore/charts 0.39.0 → 0.40.1

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/overlays.js CHANGED
@@ -5,6 +5,7 @@ import clsx from 'clsx';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { Button, Icon, Surface, useContentSize } from '@adecore/ui';
7
7
  import { useChartContext } from './context.js';
8
+ import { tableClasses } from './values-table.js';
8
9
  /* Between the cursor and the card, and the least room the card keeps to the edge of the chart. */
9
10
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
10
11
  const OFFSET = 12;
@@ -140,7 +141,7 @@ function NoteSwatch(t0) {
140
141
  }
141
142
  /* The card at the cursor: the x of the bucket, a row per series, then its markers and bands. */
142
143
  export function ChartTooltip(t0) {
143
- const $ = _c(73);
144
+ const $ = _c(72);
144
145
  const {
145
146
  total: t1,
146
147
  format,
@@ -185,128 +186,127 @@ export function ChartTooltip(t0) {
185
186
  t9 = $[21];
186
187
  }
187
188
  const pixel = chart.leftAxis + t9 - chart.scroll;
188
- const right = pixel > chart.box / 2;
189
- let t10;
190
- if ($[22] !== chart.box || $[23] !== pixel || $[24] !== right) {
191
- t10 = right ? {
192
- right: Math.round(chart.box - pixel + OFFSET),
193
- maxWidth: Math.max(0, Math.round(pixel - OFFSET - EDGE))
194
- } : {
195
- left: Math.round(pixel + OFFSET),
196
- maxWidth: Math.max(0, Math.round(chart.box - pixel - OFFSET - EDGE))
197
- };
198
- $[22] = chart.box;
199
- $[23] = pixel;
200
- $[24] = right;
201
- $[25] = t10;
202
- } else {
203
- t10 = $[25];
204
- }
205
- let place = t10;
206
- const t11 = position === null || position === undefined ? chart.plot.top : Math.max(0, Math.round(position[1]) - OFFSET);
207
- let t12;
208
- if ($[26] !== place || $[27] !== t11) {
209
- t12 = {
210
- ...place,
211
- top: t11
212
- };
213
- $[26] = place;
214
- $[27] = t11;
215
- $[28] = t12;
189
+ let place;
190
+ if (placement === "cursor") {
191
+ let t10;
192
+ if ($[22] !== chart.box || $[23] !== pixel) {
193
+ t10 = pixel > chart.box / 2 ? {
194
+ right: Math.round(chart.box - pixel + OFFSET),
195
+ maxWidth: Math.max(0, Math.round(pixel - OFFSET - EDGE))
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
+ };
213
+ $[25] = t10;
214
+ $[26] = t11;
215
+ $[27] = t12;
216
+ } else {
217
+ t12 = $[27];
218
+ }
219
+ place = t12;
216
220
  } else {
217
- t12 = $[28];
218
- }
219
- place = t12;
220
- if (placement !== "cursor") {
221
221
  const plotLeft = chart.leftAxis + Math.max(0, chart.plot.left - chart.scroll);
222
222
  const plotRight = Math.min(chart.box - chart.rightAxis, chart.leftAxis + chart.plot.right - chart.scroll);
223
- let t13;
224
- if ($[29] !== activeIndex || $[30] !== chart) {
225
- t13 = chart.bucketAt(activeIndex)?.width ?? 2 * POINT_ROOM;
226
- $[29] = activeIndex;
227
- $[30] = chart;
228
- $[31] = t13;
223
+ let t10;
224
+ if ($[28] !== activeIndex || $[29] !== chart) {
225
+ t10 = chart.bucketAt(activeIndex)?.width ?? 2 * POINT_ROOM;
226
+ $[28] = activeIndex;
227
+ $[29] = chart;
228
+ $[30] = t10;
229
229
  } else {
230
- t13 = $[31];
230
+ t10 = $[30];
231
231
  }
232
- const reach = t13 / 2;
233
- let t14;
232
+ const reach = t10 / 2;
233
+ let t11;
234
234
  let vertical;
235
- if ($[32] !== card.width || $[33] !== pixel || $[34] !== placement || $[35] !== plotLeft || $[36] !== plotRight || $[37] !== reach) {
236
- const [t15, horizontal] = placement.split("-");
237
- vertical = t15;
235
+ if ($[31] !== card.width || $[32] !== pixel || $[33] !== placement || $[34] !== plotLeft || $[35] !== plotRight || $[36] !== reach) {
236
+ const [t12, horizontal] = placement.split("-");
237
+ vertical = t12;
238
238
  const covers = side => side === "left" ? pixel - reach < plotLeft + card.width : pixel + reach > plotRight - card.width;
239
- t14 = covers(horizontal) && !covers(horizontal === "left" ? "right" : "left") ? horizontal === "left" ? "right" : "left" : horizontal;
240
- $[32] = card.width;
241
- $[33] = pixel;
242
- $[34] = placement;
243
- $[35] = plotLeft;
244
- $[36] = plotRight;
245
- $[37] = reach;
246
- $[38] = t14;
247
- $[39] = vertical;
239
+ t11 = covers(horizontal) && !covers(horizontal === "left" ? "right" : "left") ? horizontal === "left" ? "right" : "left" : horizontal;
240
+ $[31] = card.width;
241
+ $[32] = pixel;
242
+ $[33] = placement;
243
+ $[34] = plotLeft;
244
+ $[35] = plotRight;
245
+ $[36] = reach;
246
+ $[37] = t11;
247
+ $[38] = vertical;
248
248
  } else {
249
- t14 = $[38];
250
- vertical = $[39];
249
+ t11 = $[37];
250
+ vertical = $[38];
251
251
  }
252
- const side_0 = t14;
253
- let t15;
254
- if ($[40] !== chart.box || $[41] !== plotLeft || $[42] !== plotRight || $[43] !== side_0) {
255
- t15 = side_0 === "left" ? {
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
256
  left: Math.round(plotLeft)
257
257
  } : {
258
258
  right: Math.round(chart.box - plotRight)
259
259
  };
260
- $[40] = chart.box;
261
- $[41] = plotLeft;
262
- $[42] = plotRight;
263
- $[43] = side_0;
264
- $[44] = t15;
260
+ $[39] = chart.box;
261
+ $[40] = plotLeft;
262
+ $[41] = plotRight;
263
+ $[42] = side_0;
264
+ $[43] = t12;
265
265
  } else {
266
- t15 = $[44];
266
+ t12 = $[43];
267
267
  }
268
- let t16;
269
- if ($[45] !== card.height || $[46] !== chart.plot.bottom || $[47] !== chart.plot.top || $[48] !== vertical) {
270
- t16 = vertical === "top" ? Math.round(chart.plot.top) : Math.round(chart.plot.bottom - card.height);
271
- $[45] = card.height;
272
- $[46] = chart.plot.bottom;
273
- $[47] = chart.plot.top;
274
- $[48] = vertical;
275
- $[49] = t16;
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
276
  } else {
277
- t16 = $[49];
277
+ t13 = $[48];
278
278
  }
279
- let t17;
280
- if ($[50] !== plotLeft || $[51] !== plotRight) {
281
- t17 = Math.round(plotRight - plotLeft);
282
- $[50] = plotLeft;
283
- $[51] = plotRight;
284
- $[52] = t17;
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
285
  } else {
286
- t17 = $[52];
286
+ t14 = $[51];
287
287
  }
288
- const t18 = Math.max(0, t17);
289
- let t19;
290
- if ($[53] !== t15 || $[54] !== t16 || $[55] !== t18) {
291
- t19 = {
292
- ...t15,
293
- top: t16,
294
- maxWidth: t18
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
295
  };
296
- $[53] = t15;
297
- $[54] = t16;
298
- $[55] = t18;
299
- $[56] = t19;
296
+ $[52] = t12;
297
+ $[53] = t13;
298
+ $[54] = t15;
299
+ $[55] = t16;
300
300
  } else {
301
- t19 = $[56];
301
+ t16 = $[55];
302
302
  }
303
- place = t19;
303
+ place = t16;
304
304
  }
305
305
  const sum = bucket.values.reduce(_temp, 0);
306
306
  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
307
  t8 = createPortal;
308
308
  T0 = Surface;
309
- if ($[57] !== measure || $[58] !== ref) {
309
+ if ($[56] !== measure || $[57] !== ref) {
310
310
  t3 = node => {
311
311
  measure(node);
312
312
  if (typeof ref === "function") {
@@ -317,19 +317,19 @@ export function ChartTooltip(t0) {
317
317
  }
318
318
  }
319
319
  };
320
- $[57] = measure;
321
- $[58] = ref;
322
- $[59] = t3;
320
+ $[56] = measure;
321
+ $[57] = ref;
322
+ $[58] = t3;
323
323
  } else {
324
- t3 = $[59];
324
+ t3 = $[58];
325
325
  }
326
326
  t4 = true;
327
- if ($[60] !== className) {
327
+ if ($[59] !== className) {
328
328
  t5 = clsx("absolute flex w-max min-w-36 flex-col gap-1 rounded-lg px-2.5 py-2 text-xs", className);
329
- $[60] = className;
330
- $[61] = t5;
329
+ $[59] = className;
330
+ $[60] = t5;
331
331
  } else {
332
- t5 = $[61];
332
+ t5 = $[60];
333
333
  }
334
334
  t6 = place;
335
335
  t7 = children !== undefined ? children(bucket) : /*#__PURE__*/_jsxs(_Fragment, {
@@ -345,8 +345,8 @@ export function ChartTooltip(t0) {
345
345
  className: "ml-auto pl-3 text-text tabular-nums",
346
346
  children: chart.formatX(bucket.x)
347
347
  })]
348
- }), chart.readable.map(t13 => {
349
- const [id, entry_0] = t13;
348
+ }), chart.readable.map(t10 => {
349
+ const [id, entry_0] = t10;
350
350
  const value = entry_0.values[activeIndex];
351
351
  return /*#__PURE__*/_jsxs("p", {
352
352
  className: "flex items-center gap-2 text-text-muted",
@@ -398,7 +398,7 @@ export function ChartTooltip(t0) {
398
398
  t8 = $[17];
399
399
  }
400
400
  let t9;
401
- if ($[62] !== T0 || $[63] !== t3 || $[64] !== t4 || $[65] !== t5 || $[66] !== t6 || $[67] !== t7) {
401
+ if ($[61] !== T0 || $[62] !== t3 || $[63] !== t4 || $[64] !== t5 || $[65] !== t6 || $[66] !== t7) {
402
402
  t9 = /*#__PURE__*/_jsx(T0, {
403
403
  ref: t3,
404
404
  "aria-hidden": t4,
@@ -406,25 +406,25 @@ export function ChartTooltip(t0) {
406
406
  style: t6,
407
407
  children: t7
408
408
  });
409
- $[62] = T0;
410
- $[63] = t3;
411
- $[64] = t4;
412
- $[65] = t5;
413
- $[66] = t6;
414
- $[67] = t7;
415
- $[68] = t9;
409
+ $[61] = T0;
410
+ $[62] = t3;
411
+ $[63] = t4;
412
+ $[64] = t5;
413
+ $[65] = t6;
414
+ $[66] = t7;
415
+ $[67] = t9;
416
416
  } else {
417
- t9 = $[68];
417
+ t9 = $[67];
418
418
  }
419
419
  let t10;
420
- if ($[69] !== elements.tooltip || $[70] !== t8 || $[71] !== t9) {
420
+ if ($[68] !== elements.tooltip || $[69] !== t8 || $[70] !== t9) {
421
421
  t10 = t8(t9, elements.tooltip);
422
- $[69] = elements.tooltip;
423
- $[70] = t8;
424
- $[71] = t9;
425
- $[72] = t10;
422
+ $[68] = elements.tooltip;
423
+ $[69] = t8;
424
+ $[70] = t9;
425
+ $[71] = t10;
426
426
  } else {
427
- t10 = $[72];
427
+ t10 = $[71];
428
428
  }
429
429
  return t10;
430
430
  }
@@ -517,7 +517,7 @@ export function ChartLegend(t0) {
517
517
  }
518
518
  /* A toggle that shows every value as a table. Hidden, the table is still there for a screen reader. */
519
519
  export function ChartTable(t0) {
520
- const $ = _c(81);
520
+ const $ = _c(85);
521
521
  const {
522
522
  toggle: t1,
523
523
  open,
@@ -589,18 +589,25 @@ export function ChartTable(t0) {
589
589
  return value === null || value === undefined ? "" : chart.formatY(value);
590
590
  })]
591
591
  }]);
592
- const head = shown ? "h-8 px-2 text-right font-medium whitespace-nowrap text-text-muted" : undefined;
593
- const cell = shown ? "h-8 px-2 text-right whitespace-nowrap text-text" : undefined;
592
+ let t16;
593
+ if ($[30] !== shown) {
594
+ t16 = tableClasses(shown);
595
+ $[30] = shown;
596
+ $[31] = t16;
597
+ } else {
598
+ t16 = $[31];
599
+ }
600
+ const classes = t16;
594
601
  t14 = createPortal;
595
602
  t11 = ref;
596
- if ($[30] !== className) {
603
+ if ($[32] !== className) {
597
604
  t12 = clsx("flex flex-col items-start gap-2", className);
598
- $[30] = className;
599
- $[31] = t12;
605
+ $[32] = className;
606
+ $[33] = t12;
600
607
  } else {
601
- t12 = $[31];
608
+ t12 = $[33];
602
609
  }
603
- if ($[32] !== id || $[33] !== setShown || $[34] !== shown || $[35] !== t || $[36] !== toggle) {
610
+ if ($[34] !== id || $[35] !== setShown || $[36] !== shown || $[37] !== t || $[38] !== toggle) {
604
611
  t13 = toggle && /*#__PURE__*/_jsx(Button, {
605
612
  size: "sm",
606
613
  "aria-expanded": shown,
@@ -608,122 +615,124 @@ export function ChartTable(t0) {
608
615
  onClick: () => setShown(!shown),
609
616
  children: shown ? t("values.hide") : t("values.show")
610
617
  });
611
- $[32] = id;
612
- $[33] = setShown;
613
- $[34] = shown;
614
- $[35] = t;
615
- $[36] = toggle;
616
- $[37] = t13;
618
+ $[34] = id;
619
+ $[35] = setShown;
620
+ $[36] = shown;
621
+ $[37] = t;
622
+ $[38] = toggle;
623
+ $[39] = t13;
617
624
  } else {
618
- t13 = $[37];
625
+ t13 = $[39];
619
626
  }
620
627
  t9 = id;
621
- t10 = shown ? "max-h-80 w-full overflow-auto rounded-md border border-border-soft" : "sr-only";
622
- t6 = shown ? "w-full border-collapse text-xs tabular-nums" : undefined;
623
- let t16;
624
- if ($[38] !== chart.label || $[39] !== t) {
625
- t16 = t("values.caption", {
628
+ t10 = classes.box;
629
+ t6 = classes.table;
630
+ let t17;
631
+ if ($[40] !== chart.label || $[41] !== t) {
632
+ t17 = t("values.caption", {
626
633
  label: chart.label
627
634
  });
628
- $[38] = chart.label;
629
- $[39] = t;
630
- $[40] = t16;
635
+ $[40] = chart.label;
636
+ $[41] = t;
637
+ $[42] = t17;
631
638
  } else {
632
- t16 = $[40];
639
+ t17 = $[42];
633
640
  }
634
- if ($[41] !== t16) {
641
+ if ($[43] !== t17) {
635
642
  t7 = /*#__PURE__*/_jsx("caption", {
636
643
  className: "sr-only",
637
- children: t16
644
+ children: t17
638
645
  });
639
- $[41] = t16;
640
- $[42] = t7;
641
- } else {
642
- t7 = $[42];
643
- }
644
- const t17 = shown ? "sticky top-0 bg-surface-hover" : undefined;
645
- let t18;
646
- if ($[43] !== grouped) {
647
- t18 = grouped && /*#__PURE__*/_jsx("td", {});
648
- $[43] = grouped;
649
- $[44] = t18;
646
+ $[43] = t17;
647
+ $[44] = t7;
650
648
  } else {
651
- t18 = $[44];
649
+ t7 = $[44];
652
650
  }
651
+ const t18 = classes.head;
653
652
  let t19;
654
- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
655
- t19 = /*#__PURE__*/_jsx("td", {});
656
- $[45] = t19;
653
+ if ($[45] !== grouped) {
654
+ t19 = grouped && /*#__PURE__*/_jsx("td", {});
655
+ $[45] = grouped;
656
+ $[46] = t19;
657
657
  } else {
658
- t19 = $[45];
658
+ t19 = $[46];
659
659
  }
660
660
  let t20;
661
- if ($[46] !== columns || $[47] !== head) {
662
- let t21;
663
- if ($[49] !== head) {
664
- t21 = (column, index_0) => /*#__PURE__*/_jsx("th", {
661
+ if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
662
+ t20 = /*#__PURE__*/_jsx("td", {});
663
+ $[47] = t20;
664
+ } else {
665
+ t20 = $[47];
666
+ }
667
+ let t21;
668
+ if ($[48] !== classes.column || $[49] !== columns) {
669
+ let t22;
670
+ if ($[51] !== classes.column) {
671
+ t22 = (column, index_0) => /*#__PURE__*/_jsx("th", {
665
672
  scope: "col",
666
- className: head,
673
+ className: classes.column,
667
674
  children: column
668
675
  }, index_0);
669
- $[49] = head;
670
- $[50] = t21;
676
+ $[51] = classes.column;
677
+ $[52] = t22;
671
678
  } else {
672
- t21 = $[50];
679
+ t22 = $[52];
673
680
  }
674
- t20 = columns.map(t21);
675
- $[46] = columns;
676
- $[47] = head;
677
- $[48] = t20;
681
+ t21 = columns.map(t22);
682
+ $[48] = classes.column;
683
+ $[49] = columns;
684
+ $[50] = t21;
678
685
  } else {
679
- t20 = $[48];
686
+ t21 = $[50];
680
687
  }
681
- let t21;
682
- if ($[51] !== t18 || $[52] !== t20) {
683
- t21 = /*#__PURE__*/_jsxs("tr", {
684
- children: [t18, t19, t20]
688
+ let t22;
689
+ if ($[53] !== t19 || $[54] !== t21) {
690
+ t22 = /*#__PURE__*/_jsxs("tr", {
691
+ children: [t19, t20, t21]
685
692
  });
686
- $[51] = t18;
687
- $[52] = t20;
688
- $[53] = t21;
693
+ $[53] = t19;
694
+ $[54] = t21;
695
+ $[55] = t22;
689
696
  } else {
690
- t21 = $[53];
697
+ t22 = $[55];
691
698
  }
692
- if ($[54] !== t17 || $[55] !== t21) {
699
+ if ($[56] !== classes.head || $[57] !== t22) {
693
700
  t8 = /*#__PURE__*/_jsx("thead", {
694
- className: t17,
695
- children: t21
701
+ className: t18,
702
+ children: t22
696
703
  });
697
- $[54] = t17;
698
- $[55] = t21;
699
- $[56] = t8;
704
+ $[56] = classes.head;
705
+ $[57] = t22;
706
+ $[58] = t8;
700
707
  } else {
701
- t8 = $[56];
708
+ t8 = $[58];
702
709
  }
703
- let t22;
704
- if ($[57] !== cell || $[58] !== grouped || $[59] !== shown) {
705
- t22 = row_0 => /*#__PURE__*/_jsxs("tr", {
706
- className: shown ? "border-t border-border-soft" : undefined,
710
+ let t23;
711
+ if ($[59] !== classes.cell || $[60] !== classes.row || $[61] !== classes.rowHeading || $[62] !== grouped || $[63] !== shown) {
712
+ t23 = row_0 => /*#__PURE__*/_jsxs("tr", {
713
+ className: classes.row,
707
714
  children: [grouped && /*#__PURE__*/_jsx("td", {
708
715
  className: shown ? "h-8 px-2 text-text-muted" : undefined,
709
716
  children: row_0.group
710
717
  }), /*#__PURE__*/_jsx("th", {
711
718
  scope: "row",
712
- className: shown ? "h-8 px-2 text-left font-normal whitespace-nowrap text-text-muted" : undefined,
719
+ className: classes.rowHeading,
713
720
  children: row_0.label
714
721
  }), row_0.cells.map((value_0, index_1) => /*#__PURE__*/_jsx("td", {
715
- className: cell,
722
+ className: classes.cell,
716
723
  children: value_0
717
724
  }, index_1))]
718
725
  }, row_0.key);
719
- $[57] = cell;
720
- $[58] = grouped;
721
- $[59] = shown;
722
- $[60] = t22;
726
+ $[59] = classes.cell;
727
+ $[60] = classes.row;
728
+ $[61] = classes.rowHeading;
729
+ $[62] = grouped;
730
+ $[63] = shown;
731
+ $[64] = t23;
723
732
  } else {
724
- t22 = $[60];
733
+ t23 = $[64];
725
734
  }
726
- t5 = rows.map(t22);
735
+ t5 = rows.map(t23);
727
736
  $[8] = chart;
728
737
  $[9] = className;
729
738
  $[10] = columns;
@@ -759,67 +768,67 @@ export function ChartTable(t0) {
759
768
  t9 = $[29];
760
769
  }
761
770
  let t15;
762
- if ($[61] !== t5) {
771
+ if ($[65] !== t5) {
763
772
  t15 = /*#__PURE__*/_jsx("tbody", {
764
773
  children: t5
765
774
  });
766
- $[61] = t5;
767
- $[62] = t15;
775
+ $[65] = t5;
776
+ $[66] = t15;
768
777
  } else {
769
- t15 = $[62];
778
+ t15 = $[66];
770
779
  }
771
780
  let t16;
772
- if ($[63] !== t15 || $[64] !== t6 || $[65] !== t7 || $[66] !== t8) {
781
+ if ($[67] !== t15 || $[68] !== t6 || $[69] !== t7 || $[70] !== t8) {
773
782
  t16 = /*#__PURE__*/_jsxs("table", {
774
783
  className: t6,
775
784
  children: [t7, t8, t15]
776
785
  });
777
- $[63] = t15;
778
- $[64] = t6;
779
- $[65] = t7;
780
- $[66] = t8;
781
- $[67] = t16;
786
+ $[67] = t15;
787
+ $[68] = t6;
788
+ $[69] = t7;
789
+ $[70] = t8;
790
+ $[71] = t16;
782
791
  } else {
783
- t16 = $[67];
792
+ t16 = $[71];
784
793
  }
785
794
  let t17;
786
- if ($[68] !== t10 || $[69] !== t16 || $[70] !== t9) {
795
+ if ($[72] !== t10 || $[73] !== t16 || $[74] !== t9) {
787
796
  t17 = /*#__PURE__*/_jsx("div", {
788
797
  id: t9,
789
798
  className: t10,
790
799
  children: t16
791
800
  });
792
- $[68] = t10;
793
- $[69] = t16;
794
- $[70] = t9;
795
- $[71] = t17;
801
+ $[72] = t10;
802
+ $[73] = t16;
803
+ $[74] = t9;
804
+ $[75] = t17;
796
805
  } else {
797
- t17 = $[71];
806
+ t17 = $[75];
798
807
  }
799
808
  let t18;
800
- if ($[72] !== t11 || $[73] !== t12 || $[74] !== t13 || $[75] !== t17) {
809
+ if ($[76] !== t11 || $[77] !== t12 || $[78] !== t13 || $[79] !== t17) {
801
810
  t18 = /*#__PURE__*/_jsxs("div", {
802
811
  ref: t11,
803
812
  className: t12,
804
813
  children: [t13, t17]
805
814
  });
806
- $[72] = t11;
807
- $[73] = t12;
808
- $[74] = t13;
809
- $[75] = t17;
810
- $[76] = t18;
815
+ $[76] = t11;
816
+ $[77] = t12;
817
+ $[78] = t13;
818
+ $[79] = t17;
819
+ $[80] = t18;
811
820
  } else {
812
- t18 = $[76];
821
+ t18 = $[80];
813
822
  }
814
823
  let t19;
815
- if ($[77] !== chart.elements.table || $[78] !== t14 || $[79] !== t18) {
824
+ if ($[81] !== chart.elements.table || $[82] !== t14 || $[83] !== t18) {
816
825
  t19 = t14(t18, chart.elements.table);
817
- $[77] = chart.elements.table;
818
- $[78] = t14;
819
- $[79] = t18;
820
- $[80] = t19;
826
+ $[81] = chart.elements.table;
827
+ $[82] = t14;
828
+ $[83] = t18;
829
+ $[84] = t19;
821
830
  } else {
822
- t19 = $[80];
831
+ t19 = $[84];
823
832
  }
824
833
  return t19;
825
834
  }
package/dist/points.js CHANGED
@@ -1,4 +1,3 @@
1
- /* The pure geometry of a point chart: the nearest point, moving between points, the frontier and the end labels. */
2
1
  /* The point closest to (x, y) within `reach` pixels, so the pointer need not land on a mark exactly; -1 for none. */
3
2
  export function nearestPoint(points, x, y, reach) {
4
3
  let nearest = -1;