@pioneer-code/pioneer-charts 22.2.13 → 22.2.14
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.
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import * as rxjs from 'rxjs';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { TemplateRef, OnDestroy, ElementRef, Signal } from '@angular/core';
|
|
4
|
-
import { AxisDomain, AxisScale } from 'd3-axis';
|
|
5
|
-
import { Selection, BaseType } from 'd3-selection';
|
|
6
1
|
import * as _pioneer_code_pioneer_charts from '@pioneer-code/pioneer-charts';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { TemplateRef, ElementRef } from '@angular/core';
|
|
7
4
|
|
|
8
5
|
/**
|
|
9
6
|
* Base configuration for all charts.
|
|
@@ -30,6 +27,12 @@ declare class PcacChartConfig {
|
|
|
30
27
|
* initializer still applies to anything constructed via `new`.
|
|
31
28
|
*/
|
|
32
29
|
heightFull?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* What the chart shows, for screen readers - e.g. `'Sales by month, 2026'`. The chart's `<svg>` is
|
|
32
|
+
* announced as one image with this name; when it isn't set, the chart's type is used (`'Bar
|
|
33
|
+
* chart'`, `'Pie chart'`, ...). Optional for the same reason as `heightFull`.
|
|
34
|
+
*/
|
|
35
|
+
ariaLabel?: string;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Up to three short labels placed along an axis by position rather than by value: `min` at its
|
|
@@ -152,44 +155,6 @@ declare class PcacAxisConfig {
|
|
|
152
155
|
domainMin?: number | string;
|
|
153
156
|
domainMax?: number | string;
|
|
154
157
|
}
|
|
155
|
-
/**
|
|
156
|
-
* The `PcacChartMargin` type lives here rather than in chart.ts so the axis builder can take
|
|
157
|
-
* one without importing the class module that imports it back.
|
|
158
|
-
*/
|
|
159
|
-
interface PcacChartMargin {
|
|
160
|
-
top: number;
|
|
161
|
-
right: number;
|
|
162
|
-
bottom: number;
|
|
163
|
-
left: number;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* `PcacAxisConfig` with every default applied - what builders work with, so they never have to
|
|
167
|
-
* null-check. `tickSize`, `label`, `subLabels` and the `*Color` fields stay optional: "not set"
|
|
168
|
-
* is itself the meaningful default (no marks, no labels, the theme's colors). The color fields
|
|
169
|
-
* are picked up by name, so a new one needs only its declaration on the class.
|
|
170
|
-
*/
|
|
171
|
-
type PcacOptionalAxisFields = 'tickSize' | 'label' | 'subLabels' | Extract<keyof PcacAxisConfig, `${string}Color`>;
|
|
172
|
-
type PcacResolvedAxisConfig = Required<Omit<PcacAxisConfig, PcacOptionalAxisFields>> & Pick<PcacAxisConfig, PcacOptionalAxisFields>;
|
|
173
|
-
/** True if `axis` has at least one sub label to draw (an empty `subLabels` object counts as none). */
|
|
174
|
-
declare function hasAxisSubLabels(axis: PcacAxisConfig | undefined): boolean;
|
|
175
|
-
/**
|
|
176
|
-
* Room reserved in a margin for an axis `label`: the theme's 12px label plus a gap from the tick
|
|
177
|
-
* labels. Reserved on the side the label sits on (`bottom` for x, `left` for y), and taken out
|
|
178
|
-
* of the plot area, the same way a longer tick is. Change together with `.pcac-axis-label`.
|
|
179
|
-
*/
|
|
180
|
-
declare const PCAC_AXIS_LABEL_SPACE = 18;
|
|
181
|
-
/** Likewise for a row of `subLabels`: the theme's 11px text plus a gap (`.pcac-axis-sub-label`). */
|
|
182
|
-
declare const PCAC_AXIS_SUB_LABEL_SPACE = 16;
|
|
183
|
-
/**
|
|
184
|
-
* Total margin an axis's `label` and `subLabels` take on its side. `PcacChart` reserves it and
|
|
185
|
-
* the axis builder places the text by it, so the two stay in step.
|
|
186
|
-
*/
|
|
187
|
-
declare function axisLabelSpace(axis: PcacAxisConfig | undefined): number;
|
|
188
|
-
/**
|
|
189
|
-
* @param showGridDefault what `showGrid` resolves to when the consumer left it unset - each chart
|
|
190
|
-
* passes `true` for the axis whose grid it has always drawn and `false` for the other.
|
|
191
|
-
*/
|
|
192
|
-
declare function resolveAxisConfig(axis?: PcacAxisConfig, showGridDefault?: boolean): PcacResolvedAxisConfig;
|
|
193
158
|
/**
|
|
194
159
|
* Base configuration for every chart that has an x and y axis (bar, line, area, plot - not pie).
|
|
195
160
|
*/
|
|
@@ -256,9 +221,8 @@ declare enum PcacFormatEnum {
|
|
|
256
221
|
DateTime = "dateTime",
|
|
257
222
|
Fahrenheit = "fahrenheit",
|
|
258
223
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
* e.g. 0 = 12am, 1 = 1am, 13 = 1pm, 23 = 11pm
|
|
224
|
+
* Hours of the day, 0-24, labelled on a 12 hour clock: 0 = 12am, 1 = 1am, 13 = 1pm, 24 = 12am.
|
|
225
|
+
* A value between hours shows its minutes (2.5 = 2:30am).
|
|
262
226
|
*/
|
|
263
227
|
OneDayHours = "oneDayHours"
|
|
264
228
|
}
|
|
@@ -273,157 +237,6 @@ declare class PcacBarHorizontalChartColorOverrideConfig {
|
|
|
273
237
|
colors: string[];
|
|
274
238
|
}
|
|
275
239
|
|
|
276
|
-
/**
|
|
277
|
-
* Generic over each axis's own domain type (e.g. `number` for a value axis's `ScaleLinear`,
|
|
278
|
-
* `string` for a category axis's `ScaleBand`) rather than `any`, since the two axes on a chart
|
|
279
|
-
* routinely have different domain types and each real D3 scale already satisfies `AxisScale`
|
|
280
|
-
* structurally - no widening needed at the type level.
|
|
281
|
-
*/
|
|
282
|
-
interface IPcacAxisBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomain extends AxisDomain = AxisDomain> {
|
|
283
|
-
svg: Selection<SVGGElement, unknown, BaseType, unknown>;
|
|
284
|
-
/** Plot area size - the axes' own lengths - and the chart's margins, which position a `label`. */
|
|
285
|
-
width: number;
|
|
286
|
-
height: number;
|
|
287
|
-
margin: PcacChartMargin;
|
|
288
|
-
xScale: AxisScale<XDomain>;
|
|
289
|
-
yScale: AxisScale<YDomain>;
|
|
290
|
-
/**
|
|
291
|
-
* The chart's per-axis settings, defaults already applied (`resolveAxisConfig()`). `hide` skips
|
|
292
|
-
* the axis entirely. `tickSize` is D3's `tickSizeInner`; left undefined, D3's default of 6
|
|
293
|
-
* applies to the geometry - but the theme hides tick marks unless the axis group carries
|
|
294
|
-
* `pcac-axis-tick-marks`, which is added exactly when a size is given, so an undefined size
|
|
295
|
-
* means "no visible marks, labels where they've always been". `0` is a legitimate value (no
|
|
296
|
-
* marks, labels hugging the axis), hence the `!== undefined` checks below. `showLine` adds
|
|
297
|
-
* `pcac-axis-line`, which un-hides D3's `.domain` path the same way. The domain path keeps
|
|
298
|
-
* D3's default 6px outer end-caps (`tickSizeOuter`), so it reads as a bracket rather than a
|
|
299
|
-
* bare rule; that's D3's standard look and is left as-is. `label` and `subLabels` are drawn
|
|
300
|
-
* inside the axis group (so they're raised and non-interactive along with it) - see `drawLabels`.
|
|
301
|
-
* `format` picks the tick label format; `None` leaves D3's default. The `*Color` fields are
|
|
302
|
-
* applied by `applyColors`.
|
|
303
|
-
*/
|
|
304
|
-
xAxis: PcacResolvedAxisConfig;
|
|
305
|
-
yAxis: PcacResolvedAxisConfig;
|
|
306
|
-
}
|
|
307
|
-
declare class PcacAxisBuilder {
|
|
308
|
-
drawAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>): void;
|
|
309
|
-
/**
|
|
310
|
-
* Moves both axis groups to the end of the chart's `<g>`, so they paint over everything drawn
|
|
311
|
-
* since `drawAxis()`. Axes are drawn first (so scales and margins are settled before content),
|
|
312
|
-
* which leaves anything sitting at x = 0 - a line chart's first segment and dot, an area's fill,
|
|
313
|
-
* a horizontal bar chart's bars - painting over the y axis line. Builders call this after the
|
|
314
|
-
* content that should sit *under* the axes, and draw anything that should stay on top (the
|
|
315
|
-
* line/area/plot charts' dots) afterwards. Safe to sit above the hover/zoom overlay rects too,
|
|
316
|
-
* because the groups are `pointer-events: none` (set where each group is appended).
|
|
317
|
-
*/
|
|
318
|
-
raiseAxes(svg: Selection<SVGGElement, unknown, BaseType, unknown>): void;
|
|
319
|
-
drawYAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>): void;
|
|
320
|
-
drawXAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>): void;
|
|
321
|
-
/**
|
|
322
|
-
* The axis `label` and `subLabels`. Both are placed by two distances: along the axis (0 at its
|
|
323
|
-
* start, `length` at its end - for the y axis, 0 is the bottom) and out from it, toward the
|
|
324
|
-
* chart's edge. The label goes at the very edge (`outer`, i.e. the margin), the sub-label row
|
|
325
|
-
* `PCAC_AXIS_LABEL_SPACE` inside that when there's a label. For the y axis the text is rotated
|
|
326
|
-
* to read bottom-to-top, which swaps the two: after `rotate(-90)` x runs up the axis (so the
|
|
327
|
-
* bottom is x = -length) and y runs left. `fill` is set explicitly because d3-axis puts
|
|
328
|
-
* `fill="none"` on the group; its own tick text does the same.
|
|
329
|
-
*/
|
|
330
|
-
private drawLabels;
|
|
331
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PcacAxisBuilder, never>;
|
|
332
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Generic over each axis's own domain type, same rationale as `IPcacAxisBuilderConfig`.
|
|
337
|
-
*/
|
|
338
|
-
interface IPcacGridBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomain extends AxisDomain = AxisDomain> {
|
|
339
|
-
svg: Selection<SVGGElement, unknown, BaseType, unknown>;
|
|
340
|
-
/**
|
|
341
|
-
* Required for horizontal grid
|
|
342
|
-
*/
|
|
343
|
-
width: number;
|
|
344
|
-
/**
|
|
345
|
-
* Required for vertical grid
|
|
346
|
-
*/
|
|
347
|
-
height: number;
|
|
348
|
-
xScale: AxisScale<XDomain>;
|
|
349
|
-
yScale: AxisScale<YDomain>;
|
|
350
|
-
/**
|
|
351
|
-
* Tick count hint for a continuous scale (D3's `ticks(n)`); a category (band) scale ignores it
|
|
352
|
-
* and gets one line per category.
|
|
353
|
-
*/
|
|
354
|
-
numberOfTicks: number;
|
|
355
|
-
/**
|
|
356
|
-
* Line color (`PcacAxisConfig.gridColor`), set on the grid group as `--pcac-grid-color` for the
|
|
357
|
-
* theme's `.pcac-grid-rule line` rule to read; unset means the theme's color. See the axis
|
|
358
|
-
* builder's `applyColors` for why a custom property.
|
|
359
|
-
*/
|
|
360
|
-
color?: string;
|
|
361
|
-
}
|
|
362
|
-
declare class PcacGridBuilder {
|
|
363
|
-
/**
|
|
364
|
-
* Vertical lines, one per x-axis tick (or category), running the plot's full height. The group
|
|
365
|
-
* is classed `pcac-grid-vertical` (the horizontal one `pcac-grid-horizontal`) so a chart can
|
|
366
|
-
* find and redraw just one grid - the line/area/plot charts do on zoom, when an axis's ticks move.
|
|
367
|
-
*/
|
|
368
|
-
drawVerticalGrid<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacGridBuilderConfig<XDomain, YDomain>): void;
|
|
369
|
-
/**
|
|
370
|
-
* Horizontal lines, one per y-axis tick (or category), running the plot's full width.
|
|
371
|
-
*/
|
|
372
|
-
drawHorizontalGrid<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacGridBuilderConfig<XDomain, YDomain>): void;
|
|
373
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PcacGridBuilder, never>;
|
|
374
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
declare class PcacColorService {
|
|
378
|
-
private primary;
|
|
379
|
-
private primaryLight;
|
|
380
|
-
private success;
|
|
381
|
-
private danger;
|
|
382
|
-
private warning;
|
|
383
|
-
private orange;
|
|
384
|
-
private blue;
|
|
385
|
-
private alert;
|
|
386
|
-
/** A consumer's own scale from `setScale()`; replaces the default palette while set. */
|
|
387
|
-
private customScale;
|
|
388
|
-
/**
|
|
389
|
-
* The palette charts cycle through: the `setScale()` one when given, else the default colors
|
|
390
|
-
* built from the current fields - so a setter like `setSuccess()` changes the charts drawn after
|
|
391
|
-
* it, rather than a copy of the colors taken when the service was created.
|
|
392
|
-
*/
|
|
393
|
-
private get scale();
|
|
394
|
-
/**
|
|
395
|
-
* Get a scale of colors dynamically
|
|
396
|
-
* @param numberOfNodes Number of items in dynamically build collection of colors
|
|
397
|
-
*/
|
|
398
|
-
getColorScale(numberOfNodes: number): string[];
|
|
399
|
-
getAlert(): string;
|
|
400
|
-
/**
|
|
401
|
-
* Set the scale that charts use to set colors of data[x] on the UI, in place of the default
|
|
402
|
-
* palette (and of the individual color setters below, which only shape the default). An empty
|
|
403
|
-
* array goes back to the default palette rather than leaving charts with no colors.
|
|
404
|
-
* @param colors A collection of hex values
|
|
405
|
-
*/
|
|
406
|
-
setScale(colors: string[]): void;
|
|
407
|
-
/** @deprecated No chart reads the primary color; it isn't part of the palette. */
|
|
408
|
-
setPrimary(color: string): void;
|
|
409
|
-
setPrimaryLight(color: string): void;
|
|
410
|
-
setSuccess(color: string): void;
|
|
411
|
-
setDanger(color: string): void;
|
|
412
|
-
setWarning(color: string): void;
|
|
413
|
-
setOrange(color: string): void;
|
|
414
|
-
setBlue(color: string): void;
|
|
415
|
-
setAlert(color: string): void;
|
|
416
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PcacColorService, never>;
|
|
417
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
declare class PcacTransitionService {
|
|
421
|
-
private transitionDuration;
|
|
422
|
-
getTransitionDuration(): number;
|
|
423
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PcacTransitionService, never>;
|
|
424
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
240
|
/**
|
|
428
241
|
* A datum drawn at the same coordinate as the hovered one (see `PcacTooltipContext.coincident`),
|
|
429
242
|
* located the same way the context locates `$implicit`: `parent` is the series it belongs to,
|
|
@@ -524,372 +337,24 @@ declare class PcacTooltipDirective {
|
|
|
524
337
|
* `<ng-template>`, so `point.value` etc. are checked against `PcacData` under strictTemplates.
|
|
525
338
|
*/
|
|
526
339
|
static ngTemplateContextGuard(_dir: PcacTooltipDirective, _ctx: unknown): _ctx is PcacTooltipContext;
|
|
527
|
-
static ɵfac:
|
|
528
|
-
static ɵdir:
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
declare class PcacTooltipBuilder implements OnDestroy {
|
|
532
|
-
private appRef;
|
|
533
|
-
private document;
|
|
534
|
-
private shell;
|
|
535
|
-
/**
|
|
536
|
-
* One tooltip element shared by every chart on the page, appended to `<body>` so it can float
|
|
537
|
-
* over anything. It's only ever a positioning shell: the default look (`.pcac-d3-tooltip-default`)
|
|
538
|
-
* is toggled on when the library renders its own key/value content and off when a consumer's
|
|
539
|
-
* `<ng-template pcacTooltip>` is rendered into it instead, so a custom template owns the whole box.
|
|
540
|
-
*
|
|
541
|
-
* Created on first use rather than with the service, which every chart builder injects: that
|
|
542
|
-
* way nothing touches the DOM until a chart actually shows a tooltip, so building a chart
|
|
543
|
-
* where there's no browser `document` (server-side rendering) doesn't throw. Removed again in
|
|
544
|
-
* `ngOnDestroy()`, when the app that owns this root service is destroyed.
|
|
545
|
-
*/
|
|
546
|
-
get tooltip(): Selection<HTMLDivElement, unknown, null, undefined>;
|
|
547
|
-
/**
|
|
548
|
-
* The consumer template currently rendered into the shell, if any. Created on the first show
|
|
549
|
-
* of a hover and torn down in `hideTooltip()` - not kept around between hovers - so a view is
|
|
550
|
-
* never left holding onto a declaring component that has since been destroyed (e.g. after a
|
|
551
|
-
* route change). While it lives, repeated `mousemove`s just update its context in place.
|
|
552
|
-
*/
|
|
553
|
-
private view;
|
|
554
|
-
private viewTemplate;
|
|
555
|
-
/** Space left between the tooltip and whatever it's placed next to (the cursor or an anchor). */
|
|
556
|
-
static readonly GAP = 8;
|
|
557
|
-
/**
|
|
558
|
-
* Shows the tooltip for a hovered datum. Renders `template` when the chart has one projected;
|
|
559
|
-
* otherwise falls back to the default key/value content, formatted per `valueFormat`/`keyFormat`.
|
|
560
|
-
* Placed beside `anchor` when one is given (see `positionBeside`), else above the event's position.
|
|
561
|
-
*/
|
|
562
|
-
showTooltip(event: MouseEvent, template: TemplateRef<PcacTooltipContext> | undefined, context: PcacTooltipContext, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum, anchor?: Element | null): void;
|
|
563
|
-
/**
|
|
564
|
-
* @deprecated Builders should call `PcacChart.showTooltip()`, which routes through a chart's
|
|
565
|
-
* projected `pcacTooltip` template. This only ever renders the default content.
|
|
566
|
-
*/
|
|
567
|
-
showBarTooltip(event: MouseEvent, data: PcacData, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): void;
|
|
568
|
-
hideTooltip(): void;
|
|
569
|
-
ngOnDestroy(): void;
|
|
570
|
-
/**
|
|
571
|
-
* The library's own key/value content. Built from text nodes, never parsed as HTML: `key` and
|
|
572
|
-
* `value` are consumer data, and markup in them must show as text rather than run.
|
|
573
|
-
*/
|
|
574
|
-
private renderDefault;
|
|
575
|
-
private renderTemplate;
|
|
576
|
-
private destroyView;
|
|
577
|
-
/**
|
|
578
|
-
* Shows the (already rendered) shell at the page's top-left so it can be measured. Left where the
|
|
579
|
-
* last hover put it, a shell near the right edge would be squeezed by its containing block and
|
|
580
|
-
* measure narrower (wrapped) than the content really is once it's moved somewhere with room.
|
|
581
|
-
*/
|
|
582
|
-
private measurable;
|
|
583
|
-
/**
|
|
584
|
-
* Centers the tooltip horizontally on the cursor and sits it just above. Measured from the real
|
|
585
|
-
* box rather than fixed offsets so it works for content of any size.
|
|
586
|
-
*/
|
|
587
|
-
private positionAbove;
|
|
588
|
-
/**
|
|
589
|
-
* Places the tooltip diagonally off one corner of `anchor`'s rendered box, so it never covers
|
|
590
|
-
* the anchor itself (e.g. a point's image). Prefers above-right - the tooltip's bottom-left
|
|
591
|
-
* corner at the anchor's top-right - and flips each axis independently when the tooltip wouldn't
|
|
592
|
-
* fit in the viewport that way: to the left when there's no room on the right, below when there's
|
|
593
|
-
* no room above. When neither side of an axis fits, it takes whichever side has more room.
|
|
594
|
-
*/
|
|
595
|
-
private positionBeside;
|
|
596
|
-
/** The default tooltip's two lines as plain text; `key` is null when the datum has none. */
|
|
597
|
-
private getBarTipData;
|
|
598
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PcacTooltipBuilder, never>;
|
|
599
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Everything `showTooltip()` needs beyond the hovered datum itself. `parent`/`isThreshold` feed
|
|
604
|
-
* the consumer template's context; the formats only apply to the default (no template) content.
|
|
605
|
-
*/
|
|
606
|
-
interface PcacTooltipOptions {
|
|
607
|
-
/** See `PcacTooltipContext.index`. Required so no hover site can forget to supply it. */
|
|
608
|
-
index: number;
|
|
609
|
-
parent?: PcacData | null;
|
|
610
|
-
/** See `PcacTooltipContext.parentIndex`. Defaults to `null`, matching `parent`'s default. */
|
|
611
|
-
parentIndex?: number | null;
|
|
612
|
-
isThreshold?: boolean;
|
|
613
|
-
/** See `PcacTooltipContext.coincident`. Defaults to none. */
|
|
614
|
-
coincident?: PcacTooltipCoincident[];
|
|
615
|
-
valueFormat?: PcacFormatEnum;
|
|
616
|
-
keyFormat?: PcacFormatEnum;
|
|
617
|
-
/**
|
|
618
|
-
* The element the tooltip is placed beside instead of above the cursor: off one of its corners,
|
|
619
|
-
* whichever fits in the viewport (see `PcacTooltipBuilder.positionBeside`), so it never covers it.
|
|
620
|
-
*/
|
|
621
|
-
anchor?: Element | null;
|
|
622
|
-
}
|
|
623
|
-
declare class PcacChart {
|
|
624
|
-
axisBuilder: PcacAxisBuilder;
|
|
625
|
-
gridBuilder: PcacGridBuilder;
|
|
626
|
-
transitionService: PcacTransitionService;
|
|
627
|
-
tooltipBuilder: PcacTooltipBuilder;
|
|
628
|
-
colorService: PcacColorService;
|
|
629
|
-
/** D3's own `tickSizeInner` default, which the default `margin` below is sized around. */
|
|
630
|
-
static readonly DEFAULT_TICK_SIZE = 6;
|
|
631
|
-
/** See `PCAC_AXIS_LABEL_SPACE` / `PCAC_AXIS_SUB_LABEL_SPACE` in chart.model.ts. */
|
|
632
|
-
static readonly AXIS_LABEL_SPACE = 18;
|
|
633
|
-
static readonly AXIS_SUB_LABEL_SPACE = 16;
|
|
634
|
-
margin: PcacChartMargin;
|
|
635
|
-
private readonly defaultMargin;
|
|
636
|
-
/**
|
|
637
|
-
* The current build's per-axis settings with defaults applied, set by `initializeAxisState()`.
|
|
638
|
-
* Builders read these (not the raw `config.xAxis`) everywhere: drawing the axes, choosing
|
|
639
|
-
* whether to draw a grid, how many grid lines, and so on. Pie has no axes and never sets them.
|
|
640
|
-
*/
|
|
641
|
-
xAxis: PcacResolvedAxisConfig;
|
|
642
|
-
yAxis: PcacResolvedAxisConfig;
|
|
643
|
-
svg: Selection<SVGGElement, unknown, BaseType, unknown>;
|
|
644
|
-
width: number;
|
|
645
|
-
height: number;
|
|
646
|
-
colors: string[];
|
|
647
|
-
startData: PcacData[];
|
|
648
|
-
/**
|
|
649
|
-
* Swaps a consumer's `colorOverride` in for the theme palette `initializeChartState` set, in
|
|
650
|
-
* order. Checks `length` rather than truthiness: every config class defaults its override to
|
|
651
|
-
* `[]`, and an empty array is truthy - taken as an override, it would leave every mark with no
|
|
652
|
-
* color. Cycled out to at least as many entries as the theme palette, the same way that palette
|
|
653
|
-
* cycles its own colors, so an override shorter than the data repeats rather than leaving the
|
|
654
|
-
* marks past its end with an `undefined` color. Call after `initializeChartState()`.
|
|
655
|
-
*/
|
|
656
|
-
protected applyColorOverride(override: readonly string[] | undefined): void;
|
|
657
|
-
/**
|
|
658
|
-
* Raw, unadjusted container width measured by the last successful `initializeChartState()`
|
|
659
|
-
* call, or `null` if none has succeeded yet. Deliberately tracked separately from `width`:
|
|
660
|
-
* some builders (e.g. bar-horizontal-chart's `setHorizontalMarginsBasedOnContent`) recompute
|
|
661
|
-
* `width`/`margin.left` mid-build from measured axis-label sizes, so `width` alone isn't a
|
|
662
|
-
* stable basis for "did the container itself resize" — the raw container measurement is.
|
|
663
|
-
*/
|
|
664
|
-
private lastContainerWidth;
|
|
665
|
-
/**
|
|
666
|
-
* Raw container height measured by the last successful `initializeChartState()` call, and
|
|
667
|
-
* whether that build was running with `heightFull` on. Only consulted by `containerSizeChanged`
|
|
668
|
-
* when it was: without `heightFull` the container's height is driven *by* the chart's own SVG
|
|
669
|
-
* height, so comparing it would report "changed" every time the chart itself grew or shrank.
|
|
670
|
-
*/
|
|
671
|
-
private lastContainerHeight;
|
|
672
|
-
private lastHeightFull;
|
|
673
|
-
/**
|
|
674
|
-
* How much the vertical margins have grown this build beyond their defaults - for tick marks
|
|
675
|
-
* and axis labels (`initializeAxisState()`; negative when a short tick took some away) and for
|
|
676
|
-
* content that hangs past the plot's edge (`reserveEdgeSpace()`). `resolveHeight()` subtracts
|
|
677
|
-
* it from the plot height so the SVG's total height doesn't change with any of them. Reset
|
|
678
|
-
* alongside the margins.
|
|
679
|
-
*/
|
|
680
|
-
private reservedHeight;
|
|
681
|
-
/**
|
|
682
|
-
* Resolves the consumer's projected `<ng-template pcacTooltip>`, if any. Each chart component
|
|
683
|
-
* points this at its own `contentChild(PcacTooltipDirective)` query. It's a getter rather than
|
|
684
|
-
* a captured value so it's read lazily, at hover time, from inside a D3 listener: reading the
|
|
685
|
-
* query signal in the component's build effect instead would make the effect depend on it and
|
|
686
|
-
* rebuild the whole chart (restarting its entry animation) whenever the query resolves.
|
|
687
|
-
*/
|
|
688
|
-
tooltipTemplate: () => TemplateRef<PcacTooltipContext> | undefined;
|
|
689
|
-
/**
|
|
690
|
-
* Puts `margin` back to its defaults. `initializeAxisState()` calls this first thing, before any
|
|
691
|
-
* per-build adjustment (hidden axes giving sides back, tick sizes growing them, label widths
|
|
692
|
-
* measured into `margin.left`): `margin` lives on this per-chart instance and so persists
|
|
693
|
-
* between builds, and without a reset an adjustment made for one config silently carries into
|
|
694
|
-
* the next - e.g. axes drawn with no room after `hide` flips back to false.
|
|
695
|
-
*/
|
|
696
|
-
resetMargin(): void;
|
|
697
|
-
/**
|
|
698
|
-
* Resolves the config's `xAxis`/`yAxis` onto this chart and sets the margins up for them. Axis
|
|
699
|
-
* charts call this at the top of `buildChart()`, on their own copy of the config (it rewrites
|
|
700
|
-
* `config.height` for hidden axes), before `initializeChartState()` measures the plot area.
|
|
701
|
-
* In order:
|
|
702
|
-
*
|
|
703
|
-
* 1. `resetMargin()`.
|
|
704
|
-
* 2. Tick marks: room for a non-default `tickSize` is reserved on each axis that will actually
|
|
705
|
-
* be drawn (`reserveTickSizeMargins`).
|
|
706
|
-
* 3. Labels: `AXIS_LABEL_SPACE` is added to `bottom` / `left` for an axis with a `label`, and
|
|
707
|
-
* `AXIS_SUB_LABEL_SPACE` for one with any `subLabels` (see `axisLabelSpace`), again only if
|
|
708
|
-
* the axis will be drawn.
|
|
709
|
-
* 4. Hidden axes: an axis with `hide` gives its margins back to the plot. The y axis owns
|
|
710
|
-
* `left` and `top` (the top margin is only there so the topmost y label isn't clipped), the
|
|
711
|
-
* x axis `bottom` and `right` (likewise for the rightmost x label). Each reclaimed vertical
|
|
712
|
-
* margin is added onto `config.height` so the SVG's total height stays what the consumer
|
|
713
|
-
* configured; horizontally `initializeChartState()` picks the change up on its own.
|
|
714
|
-
*
|
|
715
|
-
* @param defaultGrid the axis whose grid this chart draws when the consumer hasn't said
|
|
716
|
-
* (`PcacAxisConfig.showGrid`): `'y'` for horizontal lines, `'x'` for vertical.
|
|
717
|
-
* @param hiddenAxisMargin what a hidden axis's sides shrink to, rather than 0. The
|
|
718
|
-
* line/area/plot charts keep 8px so a dot on the edge of the plot isn't clipped by the SVG.
|
|
719
|
-
*/
|
|
720
|
-
initializeAxisState(config: PcacAxisChartConfig, defaultGrid: 'x' | 'y', hiddenAxisMargin?: number): void;
|
|
721
|
-
/**
|
|
722
|
-
* The `PcacAxisBuilder` config for this chart's current state - everything but the scales is
|
|
723
|
-
* already on the instance. Builders pass the result to `drawAxis()` (or `drawXAxis()` with a
|
|
724
|
-
* rescaled x, on zoom).
|
|
725
|
-
*/
|
|
726
|
-
axisBuilderConfig<XDomain extends AxisDomain, YDomain extends AxisDomain>(xScale: AxisScale<XDomain>, yScale: AxisScale<YDomain>): IPcacAxisBuilderConfig<XDomain, YDomain>;
|
|
727
|
-
/**
|
|
728
|
-
* Draws whichever grids the resolved axes ask for: vertical lines from the x axis's ticks,
|
|
729
|
-
* horizontal from the y's (`PcacAxisConfig.showGrid`). `which` restricts it to one axis - the
|
|
730
|
-
* line/area/plot charts redraw just a zoomed axis's grid against its rescaled scale on zoom.
|
|
731
|
-
*/
|
|
732
|
-
drawGrids<XDomain extends AxisDomain, YDomain extends AxisDomain>(xScale: AxisScale<XDomain>, yScale: AxisScale<YDomain>, which?: 'x' | 'y' | 'both'): void;
|
|
733
|
-
/**
|
|
734
|
-
* Makes room in the margins for tick marks longer (or shorter) than D3's default. The default
|
|
735
|
-
* margins are sized around that default (`DEFAULT_TICK_SIZE`), and D3 places each tick label at
|
|
736
|
-
* tick length + padding, so a longer tick pushes its labels outward by exactly the difference -
|
|
737
|
-
* into space the margin doesn't have unless it grows by the same amount. Growing the margin here,
|
|
738
|
-
* *before* `initializeChartState()` measures the plot area, is what makes the chart shrink to fit
|
|
739
|
-
* its labels rather than pushing them off the edge of the SVG. A shorter tick hands the
|
|
740
|
-
* difference back to the plot area the same way.
|
|
741
|
-
*
|
|
742
|
-
* Horizontally that happens on its own: `initializeChartState()` derives `width` from the
|
|
743
|
-
* container minus the margins. Vertically it doesn't - `config.height` is the plot area, and
|
|
744
|
-
* the SVG is that plus the margins - so a taller bottom margin would grow the SVG instead. The
|
|
745
|
-
* delta is therefore also remembered in `reservedHeight` and taken back out of the plot
|
|
746
|
-
* height by `resolveHeight()`, keeping the chart's total footprint where the consumer put it.
|
|
747
|
-
*
|
|
748
|
-
* Called by `initializeAxisState()` right after `resetMargin()`, for the axes that will be
|
|
749
|
-
* drawn. Only the axis a tick size is given for is affected; `undefined` leaves that margin
|
|
750
|
-
* alone.
|
|
751
|
-
* @param xTickSize `tickSizeInner` for the bottom (x) axis, which lives in `margin.bottom`
|
|
752
|
-
* @param yTickSize `tickSizeInner` for the left (y) axis, which lives in `margin.left`
|
|
753
|
-
*/
|
|
754
|
-
reserveTickSizeMargins(xTickSize?: number, yTickSize?: number): void;
|
|
755
|
-
/**
|
|
756
|
-
* Makes sure each given margin is at least that big, for content drawn at the very edge of the
|
|
757
|
-
* plot area that reaches past it - a point image on the line/area/plot charts, say, whose box
|
|
758
|
-
* is centered on a point at the top of the y domain and so hangs half of itself above the plot.
|
|
759
|
-
* Those charts already widen their clip-path to let such a point through; this is what stops
|
|
760
|
-
* the `<svg>` itself from cutting it off, the SVG being only the plot area plus the margins.
|
|
761
|
-
*
|
|
762
|
-
* "At least", not "add": the default margins, and any tick / label room already reserved in
|
|
763
|
-
* them, may well cover it already (`margin.left` is 40 by default), and adding on top of that
|
|
764
|
-
* would give up plot area for nothing. Vertical growth is taken out of the plot height the same
|
|
765
|
-
* way `reserveTickSizeMargins()`'s is, so the SVG's total height stays what the consumer
|
|
766
|
-
* configured; horizontally `initializeChartState()` picks the change up on its own. A side
|
|
767
|
-
* left `undefined` is untouched.
|
|
768
|
-
*
|
|
769
|
-
* Call after `initializeAxisState()` (which resets the margins) and before
|
|
770
|
-
* `initializeChartState()` (which measures the plot area against them).
|
|
771
|
-
*/
|
|
772
|
-
reserveEdgeSpace(space: Partial<PcacChartMargin>): void;
|
|
773
|
-
/**
|
|
774
|
-
* Shows the tooltip for a hovered datum, through the chart's `pcacTooltip` template when one is
|
|
775
|
-
* projected and the default key/value content otherwise. Every builder's hover handler should
|
|
776
|
-
* go through here rather than `tooltipBuilder` directly so the template is honored everywhere.
|
|
777
|
-
*/
|
|
778
|
-
showTooltip(event: MouseEvent, data: PcacData, options: PcacTooltipOptions): void;
|
|
779
|
-
hideTooltip(): void;
|
|
780
|
-
/**
|
|
781
|
-
* Prior to building a chart, we need to initialize the state of the chart.
|
|
782
|
-
*
|
|
783
|
-
* Returns `false` (and leaves `width`/`height`/`colors` untouched) if the container hasn't
|
|
784
|
-
* been laid out yet, so its `clientWidth` measures 0 — this happens when a chart mounts
|
|
785
|
-
* already holding data (e.g. behind a loading gate) and its first `ngOnChanges` fires before
|
|
786
|
-
* the browser has committed layout for its own just-created DOM node. Callers should bail out
|
|
787
|
-
* of their build on `false` rather than proceeding with a degenerate width; `PcacChartResizeService`
|
|
788
|
-
* (wired up by every chart component) retries the build once the container has a real size.
|
|
789
|
-
* @param chartElm Reference to SVG on dom
|
|
790
|
-
* @param config Chart specific configuration
|
|
791
|
-
*/
|
|
792
|
-
/**
|
|
793
|
-
* Removes whatever the chart last drew, for a build with no data to draw. Builders call it
|
|
794
|
-
* rather than just returning, which left the previous data on screen when a consumer emptied
|
|
795
|
-
* the chart (e.g. a filter that now matches nothing).
|
|
796
|
-
*/
|
|
797
|
-
clearChart(chartElm: ElementRef): void;
|
|
798
|
-
initializeChartState(chartElm: ElementRef, config: PcacChartConfig): boolean;
|
|
799
|
-
/**
|
|
800
|
-
* `config.height` normally *is* the height of the drawing area. With `config.heightFull` on it
|
|
801
|
-
* becomes a floor instead: the chart fills its container, and only falls back to `config.height`
|
|
802
|
-
* when the container is shorter than that (or has no definite height of its own to fill - see
|
|
803
|
-
* `PcacChartConfig.heightFull`, where an auto-height container measures ~0 here and the
|
|
804
|
-
* `Math.max` keeps the configured height).
|
|
805
|
-
*
|
|
806
|
-
* Note this deliberately subtracts the margins, so it's the *total* SVG that ends up matching
|
|
807
|
-
* the container: `buildContainer()` adds `margin.top`/`margin.bottom` back on top of `height`
|
|
808
|
-
* when sizing the `<svg>`, so filling without this would overflow the container by exactly the
|
|
809
|
-
* vertical margins.
|
|
810
|
-
* @param container The chart's container element (the `<svg>`'s parent)
|
|
811
|
-
* @param config Chart specific configuration
|
|
812
|
-
*/
|
|
813
|
-
private resolveHeight;
|
|
814
|
-
/**
|
|
815
|
-
* True if the container's current raw layout width differs from the one measured by the last
|
|
816
|
-
* successful build, or if no successful build has happened yet. For a `heightFull` chart, a
|
|
817
|
-
* change in the container's height counts too - that's the whole size the chart is tracking.
|
|
818
|
-
*
|
|
819
|
-
* `PcacChartResizeService`'s `ResizeObserver` is guaranteed to fire once as soon as it starts
|
|
820
|
-
* observing — that's what lets a chart recover from the 0-width race described on
|
|
821
|
-
* `initializeChartState`, but it also means that "routine" first callback usually lands
|
|
822
|
-
* moments after `ngOnChanges` already built successfully at the same width. Without this
|
|
823
|
-
* check, that redundant callback would restart the chart's enter transition mid-animation for
|
|
824
|
-
* no visual change. Only `ngOnChanges` (which reacts to data, not size) should skip this check.
|
|
825
|
-
* @param chartElm Reference to SVG on dom
|
|
826
|
-
*/
|
|
827
|
-
containerSizeChanged(chartElm: ElementRef): boolean;
|
|
828
|
-
/**
|
|
829
|
-
* 1) Set the width and height of the SVG
|
|
830
|
-
* 2) Add a group and translate it to state of {{center}} option
|
|
831
|
-
* @param chartElm Reference to SVG on dom
|
|
832
|
-
* @param center Are we pinning x,y to the top,left, or are we centering our drawing group inside the SVG.
|
|
833
|
-
*/
|
|
834
|
-
buildContainer(chartElm: ElementRef, center?: boolean): void;
|
|
835
|
-
/**
|
|
836
|
-
* Most charts share a default margin(s) state.
|
|
837
|
-
* In some cases, that state needs to be calculated based on the content that resides in that margin.
|
|
838
|
-
* For example, labels on a horizontal bar chart are dynamic and such the margin needs to be calculated ahead of
|
|
839
|
-
* chart axis construction.
|
|
840
|
-
*
|
|
841
|
-
* Measures with the y axis's own `tickSize` (the measured box spans the tick line as well as
|
|
842
|
-
* the label, so measuring at a different length would put the labels off by the difference)
|
|
843
|
-
* and adds its `axisLabelSpace()` back on top, since the measurement replaces whatever
|
|
844
|
-
* `initializeAxisState()` reserved for the label / sub labels.
|
|
845
|
-
* @param chartElm Reference to SVG on dom
|
|
846
|
-
* @param yScale D3 scale transformation object (d3.ScaleBand)
|
|
847
|
-
*/
|
|
848
|
-
setHorizontalMarginsBasedOnContent<Domain extends AxisDomain>(chartElm: ElementRef, yScale: AxisScale<Domain>): void;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
/**
|
|
852
|
-
* Provided per-component (see PcacBarHorizontalChartComponent's `providers`), not root-scoped:
|
|
853
|
-
* this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,
|
|
854
|
-
* height, colors, svg). A root singleton would be shared and clobbered by every
|
|
855
|
-
* <pcac-bar-horizontal-chart> rendered at once.
|
|
856
|
-
*/
|
|
857
|
-
declare class BarHorizontalChartBuilder extends PcacChart {
|
|
858
|
-
private xScale;
|
|
859
|
-
private yScaleStacked;
|
|
860
|
-
private yScaleGrouped;
|
|
861
|
-
private barClickedSource;
|
|
862
|
-
private config;
|
|
863
|
-
barClicked$: rxjs.Observable<PcacData>;
|
|
864
|
-
buildChart(chartElm: ElementRef, config: PcacBarHorizontalChartConfig): void;
|
|
865
|
-
private buildScales;
|
|
866
|
-
private drawChart;
|
|
867
|
-
private addGroups;
|
|
868
|
-
private drawBarsPerGroup;
|
|
869
|
-
private drawThresholdAcrossChart;
|
|
870
|
-
/** One threshold across each group that has one; groups without an entry are skipped. */
|
|
871
|
-
private drawThresholdsPerGroup;
|
|
872
|
-
/** One threshold across each bar that has one; bars without an entry are skipped. */
|
|
873
|
-
private drawThresholdsPerBarInGroup;
|
|
874
|
-
private applyPreTransitionThresholdStyles;
|
|
875
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BarHorizontalChartBuilder, never>;
|
|
876
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
340
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacTooltipDirective, never>;
|
|
341
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PcacTooltipDirective, "ng-template[pcacTooltip]", never, {}, {}, never, never, true, never>;
|
|
877
342
|
}
|
|
878
343
|
|
|
879
344
|
declare class PcacBarHorizontalChartComponent {
|
|
880
345
|
private chartBuilder;
|
|
881
|
-
readonly config:
|
|
882
|
-
readonly chartElm:
|
|
883
|
-
readonly barClicked:
|
|
346
|
+
readonly config: _angular_core.InputSignal<PcacBarHorizontalChartConfig>;
|
|
347
|
+
readonly chartElm: _angular_core.Signal<ElementRef<any>>;
|
|
348
|
+
readonly barClicked: _angular_core.OutputRef<_pioneer_code_pioneer_charts.PcacData>;
|
|
884
349
|
/**
|
|
885
350
|
* Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the
|
|
886
351
|
* default tooltip when present (see PcacTooltipDirective).
|
|
887
352
|
*/
|
|
888
|
-
readonly tooltipTemplate:
|
|
353
|
+
readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
|
|
889
354
|
constructor();
|
|
890
355
|
buildChart(): void;
|
|
891
|
-
static ɵfac:
|
|
892
|
-
static ɵcmp:
|
|
356
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacBarHorizontalChartComponent, never>;
|
|
357
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacBarHorizontalChartComponent, "pcac-bar-horizontal-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "barClicked": "barClicked"; }, ["tooltipTemplate"], never, true, never>;
|
|
893
358
|
}
|
|
894
359
|
|
|
895
360
|
declare class PcacBarVerticalChartConfig extends PcacAxisChartConfig {
|
|
@@ -902,72 +367,63 @@ declare class PcacBarVerticalChartColorOverrideConfig {
|
|
|
902
367
|
colors: string[];
|
|
903
368
|
}
|
|
904
369
|
|
|
905
|
-
/**
|
|
906
|
-
* Provided per-component (see PcacBarVerticalChartComponent's `providers`), not root-scoped:
|
|
907
|
-
* this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,
|
|
908
|
-
* height, colors, svg). A root singleton would be shared and clobbered by every
|
|
909
|
-
* <pcac-bar-vertical-chart> rendered at once.
|
|
910
|
-
*/
|
|
911
|
-
declare class BarVerticalChartBuilder extends PcacChart {
|
|
912
|
-
private xScaleStacked;
|
|
913
|
-
private xScaleGrouped;
|
|
914
|
-
private yScale;
|
|
915
|
-
private barClickedSource;
|
|
916
|
-
barClicked$: rxjs.Observable<PcacData>;
|
|
917
|
-
buildChart(chartElm: ElementRef, config: PcacBarVerticalChartConfig): void;
|
|
918
|
-
private buildScales;
|
|
919
|
-
private drawChart;
|
|
920
|
-
private addGroups;
|
|
921
|
-
private drawBarsPerGroup;
|
|
922
|
-
private drawThresholdAcrossChart;
|
|
923
|
-
/** One threshold across each group that has one; groups without an entry are skipped. */
|
|
924
|
-
private drawThresholdsPerGroup;
|
|
925
|
-
/** One threshold across each bar that has one; bars without an entry are skipped. */
|
|
926
|
-
private drawThresholdsPerBarInGroup;
|
|
927
|
-
private applyPreTransitionThresholdStyles;
|
|
928
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BarVerticalChartBuilder, never>;
|
|
929
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
370
|
declare class PcacBarVerticalChartComponent {
|
|
933
371
|
private chartBuilder;
|
|
934
|
-
readonly config:
|
|
935
|
-
readonly chartElm:
|
|
936
|
-
readonly barClicked:
|
|
372
|
+
readonly config: _angular_core.InputSignal<PcacBarVerticalChartConfig>;
|
|
373
|
+
readonly chartElm: _angular_core.Signal<ElementRef<any>>;
|
|
374
|
+
readonly barClicked: _angular_core.OutputRef<_pioneer_code_pioneer_charts.PcacData>;
|
|
937
375
|
/**
|
|
938
376
|
* Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the
|
|
939
377
|
* default tooltip when present (see PcacTooltipDirective).
|
|
940
378
|
*/
|
|
941
|
-
readonly tooltipTemplate:
|
|
379
|
+
readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
|
|
942
380
|
constructor();
|
|
943
381
|
buildChart(): void;
|
|
944
|
-
static ɵfac:
|
|
945
|
-
static ɵcmp:
|
|
382
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacBarVerticalChartComponent, never>;
|
|
383
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacBarVerticalChartComponent, "pcac-bar-vertical-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "barClicked": "barClicked"; }, ["tooltipTemplate"], never, true, never>;
|
|
946
384
|
}
|
|
947
385
|
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
* including its first, so observing the container naturally retries that exact case.
|
|
960
|
-
*/
|
|
961
|
-
declare class PcacChartResizeService {
|
|
386
|
+
declare class PcacColorService {
|
|
387
|
+
private primary;
|
|
388
|
+
private primaryLight;
|
|
389
|
+
private success;
|
|
390
|
+
private danger;
|
|
391
|
+
private warning;
|
|
392
|
+
private orange;
|
|
393
|
+
private blue;
|
|
394
|
+
private alert;
|
|
395
|
+
/** A consumer's own scale from `setScale()`; replaces the default palette while set. */
|
|
396
|
+
private customScale;
|
|
962
397
|
/**
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
* observer's first (guaranteed-initial) callback, debounced for every one after that.
|
|
398
|
+
* The palette charts cycle through: the `setScale()` one when given, else the default colors
|
|
399
|
+
* built from the current fields - so a setter like `setSuccess()` changes the charts drawn after
|
|
400
|
+
* it, rather than a copy of the colors taken when the service was created.
|
|
967
401
|
*/
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
402
|
+
private get scale();
|
|
403
|
+
/**
|
|
404
|
+
* Get a scale of colors dynamically
|
|
405
|
+
* @param numberOfNodes Number of items in dynamically build collection of colors
|
|
406
|
+
*/
|
|
407
|
+
getColorScale(numberOfNodes: number): string[];
|
|
408
|
+
getAlert(): string;
|
|
409
|
+
/**
|
|
410
|
+
* Set the scale that charts use to set colors of data[x] on the UI, in place of the default
|
|
411
|
+
* palette (and of the individual color setters below, which only shape the default). An empty
|
|
412
|
+
* array goes back to the default palette rather than leaving charts with no colors.
|
|
413
|
+
* @param colors A collection of hex values
|
|
414
|
+
*/
|
|
415
|
+
setScale(colors: string[]): void;
|
|
416
|
+
/** @deprecated No chart reads the primary color; it isn't part of the palette. */
|
|
417
|
+
setPrimary(color: string): void;
|
|
418
|
+
setPrimaryLight(color: string): void;
|
|
419
|
+
setSuccess(color: string): void;
|
|
420
|
+
setDanger(color: string): void;
|
|
421
|
+
setWarning(color: string): void;
|
|
422
|
+
setOrange(color: string): void;
|
|
423
|
+
setBlue(color: string): void;
|
|
424
|
+
setAlert(color: string): void;
|
|
425
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacColorService, never>;
|
|
426
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
971
427
|
}
|
|
972
428
|
|
|
973
429
|
declare class PcacLegendConfigItem {
|
|
@@ -981,12 +437,12 @@ declare class PcacLegendConfig {
|
|
|
981
437
|
}
|
|
982
438
|
declare class PcacLegend {
|
|
983
439
|
readonly colorService: PcacColorService;
|
|
984
|
-
config:
|
|
985
|
-
itemClicked:
|
|
986
|
-
colorScale:
|
|
440
|
+
config: _angular_core.ModelSignal<PcacLegendConfig>;
|
|
441
|
+
itemClicked: _angular_core.OutputEmitterRef<PcacLegendConfigItem[]>;
|
|
442
|
+
colorScale: _angular_core.Signal<string[]>;
|
|
987
443
|
onItemClicked(index: number): void;
|
|
988
|
-
static ɵfac:
|
|
989
|
-
static ɵcmp:
|
|
444
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacLegend, never>;
|
|
445
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacLegend, "pcac-legend", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "config": "configChange"; "itemClicked": "itemClicked"; }, never, never, true, never>;
|
|
990
446
|
}
|
|
991
447
|
|
|
992
448
|
declare enum PcacLineAreaPlotChartConfigType {
|
|
@@ -1128,48 +584,48 @@ declare class PcacPlotChartConfig extends PcacLineAreaChartConfig {
|
|
|
1128
584
|
}
|
|
1129
585
|
|
|
1130
586
|
declare class PcacPlotChart {
|
|
1131
|
-
readonly config:
|
|
587
|
+
readonly config: _angular_core.InputSignal<PcacPlotChartConfig>;
|
|
1132
588
|
readonly types: typeof PcacLineAreaPlotChartConfigType;
|
|
1133
|
-
readonly dotClicked:
|
|
589
|
+
readonly dotClicked: _angular_core.OutputEmitterRef<PcacData>;
|
|
1134
590
|
/**
|
|
1135
591
|
* Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
|
|
1136
592
|
* inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).
|
|
1137
593
|
*/
|
|
1138
|
-
readonly tooltipTemplate:
|
|
1139
|
-
static ɵfac:
|
|
1140
|
-
static ɵcmp:
|
|
594
|
+
readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
|
|
595
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacPlotChart, never>;
|
|
596
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacPlotChart, "pcac-plot-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "dotClicked": "dotClicked"; }, ["tooltipTemplate"], never, true, never>;
|
|
1141
597
|
}
|
|
1142
598
|
|
|
1143
599
|
declare class PcacLineChartConfig extends PcacLineAreaChartConfig {
|
|
1144
600
|
}
|
|
1145
601
|
|
|
1146
602
|
declare class PcacLineChart {
|
|
1147
|
-
readonly config:
|
|
603
|
+
readonly config: _angular_core.InputSignal<PcacLineChartConfig>;
|
|
1148
604
|
readonly types: typeof PcacLineAreaPlotChartConfigType;
|
|
1149
|
-
readonly dotClicked:
|
|
605
|
+
readonly dotClicked: _angular_core.OutputEmitterRef<PcacData>;
|
|
1150
606
|
/**
|
|
1151
607
|
* Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
|
|
1152
608
|
* inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).
|
|
1153
609
|
*/
|
|
1154
|
-
readonly tooltipTemplate:
|
|
1155
|
-
static ɵfac:
|
|
1156
|
-
static ɵcmp:
|
|
610
|
+
readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
|
|
611
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacLineChart, never>;
|
|
612
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacLineChart, "pcac-line-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "dotClicked": "dotClicked"; }, ["tooltipTemplate"], never, true, never>;
|
|
1157
613
|
}
|
|
1158
614
|
|
|
1159
615
|
declare class PcacAreaChartConfig extends PcacLineAreaChartConfig {
|
|
1160
616
|
}
|
|
1161
617
|
|
|
1162
618
|
declare class PcacAreaChart {
|
|
1163
|
-
readonly config:
|
|
619
|
+
readonly config: _angular_core.InputSignal<PcacAreaChartConfig>;
|
|
1164
620
|
readonly types: typeof PcacLineAreaPlotChartConfigType;
|
|
1165
|
-
readonly dotClicked:
|
|
621
|
+
readonly dotClicked: _angular_core.OutputEmitterRef<PcacData>;
|
|
1166
622
|
/**
|
|
1167
623
|
* Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the
|
|
1168
624
|
* inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).
|
|
1169
625
|
*/
|
|
1170
|
-
readonly tooltipTemplate:
|
|
1171
|
-
static ɵfac:
|
|
1172
|
-
static ɵcmp:
|
|
626
|
+
readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
|
|
627
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacAreaChart, never>;
|
|
628
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacAreaChart, "pcac-area-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "dotClicked": "dotClicked"; }, ["tooltipTemplate"], never, true, never>;
|
|
1173
629
|
}
|
|
1174
630
|
|
|
1175
631
|
/**
|
|
@@ -1212,55 +668,21 @@ declare class PcacPieChartConfig extends PcacChartConfig {
|
|
|
1212
668
|
colorOverride?: string[];
|
|
1213
669
|
}
|
|
1214
670
|
|
|
1215
|
-
/**
|
|
1216
|
-
* Provided per-component (see PcacPieChartComponent's `providers`), not root-scoped:
|
|
1217
|
-
* this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,
|
|
1218
|
-
* height, colors, svg). A root singleton would be shared and clobbered by every
|
|
1219
|
-
* <pcac-pie-chart> rendered at once.
|
|
1220
|
-
*/
|
|
1221
|
-
declare class PieChartBuilder extends PcacChart {
|
|
1222
|
-
private radius;
|
|
1223
|
-
private innerRadius;
|
|
1224
|
-
private arcShape;
|
|
1225
|
-
private arcOverShape;
|
|
1226
|
-
private pieAngles;
|
|
1227
|
-
private sliceClickedSource;
|
|
1228
|
-
sliceClicked$: rxjs.Observable<PcacData>;
|
|
1229
|
-
buildChart(chartElm: ElementRef, config: PcacPieChartConfig): void;
|
|
1230
|
-
private buildShapes;
|
|
1231
|
-
private drawChart;
|
|
1232
|
-
/**
|
|
1233
|
-
* The donut's `label` / `subLabel`, stacked around the center of the hole. Each line starts at a
|
|
1234
|
-
* size proportional to the hole and shrinks until it fits across it; a line that would have to
|
|
1235
|
-
* drop below `MIN_CENTER_FONT_SIZE` is left out rather than spill over the slices. Drawn after
|
|
1236
|
-
* the slices and ignoring the pointer, so it never blocks a slice's hover or click.
|
|
1237
|
-
*/
|
|
1238
|
-
private drawCenter;
|
|
1239
|
-
/**
|
|
1240
|
-
* One centered line of the donut's center text at the largest size up to `preferredSize` that
|
|
1241
|
-
* fits `maxWidth`, or nothing (null) when there's no text or it can't fit at a readable size.
|
|
1242
|
-
*/
|
|
1243
|
-
private drawCenterLine;
|
|
1244
|
-
private tweenChart;
|
|
1245
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PieChartBuilder, never>;
|
|
1246
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
671
|
declare class PcacPieChartComponent {
|
|
1250
672
|
private chartBuilder;
|
|
1251
|
-
readonly config:
|
|
1252
|
-
readonly chartElm:
|
|
1253
|
-
readonly sliceClicked:
|
|
673
|
+
readonly config: _angular_core.InputSignal<PcacPieChartConfig>;
|
|
674
|
+
readonly chartElm: _angular_core.Signal<ElementRef<any>>;
|
|
675
|
+
readonly sliceClicked: _angular_core.OutputRef<_pioneer_code_pioneer_charts.PcacData>;
|
|
1254
676
|
/**
|
|
1255
677
|
* Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the
|
|
1256
678
|
* default tooltip when present (see PcacTooltipDirective).
|
|
1257
679
|
*/
|
|
1258
|
-
readonly tooltipTemplate:
|
|
680
|
+
readonly tooltipTemplate: _angular_core.Signal<PcacTooltipDirective | undefined>;
|
|
1259
681
|
constructor();
|
|
1260
682
|
buildChart(): void;
|
|
1261
|
-
static ɵfac:
|
|
1262
|
-
static ɵcmp:
|
|
683
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PcacPieChartComponent, never>;
|
|
684
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PcacPieChartComponent, "pcac-pie-chart", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "sliceClicked": "sliceClicked"; }, ["tooltipTemplate"], never, true, never>;
|
|
1263
685
|
}
|
|
1264
686
|
|
|
1265
|
-
export {
|
|
1266
|
-
export type {
|
|
687
|
+
export { PcacAreaChart, PcacAreaChartConfig, PcacAxisChartConfig, PcacAxisConfig, PcacAxisSubLabels, PcacBarHorizontalChartColorOverrideConfig, PcacBarHorizontalChartComponent, PcacBarHorizontalChartConfig, PcacBarVerticalChartColorOverrideConfig, PcacBarVerticalChartComponent, PcacBarVerticalChartConfig, PcacChartConfig, PcacColorService, PcacData, PcacDataRange, PcacFormatEnum, PcacLegend, PcacLegendConfig, PcacLegendConfigItem, PcacLineChart, PcacLineChartConfig, PcacPieChartComponent, PcacPieChartConfig, PcacPieDonutConfig, PcacPlotChart, PcacPlotChartConfig, PcacPointFanOutConfig, PcacPointImageConfig, PcacPointRangeConfig, PcacPointRangeShow, PcacPointRangeStyle, PcacRangeBounds, PcacTooltipDirective };
|
|
688
|
+
export type { PcacTooltipCoincident, PcacTooltipContext };
|