@pioneer-code/pioneer-charts 22.2.10 → 22.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "type": "git",
23
23
  "url": "git+https://github.com/PioneerCode/pioneer-charts.git"
24
24
  },
25
- "version": "22.2.10",
25
+ "version": "22.2.12",
26
26
  "license": "MIT",
27
27
  "peerDependencies": {
28
28
  "@angular/common": "^22.1.0",
@@ -529,12 +529,14 @@ declare class PcacTooltipBuilder {
529
529
  */
530
530
  private view;
531
531
  private viewTemplate;
532
+ /** Space left between the tooltip and whatever it's placed next to (the cursor or an anchor). */
533
+ static readonly GAP = 8;
532
534
  /**
533
- * Shows the tooltip for a hovered datum at the event's position. Renders `template` when the
534
- * chart has one projected; otherwise falls back to the default key/value content, formatted per
535
- * `valueFormat`/`keyFormat`.
535
+ * Shows the tooltip for a hovered datum. Renders `template` when the chart has one projected;
536
+ * otherwise falls back to the default key/value content, formatted per `valueFormat`/`keyFormat`.
537
+ * Placed beside `anchor` when one is given (see `positionBeside`), else above the event's position.
536
538
  */
537
- showTooltip(event: MouseEvent, template: TemplateRef<PcacTooltipContext> | undefined, context: PcacTooltipContext, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): void;
539
+ showTooltip(event: MouseEvent, template: TemplateRef<PcacTooltipContext> | undefined, context: PcacTooltipContext, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum, anchor?: Element | null): void;
538
540
  /**
539
541
  * @deprecated Builders should call `PcacChart.showTooltip()`, which routes through a chart's
540
542
  * projected `pcacTooltip` template. This only ever renders the default content.
@@ -545,10 +547,24 @@ declare class PcacTooltipBuilder {
545
547
  private renderTemplate;
546
548
  private destroyView;
547
549
  /**
548
- * Centers the (already rendered) tooltip horizontally on the cursor and sits it just above.
549
- * Measured from the real box rather than fixed offsets so it works for content of any size.
550
+ * Shows the (already rendered) shell at the page's top-left so it can be measured. Left where the
551
+ * last hover put it, a shell near the right edge would be squeezed by its containing block and
552
+ * measure narrower (wrapped) than the content really is once it's moved somewhere with room.
550
553
  */
551
- private position;
554
+ private measurable;
555
+ /**
556
+ * Centers the tooltip horizontally on the cursor and sits it just above. Measured from the real
557
+ * box rather than fixed offsets so it works for content of any size.
558
+ */
559
+ private positionAbove;
560
+ /**
561
+ * Places the tooltip diagonally off one corner of `anchor`'s rendered box, so it never covers
562
+ * the anchor itself (e.g. a point's image). Prefers above-right - the tooltip's bottom-left
563
+ * corner at the anchor's top-right - and flips each axis independently when the tooltip wouldn't
564
+ * fit in the viewport that way: to the left when there's no room on the right, below when there's
565
+ * no room above. When neither side of an axis fits, it takes whichever side has more room.
566
+ */
567
+ private positionBeside;
552
568
  private getBarTipData;
553
569
  static ɵfac: i0.ɵɵFactoryDeclaration<PcacTooltipBuilder, never>;
554
570
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
@@ -569,6 +585,11 @@ interface PcacTooltipOptions {
569
585
  coincident?: PcacTooltipCoincident[];
570
586
  valueFormat?: PcacFormatEnum;
571
587
  keyFormat?: PcacFormatEnum;
588
+ /**
589
+ * The element the tooltip is placed beside instead of above the cursor: off one of its corners,
590
+ * whichever fits in the viewport (see `PcacTooltipBuilder.positionBeside`), so it never covers it.
591
+ */
592
+ anchor?: Element | null;
572
593
  }
573
594
  declare class PcacChart {
574
595
  axisBuilder: PcacAxisBuilder;
@@ -992,7 +1013,8 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
992
1013
  enableZoomX: boolean;
993
1014
  enableZoomY: boolean;
994
1015
  /**
995
- * Hex color codes to override the default colors
1016
+ * Hex color codes to override the default colors, one per series in order. Repeats from the
1017
+ * start when there are more series than colors, as the default palette does.
996
1018
  */
997
1019
  colorOverride: string[];
998
1020
  /**