@pioneer-code/pioneer-charts 22.2.16 → 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.
package/package.json CHANGED
@@ -30,10 +30,9 @@
30
30
  "type": "git",
31
31
  "url": "git+https://github.com/PioneerCode/pioneer-charts.git"
32
32
  },
33
- "version": "22.2.16",
33
+ "version": "22.2.18",
34
34
  "license": "MIT",
35
35
  "peerDependencies": {
36
- "@angular/common": "^22.1.0",
37
36
  "@angular/core": "^22.1.0",
38
37
  "rxjs": "^7.4.0"
39
38
  },
@@ -50,7 +49,10 @@
50
49
  "d3-zoom": "^3.0.0",
51
50
  "tslib": "^2.3.0"
52
51
  },
53
- "sideEffects": false,
52
+ "sideEffects": [
53
+ "*.css",
54
+ "*.scss"
55
+ ],
54
56
  "module": "fesm2022/pioneer-code-pioneer-charts.mjs",
55
57
  "typings": "types/pioneer-code-pioneer-charts.d.ts",
56
58
  "exports": {
@@ -34,6 +34,12 @@
34
34
  border-radius: 50%;
35
35
  margin-right: 4px;
36
36
  transition: box-shadow 0.3s ease, transform 0.3s ease;
37
+
38
+ // Grown in place, without the animation, for anyone who has asked their system to reduce
39
+ // motion - as the charts are drawn without theirs (PcacTransitionService).
40
+ @media (prefers-reduced-motion: reduce) {
41
+ transition: none;
42
+ }
37
43
  }
38
44
 
39
45
  .pcac-legend-unchecked {
@@ -25,6 +25,29 @@
25
25
  border-radius: 2px;
26
26
  }
27
27
 
28
+ // A bar, slice or point with keyboard focus (see core/marks.ts). Focus already does what hover does -
29
+ // highlights the mark and shows its tooltip - and the ring marks which one has it on top of that,
30
+ // so it can't be mistaken for a mark the pointer happens to be over. Only for focus from the
31
+ // keyboard: pressing the pointer on a mark doesn't focus it.
32
+ [data-pcac-mark]:focus {
33
+ outline: none;
34
+ }
35
+
36
+ // Its color is `--pcac-focus-ring-color`, like the axis and grid colors below: a page with a dark
37
+ // background sets a light one.
38
+ [data-pcac-mark]:focus-visible {
39
+ outline: 2px solid var(--pcac-focus-ring-color, #{imports.$gray-800});
40
+ outline-offset: 2px;
41
+ }
42
+
43
+ // A slice is traced along its own edge instead: an outline is always a rectangle - the slice's
44
+ // bounding box - which, around a wedge, frames half its neighbors too.
45
+ .pcac-arc path[data-pcac-mark]:focus-visible {
46
+ outline: none;
47
+ stroke: var(--pcac-focus-ring-color, #{imports.$gray-800});
48
+ stroke-width: 2px;
49
+ }
50
+
28
51
  // Each color below is `var(--pcac-*-color, <theme color>)`. A builder sets the property on a
29
52
  // part's group only when the chart's config gives that color (`PcacAxisConfig`'s `*Color` fields,
30
53
  // `PcacPointFanOutConfig.spokeColor` / `anchorColor`, `PcacDonutChartConfig.labelColor` /
@@ -99,8 +99,10 @@
99
99
  fill: none;
100
100
  }
101
101
 
102
+ // The hover crosshair's line and value labels: `--pcac-crosshair-line-color` and
103
+ // `--pcac-crosshair-text-color`, for a dark background (see pioneer-charts.scss's colors).
102
104
  .effect-line {
103
- stroke: imports.$gray-400;
105
+ stroke: var(--pcac-crosshair-line-color, #{imports.$gray-400});
104
106
  stroke-width: 1px;
105
107
  opacity: 0;
106
108
  }
@@ -114,7 +116,7 @@
114
116
  .effect-text {
115
117
  font-size: 11px;
116
118
  font-weight: bold;
117
- fill: imports.$gray-800;
119
+ fill: var(--pcac-crosshair-text-color, #{imports.$gray-800});
118
120
  }
119
121
  }
120
122
 
@@ -14,6 +14,21 @@
14
14
  border-radius: 2px;
15
15
  }
16
16
 
17
+ [data-pcac-mark]:focus {
18
+ outline: none;
19
+ }
20
+
21
+ [data-pcac-mark]:focus-visible {
22
+ outline: 2px solid var(--pcac-focus-ring-color, #343a40);
23
+ outline-offset: 2px;
24
+ }
25
+
26
+ .pcac-arc path[data-pcac-mark]:focus-visible {
27
+ outline: none;
28
+ stroke: var(--pcac-focus-ring-color, #343a40);
29
+ stroke-width: 2px;
30
+ }
31
+
17
32
  .pcac-grid-rule line {
18
33
  stroke: var(--pcac-grid-color, #e9ecef);
19
34
  }
@@ -1 +1 @@
1
- .pcac-d3-tooltip{position:absolute;pointer-events:none;display:none;z-index:1000}.pcac-d3-tooltip-default{text-align:center;font-size:14px;padding:.5rem;background-color:rgba(52,58,64,.85);color:#fff;border-radius:2px}.pcac-grid-rule line{stroke:var(--pcac-grid-color, #e9ecef)}.pcac-donut-center-label{fill:var(--pcac-donut-center-label-color, #343a40);font-weight:500}.pcac-donut-center-sub-label{fill:var(--pcac-donut-center-sub-label-color, #6c757d)}.pcac-x-axis path,.pcac-x-axis line,.pcac-y-axis path,.pcac-y-axis line{stroke:none}.pcac-x-axis.pcac-axis-tick-marks .tick line,.pcac-y-axis.pcac-axis-tick-marks .tick line{stroke:var(--pcac-axis-tick-color, #212529)}.pcac-x-axis.pcac-axis-line .domain,.pcac-y-axis.pcac-axis-line .domain{stroke:var(--pcac-axis-line-color, #212529)}.pcac-x-axis .pcac-axis-label,.pcac-y-axis .pcac-axis-label{font-size:12px;font-weight:600;fill:var(--pcac-axis-label-color, #495057)}.pcac-x-axis .pcac-axis-sub-label,.pcac-y-axis .pcac-axis-sub-label{font-size:11px;fill:var(--pcac-axis-sub-label-color, #6c757d)}:where(.pcac-x-axis,.pcac-y-axis) :where(.tick) text{fill:var(--pcac-axis-tick-label-color, currentColor)}
1
+ .pcac-d3-tooltip{position:absolute;pointer-events:none;display:none;z-index:1000}.pcac-d3-tooltip-default{text-align:center;font-size:14px;padding:.5rem;background-color:rgba(52,58,64,.85);color:#fff;border-radius:2px}[data-pcac-mark]:focus{outline:none}[data-pcac-mark]:focus-visible{outline:2px solid var(--pcac-focus-ring-color, #343a40);outline-offset:2px}.pcac-arc path[data-pcac-mark]:focus-visible{outline:none;stroke:var(--pcac-focus-ring-color, #343a40);stroke-width:2px}.pcac-grid-rule line{stroke:var(--pcac-grid-color, #e9ecef)}.pcac-donut-center-label{fill:var(--pcac-donut-center-label-color, #343a40);font-weight:500}.pcac-donut-center-sub-label{fill:var(--pcac-donut-center-sub-label-color, #6c757d)}.pcac-x-axis path,.pcac-x-axis line,.pcac-y-axis path,.pcac-y-axis line{stroke:none}.pcac-x-axis.pcac-axis-tick-marks .tick line,.pcac-y-axis.pcac-axis-tick-marks .tick line{stroke:var(--pcac-axis-tick-color, #212529)}.pcac-x-axis.pcac-axis-line .domain,.pcac-y-axis.pcac-axis-line .domain{stroke:var(--pcac-axis-line-color, #212529)}.pcac-x-axis .pcac-axis-label,.pcac-y-axis .pcac-axis-label{font-size:12px;font-weight:600;fill:var(--pcac-axis-label-color, #495057)}.pcac-x-axis .pcac-axis-sub-label,.pcac-y-axis .pcac-axis-sub-label{font-size:11px;fill:var(--pcac-axis-sub-label-color, #6c757d)}:where(.pcac-x-axis,.pcac-y-axis) :where(.tick) text{fill:var(--pcac-axis-tick-label-color, currentColor)}
@@ -1,6 +1,6 @@
1
1
  import * as _pioneer_code_pioneer_charts from '@pioneer-code/pioneer-charts';
2
2
  import * as _angular_core from '@angular/core';
3
- import { TemplateRef, ElementRef } from '@angular/core';
3
+ import { TemplateRef } from '@angular/core';
4
4
 
5
5
  /**
6
6
  * Base configuration for all charts.
@@ -90,8 +90,8 @@ declare class PcacAxisConfig {
90
90
  * the axis. Labels follow the marks (D3 places them at tick length + 3px), and the chart's
91
91
  * margins grow or shrink by the same amount so the plot area makes room for them - a longer
92
92
  * tick means a slightly smaller plot, never labels pushed off the edge. Only the per-tick marks
93
- * change; the axis line's two end-caps keep their default length. Color comes from the theme
94
- * (`.pcac-axis-tick-marks .tick line`, `$gray-900`, the same as the axis line).
93
+ * change; the axis line's two end-caps keep their default length. Colored by `tickColor`, the
94
+ * theme's `$gray-900` (like the axis line) by default.
95
95
  */
96
96
  tickSize?: number;
97
97
  /**
@@ -106,8 +106,8 @@ declare class PcacAxisConfig {
106
106
  tickLabelColor?: string;
107
107
  /**
108
108
  * Draw a solid line along the axis itself (the full length of the axis, with D3's short
109
- * end-caps). Off by default, as the theme has always hidden it. Color comes from the theme
110
- * (`.pcac-axis-line .domain`, `$gray-900`).
109
+ * end-caps). Off by default, as the theme has always hidden it. Colored by `lineColor`, the
110
+ * theme's `$gray-900` by default.
111
111
  */
112
112
  showLine?: boolean;
113
113
  /**
@@ -140,7 +140,8 @@ declare class PcacAxisConfig {
140
140
  * (`yAxis`) or key (`xAxis`) in the default tooltip. On the line/area/plot charts the x axis's
141
141
  * format is also what decides how a point's `key` maps to an x position (by index for the
142
142
  * default, `Decimal` and `DateTime` by the key's own value on a linear/time scale - see
143
- * `PcacLineAreaChartConfig`); a bar chart's category axis ignores it. Default `None`, which
143
+ * `PcacLineAreaChartConfig`); on a bar chart's category axis it only formats keys that are
144
+ * numbers, and shows any other key as it is. Default `None`, which
144
145
  * on those charts behaves as `DatasetLength`.
145
146
  */
146
147
  format?: PcacFormatEnum;
@@ -231,10 +232,12 @@ declare class PcacBarHorizontalChartConfig extends PcacAxisChartConfig {
231
232
  isStacked: boolean;
232
233
  thresholds: PcacData[];
233
234
  spreadColorsPerGroup: boolean;
234
- colorOverride: PcacBarHorizontalChartColorOverrideConfig;
235
- }
236
- declare class PcacBarHorizontalChartColorOverrideConfig {
237
- colors: string[];
235
+ /**
236
+ * Bar colors, any CSS color, in place of the theme palette - by series, or by group with
237
+ * `spreadColorsPerGroup`. Repeated when there are more series (or groups) than colors. Omitted
238
+ * or empty, the theme palette is used - optional, as on every chart's config.
239
+ */
240
+ colorOverride?: string[];
238
241
  }
239
242
 
240
243
  /**
@@ -341,10 +344,10 @@ declare class PcacTooltipDirective {
341
344
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PcacTooltipDirective, "ng-template[pcacTooltip]", never, {}, {}, never, never, true, never>;
342
345
  }
343
346
 
344
- declare class PcacBarHorizontalChartComponent {
347
+ declare class PcacBarHorizontalChart {
345
348
  private chartBuilder;
346
349
  readonly config: _angular_core.InputSignal<PcacBarHorizontalChartConfig>;
347
- readonly chartElm: _angular_core.Signal<ElementRef<any>>;
350
+ private readonly chartElm;
348
351
  readonly barClicked: _angular_core.OutputRef<_pioneer_code_pioneer_charts.PcacData>;
349
352
  /**
350
353
  * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the
@@ -352,25 +355,27 @@ declare class PcacBarHorizontalChartComponent {
352
355
  */
353
356
  readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
354
357
  constructor();
355
- buildChart(): void;
356
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacBarHorizontalChartComponent, never>;
357
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacBarHorizontalChartComponent, "pcac-bar-horizontal-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "barClicked": "barClicked"; }, ["tooltipTemplate"], never, true, never>;
358
+ private buildChart;
359
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacBarHorizontalChart, never>;
360
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacBarHorizontalChart, "pcac-bar-horizontal-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "barClicked": "barClicked"; }, ["tooltipTemplate"], never, true, never>;
358
361
  }
359
362
 
360
363
  declare class PcacBarVerticalChartConfig extends PcacAxisChartConfig {
361
364
  isStacked: boolean;
362
365
  thresholds: PcacData[];
363
366
  spreadColorsPerGroup: boolean;
364
- colorOverride: PcacBarVerticalChartColorOverrideConfig;
365
- }
366
- declare class PcacBarVerticalChartColorOverrideConfig {
367
- colors: string[];
367
+ /**
368
+ * Bar colors, any CSS color, in place of the theme palette - by series, or by group with
369
+ * `spreadColorsPerGroup`. Repeated when there are more series (or groups) than colors. Omitted
370
+ * or empty, the theme palette is used - optional, as on every chart's config.
371
+ */
372
+ colorOverride?: string[];
368
373
  }
369
374
 
370
- declare class PcacBarVerticalChartComponent {
375
+ declare class PcacBarVerticalChart {
371
376
  private chartBuilder;
372
377
  readonly config: _angular_core.InputSignal<PcacBarVerticalChartConfig>;
373
- readonly chartElm: _angular_core.Signal<ElementRef<any>>;
378
+ private readonly chartElm;
374
379
  readonly barClicked: _angular_core.OutputRef<_pioneer_code_pioneer_charts.PcacData>;
375
380
  /**
376
381
  * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the
@@ -378,13 +383,12 @@ declare class PcacBarVerticalChartComponent {
378
383
  */
379
384
  readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
380
385
  constructor();
381
- buildChart(): void;
382
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacBarVerticalChartComponent, never>;
383
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacBarVerticalChartComponent, "pcac-bar-vertical-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "barClicked": "barClicked"; }, ["tooltipTemplate"], never, true, never>;
386
+ private buildChart;
387
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacBarVerticalChart, never>;
388
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacBarVerticalChart, "pcac-bar-vertical-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "barClicked": "barClicked"; }, ["tooltipTemplate"], never, true, never>;
384
389
  }
385
390
 
386
391
  declare class PcacColorService {
387
- private primary;
388
392
  private primaryLight;
389
393
  private success;
390
394
  private danger;
@@ -426,8 +430,6 @@ declare class PcacColorService {
426
430
  * @param colors A collection of hex values
427
431
  */
428
432
  setScale(colors: string[]): void;
429
- /** @deprecated No chart reads the primary color; it isn't part of the palette. */
430
- setPrimary(color: string): void;
431
433
  setPrimaryLight(color: string): void;
432
434
  setSuccess(color: string): void;
433
435
  setDanger(color: string): void;
@@ -449,7 +451,8 @@ declare class PcacLegendConfig {
449
451
  items: PcacLegendConfigItem[];
450
452
  }
451
453
  declare class PcacLegend {
452
- readonly colorService: PcacColorService;
454
+ readonly headingId: string;
455
+ private readonly colorService;
453
456
  config: _angular_core.ModelSignal<PcacLegendConfig>;
454
457
  itemClicked: _angular_core.OutputEmitterRef<PcacLegendConfigItem[]>;
455
458
  colorScale: _angular_core.Signal<string[]>;
@@ -525,15 +528,18 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
525
528
  /**
526
529
  * Zoom and pan along the x / y axis (scroll / pinch to zoom 1x-10x, drag to pan, never leaving
527
530
  * the original domain). Either, or both, can be on. A gesture is always two-dimensional, so with
528
- * only one enabled the other axis simply stays put. Both off by default.
531
+ * only one enabled the other axis simply stays put. Both off by default. The zoom is kept when
532
+ * the chart redraws - a new config, a series toggled in a legend, a resize (which keeps the same
533
+ * part of the domain in view) - and dropped when zoom is turned off or the zoomable axes change.
529
534
  */
530
535
  enableZoomX: boolean;
531
536
  enableZoomY: boolean;
532
537
  /**
533
- * Hex color codes to override the default colors, one per series in order. Repeats from the
534
- * start when there are more series than colors, as the default palette does.
538
+ * Series colors, any CSS color, in place of the theme palette, one per series in order. Repeats
539
+ * from the start when there are more series than colors, as the default palette does. Omitted or
540
+ * empty, the theme palette is used - optional, as on every chart's config.
535
541
  */
536
- colorOverride: string[];
542
+ colorOverride?: string[];
537
543
  /**
538
544
  * Bounding box for any point images (`PcacData.image`) on this chart. Optional; each field falls
539
545
  * back to the `PcacPointImageConfig` default when not given, so a consumer only setting `image`
@@ -598,7 +604,7 @@ declare class PcacPlotChartConfig extends PcacLineAreaChartConfig {
598
604
 
599
605
  declare class PcacPlotChart {
600
606
  readonly config: _angular_core.InputSignal<PcacPlotChartConfig>;
601
- readonly types: typeof PcacLineAreaPlotChartConfigType;
607
+ protected readonly types: typeof PcacLineAreaPlotChartConfigType;
602
608
  readonly dotClicked: _angular_core.OutputEmitterRef<PcacData>;
603
609
  /**
604
610
  * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
@@ -614,7 +620,7 @@ declare class PcacLineChartConfig extends PcacLineAreaChartConfig {
614
620
 
615
621
  declare class PcacLineChart {
616
622
  readonly config: _angular_core.InputSignal<PcacLineChartConfig>;
617
- readonly types: typeof PcacLineAreaPlotChartConfigType;
623
+ protected readonly types: typeof PcacLineAreaPlotChartConfigType;
618
624
  readonly dotClicked: _angular_core.OutputEmitterRef<PcacData>;
619
625
  /**
620
626
  * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
@@ -630,7 +636,7 @@ declare class PcacAreaChartConfig extends PcacLineAreaChartConfig {
630
636
 
631
637
  declare class PcacAreaChart {
632
638
  readonly config: _angular_core.InputSignal<PcacAreaChartConfig>;
633
- readonly types: typeof PcacLineAreaPlotChartConfigType;
639
+ protected readonly types: typeof PcacLineAreaPlotChartConfigType;
634
640
  readonly dotClicked: _angular_core.OutputEmitterRef<PcacData>;
635
641
  /**
636
642
  * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
@@ -665,7 +671,7 @@ declare class PcacPieChartConfig extends PcacPieDonutChartConfig {
665
671
 
666
672
  declare class PcacPieChart {
667
673
  readonly config: _angular_core.InputSignal<PcacPieChartConfig>;
668
- readonly types: typeof PcacPieDonutChartType;
674
+ protected readonly types: typeof PcacPieDonutChartType;
669
675
  readonly sliceClicked: _angular_core.OutputEmitterRef<PcacData>;
670
676
  /**
671
677
  * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
@@ -705,7 +711,7 @@ declare class PcacDonutChartConfig extends PcacPieDonutChartConfig {
705
711
 
706
712
  declare class PcacDonutChart {
707
713
  readonly config: _angular_core.InputSignal<PcacDonutChartConfig>;
708
- readonly types: typeof PcacPieDonutChartType;
714
+ protected readonly types: typeof PcacPieDonutChartType;
709
715
  readonly sliceClicked: _angular_core.OutputEmitterRef<PcacData>;
710
716
  /**
711
717
  * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
@@ -716,5 +722,5 @@ declare class PcacDonutChart {
716
722
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacDonutChart, "pcac-donut-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "sliceClicked": "sliceClicked"; }, ["tooltipTemplate"], never, true, never>;
717
723
  }
718
724
 
719
- export { PcacAreaChart, PcacAreaChartConfig, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChartColorOverrideConfig, PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChartColorOverrideConfig, 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 };
725
+ 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 };
720
726
  export type { PcacTooltipCoincident, PcacTooltipContext };