@pioneer-code/pioneer-charts 22.2.27 → 22.2.29

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,7 +30,7 @@
30
30
  "type": "git",
31
31
  "url": "git+https://github.com/PioneerCode/pioneer-charts.git"
32
32
  },
33
- "version": "22.2.27",
33
+ "version": "22.2.29",
34
34
  "license": "MIT",
35
35
  "peerDependencies": {
36
36
  "@angular/core": "^22.1.0",
@@ -0,0 +1,76 @@
1
+ @use "../core/theme/imports";
2
+
3
+ .pcac-state-timeline {
4
+ svg {
5
+ width: 100%;
6
+ display: block;
7
+ }
8
+
9
+ .pcac-state-period {
10
+ cursor: pointer;
11
+ }
12
+
13
+ // A period in the worst state it was in, deeper the more of what's known of it that state took
14
+ // (`--pcac-state-share`, set by the builder): from 75% of the state's color mixed into the
15
+ // background to all of it, so a period with a little Error is still plainly red. A state's color
16
+ // is its config `color` (`--pcac-state-color`, set on the period) or, without one, the theme's for
17
+ // its place among the states: the first is OK, the last Error, any between Warning. Each is a
18
+ // custom property, so a stylesheet can restyle them; a dark page sets its own (the docs site's
19
+ // dark theme has a set).
20
+ //
21
+ // OK is pale and Warning and Error strong, so they differ in lightness as well as hue: a red-green
22
+ // color-blind reader tells them apart by that (checked with the dataviz palette validator, every
23
+ // pair, at full strength and at 75%, against a white page). Most periods are OK, and stay quiet.
24
+ .pcac-state-ok {
25
+ --pcac-state-theme-color: var(--pcac-state-timeline-ok-color, #98c9b2);
26
+ }
27
+
28
+ .pcac-state-warning {
29
+ --pcac-state-theme-color: var(--pcac-state-timeline-warning-color, #d97706);
30
+ }
31
+
32
+ .pcac-state-error {
33
+ --pcac-state-theme-color: var(--pcac-state-timeline-error-color, #bb2d3b);
34
+ }
35
+
36
+ .pcac-state-fill {
37
+ fill: color-mix(
38
+ in srgb,
39
+ var(--pcac-state-color, var(--pcac-state-theme-color))
40
+ calc(75% + var(--pcac-state-share, 1) * 25%),
41
+ var(--pcac-state-timeline-background-color, #{imports.$white})
42
+ );
43
+ }
44
+
45
+ // Nothing known of it: gray, lighter than OK's green. Part of it unknown: the same gray striped over
46
+ // its color.
47
+ .pcac-state-unknown .pcac-state-fill {
48
+ fill: var(--pcac-state-timeline-unknown-color, #{imports.$gray-200});
49
+ }
50
+
51
+ .pcac-state-stripe {
52
+ fill: var(--pcac-state-timeline-unknown-color, #{imports.$gray-200});
53
+ fill-opacity: 0.85;
54
+ }
55
+
56
+ // A hovered or focused period is outlined in the text color.
57
+ .pcac-state-period.is-active .pcac-state-fill {
58
+ stroke: currentColor;
59
+ stroke-width: 1.5px;
60
+ }
61
+
62
+ .pcac-state-row-label {
63
+ font-size: 11px;
64
+ fill: var(--pcac-state-timeline-row-label-color, #{imports.$gray-700});
65
+ }
66
+ }
67
+
68
+ // `heightFull` support (see PcacChartConfig.heightFull), as on the other charts.
69
+ pcac-state-timeline.pcac-height-full {
70
+ display: block;
71
+ height: 100%;
72
+
73
+ .pcac-state-timeline {
74
+ height: 100%;
75
+ }
76
+ }
@@ -650,6 +650,15 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
650
650
  * empty, the theme palette is used - optional, as on every chart's config.
651
651
  */
652
652
  colorOverride?: string[];
653
+ /**
654
+ * Radius of each point's dot at rest, in px. Default 4. A hovered or focused dot grows to 1.5x
655
+ * that, and never to less than 4px, so the point being read always shows. 0 draws no dots at
656
+ * rest, for a line or area chart where the line carries the data - a sparkline, say: each point
657
+ * can still be hovered, focused and clicked (a dot smaller than 4px gets a transparent 4px
658
+ * target), and still shows its tooltip. Not for a plot chart, which then draws nothing until
659
+ * hovered. Point images are unaffected; they're sized by `pointImage`.
660
+ */
661
+ pointRadius?: number;
653
662
  /**
654
663
  * Bounding box for any point images (`PcacData.image`) on this chart. Optional; each field falls
655
664
  * back to the `PcacPointImageConfig` default when not given, so a consumer only setting `image`
@@ -1012,5 +1021,70 @@ declare class PcacDonutChart {
1012
1021
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacDonutChart, "pcac-donut-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "sliceClicked": "sliceClicked"; }, ["tooltipTemplate"], never, true, never>;
1013
1022
  }
1014
1023
 
1015
- export { PcacAreaChart, PcacAreaChartConfig, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChart, PcacBarHorizontalChart as PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChart, PcacBarVerticalChart as PcacBarVerticalChartComponent, PcacBarVerticalChartConfig, PcacChartConfig, PcacColorService, PcacCornerLabels, PcacData, PcacDataRange, PcacDonutChart, PcacDonutChartConfig, PcacDotPlotChart, PcacDotPlotChartConfig, PcacFormatEnum, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChart, PcacPieChartConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointFanOutConfig, PcacPointGaugeConfig, PcacPointImageConfig, PcacPointRangeConfig, PcacPointRangeShow, PcacPointRangeStyle, PcacProximityChart, PcacProximityChartConfig, PcacRangeBounds, PcacReferenceLine, PcacTooltipDirective };
1024
+ /** One state a period can be in, such as OK or Error: its key, its name and its color. */
1025
+ declare class PcacStateTimelineState {
1026
+ /** The state's key, matching the keys in a period's `data`. */
1027
+ key: string;
1028
+ /** The state's name in the tooltip and for screen readers. Defaults to its `key`. */
1029
+ label?: string;
1030
+ /**
1031
+ * Any CSS color. Defaults to the theme: pale green for the first state, strong red for the last,
1032
+ * and amber for any in between. Choose colors that differ in lightness so people with color
1033
+ * blindness can tell them apart.
1034
+ */
1035
+ color?: string;
1036
+ }
1037
+ /**
1038
+ * A state timeline shows how something's status changed over time. Each row is one thing you're
1039
+ * tracking, like a service or a device, split into periods such as days or hours. Each period is
1040
+ * colored by the worst state it reached, so one hour of Error in an otherwise good day still shows.
1041
+ *
1042
+ * `data` is a list of rows. A row's `key` is its name, shown to its left unless `rowLabels` is
1043
+ * false, and its `data` is its periods, oldest first. Each period has:
1044
+ * - `key`: its name, shown in the tooltip and read by screen readers (`'Fri, Nov 20'`).
1045
+ * - `value`: how long it is, in any unit. Leave it out and the length is the total of its states.
1046
+ * - `data`: how much time it spent in each state, in the same unit, keyed by the state's `key`.
1047
+ *
1048
+ * Any time not covered by a state is unknown: a partly unknown period is striped, and an entirely
1049
+ * unknown one is plain gray. The color is lighter when the worst state lasted a short time and
1050
+ * full strength when it lasted all of the period's known time. Every period in a row is the same
1051
+ * width. A row or period with `hide` set is left out.
1052
+ */
1053
+ declare class PcacStateTimelineConfig extends PcacChartConfig {
1054
+ /**
1055
+ * Height in pixels, split evenly between the rows with 4px between them. Default 24, which fits
1056
+ * one row; set a larger height for more rows.
1057
+ */
1058
+ height: number;
1059
+ /** The states a period can be in, from least to most severe. Each period shows its worst. */
1060
+ states: PcacStateTimelineState[];
1061
+ /**
1062
+ * Space between periods, in px. Default 2. It shrinks to 1px, then to none, when periods get
1063
+ * too narrow.
1064
+ */
1065
+ gap?: number;
1066
+ /** Show each row's name to its left. Default true. */
1067
+ rowLabels?: boolean;
1068
+ }
1069
+
1070
+ /** A state timeline: rows of periods, each colored by the worst state it was in (see PcacStateTimelineConfig). */
1071
+ declare class PcacStateTimeline {
1072
+ private chartBuilder;
1073
+ readonly config: _angular_core.InputSignal<PcacStateTimelineConfig>;
1074
+ private readonly chartElm;
1075
+ /** A period clicked, or Enter or Space on one focused: the period itself, from its row's `data`. */
1076
+ readonly periodClicked: _angular_core.OutputRef<_pioneer_code_pioneer_charts.PcacData>;
1077
+ /**
1078
+ * Optional consumer `<ng-template pcacTooltip>`, replacing the default tooltip (see
1079
+ * PcacTooltipDirective): its `$implicit` is the period, `parent` its row, `index` its place in
1080
+ * the row and `parentIndex` the row's among those drawn.
1081
+ */
1082
+ readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
1083
+ constructor();
1084
+ private buildChart;
1085
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacStateTimeline, never>;
1086
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacStateTimeline, "pcac-state-timeline", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "periodClicked": "periodClicked"; }, ["tooltipTemplate"], never, true, never>;
1087
+ }
1088
+
1089
+ export { PcacAreaChart, PcacAreaChartConfig, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChart, PcacBarHorizontalChart as PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChart, PcacBarVerticalChart as PcacBarVerticalChartComponent, PcacBarVerticalChartConfig, PcacChartConfig, PcacColorService, PcacCornerLabels, PcacData, PcacDataRange, PcacDonutChart, PcacDonutChartConfig, PcacDotPlotChart, PcacDotPlotChartConfig, PcacFormatEnum, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChart, PcacPieChartConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointFanOutConfig, PcacPointGaugeConfig, PcacPointImageConfig, PcacPointRangeConfig, PcacPointRangeShow, PcacPointRangeStyle, PcacProximityChart, PcacProximityChartConfig, PcacRangeBounds, PcacReferenceLine, PcacStateTimeline, PcacStateTimelineConfig, PcacStateTimelineState, PcacTooltipDirective };
1016
1090
  export type { PcacTooltipCoincident, PcacTooltipContext };