@pioneer-code/pioneer-charts 22.2.1 → 22.2.2

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.1",
25
+ "version": "22.2.2",
26
26
  "license": "MIT",
27
27
  "peerDependencies": {
28
28
  "@angular/common": "^22.1.0",
@@ -10,6 +10,18 @@
10
10
  stroke-width: 2px;
11
11
  }
12
12
 
13
+ // The plot chart's `pointFanOut` anchors (see PcacPointFanOutConfig.showAnchor): a spoke from
14
+ // the shared coordinate to each fanned-out point, and a dot on the coordinate itself. Quiet
15
+ // grays, like the grid, so they read as guides rather than data.
16
+ .fan-out-spoke {
17
+ stroke: imports.$gray-400;
18
+ stroke-width: 1px;
19
+ }
20
+
21
+ .fan-out-anchor {
22
+ fill: imports.$gray-600;
23
+ }
24
+
13
25
  .effects-canvas {
14
26
  fill: none;
15
27
  }
@@ -343,6 +343,17 @@ declare class PcacTransitionService {
343
343
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
344
344
  }
345
345
 
346
+ /**
347
+ * A datum drawn at the same coordinate as the hovered one (see `PcacTooltipContext.coincident`),
348
+ * located the same way the context locates `$implicit`: `parent` is the series it belongs to,
349
+ * `index` its position in `parent.data`, `parentIndex` the series' position in the chart's `data`.
350
+ */
351
+ interface PcacTooltipCoincident {
352
+ data: PcacData;
353
+ parent: PcacData;
354
+ index: number;
355
+ parentIndex: number;
356
+ }
346
357
  /**
347
358
  * Template context handed to a consumer's `<ng-template pcacTooltip>` each time a tooltip is shown.
348
359
  */
@@ -380,6 +391,14 @@ interface PcacTooltipContext {
380
391
  * Position of `parent` in the chart's top-level `data`; `null` whenever `parent` is.
381
392
  */
382
393
  parentIndex: number | null;
394
+ /**
395
+ * Every *other* datum drawn at exactly the same coordinate as `$implicit`, in data order, so a
396
+ * template can list who else is at the hovered point. Set by the line, area and plot charts,
397
+ * whether or not the plot chart's `pointFanOut` has spread the points apart (without it, the
398
+ * hovered point is the only one of them visible, which makes this list all the more useful).
399
+ * Empty on the other charts and whenever nothing shares the point.
400
+ */
401
+ coincident: PcacTooltipCoincident[];
383
402
  }
384
403
  /**
385
404
  * Marks an `<ng-template>` projected into any chart component as that chart's tooltip. When
@@ -405,6 +424,17 @@ interface PcacTooltipContext {
405
424
  * <div class="my-tooltip">{{ orders[g!][i].customer }}: {{ point.value | number }}</div>
406
425
  * </ng-template>
407
426
  * ```
427
+ *
428
+ * `coincident` lists the other points at the hovered coordinate, each located the same way:
429
+ *
430
+ * ```html
431
+ * <ng-template pcacTooltip let-point let-others="coincident">
432
+ * <div class="my-tooltip">
433
+ * {{ point.key }}, {{ point.value }}
434
+ * @for (other of others; track other.parentIndex) { <div>Also here: {{ other.parent.key }}</div> }
435
+ * </div>
436
+ * </ng-template>
437
+ * ```
408
438
  */
409
439
  declare class PcacTooltipDirective {
410
440
  readonly templateRef: TemplateRef<PcacTooltipContext>;
@@ -470,6 +500,8 @@ interface PcacTooltipOptions {
470
500
  /** See `PcacTooltipContext.parentIndex`. Defaults to `null`, matching `parent`'s default. */
471
501
  parentIndex?: number | null;
472
502
  isThreshold?: boolean;
503
+ /** See `PcacTooltipContext.coincident`. Defaults to none. */
504
+ coincident?: PcacTooltipCoincident[];
473
505
  valueFormat?: PcacFormatEnum;
474
506
  keyFormat?: PcacFormatEnum;
475
507
  }
@@ -861,7 +893,42 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
861
893
  pointImage?: Partial<PcacPointImageConfig>;
862
894
  }
863
895
 
896
+ /**
897
+ * How the plot chart spreads out points that share a coordinate (see
898
+ * `PcacPlotChartConfig.pointFanOut`). Each group of coincident points is placed evenly around
899
+ * a ring centered on the shared coordinate, starting at 12 o'clock and going clockwise in data
900
+ * order (series order, then point order), so every point stays visible and hoverable.
901
+ */
902
+ declare class PcacPointFanOutConfig {
903
+ /**
904
+ * Ring radius in px, the same for every group. When not set, each group gets the smallest
905
+ * radius at which its neighbours sit `gap` px apart - so a pair barely moves while a group of
906
+ * five spreads as far as it has to.
907
+ */
908
+ radius?: number;
909
+ /**
910
+ * Space between neighbouring points on the ring, in px, when `radius` is not set. Measured
911
+ * between their image boxes (or hovered dots), not their centers.
912
+ */
913
+ gap: number;
914
+ /**
915
+ * Draw a dot at the shared coordinate - the value the group's points actually have - with a
916
+ * spoke out to each of them. Styled by the theme's `.fan-out-anchor` / `.fan-out-spoke` rules.
917
+ */
918
+ showAnchor: boolean;
919
+ }
864
920
  declare class PcacPlotChartConfig extends PcacLineAreaChartConfig {
921
+ /**
922
+ * Spread points that share a coordinate around it instead of drawing them on top of one
923
+ * another (where only the last series' point shows, and only it can be hovered). Off when not
924
+ * set; `{}` turns it on with every `PcacPointFanOutConfig` default. The fanned points keep
925
+ * their true value in the tooltip, and the hovered point's tooltip context lists the others at
926
+ * its coordinate in `coincident` (see `PcacTooltipContext`).
927
+ *
928
+ * Plot chart only: a line or area chart's points are joined in series order, so moving one
929
+ * would kink the line.
930
+ */
931
+ pointFanOut?: Partial<PcacPointFanOutConfig>;
865
932
  }
866
933
 
867
934
  declare class PcacPlotChart {
@@ -949,5 +1016,5 @@ declare class PcacPieChartComponent {
949
1016
  static ɵcmp: i0.ɵɵComponentDeclaration<PcacPieChartComponent, "pcac-pie-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "sliceClicked": "sliceClicked"; }, ["tooltipTemplate"], never, true, never>;
950
1017
  }
951
1018
 
952
- export { BarHorizontalChartBuilder, BarVerticalChartBuilder, PCAC_AXIS_LABEL_SPACE, PCAC_AXIS_SUB_LABEL_SPACE, PcacAreaChart, PcacAreaChartConfig, PcacAxisBuilder, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChartColorOverrideConfig, PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChartColorOverrideConfig, PcacBarVerticalChartComponent, PcacBarVerticalChartConfig, PcacChart, PcacChartConfig, PcacChartResizeService, PcacColorService, PcacData, PcacFormatEnum, PcacGridBuilder, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChartComponent, PcacPieChartConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointImageConfig, PcacTooltipBuilder, PcacTooltipDirective, PcacTransitionService, PieChartBuilder, axisLabelSpace, hasAxisSubLabels, resolveAxisConfig };
953
- export type { IPcacAxisBuilderConfig, IPcacGridBuilderConfig, PcacChartMargin, PcacResolvedAxisConfig, PcacTooltipContext, PcacTooltipOptions };
1019
+ export { BarHorizontalChartBuilder, BarVerticalChartBuilder, PCAC_AXIS_LABEL_SPACE, PCAC_AXIS_SUB_LABEL_SPACE, PcacAreaChart, PcacAreaChartConfig, PcacAxisBuilder, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChartColorOverrideConfig, PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChartColorOverrideConfig, PcacBarVerticalChartComponent, PcacBarVerticalChartConfig, PcacChart, PcacChartConfig, PcacChartResizeService, PcacColorService, PcacData, PcacFormatEnum, PcacGridBuilder, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChartComponent, PcacPieChartConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointFanOutConfig, PcacPointImageConfig, PcacTooltipBuilder, PcacTooltipDirective, PcacTransitionService, PieChartBuilder, axisLabelSpace, hasAxisSubLabels, resolveAxisConfig };
1020
+ export type { IPcacAxisBuilderConfig, IPcacGridBuilderConfig, PcacChartMargin, PcacResolvedAxisConfig, PcacTooltipCoincident, PcacTooltipContext, PcacTooltipOptions };