@pioneer-code/pioneer-charts 22.2.17 → 22.2.18

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.
@@ -102,8 +102,8 @@ class PcacAxisConfig {
102
102
  * the axis. Labels follow the marks (D3 places them at tick length + 3px), and the chart's
103
103
  * margins grow or shrink by the same amount so the plot area makes room for them - a longer
104
104
  * tick means a slightly smaller plot, never labels pushed off the edge. Only the per-tick marks
105
- * change; the axis line's two end-caps keep their default length. Color comes from the theme
106
- * (`.pcac-axis-tick-marks .tick line`, `$gray-900`, the same as the axis line).
105
+ * change; the axis line's two end-caps keep their default length. Colored by `tickColor`, the
106
+ * theme's `$gray-900` (like the axis line) by default.
107
107
  */
108
108
  tickSize;
109
109
  /**
@@ -118,8 +118,8 @@ class PcacAxisConfig {
118
118
  tickLabelColor;
119
119
  /**
120
120
  * Draw a solid line along the axis itself (the full length of the axis, with D3's short
121
- * end-caps). Off by default, as the theme has always hidden it. Color comes from the theme
122
- * (`.pcac-axis-line .domain`, `$gray-900`).
121
+ * end-caps). Off by default, as the theme has always hidden it. Colored by `lineColor`, the
122
+ * theme's `$gray-900` by default.
123
123
  */
124
124
  showLine = false;
125
125
  /**
@@ -152,7 +152,8 @@ class PcacAxisConfig {
152
152
  * (`yAxis`) or key (`xAxis`) in the default tooltip. On the line/area/plot charts the x axis's
153
153
  * format is also what decides how a point's `key` maps to an x position (by index for the
154
154
  * default, `Decimal` and `DateTime` by the key's own value on a linear/time scale - see
155
- * `PcacLineAreaChartConfig`); a bar chart's category axis ignores it. Default `None`, which
155
+ * `PcacLineAreaChartConfig`); on a bar chart's category axis it only formats keys that are
156
+ * numbers, and shows any other key as it is. Default `None`, which
156
157
  * on those charts behaves as `DatasetLength`.
157
158
  */
158
159
  format = PcacFormatEnum.None;
@@ -331,8 +332,24 @@ function formatValue(pcacFormat, value) {
331
332
  *
332
333
  * Numeric formats take their precision from the scale's tick step where the scale has one: a
333
334
  * fixed precision is fine for a whole domain but breaks down once zoom narrows it to a few units.
335
+ *
336
+ * On a category axis (a band scale - a bar chart's groups) only keys that are numbers are formatted
337
+ * - `'0.25'` reads `25%` - and any other key is shown as it is: a format there, easy to set by
338
+ * mistake on the horizontal chart (where y is the category axis), turned every label into `NaN%`
339
+ * or `Chipsm`.
334
340
  */
335
341
  function axisTickFormat(pcacFormat, scale, ticks) {
342
+ const format = valueTickFormat(pcacFormat, scale, ticks);
343
+ if (!format || !('bandwidth' in scale)) {
344
+ return format;
345
+ }
346
+ return (d) => isNumericKey(d) ? format(d) : String(d);
347
+ }
348
+ /** A category key that reads as a number - `0.25`, `'1500'` - rather than text like `'Chips'`. */
349
+ function isNumericKey(key) {
350
+ return (typeof key === 'number' || (typeof key === 'string' && key.trim() !== '')) && Number.isFinite(Number(key));
351
+ }
352
+ function valueTickFormat(pcacFormat, scale, ticks) {
336
353
  const withTicks = scale;
337
354
  switch (pcacFormat) {
338
355
  case PcacFormatEnum.Percentage:
@@ -665,6 +682,189 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
665
682
  }]
666
683
  }] });
667
684
 
685
+ /** Marks the elements `makeMarksAccessible` set up, so navigation can find a chart's marks. */
686
+ const MARK_ATTR = 'data-pcac-mark';
687
+ /**
688
+ * Makes a chart's marks usable from the keyboard and readable by a screen reader, alongside the
689
+ * pointer handlers they already have.
690
+ *
691
+ * Every mark gets a role and a name, but only one of them - the chart's "tab stop" - is in the Tab
692
+ * order (see `refreshTabStop`): Tab reaches the chart once, and the arrow keys move between its
693
+ * marks, Home and End to the first and last. A chart of a thousand bars isn't a thousand Tab
694
+ * presses to get past. Focus does what hovering does (`focus`), and Enter or Space what a click
695
+ * does (`activate`); Escape hides the tooltip, as moving the pointer away would - and goes no
696
+ * further while it has one to hide, so it doesn't also close a dialog the chart is in. Keys pressed
697
+ * with Alt, Ctrl or Cmd are left to the browser (Alt+Left is Back).
698
+ *
699
+ * A mark takes focus from the keyboard only: pressing the pointer on one is kept from focusing it,
700
+ * so a click doesn't leave a keyboard-style tooltip and focus ring behind on the clicked mark. It
701
+ * does let go of a mark in the same chart that has focus, which would otherwise stay highlighted,
702
+ * its tooltip gone, while the pointer is at work elsewhere in the chart.
703
+ */
704
+ function makeMarksAccessible(marks, access) {
705
+ const skipped = (d) => access.skip?.(d) ?? false;
706
+ // The marks showing what focus shows (their tooltip, highlighted), until blur or Escape.
707
+ const open = new WeakSet();
708
+ marks
709
+ .attr(MARK_ATTR, (d) => (skipped(d) ? null : ''))
710
+ .attr('aria-hidden', (d) => (skipped(d) ? 'true' : null))
711
+ // An image, with a name, rather than a button: whether the chart's click output has a listener
712
+ // can't be told from here (the pie, donut, line, area and plot charts' own wrappers always
713
+ // listen, to pass it on), and a button that does nothing would be a lie. Enter and Space still
714
+ // do what a click does, and the click listener has browsers report the mark as clickable.
715
+ .attr('role', (d) => (skipped(d) ? null : 'img'))
716
+ .attr('aria-label', function (d) {
717
+ return skipped(d) ? null : access.label(d, this);
718
+ })
719
+ .attr('tabindex', (d) => (skipped(d) ? null : -1))
720
+ // The events are typed plainly as `Event`: with the element type generic here, d3's typings
721
+ // (@types/d3-selection 3.0.12 on) can't narrow them to `MouseEvent`/`KeyboardEvent`.
722
+ .on('mousedown.pcac-mark', function (event) {
723
+ event.preventDefault();
724
+ const focused = this.ownerDocument.activeElement;
725
+ if (focused !== this && focused?.hasAttribute(MARK_ATTR) && sameChart(focused, this)) {
726
+ focused.blur();
727
+ }
728
+ })
729
+ .on('focus.pcac-mark', function (_event, d) {
730
+ open.add(this);
731
+ access.focus(this, d);
732
+ })
733
+ .on('blur.pcac-mark', function (_event, d) {
734
+ open.delete(this);
735
+ access.blur(this, d);
736
+ })
737
+ .on('keydown.pcac-mark', function (event, d) {
738
+ const { key, altKey, ctrlKey, metaKey } = event;
739
+ if (altKey || ctrlKey || metaKey) {
740
+ return;
741
+ }
742
+ switch (key) {
743
+ case 'Enter':
744
+ case ' ':
745
+ event.preventDefault();
746
+ access.activate(d);
747
+ return;
748
+ case 'Escape':
749
+ // Only while there's a tooltip to hide; a second Escape carries on to whatever the
750
+ // chart is in (a dialog closes, as it would have).
751
+ if (open.delete(this)) {
752
+ event.preventDefault();
753
+ event.stopPropagation();
754
+ access.blur(this, d);
755
+ }
756
+ return;
757
+ }
758
+ const target = neighbor(this, key);
759
+ if (target) {
760
+ event.preventDefault();
761
+ moveFocus(this, target);
762
+ }
763
+ });
764
+ }
765
+ /**
766
+ * Notes the chart's Tab stop - and whether it has focus - before a redraw removes every mark, so
767
+ * `refreshTabStop` can put both back: a keyboard user who pressed Enter on a bar, with a click
768
+ * handler that updates the data, stays on that bar rather than being dropped at the top of the
769
+ * page. `null` when the chart has no Tab stop.
770
+ */
771
+ function captureMarkFocus(root) {
772
+ if (!root) {
773
+ return null;
774
+ }
775
+ const marks = navigableMarks(root);
776
+ const index = marks.findIndex((mark) => mark.getAttribute('tabindex') === '0');
777
+ if (index < 0) {
778
+ return null;
779
+ }
780
+ return { index, focused: root.ownerDocument.activeElement === marks[index] };
781
+ }
782
+ /**
783
+ * Puts the chart's one Tab stop (`tabindex="0"`) on a mark that can take focus; every other mark
784
+ * is `-1` already (`makeMarksAccessible`). Call once a chart's marks are drawn, and again whenever
785
+ * marks can have been hidden - by zoom, say - so Tab doesn't land on one that can't be focused and
786
+ * skip the chart.
787
+ *
788
+ * Leaves the Tab stop where it is while that mark can still take focus, so coming back to the chart
789
+ * returns to the mark last visited. After a redraw, given what `captureMarkFocus` noted, it goes
790
+ * back to the same place - the last mark, if there are fewer now - and takes focus back if it had
791
+ * it. Touches only the old and new stops, as it runs on every zoom frame.
792
+ */
793
+ function refreshTabStop(root, previous = null) {
794
+ if (!root) {
795
+ return;
796
+ }
797
+ const current = root.querySelector(`[${MARK_ATTR}][tabindex="0"]`);
798
+ if (current && !previous && !isNotDisplayed(current, root)) {
799
+ return;
800
+ }
801
+ const marks = navigableMarks(root);
802
+ const stop = previous ? marks[Math.min(previous.index, marks.length - 1)] : marks[0];
803
+ if (current && current !== stop) {
804
+ current.setAttribute('tabindex', '-1');
805
+ }
806
+ if (!stop) {
807
+ return;
808
+ }
809
+ stop.setAttribute('tabindex', '0');
810
+ if (previous?.focused) {
811
+ stop.focus({ preventScroll: true });
812
+ }
813
+ }
814
+ /** Whether two marks are in the same chart (the same `<svg>`). */
815
+ function sameChart(a, b) {
816
+ return (a.ownerSVGElement ?? a.parentElement) === (b.ownerSVGElement ?? b.parentElement);
817
+ }
818
+ /** The chart's marks that can take focus now, in drawing order. */
819
+ function navigableMarks(root) {
820
+ return Array.from(root.querySelectorAll(`[${MARK_ATTR}]`)).filter((mark) => !isNotDisplayed(mark, root));
821
+ }
822
+ /**
823
+ * Whether the mark, or a group it's in, isn't displayed: a hidden series, or a point zoomed out of
824
+ * the plot. Read from the `display` attribute and inline style the builders set, rather than from
825
+ * layout, which a browser without one (a test environment) doesn't have.
826
+ */
827
+ function isNotDisplayed(mark, root) {
828
+ for (let node = mark; node && node !== root; node = node.parentElement) {
829
+ if (node.getAttribute('display') === 'none' || node.style?.display === 'none') {
830
+ return true;
831
+ }
832
+ }
833
+ return false;
834
+ }
835
+ /** The mark an arrow, Home or End key moves to from `mark`, or `null` for any other key. */
836
+ function neighbor(mark, key) {
837
+ const root = mark.ownerSVGElement ?? mark.parentElement;
838
+ if (!root) {
839
+ return null;
840
+ }
841
+ const marks = navigableMarks(root);
842
+ const at = marks.indexOf(mark);
843
+ switch (key) {
844
+ case 'ArrowRight':
845
+ case 'ArrowDown':
846
+ return marks[Math.min(at + 1, marks.length - 1)] ?? null;
847
+ case 'ArrowLeft':
848
+ case 'ArrowUp':
849
+ return marks[Math.max(at - 1, 0)] ?? null;
850
+ case 'Home':
851
+ return marks[0] ?? null;
852
+ case 'End':
853
+ return marks[marks.length - 1] ?? null;
854
+ default:
855
+ return null;
856
+ }
857
+ }
858
+ /** Moves focus, and the chart's Tab stop with it, from one mark to another. */
859
+ function moveFocus(from, to) {
860
+ if (from === to) {
861
+ return;
862
+ }
863
+ from.setAttribute('tabindex', '-1');
864
+ to.setAttribute('tabindex', '0');
865
+ to.focus();
866
+ }
867
+
668
868
  class PcacTooltipBuilder {
669
869
  appRef = inject(ApplicationRef);
670
870
  document = inject(DOCUMENT);
@@ -703,7 +903,7 @@ class PcacTooltipBuilder {
703
903
  */
704
904
  owner = null;
705
905
  /**
706
- * The tooltip element's id, for a focused mark's `aria-describedby` (see `PcacChart.focusMark`).
906
+ * The tooltip element's id, for a focused mark's `aria-describedby` (see `PcacChart.showMarkTooltip`).
707
907
  * One per page, like the element.
708
908
  */
709
909
  static ID = 'pcac-tooltip';
@@ -1199,6 +1399,36 @@ class PcacChart {
1199
1399
  element.setAttribute('aria-describedby', PcacTooltipBuilder.ID);
1200
1400
  }
1201
1401
  }
1402
+ /**
1403
+ * Where the chart's Tab stop was before the last redraw removed its marks, and whether it had
1404
+ * focus; put back by `restoreTabStop`. Kept until then - across a build that couldn't draw (no
1405
+ * width yet) - and not overwritten by a second clear in the same build, which finds no marks.
1406
+ */
1407
+ markFocus = null;
1408
+ noteMarkFocus(chartElm) {
1409
+ this.markFocus = captureMarkFocus(chartElm.nativeElement) ?? this.markFocus;
1410
+ }
1411
+ /**
1412
+ * Puts the chart's Tab stop on its new marks - where it was before the redraw, with focus if it
1413
+ * had it (see marks.ts). Every builder calls this once its marks are drawn.
1414
+ */
1415
+ restoreTabStop(chartElm) {
1416
+ refreshTabStop(chartElm.nativeElement, this.markFocus);
1417
+ this.markFocus = null;
1418
+ }
1419
+ /**
1420
+ * The chart's accessible name when its config gives no `ariaLabel`: its type, and the titles of
1421
+ * the axes it shows - "Bar chart - x axis: Product, y axis: Units sold". The titles are drawn
1422
+ * inside the axis groups, which are hidden from screen readers (the marks' own names carry each
1423
+ * key and value), so this is the only place they're read out.
1424
+ */
1425
+ defaultChartName() {
1426
+ const axes = [['x', this.xAxis], ['y', this.yAxis]];
1427
+ const titles = axes
1428
+ .filter(([, axis]) => !axis.hide && !!axis.label)
1429
+ .map(([name, axis]) => `${name} axis: ${axis.label}`);
1430
+ return titles.length ? `${this.chartTypeLabel} - ${titles.join(', ')}` : this.chartTypeLabel;
1431
+ }
1202
1432
  /** Keyboard focus leaving a mark: the undoing of `showMarkTooltip`. */
1203
1433
  hideMarkTooltip(element) {
1204
1434
  this.hideTooltip();
@@ -1219,6 +1449,7 @@ class PcacChart {
1219
1449
  */
1220
1450
  clearChart(chartElm) {
1221
1451
  this.hideTooltip();
1452
+ this.noteMarkFocus(chartElm);
1222
1453
  select(chartElm.nativeElement).select('g').remove();
1223
1454
  }
1224
1455
  /**
@@ -1237,6 +1468,7 @@ class PcacChart {
1237
1468
  initializeChartState(chartElm, config) {
1238
1469
  // The rebuild removes the hovered element, which gets no mouseout to close its tooltip.
1239
1470
  this.hideTooltip();
1471
+ this.noteMarkFocus(chartElm);
1240
1472
  select(chartElm.nativeElement).select('g').remove();
1241
1473
  // One color per group or per series within a group, whichever needs more. Bar charts, which
1242
1474
  // color by series across groups, top this up with `ensureColorCount()`. Read before the width
@@ -1265,7 +1497,7 @@ class PcacChart {
1265
1497
  // a screen reader, and keyboard focus on them would announce nothing.)
1266
1498
  select(chartElm.nativeElement)
1267
1499
  .attr('role', 'group')
1268
- .attr('aria-label', config.ariaLabel || this.chartTypeLabel);
1500
+ .attr('aria-label', config.ariaLabel || this.defaultChartName());
1269
1501
  this.height = this.resolveHeight(container, config);
1270
1502
  this.colors = colors;
1271
1503
  this.lastContainerWidth = containerWidth;
@@ -1375,6 +1607,11 @@ class PcacChart {
1375
1607
  if (this.yAxis.tickSize !== undefined) {
1376
1608
  axisY.tickSizeInner(this.yAxis.tickSize);
1377
1609
  }
1610
+ // Labelled as the axis will label them, or a unit suffix went unmeasured and ran off the edge.
1611
+ const format = axisTickFormat(this.yAxis.format, yScale, this.yAxis.ticks);
1612
+ if (format) {
1613
+ axisY.tickFormat(format);
1614
+ }
1378
1615
  let max = 0;
1379
1616
  select(chartElm.nativeElement).append('g')
1380
1617
  .call(axisY)
@@ -1449,131 +1686,6 @@ function fitText(text, maxWidth) {
1449
1686
  text.textContent = withEllipsis(fits);
1450
1687
  }
1451
1688
 
1452
- /** Marks the elements `makeMarksAccessible` set up, so navigation can find a chart's marks. */
1453
- const MARK_ATTR = 'data-pcac-mark';
1454
- /**
1455
- * Makes a chart's marks usable from the keyboard and readable by a screen reader, alongside the
1456
- * pointer handlers they already have.
1457
- *
1458
- * Every mark gets a role and a name, but only one of them - the chart's "tab stop" - is in the Tab
1459
- * order (see `refreshTabStop`): Tab reaches the chart once, and the arrow keys move between its
1460
- * marks, Home and End to the first and last. A chart of a thousand bars isn't a thousand Tab
1461
- * presses to get past. Focus does what hovering does (`focus`), and Enter or Space what a click
1462
- * does (`activate`); Escape hides the tooltip, as moving the pointer away would.
1463
- *
1464
- * A mark takes focus from the keyboard only: pressing the pointer on one is kept from focusing it,
1465
- * so a click doesn't leave a keyboard-style tooltip and focus ring behind on the clicked mark.
1466
- */
1467
- function makeMarksAccessible(marks, access) {
1468
- const skipped = (d) => access.skip?.(d) ?? false;
1469
- marks
1470
- .attr(MARK_ATTR, (d) => (skipped(d) ? null : ''))
1471
- .attr('aria-hidden', (d) => (skipped(d) ? 'true' : null))
1472
- // An image, with a name, rather than a button: whether the chart's click output has a listener
1473
- // can't be told from here (the pie, donut, line, area and plot charts' own wrappers always
1474
- // listen, to pass it on), and a button that does nothing would be a lie. Enter and Space still
1475
- // do what a click does, and the click listener has browsers report the mark as clickable.
1476
- .attr('role', (d) => (skipped(d) ? null : 'img'))
1477
- .attr('aria-label', function (d) {
1478
- return skipped(d) ? null : access.label(d, this);
1479
- })
1480
- .attr('tabindex', (d) => (skipped(d) ? null : -1))
1481
- // The events are typed plainly as `Event`: with the element type generic here, d3's typings
1482
- // (@types/d3-selection 3.0.12 on) can't narrow them to `MouseEvent`/`KeyboardEvent`.
1483
- .on('mousedown.pcac-mark', (event) => event.preventDefault())
1484
- .on('focus.pcac-mark', function (_event, d) {
1485
- access.focus(this, d);
1486
- })
1487
- .on('blur.pcac-mark', function (_event, d) {
1488
- access.blur(this, d);
1489
- })
1490
- .on('keydown.pcac-mark', function (event, d) {
1491
- const { key } = event;
1492
- switch (key) {
1493
- case 'Enter':
1494
- case ' ':
1495
- event.preventDefault();
1496
- access.activate(d);
1497
- return;
1498
- case 'Escape':
1499
- access.blur(this, d);
1500
- return;
1501
- }
1502
- const target = neighbor(this, key);
1503
- if (target) {
1504
- event.preventDefault();
1505
- moveFocus(this, target);
1506
- }
1507
- });
1508
- }
1509
- /**
1510
- * Puts the chart's one Tab stop (`tabindex="0"`) on its first mark that can take focus, and takes
1511
- * it off every other. Call once a chart's marks are drawn, and again whenever marks can have been
1512
- * hidden - by zoom, say - so Tab doesn't land on one that can't be focused and skip the chart.
1513
- * Leaves it where it is when that mark can still take focus, so coming back to the chart returns
1514
- * to the mark last visited.
1515
- */
1516
- function refreshTabStop(root) {
1517
- if (!root) {
1518
- return;
1519
- }
1520
- const marks = navigableMarks(root);
1521
- const current = marks.find((mark) => mark.getAttribute('tabindex') === '0');
1522
- const stop = current ?? marks[0];
1523
- for (const mark of root.querySelectorAll(`[${MARK_ATTR}]`)) {
1524
- mark.setAttribute('tabindex', mark === stop ? '0' : '-1');
1525
- }
1526
- }
1527
- /** The chart's marks that can take focus now, in drawing order. */
1528
- function navigableMarks(root) {
1529
- return Array.from(root.querySelectorAll(`[${MARK_ATTR}]`)).filter((mark) => !isNotDisplayed(mark, root));
1530
- }
1531
- /**
1532
- * Whether the mark, or a group it's in, isn't displayed: a hidden series, or a point zoomed out of
1533
- * the plot. Read from the `display` attribute and inline style the builders set, rather than from
1534
- * layout, which a browser without one (a test environment) doesn't have.
1535
- */
1536
- function isNotDisplayed(mark, root) {
1537
- for (let node = mark; node && node !== root; node = node.parentElement) {
1538
- if (node.getAttribute('display') === 'none' || node.style?.display === 'none') {
1539
- return true;
1540
- }
1541
- }
1542
- return false;
1543
- }
1544
- /** The mark an arrow, Home or End key moves to from `mark`, or `null` for any other key. */
1545
- function neighbor(mark, key) {
1546
- const root = mark.ownerSVGElement ?? mark.parentElement;
1547
- if (!root) {
1548
- return null;
1549
- }
1550
- const marks = navigableMarks(root);
1551
- const at = marks.indexOf(mark);
1552
- switch (key) {
1553
- case 'ArrowRight':
1554
- case 'ArrowDown':
1555
- return marks[Math.min(at + 1, marks.length - 1)] ?? null;
1556
- case 'ArrowLeft':
1557
- case 'ArrowUp':
1558
- return marks[Math.max(at - 1, 0)] ?? null;
1559
- case 'Home':
1560
- return marks[0] ?? null;
1561
- case 'End':
1562
- return marks[marks.length - 1] ?? null;
1563
- default:
1564
- return null;
1565
- }
1566
- }
1567
- /** Moves focus, and the chart's Tab stop with it, from one mark to another. */
1568
- function moveFocus(from, to) {
1569
- if (from === to) {
1570
- return;
1571
- }
1572
- from.setAttribute('tabindex', '-1');
1573
- to.setAttribute('tabindex', '0');
1574
- to.focus();
1575
- }
1576
-
1577
1689
  /**
1578
1690
  * How long each bar is drawn: its value, or 0 when it can't be drawn - a null or non-numeric
1579
1691
  * value, or `hide` set on the bar or on its whole group. A hidden bar keeps its slot (and so its
@@ -1674,6 +1786,24 @@ function seriesKeys(groups) {
1674
1786
  }
1675
1787
  return [...keys];
1676
1788
  }
1789
+ /**
1790
+ * The slots a grouped (not stacked) chart places each group's bars in, and which slot a bar takes:
1791
+ * its series key - so a series sits in the same place in every group - when the keys tell the
1792
+ * series apart (see `hasDistinctSeriesKeys`), and its position in its group otherwise. Placed by
1793
+ * key regardless, bars with no key (`PcacData`'s default `null`) or a repeated one all fell into
1794
+ * one slot and were drawn on top of each other, only the last visible - though they were already
1795
+ * colored by position in that case.
1796
+ */
1797
+ function seriesSlots(groups) {
1798
+ if (hasDistinctSeriesKeys(groups)) {
1799
+ return { domain: seriesKeys(groups), slotOf: (bar) => bar.key };
1800
+ }
1801
+ const size = groups.reduce((max, group) => Math.max(max, group.data?.length ?? 0), 0);
1802
+ return {
1803
+ domain: Array.from({ length: size }, (_, i) => String(i)),
1804
+ slotOf: (_bar, index) => String(index),
1805
+ };
1806
+ }
1677
1807
  /**
1678
1808
  * Whether every bar has a key that is unique within its own group - what coloring bars by series
1679
1809
  * key needs. Without that (keys left `null`, as `PcacData` defaults them, or repeated within a
@@ -1695,27 +1825,43 @@ function hasDistinctSeriesKeys(groups) {
1695
1825
  function canRoundBands(length, count) {
1696
1826
  return count > 0 && length / count >= 2;
1697
1827
  }
1698
- let warnedOfColorOverrideObject = false;
1699
1828
  /**
1700
1829
  * A bar config's `colorOverride` as the plain list of colors every chart now takes. Up to 22.2 the
1701
1830
  * bar charts wrapped it as `{ colors: [...] }`; a config still shaped that way - which TypeScript
1702
- * misses when it's spread together or loaded as JSON - is still read, and development builds warn
1703
- * about it once.
1831
+ * misses when it's spread together or loaded as JSON - is still read, and `warn` is called (see
1832
+ * `colorOverrideWarning`). Only for colors actually set: before 22.2.17 every bar config defaulted
1833
+ * to `{ colors: [] }`, so one saved as JSON back then would warn about an override its author
1834
+ * never chose.
1704
1835
  */
1705
- function barColorOverride(override) {
1836
+ function barColorOverride(override, warn = () => undefined) {
1706
1837
  if (!override || Array.isArray(override)) {
1707
1838
  return override;
1708
1839
  }
1709
- if (typeof ngDevMode !== 'undefined' && ngDevMode && !warnedOfColorOverrideObject) {
1710
- warnedOfColorOverrideObject = true;
1840
+ const colors = override.colors;
1841
+ if (colors?.length) {
1842
+ warn();
1843
+ }
1844
+ return colors;
1845
+ }
1846
+ /**
1847
+ * The development-mode warning about the old `colorOverride` shape, for one chart: each bar builder
1848
+ * keeps its own, so it warns once per chart - like the pie's leftover-`donut` warning - rather than
1849
+ * once per page, which also made it depend on which chart happened to build first.
1850
+ */
1851
+ function colorOverrideWarning() {
1852
+ let warned = false;
1853
+ return () => {
1854
+ if (warned || typeof ngDevMode === 'undefined' || !ngDevMode) {
1855
+ return;
1856
+ }
1857
+ warned = true;
1711
1858
  console.warn('Pioneer Charts: a bar chart\'s `colorOverride` is now a plain array of colors, like the other ' +
1712
1859
  'charts\' - use `colorOverride: [...]` rather than `colorOverride: { colors: [...] }`.');
1713
- }
1714
- return override.colors;
1860
+ };
1715
1861
  }
1716
1862
 
1717
1863
  /**
1718
- * Provided per-component (see PcacBarHorizontalChartComponent's `providers`), not root-scoped:
1864
+ * Provided per-component (see PcacBarHorizontalChart's `providers`), not root-scoped:
1719
1865
  * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,
1720
1866
  * height, colors, svg). A root singleton would be shared and clobbered by every
1721
1867
  * <pcac-bar-horizontal-chart> rendered at once.
@@ -1724,6 +1870,10 @@ class BarHorizontalChartBuilder extends PcacChart {
1724
1870
  xScale;
1725
1871
  yScaleStacked;
1726
1872
  yScaleGrouped;
1873
+ /** Warns, once for this chart, about a `colorOverride` in its old `{ colors }` shape. */
1874
+ warnOfColorOverride = colorOverrideWarning();
1875
+ /** A bar's slot in `yScaleGrouped`, from its datum and its index in its group (see `seriesSlots`). */
1876
+ slotOf = (bar) => bar.key;
1727
1877
  barClickedSource = new Subject();
1728
1878
  barClicked$ = this.barClickedSource.asObservable();
1729
1879
  chartTypeLabel = 'Bar chart';
@@ -1742,7 +1892,7 @@ class BarHorizontalChartBuilder extends PcacChart {
1742
1892
  return;
1743
1893
  }
1744
1894
  this.ensureColorCount(seriesKeys(config.data).length);
1745
- this.applyColorOverride(barColorOverride(config.colorOverride));
1895
+ this.applyColorOverride(barColorOverride(config.colorOverride, this.warnOfColorOverride));
1746
1896
  if (!this.buildScales(chartElm, config)) {
1747
1897
  return;
1748
1898
  }
@@ -1759,11 +1909,13 @@ class BarHorizontalChartBuilder extends PcacChart {
1759
1909
  // Rounded to whole pixels for crisp bar edges, while there's room to (see canRoundBands).
1760
1910
  .round(canRoundBands(this.height, config.data.length))
1761
1911
  .padding(0.1);
1912
+ const slots = seriesSlots(config.data);
1913
+ this.slotOf = slots.slotOf;
1762
1914
  this.yScaleGrouped = scaleBand()
1763
1915
  .padding(0.05)
1764
1916
  .range([0, this.yScaleStacked.bandwidth()])
1765
- .round(canRoundBands(this.yScaleStacked.bandwidth(), seriesKeys(config.data).length))
1766
- .domain(seriesKeys(config.data));
1917
+ .round(canRoundBands(this.yScaleStacked.bandwidth(), slots.domain.length))
1918
+ .domain(slots.domain);
1767
1919
  // The left margin is sized to the y axis's labels - unless there is no y axis to size it to
1768
1920
  if (!this.yAxis.hide && !this.setHorizontalMarginsBasedOnContent(chartElm, this.yScaleStacked)) {
1769
1921
  return false;
@@ -1778,7 +1930,7 @@ class BarHorizontalChartBuilder extends PcacChart {
1778
1930
  this.drawGrids(this.xScale, this.yScaleStacked);
1779
1931
  this.addGroups(config);
1780
1932
  this.axisBuilder.raiseAxes(this.svg);
1781
- refreshTabStop(chartElm.nativeElement);
1933
+ this.restoreTabStop(chartElm);
1782
1934
  }
1783
1935
  addGroups(config) {
1784
1936
  const groupsContainer = this.svg.append('g')
@@ -1857,7 +2009,7 @@ class BarHorizontalChartBuilder extends PcacChart {
1857
2009
  // A stacked bar spans its whole group, which is already translated into place; looking its
1858
2010
  // series key up in the group band put it off in another group's slot whenever the key
1859
2011
  // matched a group key.
1860
- .attr('y', (d) => config.isStacked ? 0 : this.yScaleGrouped(d.key) ?? 0)
2012
+ .attr('y', (d, i) => config.isStacked ? 0 : this.yScaleGrouped(this.slotOf(d, i)) ?? 0)
1861
2013
  .attr('data-group-bar-id', (_, i) => {
1862
2014
  return i;
1863
2015
  })
@@ -1948,7 +2100,7 @@ class BarHorizontalChartBuilder extends PcacChart {
1948
2100
  // Placed in its bar's slot up front - only its value (`x`) animates. Set on the transition,
1949
2101
  // it slid in from the top of the group, where the vertical chart's appear in place.
1950
2102
  // ScaleBand can return undefined for a key outside its domain; `.attr()` needs null, not undefined.
1951
- .attr('y', (d) => this.yScaleGrouped(d.key) ?? null)
2103
+ .attr('y', (d, i) => this.yScaleGrouped(this.slotOf(d, i)) ?? null)
1952
2104
  .attr('height', this.yScaleGrouped.bandwidth());
1953
2105
  rects.filter(function () {
1954
2106
  return thresholdOf(this) === null;
@@ -2103,7 +2255,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
2103
2255
  }]
2104
2256
  }] });
2105
2257
 
2106
- class PcacBarHorizontalChartComponent {
2258
+ class PcacBarHorizontalChart {
2107
2259
  chartBuilder = inject(BarHorizontalChartBuilder);
2108
2260
  config = input.required(/* @ts-ignore */
2109
2261
  ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
@@ -2140,10 +2292,10 @@ class PcacBarHorizontalChartComponent {
2140
2292
  this.chartBuilder.buildChart(this.chartElm(), config);
2141
2293
  }
2142
2294
  }
2143
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarHorizontalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2144
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacBarHorizontalChartComponent, isStandalone: true, selector: "pcac-bar-horizontal-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { barClicked: "barClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [BarHorizontalChartBuilder], queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-bar-horizontal-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-horizontal-chart{display:block}.pcac-bar-horizontal-chart svg{width:100%;display:block}pcac-bar-horizontal-chart.pcac-height-full{display:block;height:100%}pcac-bar-horizontal-chart.pcac-height-full .pcac-bar-horizontal-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
2295
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarHorizontalChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2296
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacBarHorizontalChart, isStandalone: true, selector: "pcac-bar-horizontal-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { barClicked: "barClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [BarHorizontalChartBuilder], queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-bar-horizontal-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-horizontal-chart{display:block}.pcac-bar-horizontal-chart svg{width:100%;display:block}pcac-bar-horizontal-chart.pcac-height-full{display:block;height:100%}pcac-bar-horizontal-chart.pcac-height-full .pcac-bar-horizontal-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
2145
2297
  }
2146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarHorizontalChartComponent, decorators: [{
2298
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarHorizontalChart, decorators: [{
2147
2299
  type: Component,
2148
2300
  args: [{ selector: 'pcac-bar-horizontal-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, encapsulation: ViewEncapsulation.None, providers: [BarHorizontalChartBuilder], template: "<section class=\"pcac-bar-horizontal-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-horizontal-chart{display:block}.pcac-bar-horizontal-chart svg{width:100%;display:block}pcac-bar-horizontal-chart.pcac-height-full{display:block;height:100%}pcac-bar-horizontal-chart.pcac-height-full .pcac-bar-horizontal-chart{height:100%}\n"] }]
2149
2301
  }], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], chartElm: [{ type: i0.ViewChild, args: ['chart', { isSignal: true }] }], barClicked: [{ type: i0.Output, args: ["barClicked"] }], tooltipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PcacTooltipDirective), { isSignal: true }] }] } });
@@ -2154,14 +2306,14 @@ class PcacBarHorizontalChartConfig extends PcacAxisChartConfig {
2154
2306
  spreadColorsPerGroup = false;
2155
2307
  /**
2156
2308
  * Bar colors, any CSS color, in place of the theme palette - by series, or by group with
2157
- * `spreadColorsPerGroup`. Repeated when there are more series (or groups) than colors. Empty,
2158
- * the theme palette is used.
2309
+ * `spreadColorsPerGroup`. Repeated when there are more series (or groups) than colors. Omitted
2310
+ * or empty, the theme palette is used - optional, as on every chart's config.
2159
2311
  */
2160
- colorOverride = [];
2312
+ colorOverride;
2161
2313
  }
2162
2314
 
2163
2315
  /**
2164
- * Provided per-component (see PcacBarVerticalChartComponent's `providers`), not root-scoped:
2316
+ * Provided per-component (see PcacBarVerticalChart's `providers`), not root-scoped:
2165
2317
  * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,
2166
2318
  * height, colors, svg). A root singleton would be shared and clobbered by every
2167
2319
  * <pcac-bar-vertical-chart> rendered at once.
@@ -2169,6 +2321,10 @@ class PcacBarHorizontalChartConfig extends PcacAxisChartConfig {
2169
2321
  class BarVerticalChartBuilder extends PcacChart {
2170
2322
  xScaleStacked;
2171
2323
  xScaleGrouped;
2324
+ /** Warns, once for this chart, about a `colorOverride` in its old `{ colors }` shape. */
2325
+ warnOfColorOverride = colorOverrideWarning();
2326
+ /** A bar's slot in `xScaleGrouped`, from its datum and its index in its group (see `seriesSlots`). */
2327
+ slotOf = (bar) => bar.key;
2172
2328
  yScale;
2173
2329
  barClickedSource = new Subject();
2174
2330
  barClicked$ = this.barClickedSource.asObservable();
@@ -2187,7 +2343,7 @@ class BarVerticalChartBuilder extends PcacChart {
2187
2343
  return;
2188
2344
  }
2189
2345
  this.ensureColorCount(seriesKeys(config.data).length);
2190
- this.applyColorOverride(barColorOverride(config.colorOverride));
2346
+ this.applyColorOverride(barColorOverride(config.colorOverride, this.warnOfColorOverride));
2191
2347
  this.buildScales(config);
2192
2348
  this.drawChart(chartElm, config);
2193
2349
  }
@@ -2204,11 +2360,13 @@ class BarVerticalChartBuilder extends PcacChart {
2204
2360
  // Rounded to whole pixels for crisp bar edges, while there's room to (see canRoundBands).
2205
2361
  .round(canRoundBands(this.width, config.data.length))
2206
2362
  .padding(0.1);
2363
+ const slots = seriesSlots(config.data);
2364
+ this.slotOf = slots.slotOf;
2207
2365
  this.xScaleGrouped = scaleBand()
2208
2366
  .padding(0.2)
2209
2367
  .range([0, this.xScaleStacked.bandwidth()])
2210
- .round(canRoundBands(this.xScaleStacked.bandwidth(), seriesKeys(config.data).length))
2211
- .domain(seriesKeys(config.data));
2368
+ .round(canRoundBands(this.xScaleStacked.bandwidth(), slots.domain.length))
2369
+ .domain(slots.domain);
2212
2370
  }
2213
2371
  drawChart(chartElm, config) {
2214
2372
  this.buildContainer(chartElm);
@@ -2216,7 +2374,7 @@ class BarVerticalChartBuilder extends PcacChart {
2216
2374
  this.drawGrids(this.xScaleStacked, this.yScale);
2217
2375
  this.addGroups(config);
2218
2376
  this.axisBuilder.raiseAxes(this.svg);
2219
- refreshTabStop(chartElm.nativeElement);
2377
+ this.restoreTabStop(chartElm);
2220
2378
  }
2221
2379
  addGroups(config) {
2222
2380
  const groupsContainer = this.svg.append('g')
@@ -2296,7 +2454,7 @@ class BarVerticalChartBuilder extends PcacChart {
2296
2454
  // A stacked bar spans its whole group, which is already translated into place; looking its
2297
2455
  // series key up in the group band put it off in another group's slot whenever the key
2298
2456
  // matched a group key.
2299
- .attr('x', (d) => config.isStacked ? 0 : this.xScaleGrouped(d.key) ?? 0)
2457
+ .attr('x', (d, i) => config.isStacked ? 0 : this.xScaleGrouped(this.slotOf(d, i)) ?? 0)
2300
2458
  .attr('data-group-bar-id', (_, i) => {
2301
2459
  return i;
2302
2460
  })
@@ -2414,12 +2572,12 @@ class BarVerticalChartBuilder extends PcacChart {
2414
2572
  }
2415
2573
  applyPreTransitionThresholdStyles(elm) {
2416
2574
  return elm.attr('class', 'pcac-threshold')
2417
- .attr('x', (d) => {
2575
+ .attr('x', (d, i) => {
2418
2576
  // Not every caller's selection has a per-item PcacData bound (the whole-chart threshold
2419
2577
  // rect has none), hence the defensive fallback rather than assuming `d` is always present.
2420
2578
  const datum = d;
2421
2579
  // ScaleBand can return undefined for a key outside its domain; `.attr()` needs null, not undefined.
2422
- return this.xScaleGrouped(datum ? datum.key : '') ?? null;
2580
+ return this.xScaleGrouped(datum ? this.slotOf(datum, i) : '') ?? null;
2423
2581
  })
2424
2582
  .attr('y', () => {
2425
2583
  return this.height;
@@ -2448,7 +2606,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
2448
2606
  type: Injectable
2449
2607
  }] });
2450
2608
 
2451
- class PcacBarVerticalChartComponent {
2609
+ class PcacBarVerticalChart {
2452
2610
  chartBuilder = inject(BarVerticalChartBuilder);
2453
2611
  config = input.required(/* @ts-ignore */
2454
2612
  ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
@@ -2485,10 +2643,10 @@ class PcacBarVerticalChartComponent {
2485
2643
  this.chartBuilder.buildChart(this.chartElm(), config);
2486
2644
  }
2487
2645
  }
2488
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarVerticalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2489
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacBarVerticalChartComponent, isStandalone: true, selector: "pcac-bar-vertical-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { barClicked: "barClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [BarVerticalChartBuilder], queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-bar-vertical-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-vertical-chart svg{width:100%;display:block}pcac-bar-vertical-chart.pcac-height-full{display:block;height:100%}pcac-bar-vertical-chart.pcac-height-full .pcac-bar-vertical-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
2646
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarVerticalChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2647
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacBarVerticalChart, isStandalone: true, selector: "pcac-bar-vertical-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { barClicked: "barClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [BarVerticalChartBuilder], queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-bar-vertical-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-vertical-chart svg{width:100%;display:block}pcac-bar-vertical-chart.pcac-height-full{display:block;height:100%}pcac-bar-vertical-chart.pcac-height-full .pcac-bar-vertical-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
2490
2648
  }
2491
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarVerticalChartComponent, decorators: [{
2649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacBarVerticalChart, decorators: [{
2492
2650
  type: Component,
2493
2651
  args: [{ selector: 'pcac-bar-vertical-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, encapsulation: ViewEncapsulation.None, providers: [BarVerticalChartBuilder], template: "<section class=\"pcac-bar-vertical-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-vertical-chart svg{width:100%;display:block}pcac-bar-vertical-chart.pcac-height-full{display:block;height:100%}pcac-bar-vertical-chart.pcac-height-full .pcac-bar-vertical-chart{height:100%}\n"] }]
2494
2652
  }], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], chartElm: [{ type: i0.ViewChild, args: ['chart', { isSignal: true }] }], barClicked: [{ type: i0.Output, args: ["barClicked"] }], tooltipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PcacTooltipDirective), { isSignal: true }] }] } });
@@ -2499,10 +2657,10 @@ class PcacBarVerticalChartConfig extends PcacAxisChartConfig {
2499
2657
  spreadColorsPerGroup = false;
2500
2658
  /**
2501
2659
  * Bar colors, any CSS color, in place of the theme palette - by series, or by group with
2502
- * `spreadColorsPerGroup`. Repeated when there are more series (or groups) than colors. Empty,
2503
- * the theme palette is used.
2660
+ * `spreadColorsPerGroup`. Repeated when there are more series (or groups) than colors. Omitted
2661
+ * or empty, the theme palette is used - optional, as on every chart's config.
2504
2662
  */
2505
- colorOverride = [];
2663
+ colorOverride;
2506
2664
  }
2507
2665
 
2508
2666
  // Only what a consumer configures, binds or styles with. The chart plumbing - the `PcacChart`
@@ -2533,14 +2691,14 @@ class PcacLegend {
2533
2691
  this.itemClicked.emit(items);
2534
2692
  }
2535
2693
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacLegend, deps: [], target: i0.ɵɵFactoryTarget.Component });
2536
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: PcacLegend, isStandalone: true, selector: "pcac-legend", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { config: "configChange", itemClicked: "itemClicked" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "config().heading ? headingId : null" } }, ngImport: i0, template: "<div class=\"pcac-legend-label\" [id]=\"headingId\"><small>{{config().heading}}</small></div>\n@for(item of config().items; track $index; let i = $index) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-unchecked]=\"!item.checked\"\n role=\"switch\" [attr.aria-checked]=\"item.checked\" tabindex=\"0\" (click)=\"onItemClicked(i)\"\n (keydown.enter)=\"onItemClicked(i)\" (keydown.space)=\"onItemClicked(i); $event.preventDefault()\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}\n", styles: [":host{display:flex;align-items:center;flex-wrap:wrap;column-gap:8px}.pcac-legend-label{margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;min-height:24px}.pcac-legend-item:hover .pcac-legend-circle{box-shadow:0 0 6px #0000004d;transform:scale(1.2)}.pcac-legend-circle{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:4px;transition:box-shadow .3s ease,transform .3s ease}.pcac-legend-unchecked{opacity:.5}.pcac-legend-item:focus-visible{outline:2px solid currentColor;outline-offset:2px}\n"] });
2694
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: PcacLegend, isStandalone: true, selector: "pcac-legend", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { config: "configChange", itemClicked: "itemClicked" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "config().heading ? headingId : null" } }, ngImport: i0, template: "@if (config().heading) {\n<div class=\"pcac-legend-label\" [id]=\"headingId\"><small>{{config().heading}}</small></div>\n}\n@for(item of config().items; track $index; let i = $index) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-unchecked]=\"!item.checked\"\n role=\"switch\" [attr.aria-checked]=\"item.checked\" tabindex=\"0\" (click)=\"onItemClicked(i)\"\n (keydown.enter)=\"onItemClicked(i)\" (keydown.space)=\"onItemClicked(i); $event.preventDefault()\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}\n", styles: [":host{display:flex;align-items:center;flex-wrap:wrap;column-gap:8px}.pcac-legend-label{margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;min-height:24px}.pcac-legend-item:hover .pcac-legend-circle{box-shadow:0 0 6px #0000004d;transform:scale(1.2)}.pcac-legend-circle{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:4px;transition:box-shadow .3s ease,transform .3s ease}@media(prefers-reduced-motion:reduce){.pcac-legend-circle{transition:none}}.pcac-legend-unchecked{opacity:.5}.pcac-legend-item:focus-visible{outline:2px solid currentColor;outline-offset:2px}\n"] });
2537
2695
  }
2538
2696
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacLegend, decorators: [{
2539
2697
  type: Component,
2540
2698
  args: [{ selector: 'pcac-legend', host: {
2541
2699
  role: 'group',
2542
2700
  '[attr.aria-labelledby]': 'config().heading ? headingId : null',
2543
- }, template: "<div class=\"pcac-legend-label\" [id]=\"headingId\"><small>{{config().heading}}</small></div>\n@for(item of config().items; track $index; let i = $index) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-unchecked]=\"!item.checked\"\n role=\"switch\" [attr.aria-checked]=\"item.checked\" tabindex=\"0\" (click)=\"onItemClicked(i)\"\n (keydown.enter)=\"onItemClicked(i)\" (keydown.space)=\"onItemClicked(i); $event.preventDefault()\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}\n", styles: [":host{display:flex;align-items:center;flex-wrap:wrap;column-gap:8px}.pcac-legend-label{margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;min-height:24px}.pcac-legend-item:hover .pcac-legend-circle{box-shadow:0 0 6px #0000004d;transform:scale(1.2)}.pcac-legend-circle{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:4px;transition:box-shadow .3s ease,transform .3s ease}.pcac-legend-unchecked{opacity:.5}.pcac-legend-item:focus-visible{outline:2px solid currentColor;outline-offset:2px}\n"] }]
2701
+ }, template: "@if (config().heading) {\n<div class=\"pcac-legend-label\" [id]=\"headingId\"><small>{{config().heading}}</small></div>\n}\n@for(item of config().items; track $index; let i = $index) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-unchecked]=\"!item.checked\"\n role=\"switch\" [attr.aria-checked]=\"item.checked\" tabindex=\"0\" (click)=\"onItemClicked(i)\"\n (keydown.enter)=\"onItemClicked(i)\" (keydown.space)=\"onItemClicked(i); $event.preventDefault()\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}\n", styles: [":host{display:flex;align-items:center;flex-wrap:wrap;column-gap:8px}.pcac-legend-label{margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;min-height:24px}.pcac-legend-item:hover .pcac-legend-circle{box-shadow:0 0 6px #0000004d;transform:scale(1.2)}.pcac-legend-circle{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:4px;transition:box-shadow .3s ease,transform .3s ease}@media(prefers-reduced-motion:reduce){.pcac-legend-circle{transition:none}}.pcac-legend-unchecked{opacity:.5}.pcac-legend-item:focus-visible{outline:2px solid currentColor;outline-offset:2px}\n"] }]
2544
2702
  }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }, { type: i0.Output, args: ["configChange"] }], itemClicked: [{ type: i0.Output, args: ["itemClicked"] }] } });
2545
2703
 
2546
2704
  var PcacLineAreaPlotChartConfigType;
@@ -2620,10 +2778,11 @@ class PcacLineAreaChartConfig extends PcacAxisChartConfig {
2620
2778
  enableZoomX = false;
2621
2779
  enableZoomY = false;
2622
2780
  /**
2623
- * Hex color codes to override the default colors, one per series in order. Repeats from the
2624
- * start when there are more series than colors, as the default palette does.
2781
+ * Series colors, any CSS color, in place of the theme palette, one per series in order. Repeats
2782
+ * from the start when there are more series than colors, as the default palette does. Omitted or
2783
+ * empty, the theme palette is used - optional, as on every chart's config.
2625
2784
  */
2626
- colorOverride = [];
2785
+ colorOverride;
2627
2786
  /**
2628
2787
  * Bounding box for any point images (`PcacData.image`) on this chart. Optional; each field falls
2629
2788
  * back to the `PcacPointImageConfig` default when not given, so a consumer only setting `image`
@@ -3303,7 +3462,8 @@ class PlaChartBuilder extends PcacChart {
3303
3462
  restoringZoom = false;
3304
3463
  lineGenerator;
3305
3464
  areaGenerator;
3306
- zoomBehavior;
3465
+ /** This build's zoom behavior; `null` while zoom is off. */
3466
+ zoomBehavior = null;
3307
3467
  dotClickedSource = new Subject();
3308
3468
  config;
3309
3469
  /**
@@ -3390,13 +3550,17 @@ class PlaChartBuilder extends PcacChart {
3390
3550
  this.lineGenerator = buildLineGenerator(this.xAxis.format, this.scales);
3391
3551
  this.areaGenerator = buildAreaGenerator(this.xAxis.format, this.scales, this.height);
3392
3552
  if (this.zoomEnabled) {
3393
- this.zoomBehavior = buildZoomBehavior(this.width, this.height, (event) => {
3553
+ const behavior = buildZoomBehavior(this.width, this.height, (event) => {
3394
3554
  // Zoom moves the points, not the mouse: the hovered one slides out from under a still
3395
3555
  // cursor (or is hidden outright, see `pointDisplay`), and either way the browser never
3396
3556
  // sends it a mouseout - its tooltip would stay up, and its dot stay grown, until the
3397
3557
  // cursor happened to cross it again. So the hover is ended here, on every zoom event.
3398
- // The build's own starting zoom, handed to the behavior: already drawn that way.
3399
- if (this.restoringZoom) {
3558
+ // The build's own starting zoom, handed to the behavior: already drawn that way. And a
3559
+ // gesture begun on an earlier build - a drag still going when live data or a resize redrew
3560
+ // the chart, which d3-zoom carries on through listeners on the window - belongs to a
3561
+ // drawing that's gone: left to run, it moved this one and overwrote the kept zoom with its
3562
+ // own, and the next gesture snapped back.
3563
+ if (this.restoringZoom || behavior !== this.zoomBehavior) {
3400
3564
  return;
3401
3565
  }
3402
3566
  this.leavePoint();
@@ -3458,6 +3622,10 @@ class PlaChartBuilder extends PcacChart {
3458
3622
  this.svg.selectAll('.fan-outs').raise();
3459
3623
  this.svg.selectAll('.dots').raise();
3460
3624
  });
3625
+ this.zoomBehavior = behavior;
3626
+ }
3627
+ else {
3628
+ this.zoomBehavior = null;
3461
3629
  }
3462
3630
  this.drawChart(chartElm, this.config, type);
3463
3631
  }
@@ -3491,7 +3659,7 @@ class PlaChartBuilder extends PcacChart {
3491
3659
  this.drawPointRanges();
3492
3660
  this.drawFanOuts();
3493
3661
  this.drawDots(config);
3494
- refreshTabStop(chartElm.nativeElement);
3662
+ this.restoreTabStop(chartElm);
3495
3663
  }
3496
3664
  /**
3497
3665
  * Resolves `pointImage`, finds the points that share a coordinate and, on a plot chart with
@@ -3608,7 +3776,8 @@ class PlaChartBuilder extends PcacChart {
3608
3776
  return zoomIdentity.translate(kept.x * this.width, kept.y * this.height).scale(kept.k);
3609
3777
  }
3610
3778
  attachZoomBehavior() {
3611
- if (!this.zoomEnabled)
3779
+ const zoom = this.zoomBehavior;
3780
+ if (!this.zoomEnabled || !zoom)
3612
3781
  return;
3613
3782
  // A transparent rect so the empty plot area is a hit target too: a `<g>` has no area of its
3614
3783
  // own, so wheel/drag only reaches it through something painted. The rect is only ever that -
@@ -3629,12 +3798,12 @@ class PlaChartBuilder extends PcacChart {
3629
3798
  .attr('height', this.height)
3630
3799
  .attr('fill', 'none')
3631
3800
  .attr('pointer-events', 'all');
3632
- this.svg.call(this.zoomBehavior);
3801
+ this.svg.call(zoom);
3633
3802
  // A resumed zoom is already drawn (`scales`); the behavior is told it too, so the next gesture
3634
3803
  // carries on from there rather than from the whole domain.
3635
3804
  if (this.startZoom) {
3636
3805
  this.restoringZoom = true;
3637
- this.svg.call(this.zoomBehavior.transform, this.startZoom);
3806
+ this.svg.call(zoom.transform, this.startZoom);
3638
3807
  this.restoringZoom = false;
3639
3808
  }
3640
3809
  }
@@ -4081,11 +4250,11 @@ class PcacLineAreaChartComponent {
4081
4250
  }
4082
4251
  }
4083
4252
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4084
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacLineAreaChartComponent, isStandalone: true, selector: "pcac-line-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, tooltipTemplate: { classPropertyName: "tooltipTemplate", publicName: "tooltipTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [PlaChartBuilder, PlaChartEffectsBuilder], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:#ced4da;stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:#343a40}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
4253
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacLineAreaChartComponent, isStandalone: true, selector: "pcac-line-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, tooltipTemplate: { classPropertyName: "tooltipTemplate", publicName: "tooltipTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [PlaChartBuilder, PlaChartEffectsBuilder], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:var(--pcac-crosshair-line-color, #ced4da);stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:var(--pcac-crosshair-text-color, #343a40)}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
4085
4254
  }
4086
4255
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
4087
4256
  type: Component,
4088
- args: [{ selector: 'pcac-line-area-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, encapsulation: ViewEncapsulation.None, providers: [PlaChartBuilder, PlaChartEffectsBuilder], template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:#ced4da;stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:#343a40}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"] }]
4257
+ args: [{ selector: 'pcac-line-area-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, encapsulation: ViewEncapsulation.None, providers: [PlaChartBuilder, PlaChartEffectsBuilder], template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:var(--pcac-crosshair-line-color, #ced4da);stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:var(--pcac-crosshair-text-color, #343a40)}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"] }]
4089
4258
  }], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], chartElm: [{ type: i0.ViewChild, args: ['chart', { isSignal: true }] }], dotClicked: [{ type: i0.Output, args: ["dotClicked"] }], tooltipTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipTemplate", required: false }] }] } });
4090
4259
 
4091
4260
  class PcacPlotChart {
@@ -4363,7 +4532,7 @@ class PieDonutChartBuilder extends PcacChart {
4363
4532
  rest(slice, d);
4364
4533
  },
4365
4534
  });
4366
- refreshTabStop(chartElm.nativeElement);
4535
+ this.restoreTabStop(chartElm);
4367
4536
  slices
4368
4537
  // Named, so the hover transitions (unnamed) and the check above can tell it apart from them.
4369
4538
  .transition('enter')
@@ -4549,5 +4718,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
4549
4718
  * Generated bundle index. Do not edit.
4550
4719
  */
4551
4720
 
4552
- export { PcacAreaChart, PcacAreaChartConfig, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChartComponent, PcacBarVerticalChartConfig, PcacChartConfig, PcacColorService, PcacData, PcacDataRange, PcacDonutChart, PcacDonutChartConfig, PcacFormatEnum, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChart, PcacPieChartConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointFanOutConfig, PcacPointImageConfig, PcacPointRangeConfig, PcacPointRangeShow, PcacPointRangeStyle, PcacRangeBounds, PcacTooltipDirective };
4721
+ export { PcacAreaChart, PcacAreaChartConfig, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChart, PcacBarHorizontalChart as PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChart, PcacBarVerticalChart as PcacBarVerticalChartComponent, PcacBarVerticalChartConfig, PcacChartConfig, PcacColorService, PcacData, PcacDataRange, PcacDonutChart, PcacDonutChartConfig, PcacFormatEnum, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChart, PcacPieChartConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointFanOutConfig, PcacPointImageConfig, PcacPointRangeConfig, PcacPointRangeShow, PcacPointRangeStyle, PcacRangeBounds, PcacTooltipDirective };
4553
4722
  //# sourceMappingURL=pioneer-code-pioneer-charts.mjs.map