@pioneer-code/pioneer-charts 22.2.20 → 22.2.22
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.
|
@@ -103,9 +103,22 @@ class PcacAxisConfig {
|
|
|
103
103
|
* margins grow or shrink by the same amount so the plot area makes room for them - a longer
|
|
104
104
|
* tick means a slightly smaller plot, never labels pushed off the edge. Only the per-tick marks
|
|
105
105
|
* change; the axis line's two end-caps keep their default length. Colored by `tickColor`, the
|
|
106
|
-
* theme's `$gray-900` (like the axis line) by default.
|
|
106
|
+
* theme's `$gray-900` (like the axis line) by default. Ignored while `autoTickSize` is on.
|
|
107
107
|
*/
|
|
108
108
|
tickSize;
|
|
109
|
+
/**
|
|
110
|
+
* Size the tick marks from the chart's points instead of `tickSize`: half the largest mark
|
|
111
|
+
* toward this axis, so a point sitting on the axis ends where its tick does and never covers a
|
|
112
|
+
* tick label (D3's 3px tick padding is the gap left between them). This **overrides**
|
|
113
|
+
* `tickSize` - with it on, any `tickSize` given is ignored - and turns the marks on the same
|
|
114
|
+
* way a `tickSize` does. The largest mark is measured as drawn: a hovered dot, an image's box
|
|
115
|
+
* (its height for the x axis, its width for the y axis), and a gauge ring around either,
|
|
116
|
+
* after any shrinking to fit (dot plot). Honored by the charts that draw points - line, area,
|
|
117
|
+
* plot and dot plot; ignored elsewhere. On the dot plot the marks never reach the axis (its
|
|
118
|
+
* bottom row sits a `gap` above it), so there it only spaces the labels to the marks' size.
|
|
119
|
+
* Default false.
|
|
120
|
+
*/
|
|
121
|
+
autoTickSize = false;
|
|
109
122
|
/**
|
|
110
123
|
* Tick mark color (`--pcac-axis-tick-color`), shown once `tickSize` has turned the marks on.
|
|
111
124
|
* Theme default `$gray-900`.
|
|
@@ -202,6 +215,7 @@ function resolveAxisConfig(axis, showGridDefault = false) {
|
|
|
202
215
|
showGrid: axis?.showGrid ?? showGridDefault,
|
|
203
216
|
ticks: axis?.ticks ?? defaults.ticks,
|
|
204
217
|
showLine: axis?.showLine ?? defaults.showLine,
|
|
218
|
+
autoTickSize: axis?.autoTickSize ?? defaults.autoTickSize,
|
|
205
219
|
format: axis?.format ?? defaults.format,
|
|
206
220
|
domainMin: axis?.domainMin ?? defaults.domainMin,
|
|
207
221
|
domainMax: axis?.domainMax ?? defaults.domainMax,
|
|
@@ -899,16 +913,33 @@ class PcacTooltipBuilder {
|
|
|
899
913
|
* Created on first use rather than with the service, which every chart builder injects: that
|
|
900
914
|
* way nothing touches the DOM until a chart actually shows a tooltip, so building a chart
|
|
901
915
|
* where there's no browser `document` (server-side rendering) doesn't throw. Removed again in
|
|
902
|
-
* `ngOnDestroy()`, when the app that owns this root service is destroyed.
|
|
916
|
+
* `ngOnDestroy()`, when the app that owns this root service is destroyed. The touch listener
|
|
917
|
+
* (see `onPointerDown`) is added and removed with it.
|
|
903
918
|
*/
|
|
904
919
|
get tooltip() {
|
|
905
|
-
|
|
906
|
-
.
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
920
|
+
if (!this.shell) {
|
|
921
|
+
this.shell = select(this.document.body)
|
|
922
|
+
.append('div')
|
|
923
|
+
.attr('class', 'pcac-d3-tooltip')
|
|
924
|
+
.attr('id', PcacTooltipBuilder.ID)
|
|
925
|
+
.attr('role', 'tooltip');
|
|
926
|
+
this.document.addEventListener('pointerdown', this.onPointerDown, { capture: true, passive: true });
|
|
927
|
+
}
|
|
910
928
|
return this.shell;
|
|
911
929
|
}
|
|
930
|
+
/**
|
|
931
|
+
* A touch (or pen) coming down anywhere closes the tooltip. A tap shows it by way of the mouse
|
|
932
|
+
* events the browser makes up for the tap, but nothing then moves off the mark to hide it again:
|
|
933
|
+
* without this it stayed up after a tap until the next one happened to land on another mark,
|
|
934
|
+
* scrolled away with the page, and covered whatever opened in response. A tap on another mark
|
|
935
|
+
* still shows its tooltip - this runs first, on the way down, and the made-up mouse events that
|
|
936
|
+
* show the new one come after. A mouse is left alone; it hides the tooltip by leaving the mark.
|
|
937
|
+
*/
|
|
938
|
+
onPointerDown = (event) => {
|
|
939
|
+
if (event.pointerType !== 'mouse') {
|
|
940
|
+
this.hideTooltip();
|
|
941
|
+
}
|
|
942
|
+
};
|
|
912
943
|
/**
|
|
913
944
|
* The consumer template currently rendered into the shell, if any. Created on the first show
|
|
914
945
|
* of a hover and torn down in `hideTooltip()` - not kept around between hovers - so a view is
|
|
@@ -972,6 +1003,9 @@ class PcacTooltipBuilder {
|
|
|
972
1003
|
}
|
|
973
1004
|
ngOnDestroy() {
|
|
974
1005
|
this.destroyView();
|
|
1006
|
+
if (this.shell) {
|
|
1007
|
+
this.document.removeEventListener('pointerdown', this.onPointerDown, { capture: true });
|
|
1008
|
+
}
|
|
975
1009
|
this.shell?.remove();
|
|
976
1010
|
this.shell = null;
|
|
977
1011
|
}
|
|
@@ -1248,7 +1282,8 @@ class PcacChart {
|
|
|
1248
1282
|
* In order:
|
|
1249
1283
|
*
|
|
1250
1284
|
* 1. `resetMargin()`.
|
|
1251
|
-
* 2. Tick marks:
|
|
1285
|
+
* 2. Tick marks: an axis with `autoTickSize` takes its `tickSize` from `autoTickSize` (see below).
|
|
1286
|
+
* Then room for a non-default `tickSize` is reserved on each axis that will actually
|
|
1252
1287
|
* be drawn (`reserveTickSizeMargins`).
|
|
1253
1288
|
* 3. Labels: `AXIS_LABEL_SPACE` is added to `bottom` / `left` for an axis with a `label`, and
|
|
1254
1289
|
* `AXIS_SUB_LABEL_SPACE` for one with any `subLabels` (see `axisLabelSpace`), again only if
|
|
@@ -1263,10 +1298,20 @@ class PcacChart {
|
|
|
1263
1298
|
* (`PcacAxisConfig.showGrid`): `'y'` for horizontal lines, `'x'` for vertical.
|
|
1264
1299
|
* @param hiddenAxisMargin what a hidden axis's sides shrink to, rather than 0. The
|
|
1265
1300
|
* line/area/plot charts keep 8px so a dot on the edge of the plot isn't clipped by the SVG.
|
|
1301
|
+
* @param autoTickSize for the charts that draw points: half their largest mark toward each axis
|
|
1302
|
+
* (`x`: its vertical half, `y`: its horizontal half), which an axis with `autoTickSize` takes,
|
|
1303
|
+
* rounded up, as its `tickSize` - in place of any `tickSize` the consumer gave. Left out, as by
|
|
1304
|
+
* the charts without points, `autoTickSize` does nothing.
|
|
1266
1305
|
*/
|
|
1267
|
-
initializeAxisState(config, defaultGrid, hiddenAxisMargin = 0) {
|
|
1306
|
+
initializeAxisState(config, defaultGrid, hiddenAxisMargin = 0, autoTickSize) {
|
|
1268
1307
|
this.xAxis = resolveAxisConfig(config.xAxis, defaultGrid === 'x');
|
|
1269
1308
|
this.yAxis = resolveAxisConfig(config.yAxis, defaultGrid === 'y');
|
|
1309
|
+
if (autoTickSize && this.xAxis.autoTickSize) {
|
|
1310
|
+
this.xAxis.tickSize = Math.ceil(autoTickSize.x);
|
|
1311
|
+
}
|
|
1312
|
+
if (autoTickSize && this.yAxis.autoTickSize) {
|
|
1313
|
+
this.yAxis.tickSize = Math.ceil(autoTickSize.y);
|
|
1314
|
+
}
|
|
1270
1315
|
this.resetMargin();
|
|
1271
1316
|
this.reserveTickSizeMargins(this.xAxis.hide ? undefined : this.xAxis.tickSize, this.yAxis.hide ? undefined : this.yAxis.tickSize);
|
|
1272
1317
|
if (!this.xAxis.hide) {
|
|
@@ -2789,10 +2834,16 @@ class PcacReferenceLine {
|
|
|
2789
2834
|
*/
|
|
2790
2835
|
value = 0;
|
|
2791
2836
|
/**
|
|
2792
|
-
* A few words drawn at the line
|
|
2793
|
-
*
|
|
2837
|
+
* A few words drawn at one end of the line, inside the plot (see `labelPosition`). Styled by the
|
|
2838
|
+
* theme's `.reference-line-label` rule.
|
|
2794
2839
|
*/
|
|
2795
2840
|
label;
|
|
2841
|
+
/**
|
|
2842
|
+
* Which end of the line `label` sits at. `'end'`, the default, is above the right end of a
|
|
2843
|
+
* horizontal line and beside the top of a vertical one; `'start'` is above its left end and beside
|
|
2844
|
+
* its bottom - for when the far end is crowded, say by a corner label.
|
|
2845
|
+
*/
|
|
2846
|
+
labelPosition = 'end';
|
|
2796
2847
|
/**
|
|
2797
2848
|
* Any CSS color for the line and its label. Theme default `$gray-500`. Applied as
|
|
2798
2849
|
* `--pcac-reference-line-color` on the line's group, so a stylesheet can set it on an ancestor
|
|
@@ -2804,8 +2855,8 @@ class PcacReferenceLine {
|
|
|
2804
2855
|
* Text pinned to the plot area's corners (see `PcacLineAreaChartConfig.cornerLabels`) - names for
|
|
2805
2856
|
* the regions the plot divides into, such as the quadrants between two reference lines. Pinned to
|
|
2806
2857
|
* the plot's frame rather than to data, so they stay put when the chart is zoomed. Drawn under the
|
|
2807
|
-
* series, so a point in the corner covers its label rather than the other way round
|
|
2808
|
-
* left unset is left empty.
|
|
2858
|
+
* series, so a point in the corner covers its label rather than the other way round, unless the
|
|
2859
|
+
* chart sets `labelsOnTop`. Any corner left unset is left empty.
|
|
2809
2860
|
*/
|
|
2810
2861
|
class PcacCornerLabels {
|
|
2811
2862
|
topLeft;
|
|
@@ -2872,6 +2923,15 @@ class PcacLineAreaChartConfig extends PcacAxisChartConfig {
|
|
|
2872
2923
|
* screen readers like the grid, so when they carry meaning, say so in the chart's `ariaLabel`.
|
|
2873
2924
|
*/
|
|
2874
2925
|
cornerLabels;
|
|
2926
|
+
/**
|
|
2927
|
+
* Draw the corner labels and reference-line labels over the series instead of under it, each
|
|
2928
|
+
* outlined in a halo so it stays readable on whatever it crosses - for a chart whose points crowd
|
|
2929
|
+
* the corners or the lines' ends, where they'd otherwise hide the labels. Default false. The halo
|
|
2930
|
+
* is `--pcac-label-halo-color`, the theme's `$white` by default: set it to the chart's background
|
|
2931
|
+
* (a dark one, say) on the chart or any ancestor. The labels never take the pointer, so a point
|
|
2932
|
+
* under one can still be hovered and clicked. The reference lines themselves stay under the series.
|
|
2933
|
+
*/
|
|
2934
|
+
labelsOnTop;
|
|
2875
2935
|
}
|
|
2876
2936
|
|
|
2877
2937
|
/**
|
|
@@ -2983,11 +3043,9 @@ class DotPlotChartBuilder extends PcacChart {
|
|
|
2983
3043
|
return;
|
|
2984
3044
|
}
|
|
2985
3045
|
this.hideTooltip();
|
|
2986
|
-
// A column's height is a count of marks, not a value, so there's no y axis to draw.
|
|
2987
|
-
// copies: initializeAxisState() rewrites `height`, which mustn't reach the consumer's object.
|
|
3046
|
+
// A column's height is a count of marks, not a value, so there's no y axis to draw.
|
|
2988
3047
|
const rawXAxis = config.xAxis;
|
|
2989
3048
|
config = { ...config, yAxis: { ...config.yAxis, hide: true } };
|
|
2990
|
-
this.initializeAxisState(config, 'x', 0);
|
|
2991
3049
|
const defaults = new PcacDotPlotChartConfig();
|
|
2992
3050
|
const dotRadius = config.dotRadius ?? defaults.dotRadius;
|
|
2993
3051
|
const gap = config.gap ?? defaults.gap;
|
|
@@ -2995,26 +3053,53 @@ class DotPlotChartBuilder extends PcacChart {
|
|
|
2995
3053
|
const origin = rawXAxis?.domainMin !== undefined ? Number(rawXAxis.domainMin) : 0;
|
|
2996
3054
|
this.placements = stackDots(config.data, config.binWidth, origin);
|
|
2997
3055
|
const hasImages = this.placements.some((p) => !!p.data.image);
|
|
3056
|
+
const hasDots = this.placements.some((p) => !p.data.image);
|
|
2998
3057
|
const fullSize = hasImages
|
|
2999
3058
|
? Math.max(this.pointImage.maxWidth, this.pointImage.maxHeight)
|
|
3000
3059
|
: 2 * (dotRadius + DOT_HOVER_GROWTH);
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3060
|
+
const tallest = tallestColumn(this.placements);
|
|
3061
|
+
// `autoTickSize`: half the tallest mark at a given fit - a hovered dot (its growth isn't
|
|
3062
|
+
// scaled) or an image's box - toward the x axis.
|
|
3063
|
+
const markHalf = (fit) => Math.max(hasDots ? dotRadius * fit + DOT_HOVER_GROWTH : 0, hasImages ? this.pointImage.maxHeight * fit / 2 : 0);
|
|
3064
|
+
// The fit shrinks marks to the plot's height, which an auto tick takes its length out of, so
|
|
3065
|
+
// with `autoTickSize` the layout is settled in up to three passes: at full size; at the size
|
|
3066
|
+
// that fit, if smaller; and - should the height that handed back have grown the marks past
|
|
3067
|
+
// that, rounding up a pixel - at the length they now need, which is still no longer than the
|
|
3068
|
+
// first, so the marks can only shrink again and never outgrow the tick.
|
|
3069
|
+
let tick = markHalf(1);
|
|
3070
|
+
for (let pass = 0;; pass++) {
|
|
3071
|
+
if (!this.layout(chartElm, config, tick, fullSize)) {
|
|
3072
|
+
return;
|
|
3073
|
+
}
|
|
3074
|
+
const fit = tallest ? Math.min(1, this.height / (tallest * (fullSize + gap))) : 1;
|
|
3075
|
+
this.markSize = fullSize * fit;
|
|
3076
|
+
this.markGap = gap * fit;
|
|
3077
|
+
this.dotRadius = dotRadius * fit;
|
|
3078
|
+
const needed = Math.ceil(markHalf(fit));
|
|
3079
|
+
if (!this.xAxis.autoTickSize || this.xAxis.hide || needed === this.xAxis.tickSize || pass === 2) {
|
|
3080
|
+
break;
|
|
3081
|
+
}
|
|
3082
|
+
tick = needed;
|
|
3006
3083
|
}
|
|
3007
3084
|
this.ensureColorCount(config.data.length);
|
|
3008
3085
|
this.applyColorOverride(config.colorOverride);
|
|
3009
|
-
// Shrink every mark evenly when the tallest column wouldn't fit the plot's height.
|
|
3010
|
-
const tallest = tallestColumn(this.placements);
|
|
3011
|
-
const fit = tallest ? Math.min(1, this.height / (tallest * (fullSize + gap))) : 1;
|
|
3012
|
-
this.markSize = fullSize * fit;
|
|
3013
|
-
this.markGap = gap * fit;
|
|
3014
|
-
this.dotRadius = dotRadius * fit;
|
|
3015
3086
|
this.xScale = this.buildXScale(rawXAxis?.domainMin, rawXAxis?.domainMax);
|
|
3016
3087
|
this.drawChart(chartElm);
|
|
3017
3088
|
}
|
|
3089
|
+
/**
|
|
3090
|
+
* Sets the axes and margins up and measures the plot area, with `tick` as the x axis's length
|
|
3091
|
+
* under `autoTickSize`. Returns `initializeChartState`'s result. On a copy of the config each
|
|
3092
|
+
* time: initializeAxisState() rewrites `height`, which mustn't reach the consumer's object or
|
|
3093
|
+
* build up over passes.
|
|
3094
|
+
*/
|
|
3095
|
+
layout(chartElm, config, tick, fullSize) {
|
|
3096
|
+
config = { ...config };
|
|
3097
|
+
this.initializeAxisState(config, 'x', 0, { x: tick, y: 0 });
|
|
3098
|
+
// A mark at the domain's edge is centered on it, so half of it hangs past the plot area.
|
|
3099
|
+
const half = Math.ceil(fullSize / 2);
|
|
3100
|
+
this.reserveEdgeSpace({ left: half, right: half });
|
|
3101
|
+
return this.initializeChartState(chartElm, config);
|
|
3102
|
+
}
|
|
3018
3103
|
/**
|
|
3019
3104
|
* The value axis: `xAxis.domainMin` / `domainMax` where given, otherwise the data's extent
|
|
3020
3105
|
* rounded out to nice ticks - checked on the consumer's own axis config, since the resolved one
|
|
@@ -3777,9 +3862,10 @@ function referenceLinePosition(line, scales, xFormat) {
|
|
|
3777
3862
|
}
|
|
3778
3863
|
/**
|
|
3779
3864
|
* Draws `lines` into one `.reference-lines` group, clipped to the plot (`clipPathId`) so a line
|
|
3780
|
-
* zoomed past an edge disappears there
|
|
3781
|
-
*
|
|
3782
|
-
*
|
|
3865
|
+
* zoomed past an edge disappears there, each a `.reference-line` group holding the dashed `<line>`.
|
|
3866
|
+
* Their labels go in a `.reference-line-labels` group of their own, clipped the same way, so they
|
|
3867
|
+
* can be raised over the series (`raiseLabels`) without the lines. Both hidden from screen readers,
|
|
3868
|
+
* as the grid is.
|
|
3783
3869
|
*/
|
|
3784
3870
|
function drawReferenceLines(svg, lines, scales, xFormat, width, height, clipPathId) {
|
|
3785
3871
|
if (!lines?.length) {
|
|
@@ -3796,31 +3882,46 @@ function drawReferenceLines(svg, lines, scales, xFormat, width, height, clipPath
|
|
|
3796
3882
|
.attr('class', (line) => `reference-line reference-line-${line.axis}`)
|
|
3797
3883
|
.style('--pcac-reference-line-color', (line) => line.color ?? null);
|
|
3798
3884
|
groups.append('line').attr('class', 'reference-line-stroke');
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
.
|
|
3802
|
-
|
|
3885
|
+
const labelled = resolved.filter((line) => !!line.label);
|
|
3886
|
+
if (labelled.length) {
|
|
3887
|
+
svg.append('g')
|
|
3888
|
+
.attr('class', 'reference-line-labels')
|
|
3889
|
+
.attr('clip-path', `url(#${clipPathId})`)
|
|
3890
|
+
.attr('aria-hidden', 'true')
|
|
3891
|
+
.selectAll('.reference-line-label')
|
|
3892
|
+
.data(labelled)
|
|
3893
|
+
.enter().append('text')
|
|
3894
|
+
.attr('class', (line) => `reference-line-label reference-line-label-${line.axis}`)
|
|
3895
|
+
.style('--pcac-reference-line-color', (line) => line.color ?? null)
|
|
3896
|
+
.text((line) => line.label);
|
|
3897
|
+
}
|
|
3803
3898
|
positionReferenceLines(svg, scales, xFormat, width, height);
|
|
3804
3899
|
}
|
|
3805
3900
|
/**
|
|
3806
3901
|
* Places the chart's reference lines, and their labels, against `scales` - on the first draw and
|
|
3807
|
-
* again on every zoom. A horizontal line's label sits above its right end
|
|
3808
|
-
* its top.
|
|
3902
|
+
* again on every zoom. A horizontal line's label sits above its right end, or its left with
|
|
3903
|
+
* `labelPosition: 'start'`; a vertical line's beside its top, or its bottom.
|
|
3809
3904
|
*/
|
|
3810
3905
|
function positionReferenceLines(svg, scales, xFormat, width, height) {
|
|
3811
|
-
const
|
|
3812
|
-
|
|
3906
|
+
const hidden = (line) => referenceLinePosition(line, scales, xFormat) === null ? 'none' : null;
|
|
3907
|
+
const groups = svg.selectAll('.reference-line').attr('display', hidden);
|
|
3813
3908
|
const at = (line) => referenceLinePosition(line, scales, xFormat) ?? 0;
|
|
3909
|
+
const atStart = (line) => line.labelPosition === 'start';
|
|
3814
3910
|
groups.select('.reference-line-stroke')
|
|
3815
3911
|
.attr('x1', (line) => line.axis === 'x' ? at(line) : 0)
|
|
3816
3912
|
.attr('x2', (line) => line.axis === 'x' ? at(line) : width)
|
|
3817
3913
|
.attr('y1', (line) => line.axis === 'x' ? 0 : at(line))
|
|
3818
3914
|
.attr('y2', (line) => line.axis === 'x' ? height : at(line));
|
|
3819
|
-
|
|
3820
|
-
.attr('
|
|
3821
|
-
.attr('
|
|
3822
|
-
|
|
3823
|
-
|
|
3915
|
+
svg.selectAll('.reference-line-label')
|
|
3916
|
+
.attr('display', hidden)
|
|
3917
|
+
.attr('x', (line) => line.axis === 'x'
|
|
3918
|
+
? at(line) + LABEL_INSET
|
|
3919
|
+
: atStart(line) ? LABEL_INSET : width - LABEL_INSET)
|
|
3920
|
+
.attr('y', (line) => line.axis === 'x'
|
|
3921
|
+
? atStart(line) ? height - LABEL_INSET : LABEL_INSET
|
|
3922
|
+
: at(line) - LABEL_INSET)
|
|
3923
|
+
.attr('text-anchor', (line) => line.axis === 'y' && !atStart(line) ? 'end' : 'start')
|
|
3924
|
+
.attr('dominant-baseline', (line) => line.axis === 'x' && !atStart(line) ? 'hanging' : 'auto');
|
|
3824
3925
|
}
|
|
3825
3926
|
/**
|
|
3826
3927
|
* Draws `labels` into a `.corner-labels` group, each a `.corner-label` inset from its corner of
|
|
@@ -3854,6 +3955,16 @@ function drawCornerLabels(svg, labels, width, height) {
|
|
|
3854
3955
|
.attr('dominant-baseline', (corner) => corner.baseline)
|
|
3855
3956
|
.text((corner) => corner.text);
|
|
3856
3957
|
}
|
|
3958
|
+
/**
|
|
3959
|
+
* With `labelsOnTop`, moves the corner labels and reference-line labels above everything drawn
|
|
3960
|
+
* so far - the series included - and marks them for the theme's halo. Called after each draw and
|
|
3961
|
+
* each zoom, which re-raises the series over the axes it redraws.
|
|
3962
|
+
*/
|
|
3963
|
+
function raiseLabels(svg) {
|
|
3964
|
+
svg.selectAll('.corner-labels, .reference-line-labels')
|
|
3965
|
+
.classed('pcac-labels-on-top', true)
|
|
3966
|
+
.raise();
|
|
3967
|
+
}
|
|
3857
3968
|
|
|
3858
3969
|
/**
|
|
3859
3970
|
* Finds every set of points that share a coordinate across all of the chart's visible series.
|
|
@@ -4036,12 +4147,12 @@ class PlaChartBuilder extends PcacChart {
|
|
|
4036
4147
|
/**
|
|
4037
4148
|
* How far the points' clip-path rect extends past the drawable [0, width] x [0, height] area on
|
|
4038
4149
|
* every side, so a point sitting exactly on the domain's edge isn't cut in half. 10px
|
|
4039
|
-
* comfortably clears a dot (r = 4, or 6 on hover); a point image can be much
|
|
4040
|
-
* so
|
|
4041
|
-
* (and grows the margins to match -
|
|
4042
|
-
*
|
|
4043
|
-
*
|
|
4044
|
-
*
|
|
4150
|
+
* comfortably clears a dot (r = 4, or 6 on hover); a point image or a gauge ring can be much
|
|
4151
|
+
* bigger than that, so `reservePointSpace()` widens this to half the largest mark on the chart
|
|
4152
|
+
* (and grows the margins to match, since the clip-path only matters up to the edge of the SVG).
|
|
4153
|
+
* The buffer is only there for points whose center is inside the plot; one whose center zoom
|
|
4154
|
+
* has carried past an edge is hidden outright (see `pointVisible`), rather than left showing up
|
|
4155
|
+
* to a whole half-mark beyond the axis.
|
|
4045
4156
|
*/
|
|
4046
4157
|
clipBuffer = 10;
|
|
4047
4158
|
pointImage;
|
|
@@ -4086,11 +4197,13 @@ class PlaChartBuilder extends PcacChart {
|
|
|
4086
4197
|
hide: false,
|
|
4087
4198
|
data: []
|
|
4088
4199
|
}));
|
|
4200
|
+
// Before the axes and the layout: the marks' size feeds `autoTickSize`, and a ring widens what
|
|
4201
|
+
// fan-out and the edge space have to make room for.
|
|
4202
|
+
this.pointImage = { ...new PcacPointImageConfig(), ...this.config.pointImage };
|
|
4203
|
+
this.pointGauge = this.config.pointGauge ? { ...new PcacPointGaugeConfig(), ...this.config.pointGauge } : null;
|
|
4089
4204
|
// A hidden axis keeps 8px rather than 0 so a dot on the edge of the plot isn't clipped
|
|
4090
|
-
this.initializeAxisState(this.config, 'y', 8);
|
|
4205
|
+
this.initializeAxisState(this.config, 'y', 8, this.largestMarkHalf());
|
|
4091
4206
|
this.chartTypeLabel = CHART_TYPE_LABELS[type];
|
|
4092
|
-
// Before the layout: a ring widens what fan-out and the edge space have to make room for.
|
|
4093
|
-
this.pointGauge = this.config.pointGauge ? { ...new PcacPointGaugeConfig(), ...this.config.pointGauge } : null;
|
|
4094
4207
|
this.resolvePointLayout(type);
|
|
4095
4208
|
this.reservePointSpace();
|
|
4096
4209
|
this.pointRange = this.config.pointRange ? { ...new PcacPointRangeConfig(), ...this.config.pointRange } : null;
|
|
@@ -4178,6 +4291,9 @@ class PlaChartBuilder extends PcacChart {
|
|
|
4178
4291
|
this.svg.selectAll('.point-ranges').raise();
|
|
4179
4292
|
this.svg.selectAll('.fan-outs').raise();
|
|
4180
4293
|
this.svg.selectAll('.dots').raise();
|
|
4294
|
+
if (this.config.labelsOnTop) {
|
|
4295
|
+
raiseLabels(this.svg);
|
|
4296
|
+
}
|
|
4181
4297
|
});
|
|
4182
4298
|
this.zoomBehavior = behavior;
|
|
4183
4299
|
}
|
|
@@ -4219,16 +4335,19 @@ class PlaChartBuilder extends PcacChart {
|
|
|
4219
4335
|
this.drawPointRanges();
|
|
4220
4336
|
this.drawFanOuts();
|
|
4221
4337
|
this.drawDots(config);
|
|
4338
|
+
// Labels asked to stay readable go over all of it (see `labelsOnTop`).
|
|
4339
|
+
if (config.labelsOnTop) {
|
|
4340
|
+
raiseLabels(this.svg);
|
|
4341
|
+
}
|
|
4222
4342
|
this.restoreTabStop(chartElm);
|
|
4223
4343
|
}
|
|
4224
4344
|
/**
|
|
4225
|
-
*
|
|
4345
|
+
* Finds the points that share a coordinate and, on a plot chart with
|
|
4226
4346
|
* `pointFanOut`, works out where to draw each of them instead. Coincidence is found from the
|
|
4227
4347
|
* data (see `findCoincidentGroups`) so this can run before the scales exist. Line and area
|
|
4228
4348
|
* charts still get the groups, for the tooltip's `coincident` list, but never an offset.
|
|
4229
4349
|
*/
|
|
4230
4350
|
resolvePointLayout(type) {
|
|
4231
|
-
this.pointImage = { ...new PcacPointImageConfig(), ...this.config.pointImage };
|
|
4232
4351
|
this.coincidentGroups = findCoincidentGroups(this.config.data, this.xAxis.format);
|
|
4233
4352
|
this.coincidentOf = new Map(this.coincidentGroups.flatMap((group) => group.members.map((member) => [member.data, group])));
|
|
4234
4353
|
const fanOut = type === PcacLineAreaPlotChartConfigType.Plot
|
|
@@ -4250,26 +4369,51 @@ class PlaChartBuilder extends PcacChart {
|
|
|
4250
4369
|
this.fanOutOffsets = fanOutOffsets(this.coincidentGroups, radius);
|
|
4251
4370
|
}
|
|
4252
4371
|
/**
|
|
4253
|
-
*
|
|
4254
|
-
*
|
|
4255
|
-
*
|
|
4256
|
-
*
|
|
4257
|
-
*
|
|
4258
|
-
*
|
|
4259
|
-
* center ever sits past the edge either. Must run after `resolvePointLayout()` and between
|
|
4260
|
-
* `initializeAxisState()` and `initializeChartState()`, see `reserveEdgeSpace`.
|
|
4372
|
+
* Half the largest mark on the chart toward each axis, for `autoTickSize` and the edge space
|
|
4373
|
+
* (`reservePointSpace`): `x` its vertical half (what reaches down to the x axis), `y` its
|
|
4374
|
+
* horizontal half. Measured as drawn - a hovered dot (`GAUGE_DOT_RADIUS`), an image's box, and
|
|
4375
|
+
* a gauge ring around either (circular, so the same both ways). Points in a hidden series
|
|
4376
|
+
* count, so toggling one in a legend doesn't move the axes; a gap (no value) draws nothing and
|
|
4377
|
+
* doesn't. Needs `pointImage` and `pointGauge` resolved.
|
|
4261
4378
|
*/
|
|
4262
|
-
|
|
4263
|
-
const
|
|
4264
|
-
const
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4379
|
+
largestMarkHalf() {
|
|
4380
|
+
const { maxWidth, maxHeight } = this.pointImage;
|
|
4381
|
+
const half = { x: 0, y: 0 };
|
|
4382
|
+
for (const point of this.config.data.flatMap((series) => series.data ?? [])) {
|
|
4383
|
+
if (!hasValue(point)) {
|
|
4384
|
+
continue;
|
|
4385
|
+
}
|
|
4386
|
+
let x = point.image ? maxHeight / 2 : GAUGE_DOT_RADIUS;
|
|
4387
|
+
let y = point.image ? maxWidth / 2 : GAUGE_DOT_RADIUS;
|
|
4388
|
+
if (this.pointGauge && hasGauge(point)) {
|
|
4389
|
+
// The ring surrounds the mark's larger side - see `markRadius` in `drawDots`.
|
|
4390
|
+
const ring = (point.image ? Math.max(maxWidth, maxHeight) / 2 : GAUGE_DOT_RADIUS) + gaugeExtent(this.pointGauge);
|
|
4391
|
+
x = Math.max(x, ring);
|
|
4392
|
+
y = Math.max(y, ring);
|
|
4393
|
+
}
|
|
4394
|
+
half.x = Math.max(half.x, x);
|
|
4395
|
+
half.y = Math.max(half.y, y);
|
|
4270
4396
|
}
|
|
4271
|
-
|
|
4272
|
-
|
|
4397
|
+
return half;
|
|
4398
|
+
}
|
|
4399
|
+
/**
|
|
4400
|
+
* Makes room for the points at the edge of the domain: the clip-path buffer grows to half the
|
|
4401
|
+
* largest mark (`largestMarkHalf()` - an image box, a ring, or a hovered dot) so the `.dots`
|
|
4402
|
+
* group lets it through, and the margins grow to at least that same amount so the `<svg>`
|
|
4403
|
+
* doesn't cut off what the clip-path let through (a mark is centered on its point, so at the top
|
|
4404
|
+
* of the y domain half of it sits above the plot area - in `margin.top`, which is only 8px by
|
|
4405
|
+
* default). A ring is measured around the image box's larger side, as `drawDots` draws it, on
|
|
4406
|
+
* both axes; measured against the box's own side, a ringed wide image at the top of the domain
|
|
4407
|
+
* had the top of its ring cut off by the SVG. Half a mark is all a fan-out needs too: a
|
|
4408
|
+
* fanned-out ring is shifted back inside the plot area (`fanOutShift`), so no member's center
|
|
4409
|
+
* ever sits past the edge either. A plain dot fits the default 10px buffer and every margin
|
|
4410
|
+
* already. Must run after `resolvePointLayout()` and between `initializeAxisState()` and
|
|
4411
|
+
* `initializeChartState()`, see `reserveEdgeSpace`.
|
|
4412
|
+
*/
|
|
4413
|
+
reservePointSpace() {
|
|
4414
|
+
const half = this.largestMarkHalf();
|
|
4415
|
+
const halfWidth = Math.ceil(half.y);
|
|
4416
|
+
const halfHeight = Math.ceil(half.x);
|
|
4273
4417
|
this.clipBuffer = Math.max(10, halfWidth, halfHeight);
|
|
4274
4418
|
this.reserveEdgeSpace({ top: halfHeight, bottom: halfHeight, left: halfWidth, right: halfWidth });
|
|
4275
4419
|
}
|
|
@@ -4842,11 +4986,11 @@ class PcacLineAreaChartComponent {
|
|
|
4842
4986
|
}
|
|
4843
4987
|
}
|
|
4844
4988
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4845
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacLineAreaChartComponent, isStandalone: true, selector: "pcac-line-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, tooltipTemplate: { classPropertyName: "tooltipTemplate", publicName: "tooltipTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [PlaChartBuilder, PlaChartEffectsBuilder], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .reference-line-stroke{stroke:var(--pcac-reference-line-color, #adb5bd);stroke-width:1px;stroke-dasharray:4 4}.pcac-line-area-chart .reference-line-label{font-size:11px;fill:var(--pcac-reference-line-color, #adb5bd)}.pcac-line-area-chart .point-gauge-track{fill:none;stroke:var(--pcac-point-gauge-track-color, #e9ecef)}.pcac-line-area-chart .point-gauge-arc{fill:var(--pcac-point-gauge-color, var(--pcac-point-gauge-series-color))}.pcac-line-area-chart .corner-label{font-size:12px;font-weight:500;fill:var(--pcac-corner-label-color, #6c757d)}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:var(--pcac-crosshair-line-color, #ced4da);stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:var(--pcac-crosshair-text-color, #343a40)}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
4989
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: PcacLineAreaChartComponent, isStandalone: true, selector: "pcac-line-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, tooltipTemplate: { classPropertyName: "tooltipTemplate", publicName: "tooltipTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { properties: { "class.pcac-height-full": "config().heightFull" } }, providers: [PlaChartBuilder, PlaChartEffectsBuilder], viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .reference-line-stroke{stroke:var(--pcac-reference-line-color, #adb5bd);stroke-width:1px;stroke-dasharray:4 4}.pcac-line-area-chart .reference-line-label{font-size:11px;fill:var(--pcac-reference-line-color, #adb5bd)}.pcac-line-area-chart .point-gauge-track{fill:none;stroke:var(--pcac-point-gauge-track-color, #e9ecef)}.pcac-line-area-chart .point-gauge-arc{fill:var(--pcac-point-gauge-color, var(--pcac-point-gauge-series-color))}.pcac-line-area-chart .corner-label{font-size:12px;font-weight:500;fill:var(--pcac-corner-label-color, #6c757d)}.pcac-line-area-chart .corner-labels,.pcac-line-area-chart .reference-line-labels{pointer-events:none}.pcac-line-area-chart .pcac-labels-on-top .corner-label,.pcac-line-area-chart .pcac-labels-on-top .reference-line-label{paint-order:stroke;stroke:var(--pcac-label-halo-color, #fff);stroke-width:3px;stroke-linejoin:round}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:var(--pcac-crosshair-line-color, #ced4da);stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:var(--pcac-crosshair-text-color, #343a40)}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
4846
4990
|
}
|
|
4847
4991
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
|
|
4848
4992
|
type: Component,
|
|
4849
|
-
args: [{ selector: 'pcac-line-area-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, encapsulation: ViewEncapsulation.None, providers: [PlaChartBuilder, PlaChartEffectsBuilder], template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .reference-line-stroke{stroke:var(--pcac-reference-line-color, #adb5bd);stroke-width:1px;stroke-dasharray:4 4}.pcac-line-area-chart .reference-line-label{font-size:11px;fill:var(--pcac-reference-line-color, #adb5bd)}.pcac-line-area-chart .point-gauge-track{fill:none;stroke:var(--pcac-point-gauge-track-color, #e9ecef)}.pcac-line-area-chart .point-gauge-arc{fill:var(--pcac-point-gauge-color, var(--pcac-point-gauge-series-color))}.pcac-line-area-chart .corner-label{font-size:12px;font-weight:500;fill:var(--pcac-corner-label-color, #6c757d)}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:var(--pcac-crosshair-line-color, #ced4da);stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:var(--pcac-crosshair-text-color, #343a40)}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"] }]
|
|
4993
|
+
args: [{ selector: 'pcac-line-area-chart', host: { '[class.pcac-height-full]': 'config().heightFull' }, encapsulation: ViewEncapsulation.None, providers: [PlaChartBuilder, PlaChartEffectsBuilder], template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .fan-out-spoke{stroke:var(--pcac-fan-out-spoke-color, #ced4da);stroke-width:1px}.pcac-line-area-chart .fan-out-anchor{fill:var(--pcac-fan-out-anchor-color, #6c757d)}.pcac-line-area-chart .reference-line-stroke{stroke:var(--pcac-reference-line-color, #adb5bd);stroke-width:1px;stroke-dasharray:4 4}.pcac-line-area-chart .reference-line-label{font-size:11px;fill:var(--pcac-reference-line-color, #adb5bd)}.pcac-line-area-chart .point-gauge-track{fill:none;stroke:var(--pcac-point-gauge-track-color, #e9ecef)}.pcac-line-area-chart .point-gauge-arc{fill:var(--pcac-point-gauge-color, var(--pcac-point-gauge-series-color))}.pcac-line-area-chart .corner-label{font-size:12px;font-weight:500;fill:var(--pcac-corner-label-color, #6c757d)}.pcac-line-area-chart .corner-labels,.pcac-line-area-chart .reference-line-labels{pointer-events:none}.pcac-line-area-chart .pcac-labels-on-top .corner-label,.pcac-line-area-chart .pcac-labels-on-top .reference-line-label{paint-order:stroke;stroke:var(--pcac-label-halo-color, #fff);stroke-width:3px;stroke-linejoin:round}.pcac-line-area-chart .point-ranges .point-range-series{--pcac-point-range-resolved-color: var(--pcac-point-range-color, var(--pcac-point-range-series-color))}.pcac-line-area-chart .point-ranges .point-range{opacity:var(--pcac-point-range-resting-opacity, 1);transition:opacity .15s ease-out}.pcac-line-area-chart .point-ranges .point-range.is-focused{opacity:1}.pcac-line-area-chart .point-ranges.pcac-range-hover{--pcac-point-range-resting-opacity: 0}.pcac-line-area-chart .point-ranges.pcac-range-faint{--pcac-point-range-resting-opacity: var(--pcac-point-range-faint-opacity, .2)}.pcac-line-area-chart .point-ranges.pcac-range-always.has-focus .point-range:not(.is-focused){opacity:.5}.pcac-line-area-chart .point-ranges .point-range-whisker,.pcac-line-area-chart .point-ranges .point-range-cap{stroke:var(--pcac-point-range-resolved-color);stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-box{fill:var(--pcac-point-range-resolved-color);fill-opacity:.1;stroke:var(--pcac-point-range-resolved-color);stroke-opacity:.7;stroke-width:1.25px}.pcac-line-area-chart .point-ranges .point-range-stop{stop-color:var(--pcac-point-range-resolved-color)}.pcac-line-area-chart .point-ranges .is-focused .point-range-whisker,.pcac-line-area-chart .point-ranges .is-focused .point-range-cap,.pcac-line-area-chart .point-ranges .is-focused .point-range-box{stroke-width:1.75px}.pcac-line-area-chart .point-ranges .is-focused .point-range-box{fill-opacity:.18}@media(prefers-reduced-motion:reduce){.pcac-line-area-chart .point-ranges .point-range{transition:none}}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:var(--pcac-crosshair-line-color, #ced4da);stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:var(--pcac-crosshair-text-color, #343a40)}pcac-line-chart.pcac-height-full,pcac-area-chart.pcac-height-full,pcac-plot-chart.pcac-height-full,pcac-line-area-chart.pcac-height-full{display:block;height:100%}pcac-line-area-chart.pcac-height-full .pcac-line-area-chart{height:100%}\n"] }]
|
|
4850
4994
|
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], chartElm: [{ type: i0.ViewChild, args: ['chart', { isSignal: true }] }], dotClicked: [{ type: i0.Output, args: ["dotClicked"] }], tooltipTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipTemplate", required: false }] }] } });
|
|
4851
4995
|
|
|
4852
4996
|
class PcacPlotChart {
|