@pioneer-code/pioneer-charts 22.2.3 → 22.2.5

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.
@@ -284,7 +284,7 @@ class PcacAxisBuilder {
284
284
  });
285
285
  break;
286
286
  case PcacFormatEnum.Decimal:
287
- xAxis.tickFormat((d) => format(".2s")(d));
287
+ xAxis.tickFormat(decimalTickFormat(config.xScale, config.xAxis.ticks));
288
288
  break;
289
289
  }
290
290
  const group = config.svg.append('g')
@@ -331,15 +331,29 @@ class PcacAxisBuilder {
331
331
  text('pcac-axis-sub-label', layout.length, edge, 'end', sub.max);
332
332
  }
333
333
  }
334
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacAxisBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
335
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacAxisBuilder, providedIn: 'root' });
334
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacAxisBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
335
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacAxisBuilder, providedIn: 'root' });
336
336
  }
337
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacAxisBuilder, decorators: [{
337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacAxisBuilder, decorators: [{
338
338
  type: Injectable,
339
339
  args: [{
340
340
  providedIn: 'root',
341
341
  }]
342
342
  }] });
343
+ /**
344
+ * Tick labels for a `Decimal` axis: SI-prefixed (`1.5k`), with the precision taken from the
345
+ * scale's own tick step rather than fixed. A fixed two significant digits (`.2s`) is fine for a
346
+ * whole domain but breaks down once zoom narrows it to a few units - ticks at 10.5, 11, 11.5, 12
347
+ * all rounded to `10 11 12 12`. `~` trims trailing zeros so a coarse step still reads `5 10 15`,
348
+ * not `5.0 10.0 15.0`. Falls back to the fixed format for a scale without `tickFormat` (a
349
+ * `Decimal` axis is always linear in practice, but the config type only promises `AxisScale`).
350
+ */
351
+ function decimalTickFormat(scale, ticks) {
352
+ const withTicks = scale;
353
+ const formatTick = withTicks.tickFormat ? withTicks.tickFormat(ticks, '~s') : (d) => format('.2s')(d);
354
+ // The prefix comes from the domain's largest value, which would label the origin `0k`.
355
+ return (d) => (Number(d) === 0 ? '0' : formatTick(d));
356
+ }
343
357
 
344
358
  /** Where along its axis each grid line sits, in pixels. */
345
359
  function gridLines(scale, numberOfTicks) {
@@ -386,10 +400,10 @@ class PcacGridBuilder {
386
400
  .attr('x2', config.width)
387
401
  .attr('class', (_, i) => (i === 0 ? 'pcac-grid-rule-last' : ''));
388
402
  }
389
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacGridBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
390
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacGridBuilder, providedIn: 'root' });
403
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacGridBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
404
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacGridBuilder, providedIn: 'root' });
391
405
  }
392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacGridBuilder, decorators: [{
406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacGridBuilder, decorators: [{
393
407
  type: Injectable,
394
408
  args: [{
395
409
  providedIn: 'root',
@@ -456,10 +470,10 @@ class PcacColorService {
456
470
  setAlert(color) {
457
471
  this.alert = color;
458
472
  }
459
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
460
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacColorService, providedIn: 'root' });
473
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
474
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacColorService, providedIn: 'root' });
461
475
  }
462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacColorService, decorators: [{
476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacColorService, decorators: [{
463
477
  type: Injectable,
464
478
  args: [{
465
479
  providedIn: 'root',
@@ -471,10 +485,10 @@ class PcacTransitionService {
471
485
  getTransitionDuration() {
472
486
  return this.transitionDuration;
473
487
  }
474
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTransitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
475
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTransitionService, providedIn: 'root' });
488
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTransitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
489
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTransitionService, providedIn: 'root' });
476
490
  }
477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTransitionService, decorators: [{
491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTransitionService, decorators: [{
478
492
  type: Injectable,
479
493
  args: [{
480
494
  providedIn: 'root',
@@ -608,10 +622,10 @@ class PcacTooltipBuilder {
608
622
  const finalValue = value ? value.toString() : value;
609
623
  return key ? key + '<br>' + finalValue : `${finalValue}`;
610
624
  }
611
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTooltipBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
612
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTooltipBuilder, providedIn: 'root' });
625
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTooltipBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
626
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTooltipBuilder, providedIn: 'root' });
613
627
  }
614
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTooltipBuilder, decorators: [{
628
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTooltipBuilder, decorators: [{
615
629
  type: Injectable,
616
630
  args: [{
617
631
  providedIn: 'root',
@@ -1243,10 +1257,10 @@ class BarHorizontalChartBuilder extends PcacChart {
1243
1257
  this.hideTooltip();
1244
1258
  });
1245
1259
  }
1246
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: BarHorizontalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1247
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: BarHorizontalChartBuilder });
1260
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: BarHorizontalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1261
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: BarHorizontalChartBuilder });
1248
1262
  }
1249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: BarHorizontalChartBuilder, decorators: [{
1263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: BarHorizontalChartBuilder, decorators: [{
1250
1264
  type: Injectable
1251
1265
  }] });
1252
1266
 
@@ -1299,10 +1313,10 @@ class PcacChartResizeService {
1299
1313
  destroyRef.onDestroy(() => observer.disconnect());
1300
1314
  });
1301
1315
  }
1302
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacChartResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1303
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacChartResizeService, providedIn: 'root' });
1316
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacChartResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1317
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacChartResizeService, providedIn: 'root' });
1304
1318
  }
1305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacChartResizeService, decorators: [{
1319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacChartResizeService, decorators: [{
1306
1320
  type: Injectable,
1307
1321
  args: [{ providedIn: 'root' }]
1308
1322
  }] });
@@ -1352,10 +1366,10 @@ class PcacTooltipDirective {
1352
1366
  static ngTemplateContextGuard(_dir, _ctx) {
1353
1367
  return true;
1354
1368
  }
1355
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1356
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: PcacTooltipDirective, isStandalone: true, selector: "ng-template[pcacTooltip]", ngImport: i0 });
1369
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1370
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: PcacTooltipDirective, isStandalone: true, selector: "ng-template[pcacTooltip]", ngImport: i0 });
1357
1371
  }
1358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacTooltipDirective, decorators: [{
1372
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacTooltipDirective, decorators: [{
1359
1373
  type: Directive,
1360
1374
  args: [{
1361
1375
  selector: 'ng-template[pcacTooltip]'
@@ -1398,10 +1412,10 @@ class PcacBarHorizontalChartComponent {
1398
1412
  this.chartBuilder.buildChart(this.chartElm(), config);
1399
1413
  }
1400
1414
  }
1401
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacBarHorizontalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1402
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", 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 });
1415
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacBarHorizontalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1416
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", 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 });
1403
1417
  }
1404
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacBarHorizontalChartComponent, decorators: [{
1418
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacBarHorizontalChartComponent, decorators: [{
1405
1419
  type: Component,
1406
1420
  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"] }]
1407
1421
  }], 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 }] }] } });
@@ -1669,10 +1683,10 @@ class BarVerticalChartBuilder extends PcacChart {
1669
1683
  return '3px';
1670
1684
  });
1671
1685
  }
1672
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: BarVerticalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1673
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: BarVerticalChartBuilder });
1686
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: BarVerticalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1687
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: BarVerticalChartBuilder });
1674
1688
  }
1675
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: BarVerticalChartBuilder, decorators: [{
1689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: BarVerticalChartBuilder, decorators: [{
1676
1690
  type: Injectable
1677
1691
  }] });
1678
1692
 
@@ -1712,10 +1726,10 @@ class PcacBarVerticalChartComponent {
1712
1726
  this.chartBuilder.buildChart(this.chartElm(), config);
1713
1727
  }
1714
1728
  }
1715
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacBarVerticalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1716
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", 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 });
1729
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacBarVerticalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1730
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", 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 });
1717
1731
  }
1718
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacBarVerticalChartComponent, decorators: [{
1732
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacBarVerticalChartComponent, decorators: [{
1719
1733
  type: Component,
1720
1734
  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"] }]
1721
1735
  }], 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 }] }] } });
@@ -1751,10 +1765,10 @@ class PcacLegend {
1751
1765
  this.config.set({ ...this.config(), items });
1752
1766
  this.itemClicked.emit(items);
1753
1767
  }
1754
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacLegend, deps: [], target: i0.ɵɵFactoryTarget.Component });
1755
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: PcacLegend, isStandalone: true, selector: "pcac-legend", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { config: "configChange", itemClicked: "itemClicked" }, ngImport: i0, template: "<div class=\"pcac-legend-label\"><small>{{config().heading}}</small></div>\n@for(item of config().items; track $index; let i = $index; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [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}.pcac-legend-label{margin-right:8px;margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;margin-right:8px}.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-last{margin-right:0}.pcac-legend-item:focus-visible{outline:2px solid currentColor;outline-offset:2px}\n"] });
1768
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLegend, deps: [], target: i0.ɵɵFactoryTarget.Component });
1769
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: PcacLegend, isStandalone: true, selector: "pcac-legend", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { config: "configChange", itemClicked: "itemClicked" }, ngImport: i0, template: "<div class=\"pcac-legend-label\"><small>{{config().heading}}</small></div>\n@for(item of config().items; track $index; let i = $index; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [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}.pcac-legend-label{margin-right:8px;margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;margin-right:8px}.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-last{margin-right:0}.pcac-legend-item:focus-visible{outline:2px solid currentColor;outline-offset:2px}\n"] });
1756
1770
  }
1757
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacLegend, decorators: [{
1771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLegend, decorators: [{
1758
1772
  type: Component,
1759
1773
  args: [{ selector: 'pcac-legend', template: "<div class=\"pcac-legend-label\"><small>{{config().heading}}</small></div>\n@for(item of config().items; track $index; let i = $index; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [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}.pcac-legend-label{margin-right:8px;margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;margin-right:8px}.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-last{margin-right:0}.pcac-legend-item:focus-visible{outline:2px solid currentColor;outline-offset:2px}\n"] }]
1760
1774
  }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }, { type: i0.Output, args: ["configChange"] }], itemClicked: [{ type: i0.Output, args: ["itemClicked"] }] } });
@@ -1951,10 +1965,10 @@ class PlaChartEffectsBuilder {
1951
1965
  return 'translate(' + mousePos[0] + ',' + pos.y + ')';
1952
1966
  });
1953
1967
  }
1954
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PlaChartEffectsBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1955
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PlaChartEffectsBuilder });
1968
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PlaChartEffectsBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1969
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PlaChartEffectsBuilder });
1956
1970
  }
1957
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PlaChartEffectsBuilder, decorators: [{
1971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PlaChartEffectsBuilder, decorators: [{
1958
1972
  type: Injectable
1959
1973
  }] });
1960
1974
 
@@ -1962,7 +1976,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
1962
1976
  * How the plot chart spreads out points that share a coordinate (see
1963
1977
  * `PcacPlotChartConfig.pointFanOut`). Each group of coincident points is placed evenly around
1964
1978
  * a ring centered on the shared coordinate, starting at 12 o'clock and going clockwise in data
1965
- * order (series order, then point order), so every point stays visible and hoverable.
1979
+ * order (series order, then point order), so every point stays visible and hoverable. A ring at
1980
+ * the edge of the domain is moved back inside the plot area as one, so no member hangs over an
1981
+ * axis by more than half its mark - the same as a lone point there; the anchor stays put.
1966
1982
  */
1967
1983
  class PcacPointFanOutConfig {
1968
1984
  /**
@@ -2036,16 +2052,24 @@ class PlaChartScalesBuilder {
2036
2052
  }
2037
2053
  }
2038
2054
 
2055
+ /**
2056
+ * Whether a point has an x key to position by. An explicit emptiness check, not truthiness: a
2057
+ * Decimal key of `0` is a perfectly good coordinate (the left edge of a `domainMin: 0` axis) and
2058
+ * used to be read as "no key" - drawn at pixel 0 whatever the domain, and pinned there under zoom.
2059
+ */
2060
+ function hasKey(data) {
2061
+ return data.key !== null && data.key !== undefined && data.key !== '';
2062
+ }
2039
2063
  function getXFormat(type, data, index, xScale) {
2040
2064
  switch (type) {
2041
2065
  case PcacFormatEnum.DateTime:
2042
- if (data.key) {
2066
+ if (hasKey(data)) {
2043
2067
  return xScale(new Date(data.key));
2044
2068
  }
2045
2069
  return 0;
2046
2070
  case PcacFormatEnum.Decimal:
2047
- if (data.key) {
2048
- return xScale(data.key);
2071
+ if (hasKey(data)) {
2072
+ return xScale(Number(data.key));
2049
2073
  }
2050
2074
  return 0;
2051
2075
  default:
@@ -2126,9 +2150,9 @@ function findCoincidentGroups(series, xFormat) {
2126
2150
  function xPositionKey(xFormat, data, index) {
2127
2151
  switch (xFormat) {
2128
2152
  case PcacFormatEnum.DateTime:
2129
- return data.key ? new Date(data.key).getTime() : 'none';
2153
+ return hasKey(data) ? new Date(data.key).getTime() : 'none';
2130
2154
  case PcacFormatEnum.Decimal:
2131
- return data.key ? Number(data.key) : 'none';
2155
+ return hasKey(data) ? Number(data.key) : 'none';
2132
2156
  default:
2133
2157
  return index;
2134
2158
  }
@@ -2163,6 +2187,40 @@ function fanOutOffsets(groups, radius) {
2163
2187
  function round(value) {
2164
2188
  return Math.round(value * 100) / 100;
2165
2189
  }
2190
+ /**
2191
+ * How far to move a whole fanned-out ring so that none of its members' centers leave the plot
2192
+ * area - so a member at the edge of the domain hangs over the axis by at most half its mark,
2193
+ * exactly as a lone point at that coordinate would, rather than by half its mark plus the ring's
2194
+ * radius. The ring moves as one (its members keep their spacing) and the anchor stays put, so the
2195
+ * spokes simply get longer on the side that was pushed back. Per axis: if the ring pokes out past
2196
+ * 0 it comes back by that much, else if it pokes out past the far edge it comes back by that; a
2197
+ * ring too big to fit is kept in at the axis end, where the origin is.
2198
+ *
2199
+ * `anchor` is clamped to the plot area first, so once zoom carries a group's coordinate out of the
2200
+ * domain its members follow it out at the same pace instead of staying pinned to the edge (or
2201
+ * snapping the ring's radius the moment the anchor crosses): at the edge the correction is exactly
2202
+ * the outermost member's offset, and stays so beyond it.
2203
+ */
2204
+ function fanOutShift(anchor, offsets, plot) {
2205
+ const dxs = offsets.map((o) => o.dx);
2206
+ const dys = offsets.map((o) => o.dy);
2207
+ return {
2208
+ dx: axisShift(clamp(anchor.x, 0, plot.width), Math.min(...dxs), Math.max(...dxs), plot.width),
2209
+ dy: axisShift(clamp(anchor.y, 0, plot.height), Math.min(...dys), Math.max(...dys), plot.height),
2210
+ };
2211
+ }
2212
+ function axisShift(anchor, min, max, size) {
2213
+ if (anchor + min < 0) {
2214
+ return round(-(anchor + min));
2215
+ }
2216
+ if (anchor + max > size) {
2217
+ return round(size - (anchor + max));
2218
+ }
2219
+ return 0;
2220
+ }
2221
+ function clamp(value, min, max) {
2222
+ return Math.min(Math.max(value, min), max);
2223
+ }
2166
2224
 
2167
2225
  /**
2168
2226
  * Provided per-component (see PcacLineAreaChartComponent's `providers`), not root-scoped: this
@@ -2170,6 +2228,8 @@ function round(value) {
2170
2228
  * height, colors, svg). A root singleton would be shared and clobbered by every
2171
2229
  * <pcac-line-area-chart> rendered at once.
2172
2230
  */
2231
+ /** Half the theme's 2px line stroke: how far the lines/areas/fan-outs clip-path reaches past the plot. */
2232
+ const PLOT_CLIP_ALLOWANCE = 1;
2173
2233
  class PlaChartBuilder extends PcacChart {
2174
2234
  effectsBuilder = inject(PlaChartEffectsBuilder);
2175
2235
  scales;
@@ -2180,31 +2240,44 @@ class PlaChartBuilder extends PcacChart {
2180
2240
  config;
2181
2241
  clipPathId; // <-- added
2182
2242
  /**
2183
- * How far the clip-path rect extends past the drawable [0, width] x [0, height] area on every
2184
- * side, so a point sitting exactly on the domain's edge isn't cut in half. 10px comfortably
2185
- * clears a dot (r = 4, or 6 on hover); a point image can be much bigger than that, so
2186
- * buildChart() widens this to half the largest image dimension whenever any point has one
2187
- * (and grows the margins to match - see `reservePointImageSpace()` - since the clip-path only
2188
- * matters up to the edge of the SVG).
2243
+ * A second clip-path for everything that isn't a point - lines, areas, fan-out anchors and
2244
+ * spokes: the plot area plus `PLOT_CLIP_ALLOWANCE`. These have no business past the axes; the
2245
+ * points' buffer below used to apply to them too, so a line chart with big point images had
2246
+ * its lines run on half an image past the axes once zoomed.
2247
+ */
2248
+ plotClipPathId;
2249
+ /**
2250
+ * How far the points' clip-path rect extends past the drawable [0, width] x [0, height] area on
2251
+ * every side, so a point sitting exactly on the domain's edge isn't cut in half. 10px
2252
+ * comfortably clears a dot (r = 4, or 6 on hover); a point image can be much bigger than that,
2253
+ * so buildChart() widens this to half the largest image dimension whenever any point has one
2254
+ * (and grows the margins to match - see `reservePointSpace()` - since the clip-path only
2255
+ * matters up to the edge of the SVG). The buffer is only there for points whose center is
2256
+ * inside the plot; one whose center zoom has carried past an edge is hidden outright (see
2257
+ * `pointVisible`), rather than left showing up to a whole half-mark beyond the axis.
2189
2258
  */
2190
2259
  clipBuffer = 10;
2191
2260
  pointImage;
2192
2261
  /**
2193
2262
  * Points that share a coordinate, found by `resolvePointLayout()`. `coincidentOf` looks a
2194
- * point's group up for its tooltip; the rest only matter when `fanOut` is on (plot chart with
2195
- * `pointFanOut`): `fanOutOffsets` is where each member is drawn relative to its true position,
2196
- * and `fanOutReach` how far the farthest one sits from it, for the edge space to reserve.
2263
+ * point's group up for its tooltip and for its ring's shift (see `fanOutShift`); `fanOutOffsets`
2264
+ * only matters when `fanOut` is on (plot chart with `pointFanOut`) and is where each member sits
2265
+ * on its ring relative to the shared coordinate, before that shift.
2197
2266
  */
2198
2267
  coincidentGroups = [];
2199
2268
  coincidentOf = new Map();
2200
2269
  fanOut = null;
2201
2270
  fanOutOffsets = new Map();
2202
- fanOutReach = 0;
2271
+ /** The `.point` group under the cursor, between its mouseover and mouseout (see `leavePoint`). */
2272
+ hoveredPoint = null;
2203
2273
  dotClicked$ = this.dotClickedSource.asObservable();
2204
2274
  buildChart(chartElm, config, type) {
2205
2275
  if (!config?.data?.length) {
2206
2276
  return;
2207
2277
  }
2278
+ // A rebuild throws the hovered point away with everything else, and a removed element gets
2279
+ // no mouseout, so its tooltip is closed here (see `leavePoint`).
2280
+ this.leavePoint();
2208
2281
  this.config = JSON.parse(JSON.stringify(config));
2209
2282
  this.startData = range(this.config.data[0].data.length).map(() => ({
2210
2283
  key: '',
@@ -2230,6 +2303,11 @@ class PlaChartBuilder extends PcacChart {
2230
2303
  this.areaGenerator = buildAreaGenerator(this.xAxis.format, this.scales, this.height);
2231
2304
  if (this.zoomEnabled) {
2232
2305
  this.zoomBehavior = buildZoomBehavior(this.width, this.height, (event) => {
2306
+ // Zoom moves the points, not the mouse: the hovered one slides out from under a still
2307
+ // cursor (or is hidden outright, see `pointDisplay`), and either way the browser never
2308
+ // sends it a mouseout - its tooltip would stay up, and its dot stay grown, until the
2309
+ // cursor happened to cross it again. So the hover is ended here, on every zoom event.
2310
+ this.leavePoint();
2233
2311
  // A d3 zoom transform is always two-dimensional; only the enabled axes follow it and the
2234
2312
  // other keeps its original scale, so that component of the gesture is simply ignored.
2235
2313
  const newX = this.config.enableZoomX ? event.transform.rescaleX(this.scales.x) : this.scales.x;
@@ -2263,10 +2341,16 @@ class PlaChartBuilder extends PcacChart {
2263
2341
  // (DatasetLength) positions by index, and a flat selection would number every series'
2264
2342
  // points consecutively, shoving the second series' points off to the right on zoom.
2265
2343
  this.svg.selectAll('.dots').selectAll('.point')
2266
- .attr('transform', (d, i) => this.pointTransform(d, i, zoomedScales));
2267
- // A fan-out's anchor is positioned like the points it belongs to, so it moves the same way.
2344
+ .attr('transform', (d, i) => this.pointTransform(d, i, zoomedScales))
2345
+ .attr('display', (d, i) => this.pointDisplay(d, i, zoomedScales));
2346
+ // A fan-out's anchor is positioned like the points it belongs to, so it moves the same way;
2347
+ // its spokes are re-aimed because the ring's shift back into the plot (`fanOutShift`)
2348
+ // depends on where the anchor now is.
2268
2349
  this.svg.selectAll('.fan-out')
2269
- .attr('transform', (g) => this.fanOutTransform(g, zoomedScales));
2350
+ .attr('transform', (g) => this.fanOutTransform(g, zoomedScales))
2351
+ .selectAll('.fan-out-spoke')
2352
+ .attr('x2', (member) => this.spokeEnd(member, zoomedScales).dx)
2353
+ .attr('y2', (member) => this.spokeEnd(member, zoomedScales).dy);
2270
2354
  // The hover crosshair walks the (already updated) line geometry, but reads its value back
2271
2355
  // off the y scale - which must be the zoomed one or the label is wrong.
2272
2356
  if (this.config.enableEffects) {
@@ -2308,8 +2392,7 @@ class PlaChartBuilder extends PcacChart {
2308
2392
  /**
2309
2393
  * Resolves `pointImage`, finds the points that share a coordinate and, on a plot chart with
2310
2394
  * `pointFanOut`, works out where to draw each of them instead. Coincidence is found from the
2311
- * data (see `findCoincidentGroups`) so this can run before the scales exist - it has to, as
2312
- * `reservePointSpace()` needs the fan-out's reach before the plot area is sized. Line and area
2395
+ * data (see `findCoincidentGroups`) so this can run before the scales exist. Line and area
2313
2396
  * charts still get the groups, for the tooltip's `coincident` list, but never an offset.
2314
2397
  */
2315
2398
  resolvePointLayout(type) {
@@ -2322,7 +2405,6 @@ class PlaChartBuilder extends PcacChart {
2322
2405
  if (!fanOut) {
2323
2406
  this.fanOut = null;
2324
2407
  this.fanOutOffsets = new Map();
2325
- this.fanOutReach = 0;
2326
2408
  return;
2327
2409
  }
2328
2410
  this.fanOut = { ...new PcacPointFanOutConfig(), ...fanOut };
@@ -2332,34 +2414,35 @@ class PlaChartBuilder extends PcacChart {
2332
2414
  const markSize = (group) => group.members.some((member) => !!member.data.image) ? Math.max(maxWidth, maxHeight) : 12;
2333
2415
  const radius = (group) => this.fanOut.radius ?? fanOutRadius(group.members.length, markSize(group), this.fanOut.gap);
2334
2416
  this.fanOutOffsets = fanOutOffsets(this.coincidentGroups, radius);
2335
- this.fanOutReach = Math.ceil(Math.max(0, ...this.coincidentGroups.map(radius)));
2336
2417
  }
2337
2418
  /**
2338
- * When any point has an `image`, or a fan-out has moved points off their coordinate, makes
2339
- * room for them at the edge of the domain: the clip-path buffer grows to half the box (plus
2340
- * the fan-out's reach) so the `.dots` group lets it through, and the margins grow to at least
2341
- * that same amount so the `<svg>` doesn't cut off what the clip-path let through (an image box
2342
- * is centered on its point, so at the top of the y domain half of it sits above the plot area
2343
- * - in `margin.top`, which is only 8px by default). A fanned-out plain dot needs the same
2344
- * treatment, its hovered radius plus the reach. Must run after `resolvePointLayout()` and
2345
- * between `initializeAxisState()` and `initializeChartState()`, see `reserveEdgeSpace`.
2419
+ * When any point has an `image`, makes room for it at the edge of the domain: the clip-path
2420
+ * buffer grows to half the box so the `.dots` group lets it through, and the margins grow to at
2421
+ * least that same amount so the `<svg>` doesn't cut off what the clip-path let through (an image
2422
+ * box is centered on its point, so at the top of the y domain half of it sits above the plot
2423
+ * area - in `margin.top`, which is only 8px by default). Half the box is all a fan-out needs
2424
+ * too: a fanned-out ring is shifted back inside the plot area (`fanOutShift`), so no member's
2425
+ * center ever sits past the edge either. Must run after `resolvePointLayout()` and between
2426
+ * `initializeAxisState()` and `initializeChartState()`, see `reserveEdgeSpace`.
2346
2427
  */
2347
2428
  reservePointSpace() {
2348
2429
  const hasImages = this.config.data.some((series) => series.data.some((point) => !!point.image));
2349
- if (!hasImages && this.fanOutReach === 0) {
2430
+ if (!hasImages) {
2350
2431
  this.clipBuffer = 10;
2351
2432
  return;
2352
2433
  }
2353
- const halfWidth = (hasImages ? Math.ceil(this.pointImage.maxWidth / 2) : 6) + this.fanOutReach;
2354
- const halfHeight = (hasImages ? Math.ceil(this.pointImage.maxHeight / 2) : 6) + this.fanOutReach;
2434
+ const halfWidth = Math.ceil(this.pointImage.maxWidth / 2);
2435
+ const halfHeight = Math.ceil(this.pointImage.maxHeight / 2);
2355
2436
  this.clipBuffer = Math.max(10, halfWidth, halfHeight);
2356
2437
  this.reserveEdgeSpace({ top: halfHeight, bottom: halfHeight, left: halfWidth, right: halfWidth });
2357
2438
  }
2358
2439
  createReusableClipPath() {
2359
- this.clipPathId = `pcac-clip-${Date.now()}-${Math.floor(Math.random() * 10000)}`;
2360
- this.svg.selectAll(`defs #${this.clipPathId}`).remove();
2361
- this.svg.append('defs')
2362
- .append('clipPath')
2440
+ const stamp = `${Date.now()}-${Math.floor(Math.random() * 10000)}`;
2441
+ this.clipPathId = `pcac-clip-${stamp}`;
2442
+ this.plotClipPathId = `pcac-clip-plot-${stamp}`;
2443
+ this.svg.selectAll(`defs #${this.clipPathId}, defs #${this.plotClipPathId}`).remove();
2444
+ const defs = this.svg.append('defs');
2445
+ defs.append('clipPath')
2363
2446
  .attr('id', this.clipPathId)
2364
2447
  .append('rect')
2365
2448
  // Extend the clip-path past the drawable area on every side so a dot (or point image) at
@@ -2368,6 +2451,17 @@ class PlaChartBuilder extends PcacChart {
2368
2451
  .attr('y', -this.clipBuffer)
2369
2452
  .attr('width', this.width + this.clipBuffer * 2)
2370
2453
  .attr('height', this.height + this.clipBuffer * 2);
2454
+ // Lines, areas and the fan-out anchors and spokes get the plot area itself, give or take a
2455
+ // stroke: a line along the domain's max keeps its full width rather than being halved at
2456
+ // the edge, but nothing runs on into the points' buffer - a spoke to a member that zoom has
2457
+ // carried out of the plot (and hidden, see `pointVisible`) stops at the axis.
2458
+ defs.append('clipPath')
2459
+ .attr('id', this.plotClipPathId)
2460
+ .append('rect')
2461
+ .attr('x', -PLOT_CLIP_ALLOWANCE)
2462
+ .attr('y', -PLOT_CLIP_ALLOWANCE)
2463
+ .attr('width', this.width + PLOT_CLIP_ALLOWANCE * 2)
2464
+ .attr('height', this.height + PLOT_CLIP_ALLOWANCE * 2);
2371
2465
  }
2372
2466
  get zoomEnabled() {
2373
2467
  return !!(this.config.enableZoomX || this.config.enableZoomY);
@@ -2375,9 +2469,17 @@ class PlaChartBuilder extends PcacChart {
2375
2469
  attachZoomBehavior() {
2376
2470
  if (!this.zoomEnabled)
2377
2471
  return;
2378
- // Add a transparent rect to capture zoom events
2472
+ // A transparent rect so the empty plot area is a hit target too: a `<g>` has no area of its
2473
+ // own, so wheel/drag only reaches it through something painted. The rect is only ever that -
2474
+ // the behavior is attached once, to the group, and the rect's events bubble up to it. It used
2475
+ // to be `.call()`ed on both, and d3-zoom keeps its transform per element (`__zoom`): a wheel
2476
+ // over a point never passes through the rect (a sibling of the `.dots`, not an ancestor), so
2477
+ // only the group's transform advanced, and once the point had slid out from under the cursor
2478
+ // the next tick hit the rect - whose handler redrew from its own stale, near-identity
2479
+ // transform before the group's redrew from the real one, every tick, flickering the chart
2480
+ // between the two.
2379
2481
  //
2380
- // d3's `ZoomBehavior<Element, unknown>` vs. our concretely-typed `Selection<SVGRectElement|SVGGElement, ...>`
2482
+ // d3's `ZoomBehavior<Element, unknown>` vs. our concretely-typed `Selection<SVGGElement, ...>`
2381
2483
  // is a known D3+TS typings friction point: `.call()` structurally compares nested generic Selection
2382
2484
  // methods (`.merge()`, `.select()`, ...) and those never line up across two different concrete element
2383
2485
  // types, even though a zoom behavior works on any element at runtime. Narrow, local `any` escape hatch.
@@ -2385,13 +2487,8 @@ class PlaChartBuilder extends PcacChart {
2385
2487
  .attr('width', this.width)
2386
2488
  .attr('height', this.height)
2387
2489
  .attr('fill', 'none')
2388
- .attr('pointer-events', 'all')
2389
- .call(this.zoomBehavior)
2390
- .transition()
2391
- .duration(750);
2392
- this.svg.call(this.zoomBehavior)
2393
- .transition()
2394
- .duration(750);
2490
+ .attr('pointer-events', 'all');
2491
+ this.svg.call(this.zoomBehavior);
2395
2492
  }
2396
2493
  drawLineArea(config, type) {
2397
2494
  for (let i = 0; i < config.data.length; i++) {
@@ -2406,7 +2503,7 @@ class PlaChartBuilder extends PcacChart {
2406
2503
  drawLine(lineData, index, hide = false) {
2407
2504
  this.svg.append('g')
2408
2505
  .attr('class', 'lines')
2409
- .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip-path to line group
2506
+ .attr('clip-path', `url(#${this.plotClipPathId})`)
2410
2507
  .append('path')
2411
2508
  .datum(lineData)
2412
2509
  .attr('class', 'line')
@@ -2423,7 +2520,7 @@ class PlaChartBuilder extends PcacChart {
2423
2520
  drawArea(lineData, index, hide = false) {
2424
2521
  this.svg.append('g')
2425
2522
  .attr('class', 'areas')
2426
- .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip
2523
+ .attr('clip-path', `url(#${this.plotClipPathId})`)
2427
2524
  .append('path')
2428
2525
  .datum(lineData)
2429
2526
  .attr('class', 'area')
@@ -2442,10 +2539,11 @@ class PlaChartBuilder extends PcacChart {
2442
2539
  /**
2443
2540
  * Draws one `<g class="fan-outs">` holding a `<g class="fan-out">` per group of coincident
2444
2541
  * points: a spoke from the shared coordinate to where each member is drawn, and an anchor dot
2445
- * on the coordinate itself. Only when the fan-out is on and asks for anchors. The group is
2446
- * positioned by the same translate as a point (see `drawDots`), so zoom moves it the same
2447
- * way and everything inside is relative to the coordinate; it fades in over the points' own
2448
- * entry transition.
2542
+ * on the coordinate itself. Only when the fan-out is on and asks for anchors. The group sits on
2543
+ * the true coordinate (unlike a point group, which also carries its ring's shift - see
2544
+ * `pointTransform`), so zoom moves it the same way and everything inside is relative to the
2545
+ * coordinate; each spoke ends where its member is actually drawn, ring offset plus shift. It
2546
+ * fades in over the points' own entry transition.
2449
2547
  */
2450
2548
  drawFanOuts() {
2451
2549
  if (!this.fanOut?.showAnchor || this.coincidentGroups.length === 0) {
@@ -2453,20 +2551,20 @@ class PlaChartBuilder extends PcacChart {
2453
2551
  }
2454
2552
  const groups = this.svg.append('g')
2455
2553
  .attr('class', 'fan-outs')
2456
- .attr('clip-path', `url(#${this.clipPathId})`)
2554
+ .attr('clip-path', `url(#${this.plotClipPathId})`)
2457
2555
  .selectAll('.fan-out')
2458
2556
  .data(this.coincidentGroups)
2459
2557
  .enter().append('g')
2460
2558
  .attr('class', 'fan-out')
2461
2559
  .attr('transform', (group) => this.fanOutTransform(group, this.scales));
2462
2560
  groups.selectAll('.fan-out-spoke')
2463
- .data((group) => group.members.map((member) => this.offsetOf(member.data)))
2561
+ .data((group) => group.members)
2464
2562
  .enter().append('line')
2465
2563
  .attr('class', 'fan-out-spoke')
2466
2564
  .attr('x1', 0)
2467
2565
  .attr('y1', 0)
2468
- .attr('x2', (spoke) => spoke.dx)
2469
- .attr('y2', (spoke) => spoke.dy);
2566
+ .attr('x2', (member) => this.spokeEnd(member, this.scales).dx)
2567
+ .attr('y2', (member) => this.spokeEnd(member, this.scales).dy);
2470
2568
  groups.append('circle')
2471
2569
  .attr('class', 'fan-out-anchor')
2472
2570
  .attr('r', 3);
@@ -2483,8 +2581,9 @@ class PlaChartBuilder extends PcacChart {
2483
2581
  * in its place, and sits at the group's origin. Both animate in from the baseline the same way
2484
2582
  * - the start is the baseline expressed relative to the point, since the group is already on
2485
2583
  * the point - and the tooltip / click handlers sit on the group so they behave identically for
2486
- * either. A fanned-out point's offset is applied to the child, inside the group, so it too is
2487
- * untouched by zoom.
2584
+ * either. A fanned-out point's ring offset is applied to the child, inside the group, so it too
2585
+ * is untouched by zoom; only its ring's shift back into the plot area, which depends on where
2586
+ * the coordinate is, rides along in the group's translate (see `pointTransform`).
2488
2587
  */
2489
2588
  drawDots(config) {
2490
2589
  const self = this;
@@ -2502,7 +2601,9 @@ class PlaChartBuilder extends PcacChart {
2502
2601
  .enter().append('g')
2503
2602
  .attr('class', 'point')
2504
2603
  .attr('transform', (d, i) => this.pointTransform(d, i, this.scales))
2604
+ .attr('display', (d, i) => this.pointDisplay(d, i, this.scales))
2505
2605
  .on('mouseover', function (event, d) {
2606
+ self.hoveredPoint = this;
2506
2607
  // `d` is the very element bound from `series.data` above, so identity lookup is exact.
2507
2608
  self.showTooltip(event, d, {
2508
2609
  index: series.data.indexOf(d),
@@ -2519,14 +2620,7 @@ class PlaChartBuilder extends PcacChart {
2519
2620
  .attr('r', 6)
2520
2621
  .attr('fill', self.colors[index]);
2521
2622
  })
2522
- .on('mouseout', function () {
2523
- self.hideTooltip();
2524
- select$1(this).select('.dot')
2525
- .transition()
2526
- .duration(duration / 3)
2527
- .attr('r', 4)
2528
- .attr('fill', '#fff');
2529
- })
2623
+ .on('mouseout', () => this.leavePoint())
2530
2624
  .on('click', (_event, d) => {
2531
2625
  this.dotClickedSource.next(d);
2532
2626
  });
@@ -2560,17 +2654,94 @@ class PlaChartBuilder extends PcacChart {
2560
2654
  .attr('y', (d) => -maxHeight / 2 + this.offsetOf(d).dy);
2561
2655
  }
2562
2656
  }
2563
- pointTransform(d, i, scales) {
2564
- return `translate(${getXFormat(this.xAxis.format, d, i, scales.x)}, ${scales.y(d.value)})`;
2657
+ /**
2658
+ * Ends the current hover, if there is one: hides the tooltip and shrinks the dot back. Shared by
2659
+ * the point's own mouseout and the zoom handler, which has to end a hover the browser won't
2660
+ * (the point moves, the cursor doesn't - see `buildChart`'s zoom callback).
2661
+ */
2662
+ leavePoint() {
2663
+ if (!this.hoveredPoint) {
2664
+ return;
2665
+ }
2666
+ const point = this.hoveredPoint;
2667
+ this.hoveredPoint = null;
2668
+ this.hideTooltip();
2669
+ select$1(point).select('.dot')
2670
+ .transition()
2671
+ .duration(this.transitionService.getTransitionDuration() / 3)
2672
+ .attr('r', 4)
2673
+ .attr('fill', '#fff');
2565
2674
  }
2566
- /** A fan-out sits where its members would have been drawn; any member locates it. */
2675
+ /**
2676
+ * Where a point's group goes: its true coordinate, plus - for a fanned-out point - however far
2677
+ * its ring had to be shifted to stay inside the plot area at these scales. The shift is on the
2678
+ * group rather than the child because it changes as zoom moves the coordinate (the ring offset,
2679
+ * on the child, doesn't), and this is the one attribute zoom already updates.
2680
+ */
2681
+ pointTransform(d, i, scales) {
2682
+ const { x, y } = this.pointPlacement(d, i, scales);
2683
+ return `translate(${x}, ${y})`;
2684
+ }
2685
+ /**
2686
+ * The `display` of a point's group at these scales: shown while its center is inside the plot
2687
+ * area, `none` once zoom has carried it past an edge. Together with the clip-path's buffer this
2688
+ * is what bounds how far a mark may hang over an axis: a point on the edge is drawn whole, half
2689
+ * of it outside the plot, and that half is the most that ever shows - the alternative, letting
2690
+ * the clip-path's buffer do the work, showed a point up to a whole half-mark beyond the axis
2691
+ * with its center already outside. Also takes it out of hover's reach, as a hidden group
2692
+ * receives no pointer events.
2693
+ */
2694
+ pointDisplay(d, i, scales) {
2695
+ return this.pointVisible(d, i, scales) ? null : 'none';
2696
+ }
2697
+ pointVisible(d, i, scales) {
2698
+ const { x, y } = this.markCenter(d, i, scales);
2699
+ // A hair of slack, so a point on the domain's edge isn't lost to a rescaled scale landing on
2700
+ // -0.0000001 instead of 0.
2701
+ const slack = 0.5;
2702
+ return x >= -slack && x <= this.width + slack && y >= -slack && y <= this.height + slack;
2703
+ }
2704
+ /** Where the point's group is drawn: its coordinate plus its ring's shift, if it's fanned out. */
2705
+ pointPlacement(d, i, scales) {
2706
+ const { x, y } = this.pointPosition(d, i, scales);
2707
+ const shift = this.shiftOf(d, scales);
2708
+ return { x: x + shift.dx, y: y + shift.dy };
2709
+ }
2710
+ /** Where the mark itself is centered: the group's placement plus the ring offset on the child. */
2711
+ markCenter(d, i, scales) {
2712
+ const { x, y } = this.pointPlacement(d, i, scales);
2713
+ const offset = this.offsetOf(d);
2714
+ return { x: x + offset.dx, y: y + offset.dy };
2715
+ }
2716
+ /** A fan-out sits on its members' true coordinate, unshifted; any member locates it. */
2567
2717
  fanOutTransform(group, scales) {
2568
2718
  const { data, index } = group.members[0];
2569
- return this.pointTransform(data, index, scales);
2719
+ const { x, y } = this.pointPosition(data, index, scales);
2720
+ return `translate(${x}, ${y})`;
2721
+ }
2722
+ pointPosition(d, i, scales) {
2723
+ return { x: getXFormat(this.xAxis.format, d, i, scales.x), y: scales.y(d.value) };
2570
2724
  }
2725
+ /** A member's ring offset from the shared coordinate, `0` for a point that isn't fanned out. */
2571
2726
  offsetOf(d) {
2572
2727
  return this.fanOutOffsets.get(d) ?? { dx: 0, dy: 0 };
2573
2728
  }
2729
+ /** How far `d`'s ring is moved back into the plot area at these scales (see `fanOutShift`). */
2730
+ shiftOf(d, scales) {
2731
+ const group = this.coincidentOf.get(d);
2732
+ if (!group || !this.fanOutOffsets.has(d)) {
2733
+ return { dx: 0, dy: 0 };
2734
+ }
2735
+ const { data, index } = group.members[0];
2736
+ const offsets = group.members.map((member) => this.offsetOf(member.data));
2737
+ return fanOutShift(this.pointPosition(data, index, scales), offsets, { width: this.width, height: this.height });
2738
+ }
2739
+ /** Where a spoke ends, relative to its anchor: where the member is drawn, ring offset plus shift. */
2740
+ spokeEnd(member, scales) {
2741
+ const offset = this.offsetOf(member.data);
2742
+ const shift = this.shiftOf(member.data, scales);
2743
+ return { dx: offset.dx + shift.dx, dy: offset.dy + shift.dy };
2744
+ }
2574
2745
  /** The other points at `d`'s coordinate, for the tooltip context (see `PcacTooltipContext.coincident`). */
2575
2746
  coincidentWith(d) {
2576
2747
  const group = this.coincidentOf.get(d);
@@ -2581,10 +2752,10 @@ class PlaChartBuilder extends PcacChart {
2581
2752
  .filter((member) => member.data !== d)
2582
2753
  .map((member) => ({ data: member.data, parent: member.series, index: member.index, parentIndex: member.seriesIndex }));
2583
2754
  }
2584
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PlaChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2585
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PlaChartBuilder });
2755
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PlaChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2756
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PlaChartBuilder });
2586
2757
  }
2587
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PlaChartBuilder, decorators: [{
2758
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PlaChartBuilder, decorators: [{
2588
2759
  type: Injectable
2589
2760
  }] });
2590
2761
 
@@ -2632,10 +2803,10 @@ class PcacLineAreaChartComponent {
2632
2803
  this.chartBuilder.buildChart(this.chartElm(), config, this.type());
2633
2804
  }
2634
2805
  }
2635
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2636
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", 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:#ced4da;stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:#6c757d}.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 });
2806
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2807
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", 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:#ced4da;stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:#6c757d}.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 });
2637
2808
  }
2638
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
2809
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
2639
2810
  type: Component,
2640
2811
  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:#ced4da;stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:#6c757d}.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"] }]
2641
2812
  }], 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 }] }] } });
@@ -2651,10 +2822,10 @@ class PcacPlotChart {
2651
2822
  */
2652
2823
  tooltipTemplate = contentChild(PcacTooltipDirective, /* @ts-ignore */
2653
2824
  ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
2654
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacPlotChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2655
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: PcacPlotChart, isStandalone: true, selector: "pcac-plot-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Plot\" (dotClicked)=\"dotClicked.emit($event)\"/>", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type", "tooltipTemplate"], outputs: ["dotClicked"] }] });
2825
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacPlotChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2826
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: PcacPlotChart, isStandalone: true, selector: "pcac-plot-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Plot\" (dotClicked)=\"dotClicked.emit($event)\"/>", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type", "tooltipTemplate"], outputs: ["dotClicked"] }] });
2656
2827
  }
2657
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacPlotChart, decorators: [{
2828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacPlotChart, decorators: [{
2658
2829
  type: Component,
2659
2830
  args: [{ selector: 'pcac-plot-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, imports: [PcacLineAreaChartComponent], template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Plot\" (dotClicked)=\"dotClicked.emit($event)\"/>" }]
2660
2831
  }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], dotClicked: [{ type: i0.Output, args: ["dotClicked"] }], tooltipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PcacTooltipDirective), { isSignal: true }] }] } });
@@ -2670,10 +2841,10 @@ class PcacLineChart {
2670
2841
  */
2671
2842
  tooltipTemplate = contentChild(PcacTooltipDirective, /* @ts-ignore */
2672
2843
  ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
2673
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacLineChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2674
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: PcacLineChart, isStandalone: true, selector: "pcac-line-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Line\" (dotClicked)=\"dotClicked.emit($event)\" />", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type", "tooltipTemplate"], outputs: ["dotClicked"] }] });
2844
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLineChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2845
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: PcacLineChart, isStandalone: true, selector: "pcac-line-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Line\" (dotClicked)=\"dotClicked.emit($event)\" />", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type", "tooltipTemplate"], outputs: ["dotClicked"] }] });
2675
2846
  }
2676
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacLineChart, decorators: [{
2847
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLineChart, decorators: [{
2677
2848
  type: Component,
2678
2849
  args: [{ selector: 'pcac-line-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, imports: [PcacLineAreaChartComponent], template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Line\" (dotClicked)=\"dotClicked.emit($event)\" />" }]
2679
2850
  }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], dotClicked: [{ type: i0.Output, args: ["dotClicked"] }], tooltipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PcacTooltipDirective), { isSignal: true }] }] } });
@@ -2692,10 +2863,10 @@ class PcacAreaChart {
2692
2863
  */
2693
2864
  tooltipTemplate = contentChild(PcacTooltipDirective, /* @ts-ignore */
2694
2865
  ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
2695
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacAreaChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2696
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: PcacAreaChart, isStandalone: true, selector: "pcac-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Area\" (dotClicked)=\"dotClicked.emit($event)\" />", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type", "tooltipTemplate"], outputs: ["dotClicked"] }] });
2866
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacAreaChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
2867
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: PcacAreaChart, isStandalone: true, selector: "pcac-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: PcacTooltipDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Area\" (dotClicked)=\"dotClicked.emit($event)\" />", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type", "tooltipTemplate"], outputs: ["dotClicked"] }] });
2697
2868
  }
2698
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacAreaChart, decorators: [{
2869
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacAreaChart, decorators: [{
2699
2870
  type: Component,
2700
2871
  args: [{ selector: 'pcac-area-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, imports: [PcacLineAreaChartComponent], template: "<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Area\" (dotClicked)=\"dotClicked.emit($event)\" />" }]
2701
2872
  }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], dotClicked: [{ type: i0.Output, args: ["dotClicked"] }], tooltipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PcacTooltipDirective), { isSignal: true }] }] } });
@@ -2797,10 +2968,10 @@ class PieChartBuilder extends PcacChart {
2797
2968
  const i = interpolate({ startAngle: 0, endAngle: 0 }, b);
2798
2969
  return (t) => this.arcShape(i(t)) ?? '';
2799
2970
  }
2800
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PieChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2801
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PieChartBuilder });
2971
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PieChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2972
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PieChartBuilder });
2802
2973
  }
2803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PieChartBuilder, decorators: [{
2974
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PieChartBuilder, decorators: [{
2804
2975
  type: Injectable
2805
2976
  }] });
2806
2977
 
@@ -2840,10 +3011,10 @@ class PcacPieChartComponent {
2840
3011
  this.chartBuilder.buildChart(this.chartElm(), config);
2841
3012
  }
2842
3013
  }
2843
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacPieChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2844
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: PcacPieChartComponent, isStandalone: true, selector: "pcac-pie-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { sliceClicked: "sliceClicked" }, providers: [PieChartBuilder], 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-pie-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-pie-chart svg{width:100%;display:block}.pcac-pie-chart .dot{fill:none;stroke-width:1px}\n"], encapsulation: i0.ViewEncapsulation.None });
3014
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacPieChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3015
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: PcacPieChartComponent, isStandalone: true, selector: "pcac-pie-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { sliceClicked: "sliceClicked" }, providers: [PieChartBuilder], 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-pie-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-pie-chart svg{width:100%;display:block}.pcac-pie-chart .dot{fill:none;stroke-width:1px}\n"], encapsulation: i0.ViewEncapsulation.None });
2845
3016
  }
2846
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PcacPieChartComponent, decorators: [{
3017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacPieChartComponent, decorators: [{
2847
3018
  type: Component,
2848
3019
  args: [{ selector: 'pcac-pie-chart', encapsulation: ViewEncapsulation.None, providers: [PieChartBuilder], template: "<section class=\"pcac-pie-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-pie-chart svg{width:100%;display:block}.pcac-pie-chart .dot{fill:none;stroke-width:1px}\n"] }]
2849
3020
  }], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], chartElm: [{ type: i0.ViewChild, args: ['chart', { isSignal: true }] }], sliceClicked: [{ type: i0.Output, args: ["sliceClicked"] }], tooltipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PcacTooltipDirective), { isSignal: true }] }] } });