@pioneer-code/pioneer-charts 22.2.7 → 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.
@@ -222,6 +222,34 @@ class PcacData {
222
222
  * existing object-literal / JSON data doesn't have to declare it.
223
223
  */
224
224
  image;
225
+ /**
226
+ * The span this point's `key` / `value` stands for, when the point is really the middle of a
227
+ * range: `x` for the key, `y` for the value, either or both. Currently honored by the
228
+ * line/area/plot charts only, on the innermost (point-level) `PcacData`, and only drawn when
229
+ * the chart config turns `pointRange` on (see `PcacPointRangeConfig`). Nothing is labeled on
230
+ * the chart; a custom tooltip can read it off the point.
231
+ *
232
+ * Optional for the same reason as `image`.
233
+ */
234
+ range;
235
+ }
236
+ /**
237
+ * One side of a `PcacDataRange`. `min` above `max` is read as the other way round; `min` equal to
238
+ * `max` (or either missing) as no range on that axis.
239
+ */
240
+ class PcacRangeBounds {
241
+ min;
242
+ max;
243
+ }
244
+ /**
245
+ * `PcacData.range`. `x` is read the way the point's `key` is, per the chart's `xAxis.format`: a
246
+ * number for `Decimal`, anything `new Date()` accepts for `DateTime`, and for every index-based
247
+ * format a (possibly fractional) index - `{ min: 2.5, max: 3.5 }` is half a slot either side of
248
+ * the fourth point. `y` is on the value axis.
249
+ */
250
+ class PcacDataRange {
251
+ x;
252
+ y;
225
253
  }
226
254
  var PcacFormatEnum;
227
255
  (function (PcacFormatEnum) {
@@ -1835,6 +1863,47 @@ class PcacPointImageConfig {
1835
1863
  maxWidth = 16;
1836
1864
  maxHeight = 16;
1837
1865
  }
1866
+ /** How a point's `range` is drawn (see `PcacPointRangeConfig.style`). */
1867
+ var PcacPointRangeStyle;
1868
+ (function (PcacPointRangeStyle) {
1869
+ /** Error bars: a line across each range, capped at both ends. */
1870
+ PcacPointRangeStyle["Whiskers"] = "whiskers";
1871
+ /** A rectangle spanning the x range by the y range; a thin strip when only one is set. */
1872
+ PcacPointRangeStyle["Box"] = "box";
1873
+ /**
1874
+ * A fill strongest at the point's value and fading out to the range's edges: an oval glow
1875
+ * with both ranges (brightest on the value, even off-center), a fading bar with one.
1876
+ */
1877
+ PcacPointRangeStyle["Fade"] = "fade";
1878
+ })(PcacPointRangeStyle || (PcacPointRangeStyle = {}));
1879
+ /** When a point's `range` shows (see `PcacPointRangeConfig.show`). */
1880
+ var PcacPointRangeShow;
1881
+ (function (PcacPointRangeShow) {
1882
+ /** Only the hovered point's range. */
1883
+ PcacPointRangeShow["Hover"] = "hover";
1884
+ /** Every range at `faintOpacity`, the hovered point's at full strength. */
1885
+ PcacPointRangeShow["Faint"] = "faint";
1886
+ /** Every range at full strength; the others dim while a point is hovered. */
1887
+ PcacPointRangeShow["Always"] = "always";
1888
+ })(PcacPointRangeShow || (PcacPointRangeShow = {}));
1889
+ /**
1890
+ * Drawing for `PcacData.range` on the line/area/plot charts. Ranges sit above the lines/areas and
1891
+ * below the points, on the point's true coordinate (a fanned-out point's range stays on its
1892
+ * anchor), clipped to the plot area and following zoom. The chart draws no numbers for them; a
1893
+ * custom tooltip gets the point, `range` included.
1894
+ */
1895
+ class PcacPointRangeConfig {
1896
+ style = PcacPointRangeStyle.Whiskers;
1897
+ show = PcacPointRangeShow.Faint;
1898
+ /** Opacity of the ranges at rest under `show: Faint`, 0 - 1. */
1899
+ faintOpacity = 0.2;
1900
+ /**
1901
+ * Any CSS color for every range on the chart. Unset, each takes its series' color. Applied as
1902
+ * `--pcac-point-range-color` on the chart's `.point-ranges` group, so a stylesheet can set it
1903
+ * on an ancestor instead (a config value wins).
1904
+ */
1905
+ color;
1906
+ }
1838
1907
  /**
1839
1908
  * The axes' `format` and `domainMin`/`domainMax` (`PcacAxisConfig`) do more here than on the bar
1840
1909
  * charts. `yAxis.domainMin`/`domainMax` are the y scale's domain (default 0..100). `xAxis.format`
@@ -1863,6 +1932,11 @@ class PcacLineAreaChartConfig extends PcacAxisChartConfig {
1863
1932
  * on their data still gets a sensibly-sized result.
1864
1933
  */
1865
1934
  pointImage;
1935
+ /**
1936
+ * Draw each point's `range` (see `PcacData.range`). Off when not set; `{}` turns it on with
1937
+ * every `PcacPointRangeConfig` default. Points without a `range` draw nothing extra.
1938
+ */
1939
+ pointRange;
1866
1940
  }
1867
1941
 
1868
1942
  /**
@@ -2170,6 +2244,161 @@ function buildZoomBehavior(width, height, zoomedFn) {
2170
2244
  .on("zoom", zoomedFn);
2171
2245
  }
2172
2246
 
2247
+ /** Half the length of a whisker's end cap, in px. */
2248
+ const RANGE_CAP = 5;
2249
+ /** How thick a box is drawn along an axis the point has no range on, in px. */
2250
+ const RANGE_STRIP = 4;
2251
+ /** How thick a fade is drawn along an axis the point has no range on, in px. */
2252
+ const RANGE_FADE_BAR = 10;
2253
+ /**
2254
+ * Where an x range bound lands, read the way `getXFormat` reads a key: a date for `DateTime`, a
2255
+ * number for `Decimal`, and a (possibly fractional) index for every index-based format. `NaN`
2256
+ * for anything that doesn't parse.
2257
+ */
2258
+ function xBound(value, format, scales) {
2259
+ if (value === null || value === undefined || value === '') {
2260
+ return NaN;
2261
+ }
2262
+ if (format === PcacFormatEnum.DateTime) {
2263
+ return scales.x(new Date(value));
2264
+ }
2265
+ return scales.x(Number(value));
2266
+ }
2267
+ /**
2268
+ * Sorts a pair of pixel bounds, or returns nothing if either isn't a real number - or if they're
2269
+ * the same, since a range that doesn't span anything has nothing to draw (whiskers would be a
2270
+ * stray pair of caps, a box or fade zero-sized).
2271
+ */
2272
+ function span(a, b) {
2273
+ if (!Number.isFinite(a) || !Number.isFinite(b) || a === b) {
2274
+ return undefined;
2275
+ }
2276
+ return a <= b ? [a, b] : [b, a];
2277
+ }
2278
+ /**
2279
+ * `d`'s range at these scales, drawn around `(cx, cy)` - the point's true coordinate - or `null`
2280
+ * when it has no range on either axis that can be placed.
2281
+ */
2282
+ function rangeExtent(d, cx, cy, format, scales) {
2283
+ const range = d.range;
2284
+ if (!range) {
2285
+ return null;
2286
+ }
2287
+ const xs = range.x ? span(xBound(range.x.min, format, scales), xBound(range.x.max, format, scales)) : undefined;
2288
+ const ys = range.y ? span(scales.y(Number(range.y.min)), scales.y(Number(range.y.max))) : undefined;
2289
+ if (!xs && !ys) {
2290
+ return null;
2291
+ }
2292
+ const extent = { cx, cy };
2293
+ if (xs) {
2294
+ [extent.x0, extent.x1] = xs;
2295
+ }
2296
+ if (ys) {
2297
+ [extent.y0, extent.y1] = ys;
2298
+ }
2299
+ return extent;
2300
+ }
2301
+ /**
2302
+ * Where the point sits within its range's box, as 0 - 1 fractions: the fade's brightest spot.
2303
+ * An axis without a range has the point in the middle.
2304
+ */
2305
+ function rangeFocus(extent) {
2306
+ const fraction = (v, lo, hi) => lo === undefined || hi === undefined || hi === lo ? 0.5 : Math.min(1, Math.max(0, (v - lo) / (hi - lo)));
2307
+ return { fx: fraction(extent.cx, extent.x0, extent.x1), fy: fraction(extent.cy, extent.y0, extent.y1) };
2308
+ }
2309
+ /**
2310
+ * (Re)draws one point's range into `group`, in plot coordinates, replacing whatever was there -
2311
+ * the same call serves the first draw and every zoom. `gradientId` must be unique in the page;
2312
+ * only the fade uses it. Colors, stroke widths and opacity all come from the theme (see
2313
+ * plot-line-area-chart.component.scss), so nothing here depends on the series.
2314
+ */
2315
+ function drawRange(group, extent, style, gradientId) {
2316
+ group.selectAll('*').remove();
2317
+ const { cx, cy, x0, x1, y0, y1 } = extent;
2318
+ switch (style) {
2319
+ case PcacPointRangeStyle.Box: {
2320
+ const left = x0 ?? cx - RANGE_STRIP / 2;
2321
+ const right = x1 ?? cx + RANGE_STRIP / 2;
2322
+ const top = y0 ?? cy - RANGE_STRIP / 2;
2323
+ const bottom = y1 ?? cy + RANGE_STRIP / 2;
2324
+ group.append('rect')
2325
+ .attr('class', 'point-range-box')
2326
+ .attr('x', left)
2327
+ .attr('y', top)
2328
+ .attr('width', right - left)
2329
+ .attr('height', bottom - top)
2330
+ .attr('rx', 2);
2331
+ return;
2332
+ }
2333
+ case PcacPointRangeStyle.Fade: {
2334
+ const { fx, fy } = rangeFocus(extent);
2335
+ const stops = (gradient, offsets) => {
2336
+ for (const [offset, opacity] of offsets) {
2337
+ gradient.append('stop')
2338
+ .attr('class', 'point-range-stop')
2339
+ .attr('offset', offset)
2340
+ .attr('stop-opacity', opacity);
2341
+ }
2342
+ };
2343
+ // The gradient lives inside the point's own group, not the chart's <defs>, so its stops
2344
+ // inherit the color custom properties set on the series group above it. Sized in
2345
+ // objectBoundingBox units, so the brightest spot stays on the point as zoom stretches it.
2346
+ const defs = group.append('defs');
2347
+ if (x0 !== undefined && x1 !== undefined && y0 !== undefined && y1 !== undefined) {
2348
+ const gradient = defs.append('radialGradient')
2349
+ .attr('id', gradientId)
2350
+ .attr('cx', 0.5).attr('cy', 0.5).attr('r', 0.5)
2351
+ .attr('fx', fx).attr('fy', fy);
2352
+ stops(gradient, [[0, 0.8], [0.5, 0.35], [1, 0]]);
2353
+ group.append('ellipse')
2354
+ .attr('class', 'point-range-fade')
2355
+ .attr('cx', (x0 + x1) / 2)
2356
+ .attr('cy', (y0 + y1) / 2)
2357
+ .attr('rx', (x1 - x0) / 2)
2358
+ .attr('ry', (y1 - y0) / 2)
2359
+ .attr('fill', `url(#${gradientId})`);
2360
+ return;
2361
+ }
2362
+ const vertical = y0 !== undefined && y1 !== undefined;
2363
+ const gradient = defs.append('linearGradient')
2364
+ .attr('id', gradientId)
2365
+ .attr('x1', 0).attr('y1', 0)
2366
+ .attr('x2', vertical ? 0 : 1).attr('y2', vertical ? 1 : 0);
2367
+ stops(gradient, [[0, 0.05], [vertical ? fy : fx, 0.8], [1, 0.05]]);
2368
+ const left = x0 ?? cx - RANGE_FADE_BAR / 2;
2369
+ const right = x1 ?? cx + RANGE_FADE_BAR / 2;
2370
+ const top = y0 ?? cy - RANGE_FADE_BAR / 2;
2371
+ const bottom = y1 ?? cy + RANGE_FADE_BAR / 2;
2372
+ group.append('rect')
2373
+ .attr('class', 'point-range-fade')
2374
+ .attr('x', left)
2375
+ .attr('y', top)
2376
+ .attr('width', right - left)
2377
+ .attr('height', bottom - top)
2378
+ .attr('rx', RANGE_FADE_BAR / 2)
2379
+ .attr('fill', `url(#${gradientId})`);
2380
+ return;
2381
+ }
2382
+ default: {
2383
+ // Whiskers
2384
+ const line = (xa, ya, xb, yb, cls) => group.append('line')
2385
+ .attr('class', cls)
2386
+ .attr('x1', xa).attr('y1', ya)
2387
+ .attr('x2', xb).attr('y2', yb);
2388
+ if (y0 !== undefined && y1 !== undefined) {
2389
+ line(cx, y0, cx, y1, 'point-range-whisker');
2390
+ line(cx - RANGE_CAP, y0, cx + RANGE_CAP, y0, 'point-range-cap');
2391
+ line(cx - RANGE_CAP, y1, cx + RANGE_CAP, y1, 'point-range-cap');
2392
+ }
2393
+ if (x0 !== undefined && x1 !== undefined) {
2394
+ line(x0, cy, x1, cy, 'point-range-whisker');
2395
+ line(x0, cy - RANGE_CAP, x0, cy + RANGE_CAP, 'point-range-cap');
2396
+ line(x1, cy - RANGE_CAP, x1, cy + RANGE_CAP, 'point-range-cap');
2397
+ }
2398
+ }
2399
+ }
2400
+ }
2401
+
2173
2402
  /**
2174
2403
  * Finds every set of points that share a coordinate across all of the chart's visible series.
2175
2404
  * Coincidence is decided from the data rather than from scaled pixels, so this can run before
@@ -2286,6 +2515,17 @@ function clamp(value, min, max) {
2286
2515
  */
2287
2516
  /** Half the theme's 2px line stroke: how far the lines/areas/fan-outs clip-path reaches past the plot. */
2288
2517
  const PLOT_CLIP_ALLOWANCE = 1;
2518
+ /**
2519
+ * Names for the dot's transitions. d3 lets only one transition *per name* run on an element: a
2520
+ * new one cancels the old. The enter rise (`cy`) keeps the default name; the hover grow/shrink
2521
+ * and the entry's size-in (`r`) each get their own, so hovering a dot while the chart is still
2522
+ * animating in no longer cancels its rise and strands it short of its value. Hover interrupts
2523
+ * the size-in explicitly instead, since both tween `r`.
2524
+ */
2525
+ const DOT_GROW_TRANSITION = 'pcac-dot-grow';
2526
+ const DOT_HOVER_TRANSITION = 'pcac-dot-hover';
2527
+ /** See `revealAfterEntry`. */
2528
+ const REVEAL_TRANSITION = 'pcac-reveal';
2289
2529
  class PlaChartBuilder extends PcacChart {
2290
2530
  effectsBuilder = inject(PlaChartEffectsBuilder);
2291
2531
  scales;
@@ -2326,6 +2566,10 @@ class PlaChartBuilder extends PcacChart {
2326
2566
  fanOutOffsets = new Map();
2327
2567
  /** The `.point` group under the cursor, between its mouseover and mouseout (see `leavePoint`). */
2328
2568
  hoveredPoint = null;
2569
+ /** `config.pointRange` with its defaults applied, or `null` while ranges are off. */
2570
+ pointRange = null;
2571
+ /** Each drawn range's `.point-range` group, by its point, so hover can find the one to focus. */
2572
+ rangeGroupOf = new Map();
2329
2573
  dotClicked$ = this.dotClickedSource.asObservable();
2330
2574
  buildChart(chartElm, config, type) {
2331
2575
  if (!config?.data?.length) {
@@ -2345,6 +2589,7 @@ class PlaChartBuilder extends PcacChart {
2345
2589
  this.initializeAxisState(this.config, 'y', 8);
2346
2590
  this.resolvePointLayout(type);
2347
2591
  this.reservePointSpace();
2592
+ this.pointRange = this.config.pointRange ? { ...new PcacPointRangeConfig(), ...this.config.pointRange } : null;
2348
2593
  if (!this.initializeChartState(chartElm, this.config)) {
2349
2594
  return;
2350
2595
  }
@@ -2412,8 +2657,12 @@ class PlaChartBuilder extends PcacChart {
2412
2657
  if (this.config.enableEffects) {
2413
2658
  this.effectsBuilder.updateScales(newX, newY);
2414
2659
  }
2660
+ // Ranges are drawn in plot coordinates rather than hung off a translate, so every one is
2661
+ // redrawn against the zoomed scales.
2662
+ this.updatePointRanges(zoomedScales);
2415
2663
  // Redrawing an axis appends it at the end of the group, above the dots; put them back
2416
2664
  // on top so a point on the baseline isn't covered (see drawChart's draw order).
2665
+ this.svg.selectAll('.point-ranges').raise();
2417
2666
  this.svg.selectAll('.fan-outs').raise();
2418
2667
  this.svg.selectAll('.dots').raise();
2419
2668
  });
@@ -2440,8 +2689,10 @@ class PlaChartBuilder extends PcacChart {
2440
2689
  }
2441
2690
  // Axes above the lines/areas (so an axis line isn't covered by a series sitting at x = 0),
2442
2691
  // but the dots above the axes: a point on the baseline or the y axis stays whole. Fan-out
2443
- // spokes go between the two so they run underneath the points they lead to.
2692
+ // spokes go between the two so they run underneath the points they lead to, and point
2693
+ // ranges under those.
2444
2694
  this.axisBuilder.raiseAxes(this.svg);
2695
+ this.drawPointRanges();
2445
2696
  this.drawFanOuts();
2446
2697
  this.drawDots(config);
2447
2698
  }
@@ -2592,6 +2843,80 @@ class PlaChartBuilder extends PcacChart {
2592
2843
  .duration(this.transitionService.getTransitionDuration())
2593
2844
  .attr('d', this.areaGenerator);
2594
2845
  }
2846
+ /**
2847
+ * Draws one `<g class="point-ranges">` holding a group per series and, inside it, a
2848
+ * `<g class="point-range">` per point that has a `range` - only while `pointRange` is on. Clipped
2849
+ * to the plot area and deaf to the pointer, so it never gets in the way of hover or zoom. When
2850
+ * each range shows is entirely the theme's business, driven by classes: `pcac-range-<show>` on
2851
+ * the outer group sets the resting opacity, and hover (`focusPointRange`) marks the hovered
2852
+ * point's range `is-focused` and the outer group `has-focus`. The colors are custom properties
2853
+ * - the series' own on its group, `color` (when set) on the outer one, which wins - see
2854
+ * plot-line-area-chart.component.scss.
2855
+ */
2856
+ drawPointRanges() {
2857
+ this.rangeGroupOf = new Map();
2858
+ if (!this.pointRange) {
2859
+ return;
2860
+ }
2861
+ const { show, faintOpacity, color } = this.pointRange;
2862
+ const layer = this.svg.append('g')
2863
+ .attr('class', `point-ranges pcac-range-${show}`)
2864
+ .attr('clip-path', `url(#${this.plotClipPathId})`)
2865
+ .attr('pointer-events', 'none')
2866
+ .style('--pcac-point-range-color', () => color ?? null)
2867
+ .style('--pcac-point-range-faint-opacity', () => faintOpacity);
2868
+ this.config.data.forEach((series, seriesIndex) => {
2869
+ const seriesGroup = layer.append('g')
2870
+ .attr('class', 'point-range-series')
2871
+ .style('--pcac-point-range-series-color', () => this.colors[seriesIndex])
2872
+ .style('display', () => series.hide ? 'none' : null);
2873
+ series.data.forEach((point) => {
2874
+ if (point.range) {
2875
+ this.rangeGroupOf.set(point, seriesGroup.append('g').attr('class', 'point-range').node());
2876
+ }
2877
+ });
2878
+ });
2879
+ this.updatePointRanges(this.scales);
2880
+ this.revealAfterEntry(layer);
2881
+ }
2882
+ /**
2883
+ * Draws every range against `scales`, around its point's true coordinate - a fanned-out point's
2884
+ * range stays on the anchor, not on the ring. A range with nothing placeable is left empty.
2885
+ */
2886
+ updatePointRanges(scales) {
2887
+ if (!this.pointRange) {
2888
+ return;
2889
+ }
2890
+ const style = this.pointRange.style;
2891
+ this.config.data.forEach((series, seriesIndex) => {
2892
+ series.data.forEach((point, index) => {
2893
+ const node = this.rangeGroupOf.get(point);
2894
+ if (!node) {
2895
+ return;
2896
+ }
2897
+ const group = select$1(node);
2898
+ const { x, y } = this.pointPosition(point, index, scales);
2899
+ const extent = rangeExtent(point, x, y, this.xAxis.format, scales);
2900
+ if (!extent) {
2901
+ group.selectAll('*').remove();
2902
+ return;
2903
+ }
2904
+ drawRange(group, extent, style, `${this.plotClipPathId}-range-${seriesIndex}-${index}`);
2905
+ });
2906
+ });
2907
+ }
2908
+ /** Brings `d`'s range forward (see `drawPointRanges`), or with `null` puts every range back to rest. */
2909
+ focusPointRange(d) {
2910
+ if (!this.pointRange || !this.svg) {
2911
+ return;
2912
+ }
2913
+ this.svg.selectAll('.point-range.is-focused').classed('is-focused', false);
2914
+ const node = d ? this.rangeGroupOf.get(d) : undefined;
2915
+ if (node) {
2916
+ select$1(node).classed('is-focused', true);
2917
+ }
2918
+ this.svg.select('.point-ranges').classed('has-focus', !!node);
2919
+ }
2595
2920
  /**
2596
2921
  * Draws one `<g class="fan-outs">` holding a `<g class="fan-out">` per group of coincident
2597
2922
  * points: a spoke from the shared coordinate to where each member is drawn, and an anchor dot
@@ -2629,9 +2954,20 @@ class PlaChartBuilder extends PcacChart {
2629
2954
  groups.append('circle')
2630
2955
  .attr('class', 'fan-out-anchor')
2631
2956
  .attr('r', 3);
2632
- groups.attr('opacity', 0)
2633
- .transition()
2634
- .duration(this.transitionService.getTransitionDuration())
2957
+ this.revealAfterEntry(groups);
2958
+ }
2959
+ /**
2960
+ * Keeps `selection` hidden while the points rise in from the baseline, then fades it in. For
2961
+ * the guides drawn around the points (fan-out spokes and anchors, point ranges): they're drawn
2962
+ * where the points end up, so showing them during the rise has them pointing at empty space.
2963
+ * Its own transition name so that nothing else animating the same element cancels it.
2964
+ */
2965
+ revealAfterEntry(selection) {
2966
+ const duration = this.transitionService.getTransitionDuration();
2967
+ selection.attr('opacity', 0)
2968
+ .transition(REVEAL_TRANSITION)
2969
+ .delay(duration)
2970
+ .duration(duration / 3)
2635
2971
  .attr('opacity', 1);
2636
2972
  }
2637
2973
  /**
@@ -2665,6 +3001,7 @@ class PlaChartBuilder extends PcacChart {
2665
3001
  .attr('display', (d, i) => this.pointDisplay(d, i, this.scales))
2666
3002
  .on('mouseover', function (event, d) {
2667
3003
  self.hoveredPoint = this;
3004
+ self.focusPointRange(d);
2668
3005
  // `d` is the very element bound from `series.data` above, so identity lookup is exact.
2669
3006
  self.showTooltip(event, d, {
2670
3007
  index: series.data.indexOf(d),
@@ -2674,9 +3011,12 @@ class PlaChartBuilder extends PcacChart {
2674
3011
  valueFormat: self.yAxis.format,
2675
3012
  keyFormat: self.xAxis.format,
2676
3013
  });
2677
- // No-op for an image point (no circle inside to grow).
3014
+ // No-op for an image point (no circle inside to grow). Its own transition name, so it
3015
+ // runs alongside the enter rise rather than cancelling it (see DOT_HOVER_TRANSITION);
3016
+ // it only takes over the entry's size tween, which it would otherwise fight over `r`.
2678
3017
  select$1(this).select('.dot')
2679
- .transition()
3018
+ .interrupt(DOT_GROW_TRANSITION)
3019
+ .transition(DOT_HOVER_TRANSITION)
2680
3020
  .duration(duration / 3)
2681
3021
  .attr('r', 6)
2682
3022
  .attr('fill', self.colors[index]);
@@ -2692,9 +3032,11 @@ class PlaChartBuilder extends PcacChart {
2692
3032
  .attr('cx', (d) => this.offsetOf(d).dx)
2693
3033
  .attr('cy', rise)
2694
3034
  .attr('fill', '#fff')
2695
- .transition()
3035
+ .call((dots) => dots.transition()
3036
+ .duration(duration)
3037
+ .attr('cy', (d) => this.offsetOf(d).dy))
3038
+ .transition(DOT_GROW_TRANSITION)
2696
3039
  .duration(duration)
2697
- .attr('cy', (d) => this.offsetOf(d).dy)
2698
3040
  .attr('r', 4);
2699
3041
  // `preserveAspectRatio="xMidYMid meet"` is what does the "resize to fit" - the image is
2700
3042
  // scaled uniformly to fit inside the maxWidth x maxHeight box and centered within it, so
@@ -2727,8 +3069,10 @@ class PlaChartBuilder extends PcacChart {
2727
3069
  const point = this.hoveredPoint;
2728
3070
  this.hoveredPoint = null;
2729
3071
  this.hideTooltip();
3072
+ this.focusPointRange(null);
2730
3073
  select$1(point).select('.dot')
2731
- .transition()
3074
+ .interrupt(DOT_GROW_TRANSITION)
3075
+ .transition(DOT_HOVER_TRANSITION)
2732
3076
  .duration(this.transitionService.getTransitionDuration() / 3)
2733
3077
  .attr('r', 4)
2734
3078
  .attr('fill', '#fff');
@@ -2865,11 +3209,11 @@ class PcacLineAreaChartComponent {
2865
3209
  }
2866
3210
  }
2867
3211
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2868
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", 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 .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:#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:#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 });
3212
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", 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 .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:#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:#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 });
2869
3213
  }
2870
3214
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
2871
3215
  type: Component,
2872
- 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 .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:#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:#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"] }]
3216
+ 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 .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:#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:#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"] }]
2873
3217
  }], 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 }] }] } });
2874
3218
 
2875
3219
  class PcacPlotChart {
@@ -2940,7 +3284,8 @@ class PcacAreaChartConfig extends PcacLineAreaChartConfig {
2940
3284
  // export * from './plot-line-area-chart.model';
2941
3285
  // The rest of that model stays internal (the shared PcacLineAreaChartConfig is reached through
2942
3286
  // the per-chart PcacLineChartConfig/PcacAreaChartConfig/PcacPlotChartConfig subclasses), but
2943
- // the point-image sizing type is part of those configs' public shape, so it's exported alone.
3287
+ // the point-image and point-range types are part of those configs' public shape, so they're
3288
+ // exported alone.
2944
3289
 
2945
3290
  /**
2946
3291
  * Provided per-component (see PcacPieChartComponent's `providers`), not root-scoped:
@@ -3091,5 +3436,5 @@ class PcacPieChartConfig extends PcacChartConfig {
3091
3436
  * Generated bundle index. Do not edit.
3092
3437
  */
3093
3438
 
3094
- 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 };
3439
+ 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 };
3095
3440
  //# sourceMappingURL=pioneer-code-pioneer-charts.mjs.map