@pioneer-code/pioneer-charts 22.2.5 → 22.2.10
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/fesm2022/pioneer-code-pioneer-charts.mjs +435 -29
- package/fesm2022/pioneer-code-pioneer-charts.mjs.map +1 -1
- package/package.json +1 -1
- package/scss/core/theme/imports.scss +3 -1
- package/scss/pioneer-charts.scss +25 -8
- package/scss/plot-line-area-chart/plot-line-area-chart.component.scss +76 -3
- package/themes/pioneer-charts.css +13 -6
- package/themes/pioneer-charts.min.css +1 -1
- package/types/pioneer-code-pioneer-charts.d.ts +126 -8
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// `!default` lets a consumer override any of these by configuring the entry point module (see
|
|
2
2
|
// pioneer-charts.scss's `@forward` of this file) via `@use "@pioneer-code/pioneer-charts/scss/pioneer-charts"
|
|
3
3
|
// with (...)`. These are the only Sass variables that actually drive rendered output in the
|
|
4
|
-
// library (tooltip background/text, grid line color, plot-line-area styling)
|
|
4
|
+
// library (tooltip background/text, grid line color, plot-line-area styling); for the axis, grid
|
|
5
|
+
// and fan-out colors they're the fallback behind a `--pcac-*-color` custom property (see
|
|
6
|
+
// pioneer-charts.scss) that a chart's config or a stylesheet may set. A `$theme-colors`
|
|
5
7
|
// Bootstrap-style map used to live here too, but nothing in the library ever read it (a leftover
|
|
6
8
|
// from an abandoned Bootstrap integration, alongside the orphaned `bootstrap` devDependency and
|
|
7
9
|
// footer.scss bug already removed elsewhere), so it was removed rather than wired up.
|
package/scss/pioneer-charts.scss
CHANGED
|
@@ -25,8 +25,12 @@
|
|
|
25
25
|
border-radius: 2px;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// Each color below is `var(--pcac-*-color, <theme color>)`. A builder sets the property on a
|
|
29
|
+
// part's group only when the chart's config gives that color (`PcacAxisConfig`'s `*Color` fields,
|
|
30
|
+
// `PcacPointFanOutConfig.spokeColor` / `anchorColor`), so a chart without one looks as before. A
|
|
31
|
+
// stylesheet can set the same property on any ancestor; a config value, on the group itself, wins.
|
|
28
32
|
.pcac-grid-rule line {
|
|
29
|
-
stroke: imports.$gray-200;
|
|
33
|
+
stroke: var(--pcac-grid-color, #{imports.$gray-200});
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
.pcac-x-axis,
|
|
@@ -40,11 +44,14 @@
|
|
|
40
44
|
// Tick marks and the axis line are hidden by default (above) and always have been, so they
|
|
41
45
|
// only appear on a chart that asks for them - `PcacAxisConfig.tickSize` for the marks,
|
|
42
46
|
// `showLine` for the line - via a class the axis builder adds for that axis. Nothing changes
|
|
43
|
-
// for charts that don't. Both share one color so a mark reads as part of its axis
|
|
44
|
-
// separate, fainter element.
|
|
45
|
-
&.pcac-axis-tick-marks .tick line
|
|
47
|
+
// for charts that don't. Both share one default color so a mark reads as part of its axis
|
|
48
|
+
// rather than a separate, fainter element, but each has its own override.
|
|
49
|
+
&.pcac-axis-tick-marks .tick line {
|
|
50
|
+
stroke: var(--pcac-axis-tick-color, #{imports.$gray-900});
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
&.pcac-axis-line .domain {
|
|
47
|
-
stroke: imports.$gray-900;
|
|
54
|
+
stroke: var(--pcac-axis-line-color, #{imports.$gray-900});
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
// The axis `label` (its title). `PcacChart.AXIS_LABEL_SPACE` reserves room for this size plus
|
|
@@ -52,12 +59,22 @@
|
|
|
52
59
|
.pcac-axis-label {
|
|
53
60
|
font-size: 12px;
|
|
54
61
|
font-weight: 600;
|
|
55
|
-
fill: imports.$gray-700;
|
|
62
|
+
fill: var(--pcac-axis-label-color, #{imports.$gray-700});
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
// Min / mid / max `subLabels`; `PcacChart.AXIS_SUB_LABEL_SPACE` is sized to this.
|
|
59
66
|
.pcac-axis-sub-label {
|
|
60
67
|
font-size: 11px;
|
|
61
|
-
fill: imports.$gray-600;
|
|
68
|
+
fill: var(--pcac-axis-sub-label-color, #{imports.$gray-600});
|
|
62
69
|
}
|
|
63
|
-
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Tick labels. d3-axis fills them `currentColor` by attribute; any stylesheet rule outranks
|
|
73
|
+
// that, so the fallback is the same value and a chart without `tickLabelColor` looks as before.
|
|
74
|
+
// Wrapped in `:where()` (specificity 0,0,1) rather than nested in the axis block above (0,2,1)
|
|
75
|
+
// so this rule still loses to a consumer's own `svg text { fill }` or `.dark-panel text { fill }`,
|
|
76
|
+
// as the bare attribute always did - the theme never styled tick labels before this rule, so it
|
|
77
|
+
// mustn't start beating CSS that consumers wrote against that.
|
|
78
|
+
:where(.pcac-x-axis, .pcac-y-axis) :where(.tick) text {
|
|
79
|
+
fill: var(--pcac-axis-tick-label-color, currentColor);
|
|
80
|
+
}
|
|
@@ -12,14 +12,87 @@
|
|
|
12
12
|
|
|
13
13
|
// The plot chart's `pointFanOut` anchors (see PcacPointFanOutConfig.showAnchor): a spoke from
|
|
14
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.
|
|
15
|
+
// grays, like the grid, so they read as guides rather than data. `spokeColor` / `anchorColor`
|
|
16
|
+
// override them through the custom properties, as the theme's axis colors do (pioneer-charts.scss).
|
|
16
17
|
.fan-out-spoke {
|
|
17
|
-
stroke: imports.$gray-400;
|
|
18
|
+
stroke: var(--pcac-fan-out-spoke-color, #{imports.$gray-400});
|
|
18
19
|
stroke-width: 1px;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.fan-out-anchor {
|
|
22
|
-
fill: imports.$gray-600;
|
|
23
|
+
fill: var(--pcac-fan-out-anchor-color, #{imports.$gray-600});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// `pointRange` (see PcacPointRangeConfig): each point's `range`, drawn by the builder into a
|
|
27
|
+
// `.point-range` group per point, a `.point-range-series` group per series, and one
|
|
28
|
+
// `.point-ranges` group for the chart. Color is the config's `color` when set
|
|
29
|
+
// (`--pcac-point-range-color`, on `.point-ranges`, or a stylesheet's on any ancestor), else the
|
|
30
|
+
// series' own (`--pcac-point-range-series-color`, which the builder sets on each series group).
|
|
31
|
+
// The `pcac-range-<show>` class picks how strongly a range shows at rest; hover marks one
|
|
32
|
+
// `.is-focused` and the chart's `.point-ranges` `.has-focus`.
|
|
33
|
+
.point-ranges {
|
|
34
|
+
// Resolved on the series group, not here: a `var()` in a custom property is substituted where
|
|
35
|
+
// it's declared, and the series color only exists from the series group down.
|
|
36
|
+
.point-range-series {
|
|
37
|
+
--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.point-range {
|
|
41
|
+
opacity: var(--pcac-point-range-resting-opacity, 1);
|
|
42
|
+
transition: opacity 150ms ease-out;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.point-range.is-focused {
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.pcac-range-hover {
|
|
50
|
+
--pcac-point-range-resting-opacity: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.pcac-range-faint {
|
|
54
|
+
--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, 0.2);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.pcac-range-always.has-focus .point-range:not(.is-focused) {
|
|
58
|
+
opacity: 0.5;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.point-range-whisker,
|
|
62
|
+
.point-range-cap {
|
|
63
|
+
stroke: var(--pcac-point-range-resolved-color);
|
|
64
|
+
stroke-width: 1.25px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.point-range-box {
|
|
68
|
+
fill: var(--pcac-point-range-resolved-color);
|
|
69
|
+
fill-opacity: 0.1;
|
|
70
|
+
stroke: var(--pcac-point-range-resolved-color);
|
|
71
|
+
stroke-opacity: 0.7;
|
|
72
|
+
stroke-width: 1.25px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.point-range-stop {
|
|
76
|
+
stop-color: var(--pcac-point-range-resolved-color);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.is-focused {
|
|
80
|
+
.point-range-whisker,
|
|
81
|
+
.point-range-cap,
|
|
82
|
+
.point-range-box {
|
|
83
|
+
stroke-width: 1.75px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.point-range-box {
|
|
87
|
+
fill-opacity: 0.18;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (prefers-reduced-motion: reduce) {
|
|
92
|
+
.point-range {
|
|
93
|
+
transition: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
23
96
|
}
|
|
24
97
|
|
|
25
98
|
.effects-canvas {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.pcac-grid-rule line {
|
|
18
|
-
stroke: #e9ecef;
|
|
18
|
+
stroke: var(--pcac-grid-color, #e9ecef);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.pcac-x-axis path,
|
|
@@ -24,19 +24,26 @@
|
|
|
24
24
|
.pcac-y-axis line {
|
|
25
25
|
stroke: none;
|
|
26
26
|
}
|
|
27
|
-
.pcac-x-axis.pcac-axis-tick-marks .tick line,
|
|
28
|
-
.pcac-y-axis.pcac-axis-tick-marks .tick line
|
|
27
|
+
.pcac-x-axis.pcac-axis-tick-marks .tick line,
|
|
28
|
+
.pcac-y-axis.pcac-axis-tick-marks .tick line {
|
|
29
|
+
stroke: var(--pcac-axis-tick-color, #212529);
|
|
30
|
+
}
|
|
31
|
+
.pcac-x-axis.pcac-axis-line .domain,
|
|
29
32
|
.pcac-y-axis.pcac-axis-line .domain {
|
|
30
|
-
stroke: #212529;
|
|
33
|
+
stroke: var(--pcac-axis-line-color, #212529);
|
|
31
34
|
}
|
|
32
35
|
.pcac-x-axis .pcac-axis-label,
|
|
33
36
|
.pcac-y-axis .pcac-axis-label {
|
|
34
37
|
font-size: 12px;
|
|
35
38
|
font-weight: 600;
|
|
36
|
-
fill: #495057;
|
|
39
|
+
fill: var(--pcac-axis-label-color, #495057);
|
|
37
40
|
}
|
|
38
41
|
.pcac-x-axis .pcac-axis-sub-label,
|
|
39
42
|
.pcac-y-axis .pcac-axis-sub-label {
|
|
40
43
|
font-size: 11px;
|
|
41
|
-
fill: #6c757d;
|
|
44
|
+
fill: var(--pcac-axis-sub-label-color, #6c757d);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:where(.pcac-x-axis, .pcac-y-axis) :where(.tick) text {
|
|
48
|
+
fill: var(--pcac-axis-tick-label-color, currentColor);
|
|
42
49
|
}
|
|
@@ -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
|
|
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-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)}
|
|
@@ -48,6 +48,11 @@ declare class PcacAxisSubLabels {
|
|
|
48
48
|
* Every field is optional so an object-literal / JSON config can give just the ones it cares
|
|
49
49
|
* about (or omit the axis entirely); the initializers apply to anything built with `new`, and
|
|
50
50
|
* `resolveAxisConfig()` fills the rest in for builders.
|
|
51
|
+
*
|
|
52
|
+
* The `*Color` fields each color one part of this axis, with any CSS color. Unset, the part keeps
|
|
53
|
+
* the theme's color. A color never turns a part on - it only shows once the part is drawn. Each
|
|
54
|
+
* is applied to the axis as the CSS custom property named on the field, so a stylesheet can set
|
|
55
|
+
* the same property on any ancestor instead; a config value wins.
|
|
51
56
|
*/
|
|
52
57
|
declare class PcacAxisConfig {
|
|
53
58
|
/**
|
|
@@ -65,6 +70,11 @@ declare class PcacAxisConfig {
|
|
|
65
70
|
* default.
|
|
66
71
|
*/
|
|
67
72
|
showGrid?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Grid line color (`--pcac-grid-color`), shown while this axis's grid is drawn - see `showGrid`.
|
|
75
|
+
* Theme default `$gray-200`.
|
|
76
|
+
*/
|
|
77
|
+
gridColor?: string;
|
|
68
78
|
/**
|
|
69
79
|
* Requested number of ticks (D3's `ticks()` hint, so the actual count can differ slightly) -
|
|
70
80
|
* also the number of grid lines for this axis. Ignored by a category (band) axis, which has one
|
|
@@ -82,12 +92,26 @@ declare class PcacAxisConfig {
|
|
|
82
92
|
* (`.pcac-axis-tick-marks .tick line`, `$gray-900`, the same as the axis line).
|
|
83
93
|
*/
|
|
84
94
|
tickSize?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Tick mark color (`--pcac-axis-tick-color`), shown once `tickSize` has turned the marks on.
|
|
97
|
+
* Theme default `$gray-900`.
|
|
98
|
+
*/
|
|
99
|
+
tickColor?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Tick label color (`--pcac-axis-tick-label-color`) - the values along the axis. Default is the
|
|
102
|
+
* page's text color (`currentColor`), as d3-axis has always drawn them.
|
|
103
|
+
*/
|
|
104
|
+
tickLabelColor?: string;
|
|
85
105
|
/**
|
|
86
106
|
* Draw a solid line along the axis itself (the full length of the axis, with D3's short
|
|
87
107
|
* end-caps). Off by default, as the theme has always hidden it. Color comes from the theme
|
|
88
108
|
* (`.pcac-axis-line .domain`, `$gray-900`).
|
|
89
109
|
*/
|
|
90
110
|
showLine?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Axis line color (`--pcac-axis-line-color`), shown with `showLine` on. Theme default `$gray-900`.
|
|
113
|
+
*/
|
|
114
|
+
lineColor?: string;
|
|
91
115
|
/**
|
|
92
116
|
* A title for the whole axis (e.g. "Revenue ($)"), drawn centered along it just inside the
|
|
93
117
|
* chart's edge: below the tick labels for the x axis, rotated to read bottom-to-top left of
|
|
@@ -96,6 +120,8 @@ declare class PcacAxisConfig {
|
|
|
96
120
|
* by the theme's `.pcac-axis-label` rule.
|
|
97
121
|
*/
|
|
98
122
|
label?: string;
|
|
123
|
+
/** `label` color (`--pcac-axis-label-color`). Theme default `$gray-700`. */
|
|
124
|
+
labelColor?: string;
|
|
99
125
|
/**
|
|
100
126
|
* Min / mid / max sub labels (e.g. "Low" / "Medium" / "High") in their own row just outside the
|
|
101
127
|
* tick labels, and inside the `label` if there is one: `min` left-aligned at the axis's start,
|
|
@@ -105,6 +131,8 @@ declare class PcacAxisConfig {
|
|
|
105
131
|
* hidden axis. Styled by the theme's `.pcac-axis-sub-label` rule.
|
|
106
132
|
*/
|
|
107
133
|
subLabels?: PcacAxisSubLabels;
|
|
134
|
+
/** `subLabels` color, all three (`--pcac-axis-sub-label-color`). Theme default `$gray-600`. */
|
|
135
|
+
subLabelColor?: string;
|
|
108
136
|
/**
|
|
109
137
|
* How the values along this axis are interpreted and shown - the tick labels, and the value
|
|
110
138
|
* (`yAxis`) or key (`xAxis`) in the default tooltip. On the line/area/plot charts the x axis's
|
|
@@ -137,10 +165,12 @@ interface PcacChartMargin {
|
|
|
137
165
|
}
|
|
138
166
|
/**
|
|
139
167
|
* `PcacAxisConfig` with every default applied - what builders work with, so they never have to
|
|
140
|
-
* null-check. `tickSize`, `label` and `
|
|
141
|
-
* default (no marks, no labels).
|
|
168
|
+
* null-check. `tickSize`, `label`, `subLabels` and the `*Color` fields stay optional: "not set"
|
|
169
|
+
* is itself the meaningful default (no marks, no labels, the theme's colors). The color fields
|
|
170
|
+
* are picked up by name, so a new one needs only its declaration on the class.
|
|
142
171
|
*/
|
|
143
|
-
type
|
|
172
|
+
type PcacOptionalAxisFields = 'tickSize' | 'label' | 'subLabels' | Extract<keyof PcacAxisConfig, `${string}Color`>;
|
|
173
|
+
type PcacResolvedAxisConfig = Required<Omit<PcacAxisConfig, PcacOptionalAxisFields>> & Pick<PcacAxisConfig, PcacOptionalAxisFields>;
|
|
144
174
|
/** True if `axis` has at least one sub label to draw (an empty `subLabels` object counts as none). */
|
|
145
175
|
declare function hasAxisSubLabels(axis: PcacAxisConfig | undefined): boolean;
|
|
146
176
|
/**
|
|
@@ -183,6 +213,34 @@ declare class PcacData {
|
|
|
183
213
|
* existing object-literal / JSON data doesn't have to declare it.
|
|
184
214
|
*/
|
|
185
215
|
image?: string;
|
|
216
|
+
/**
|
|
217
|
+
* The span this point's `key` / `value` stands for, when the point is really the middle of a
|
|
218
|
+
* range: `x` for the key, `y` for the value, either or both. Currently honored by the
|
|
219
|
+
* line/area/plot charts only, on the innermost (point-level) `PcacData`, and only drawn when
|
|
220
|
+
* the chart config turns `pointRange` on (see `PcacPointRangeConfig`). Nothing is labeled on
|
|
221
|
+
* the chart; a custom tooltip can read it off the point.
|
|
222
|
+
*
|
|
223
|
+
* Optional for the same reason as `image`.
|
|
224
|
+
*/
|
|
225
|
+
range?: PcacDataRange;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* One side of a `PcacDataRange`. `min` above `max` is read as the other way round; `min` equal to
|
|
229
|
+
* `max` (or either missing) as no range on that axis.
|
|
230
|
+
*/
|
|
231
|
+
declare class PcacRangeBounds<T> {
|
|
232
|
+
min: T;
|
|
233
|
+
max: T;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* `PcacData.range`. `x` is read the way the point's `key` is, per the chart's `xAxis.format`: a
|
|
237
|
+
* number for `Decimal`, anything `new Date()` accepts for `DateTime`, and for every index-based
|
|
238
|
+
* format a (possibly fractional) index - `{ min: 2.5, max: 3.5 }` is half a slot either side of
|
|
239
|
+
* the fourth point. `y` is on the value axis.
|
|
240
|
+
*/
|
|
241
|
+
declare class PcacDataRange {
|
|
242
|
+
x?: PcacRangeBounds<number | string>;
|
|
243
|
+
y?: PcacRangeBounds<number>;
|
|
186
244
|
}
|
|
187
245
|
declare enum PcacFormatEnum {
|
|
188
246
|
None = "none",
|
|
@@ -235,7 +293,8 @@ interface IPcacAxisBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomai
|
|
|
235
293
|
* D3's default 6px outer end-caps (`tickSizeOuter`), so it reads as a bracket rather than a
|
|
236
294
|
* bare rule; that's D3's standard look and is left as-is. `label` and `subLabels` are drawn
|
|
237
295
|
* inside the axis group (so they're raised and non-interactive along with it) - see `drawLabels`.
|
|
238
|
-
* `format` picks the tick label format; `None` leaves D3's default.
|
|
296
|
+
* `format` picks the tick label format; `None` leaves D3's default. The `*Color` fields are
|
|
297
|
+
* applied by `applyColors`.
|
|
239
298
|
*/
|
|
240
299
|
xAxis: PcacResolvedAxisConfig;
|
|
241
300
|
yAxis: PcacResolvedAxisConfig;
|
|
@@ -288,6 +347,12 @@ interface IPcacGridBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomai
|
|
|
288
347
|
* and gets one line per category.
|
|
289
348
|
*/
|
|
290
349
|
numberOfTicks: number;
|
|
350
|
+
/**
|
|
351
|
+
* Line color (`PcacAxisConfig.gridColor`), set on the grid group as `--pcac-grid-color` for the
|
|
352
|
+
* theme's `.pcac-grid-rule line` rule to read; unset means the theme's color. See the axis
|
|
353
|
+
* builder's `applyColors` for why a custom property.
|
|
354
|
+
*/
|
|
355
|
+
color?: string;
|
|
291
356
|
}
|
|
292
357
|
declare class PcacGridBuilder {
|
|
293
358
|
/**
|
|
@@ -869,6 +934,45 @@ declare class PcacPointImageConfig {
|
|
|
869
934
|
maxWidth: number;
|
|
870
935
|
maxHeight: number;
|
|
871
936
|
}
|
|
937
|
+
/** How a point's `range` is drawn (see `PcacPointRangeConfig.style`). */
|
|
938
|
+
declare enum PcacPointRangeStyle {
|
|
939
|
+
/** Error bars: a line across each range, capped at both ends. */
|
|
940
|
+
Whiskers = "whiskers",
|
|
941
|
+
/** A rectangle spanning the x range by the y range; a thin strip when only one is set. */
|
|
942
|
+
Box = "box",
|
|
943
|
+
/**
|
|
944
|
+
* A fill strongest at the point's value and fading out to the range's edges: an oval glow
|
|
945
|
+
* with both ranges (brightest on the value, even off-center), a fading bar with one.
|
|
946
|
+
*/
|
|
947
|
+
Fade = "fade"
|
|
948
|
+
}
|
|
949
|
+
/** When a point's `range` shows (see `PcacPointRangeConfig.show`). */
|
|
950
|
+
declare enum PcacPointRangeShow {
|
|
951
|
+
/** Only the hovered point's range. */
|
|
952
|
+
Hover = "hover",
|
|
953
|
+
/** Every range at `faintOpacity`, the hovered point's at full strength. */
|
|
954
|
+
Faint = "faint",
|
|
955
|
+
/** Every range at full strength; the others dim while a point is hovered. */
|
|
956
|
+
Always = "always"
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Drawing for `PcacData.range` on the line/area/plot charts. Ranges sit above the lines/areas and
|
|
960
|
+
* below the points, on the point's true coordinate (a fanned-out point's range stays on its
|
|
961
|
+
* anchor), clipped to the plot area and following zoom. The chart draws no numbers for them; a
|
|
962
|
+
* custom tooltip gets the point, `range` included.
|
|
963
|
+
*/
|
|
964
|
+
declare class PcacPointRangeConfig {
|
|
965
|
+
style: PcacPointRangeStyle;
|
|
966
|
+
show: PcacPointRangeShow;
|
|
967
|
+
/** Opacity of the ranges at rest under `show: Faint`, 0 - 1. */
|
|
968
|
+
faintOpacity: number;
|
|
969
|
+
/**
|
|
970
|
+
* Any CSS color for every range on the chart. Unset, each takes its series' color. Applied as
|
|
971
|
+
* `--pcac-point-range-color` on the chart's `.point-ranges` group, so a stylesheet can set it
|
|
972
|
+
* on an ancestor instead (a config value wins).
|
|
973
|
+
*/
|
|
974
|
+
color?: string;
|
|
975
|
+
}
|
|
872
976
|
/**
|
|
873
977
|
* The axes' `format` and `domainMin`/`domainMax` (`PcacAxisConfig`) do more here than on the bar
|
|
874
978
|
* charts. `yAxis.domainMin`/`domainMax` are the y scale's domain (default 0..100). `xAxis.format`
|
|
@@ -897,6 +1001,11 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
|
|
|
897
1001
|
* on their data still gets a sensibly-sized result.
|
|
898
1002
|
*/
|
|
899
1003
|
pointImage?: Partial<PcacPointImageConfig>;
|
|
1004
|
+
/**
|
|
1005
|
+
* Draw each point's `range` (see `PcacData.range`). Off when not set; `{}` turns it on with
|
|
1006
|
+
* every `PcacPointRangeConfig` default. Points without a `range` draw nothing extra.
|
|
1007
|
+
*/
|
|
1008
|
+
pointRange?: Partial<PcacPointRangeConfig>;
|
|
900
1009
|
}
|
|
901
1010
|
|
|
902
1011
|
/**
|
|
@@ -910,20 +1019,29 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
|
|
|
910
1019
|
declare class PcacPointFanOutConfig {
|
|
911
1020
|
/**
|
|
912
1021
|
* Ring radius in px, the same for every group. When not set, each group gets the smallest
|
|
913
|
-
* radius at which its
|
|
1022
|
+
* radius at which its neighbors sit `gap` px apart - so a pair barely moves while a group of
|
|
914
1023
|
* five spreads as far as it has to.
|
|
915
1024
|
*/
|
|
916
1025
|
radius?: number;
|
|
917
1026
|
/**
|
|
918
|
-
* Space between
|
|
1027
|
+
* Space between neighboring points on the ring, in px, when `radius` is not set. Measured
|
|
919
1028
|
* between their image boxes (or hovered dots), not their centers.
|
|
920
1029
|
*/
|
|
921
1030
|
gap: number;
|
|
922
1031
|
/**
|
|
923
1032
|
* Draw a dot at the shared coordinate - the value the group's points actually have - with a
|
|
924
|
-
* spoke out to each of them. Styled by the theme's `.fan-out-anchor` / `.fan-out-spoke` rules
|
|
1033
|
+
* spoke out to each of them. Styled by the theme's `.fan-out-anchor` / `.fan-out-spoke` rules,
|
|
1034
|
+
* whose colors `anchorColor` / `spokeColor` override.
|
|
925
1035
|
*/
|
|
926
1036
|
showAnchor: boolean;
|
|
1037
|
+
/**
|
|
1038
|
+
* Spoke color, any CSS color; theme default `$gray-400`. Applied as `--pcac-fan-out-spoke-color`
|
|
1039
|
+
* on the chart's `.fan-outs` group, so a stylesheet can set it on an ancestor instead (a config
|
|
1040
|
+
* value wins). Needs `showAnchor`.
|
|
1041
|
+
*/
|
|
1042
|
+
spokeColor?: string;
|
|
1043
|
+
/** Anchor dot color, likewise (`--pcac-fan-out-anchor-color`); theme default `$gray-600`. */
|
|
1044
|
+
anchorColor?: string;
|
|
927
1045
|
}
|
|
928
1046
|
declare class PcacPlotChartConfig extends PcacLineAreaChartConfig {
|
|
929
1047
|
/**
|
|
@@ -1024,5 +1142,5 @@ declare class PcacPieChartComponent {
|
|
|
1024
1142
|
static ɵcmp: i0.ɵɵComponentDeclaration<PcacPieChartComponent, "pcac-pie-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "sliceClicked": "sliceClicked"; }, ["tooltipTemplate"], never, true, never>;
|
|
1025
1143
|
}
|
|
1026
1144
|
|
|
1027
|
-
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 };
|
|
1145
|
+
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, PcacDataRange, PcacFormatEnum, PcacGridBuilder, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChartComponent, PcacPieChartConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointFanOutConfig, PcacPointImageConfig, PcacPointRangeConfig, PcacPointRangeShow, PcacPointRangeStyle, PcacRangeBounds, PcacTooltipBuilder, PcacTooltipDirective, PcacTransitionService, PieChartBuilder, axisLabelSpace, hasAxisSubLabels, resolveAxisConfig };
|
|
1028
1146
|
export type { IPcacAxisBuilderConfig, IPcacGridBuilderConfig, PcacChartMargin, PcacResolvedAxisConfig, PcacTooltipCoincident, PcacTooltipContext, PcacTooltipOptions };
|