@cngx/common 0.0.1-rc.0 → 0.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/README.md +13 -16
- package/card/README.md +2 -21
- package/chart/README.md +5 -8
- package/data/README.md +45 -47
- package/dialog/README.md +12 -15
- package/display/README.md +5 -9
- package/fesm2022/cngx-common-a11y.mjs +164 -51
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +157 -69
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +389 -92
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +311 -151
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +167 -29
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +445 -110
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2059 -435
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +188 -31
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +711 -90
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +1479 -73
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1144 -85
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +2 -2
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +5 -5
- package/layout/README.md +2 -2
- package/package.json +7 -6
- package/popover/README.md +8 -34
- package/stepper/README.md +69 -8
- package/tabs/README.md +6 -6
- package/theming/components/cngx-async.css +74 -0
- package/theming/components/cngx-backdrop.css +73 -0
- package/theming/components/cngx-badge.css +340 -0
- package/theming/components/cngx-bottom-sheet.css +201 -0
- package/theming/components/cngx-button-toggle.css +99 -0
- package/theming/components/cngx-dialog.css +358 -0
- package/theming/components/cngx-divider.css +145 -0
- package/theming/components/cngx-listbox.css +220 -0
- package/theming/components/cngx-menu.css +371 -0
- package/theming/components/cngx-ripple.css +116 -0
- package/theming/components/cngx-tooltip.css +265 -0
- package/theming/system-tokens.css +24 -0
- package/types/cngx-common-a11y.d.ts +159 -38
- package/types/cngx-common-card.d.ts +137 -22
- package/types/cngx-common-chart.d.ts +337 -40
- package/types/cngx-common-data.d.ts +277 -45
- package/types/cngx-common-dialog.d.ts +162 -22
- package/types/cngx-common-display.d.ts +422 -78
- package/types/cngx-common-interactive.d.ts +1880 -305
- package/types/cngx-common-layout.d.ts +191 -28
- package/types/cngx-common-popover.d.ts +632 -87
- package/types/cngx-common-stepper.d.ts +1360 -45
- package/types/cngx-common-tabs.d.ts +1139 -56
- package/types/cngx-common.d.ts +1 -1
- package/README.md +0 -18
|
@@ -19,6 +19,8 @@ import * as i1 from '@cngx/common/layout';
|
|
|
19
19
|
* scale to a constant function returning `range[0]`.
|
|
20
20
|
* @param range `[start, end]` output range (typically pixel coordinates).
|
|
21
21
|
* @returns `(v: number) => number` mapping domain values to range values.
|
|
22
|
+
*
|
|
23
|
+
* @category common/chart/scales
|
|
22
24
|
*/
|
|
23
25
|
declare function createLinearScale(domain: readonly [number, number], range: readonly [number, number]): (v: number) => number;
|
|
24
26
|
|
|
@@ -32,6 +34,8 @@ declare function createLinearScale(domain: readonly [number, number], range: rea
|
|
|
32
34
|
* @param range `[start, end]` output range (typically pixel coordinates).
|
|
33
35
|
* @returns `(v: Date | number) => number` mapping time values to range
|
|
34
36
|
* values.
|
|
37
|
+
*
|
|
38
|
+
* @category common/chart/scales
|
|
35
39
|
*/
|
|
36
40
|
declare function createTimeScale(domain: readonly [Date | number, Date | number], range: readonly [number, number]): (v: Date | number) => number;
|
|
37
41
|
|
|
@@ -51,6 +55,8 @@ declare function createTimeScale(domain: readonly [Date | number, Date | number]
|
|
|
51
55
|
* @returns Callable `(v: T) => number` returning the **leading edge** of
|
|
52
56
|
* the band, with a `bandwidth()` method returning the band width.
|
|
53
57
|
* Lookup of an unknown value returns `NaN`.
|
|
58
|
+
*
|
|
59
|
+
* @category common/chart/scales
|
|
54
60
|
*/
|
|
55
61
|
interface BandScale<T> {
|
|
56
62
|
(v: T): number;
|
|
@@ -60,6 +66,8 @@ interface BandScale<T> {
|
|
|
60
66
|
* Construct a {@link BandScale} from a categorical domain and a numeric
|
|
61
67
|
* range. See the type-level documentation above for parameter
|
|
62
68
|
* semantics.
|
|
69
|
+
*
|
|
70
|
+
* @category common/chart/scales
|
|
63
71
|
*/
|
|
64
72
|
declare function createBandScale<T>(domain: readonly T[], range: readonly [number, number], padding?: number): BandScale<T>;
|
|
65
73
|
|
|
@@ -74,6 +82,8 @@ declare function createBandScale<T>(domain: readonly T[], range: readonly [numbe
|
|
|
74
82
|
* an empty palette throws synchronously at construction time.
|
|
75
83
|
* @returns Callable `(v: T) => string` returning the palette entry for
|
|
76
84
|
* `v`. Lookup of an unknown value returns the palette's first entry.
|
|
85
|
+
*
|
|
86
|
+
* @category common/chart/scales
|
|
77
87
|
*/
|
|
78
88
|
declare function createOrdinalScale<T>(domain: readonly T[], colors: readonly string[]): (v: T) => string;
|
|
79
89
|
|
|
@@ -99,6 +109,8 @@ declare function createOrdinalScale<T>(domain: readonly T[], colors: readonly st
|
|
|
99
109
|
* `CHART_SMALL_BREAKPOINT_PX` constant; default 400). Container-size
|
|
100
110
|
* based, not viewport-based, so it works correctly inside dashboard
|
|
101
111
|
* cells of any size.
|
|
112
|
+
*
|
|
113
|
+
* @category common/chart
|
|
102
114
|
*/
|
|
103
115
|
interface CngxChartSlotContext {
|
|
104
116
|
readonly width: number;
|
|
@@ -108,6 +120,8 @@ interface CngxChartSlotContext {
|
|
|
108
120
|
/**
|
|
109
121
|
* Threshold (px) below which `CngxChartSlotContext.small` is true.
|
|
110
122
|
* Hardcoded for v1; later releases may make this a config token.
|
|
123
|
+
*
|
|
124
|
+
* @category common/chart
|
|
111
125
|
*/
|
|
112
126
|
declare const CHART_SMALL_BREAKPOINT_PX = 400;
|
|
113
127
|
/**
|
|
@@ -125,6 +139,11 @@ declare const CHART_SMALL_BREAKPOINT_PX = 400;
|
|
|
125
139
|
* </ng-template>
|
|
126
140
|
* </cngx-chart>
|
|
127
141
|
* ```
|
|
142
|
+
*
|
|
143
|
+
* @category common/chart
|
|
144
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts
|
|
145
|
+
* @since 0.1.0
|
|
146
|
+
* @relatedTo CngxChartEmpty, CngxChartError, CngxChart
|
|
128
147
|
*/
|
|
129
148
|
declare class CngxChartLoading {
|
|
130
149
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -134,9 +153,14 @@ declare class CngxChartLoading {
|
|
|
134
153
|
/**
|
|
135
154
|
* Per-instance empty slot for `<cngx-chart>`. Receives a
|
|
136
155
|
* {@link CngxChartSlotContext} so the consumer can branch on chart
|
|
137
|
-
* size
|
|
156
|
+
* size - typically a compact text fallback when `small` is true and
|
|
138
157
|
* a richer surface (`<cngx-empty-state>`, illustration, action) at
|
|
139
158
|
* regular sizes.
|
|
159
|
+
*
|
|
160
|
+
* @category common/chart
|
|
161
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts
|
|
162
|
+
* @since 0.1.0
|
|
163
|
+
* @relatedTo CngxChartLoading, CngxChartError, CngxChart
|
|
140
164
|
*/
|
|
141
165
|
declare class CngxChartEmpty {
|
|
142
166
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -148,14 +172,21 @@ declare class CngxChartEmpty {
|
|
|
148
172
|
* common slot context with the live error value via `$implicit` and
|
|
149
173
|
* `error` keys, so consumers can render a typed message AND branch
|
|
150
174
|
* on chart size.
|
|
175
|
+
*
|
|
176
|
+
* @category common/chart
|
|
151
177
|
*/
|
|
152
178
|
interface CngxChartErrorContext extends CngxChartSlotContext {
|
|
153
179
|
readonly $implicit: unknown;
|
|
154
180
|
readonly error: unknown;
|
|
155
181
|
}
|
|
156
182
|
/**
|
|
157
|
-
* `*cngxChartError` slot
|
|
183
|
+
* `*cngxChartError` slot - overrides the chart-level error placeholder.
|
|
158
184
|
* Receives a {@link CngxChartErrorContext}.
|
|
185
|
+
*
|
|
186
|
+
* @category common/chart
|
|
187
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts
|
|
188
|
+
* @since 0.1.0
|
|
189
|
+
* @relatedTo CngxChartLoading, CngxChartEmpty, CngxChart
|
|
159
190
|
*/
|
|
160
191
|
declare class CngxChartError {
|
|
161
192
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -169,12 +200,16 @@ declare class CngxChartError {
|
|
|
169
200
|
* or arbitrary references via {@link createBandScale}'s generic. The
|
|
170
201
|
* union narrows at the layer atom (`[cngxLine]`, `[cngxBar]`, ...);
|
|
171
202
|
* the chart context surface stays scale-agnostic.
|
|
203
|
+
*
|
|
204
|
+
* @category common/chart
|
|
172
205
|
*/
|
|
173
206
|
type XScaleInput = number | Date | string;
|
|
174
207
|
/**
|
|
175
208
|
* Generic scale function shape. Maps a domain value of type `TIn` to a
|
|
176
209
|
* range value (typically a pixel coordinate). Mirrors the result type
|
|
177
210
|
* of every `create*Scale` factory in `@cngx/common/chart`.
|
|
211
|
+
*
|
|
212
|
+
* @category common/chart
|
|
178
213
|
*/
|
|
179
214
|
type ScaleFn<TIn> = (v: TIn) => number;
|
|
180
215
|
/**
|
|
@@ -184,8 +219,10 @@ type ScaleFn<TIn> = (v: TIn) => number;
|
|
|
184
219
|
* dimensions, data length, and data array without needing a direct
|
|
185
220
|
* reference to the parent class. Token is non-generic at the DI
|
|
186
221
|
* boundary; layer atoms call `data<T>()` to narrow the array to their
|
|
187
|
-
* own `<T>`
|
|
222
|
+
* own `<T>` - the single boundary cast lives inside `CngxChart`'s
|
|
188
223
|
* `data<U>()` method, not at every consumer site.
|
|
224
|
+
*
|
|
225
|
+
* @category common/chart
|
|
189
226
|
*/
|
|
190
227
|
interface CngxChartContext<TX = XScaleInput, TY = number> {
|
|
191
228
|
readonly xScale: Signal<ScaleFn<TX>>;
|
|
@@ -208,6 +245,10 @@ interface CngxChartContext<TX = XScaleInput, TY = number> {
|
|
|
208
245
|
* atoms, `<cngx-chart-data-table>`). `<cngx-chart>` provides itself
|
|
209
246
|
* via `useExisting`; child queries narrow the generic on the consumer
|
|
210
247
|
* side.
|
|
248
|
+
*
|
|
249
|
+
* @category common/chart
|
|
250
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart-context.ts
|
|
251
|
+
* @since 0.1.0
|
|
211
252
|
*/
|
|
212
253
|
declare const CNGX_CHART_CONTEXT: InjectionToken<CngxChartContext<XScaleInput, number>>;
|
|
213
254
|
|
|
@@ -229,20 +270,36 @@ declare const CNGX_CHART_CONTEXT: InjectionToken<CngxChartContext<XScaleInput, n
|
|
|
229
270
|
* the X axis (top/bottom position) drives `xScale`, the Y axis
|
|
230
271
|
* (left/right) drives `yScale`. With no axis present, the
|
|
231
272
|
* corresponding scale falls back to a no-op `() => 0` and content
|
|
232
|
-
* children may render off-canvas
|
|
273
|
+
* children may render off-canvas - consumers must mount at least
|
|
233
274
|
* one axis per direction they actually use.
|
|
234
275
|
*
|
|
235
276
|
* The `[width]` / `[height]` inputs override the resize observer for
|
|
236
277
|
* fixed-dimension presets (inline sparkline at 80×24, etc.).
|
|
278
|
+
*
|
|
279
|
+
* @category common/chart
|
|
280
|
+
* @docsKind primary
|
|
281
|
+
* @wcag AA
|
|
282
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart.component.ts
|
|
283
|
+
* @since 0.1.0
|
|
284
|
+
* @relatedTo CngxAxis, CngxLine, CngxArea, CngxBar, CngxChartLegend
|
|
285
|
+
*/
|
|
286
|
+
/**
|
|
287
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
288
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
289
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
290
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
291
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
292
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
293
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
237
294
|
*/
|
|
238
295
|
declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, number> {
|
|
239
296
|
/**
|
|
240
297
|
* Raw data input. Aliased as `data` at the template-binding level so
|
|
241
298
|
* consumer markup stays `<cngx-chart [data]="rows">`. The public,
|
|
242
|
-
* typed read surface is the `data<U>()` method below
|
|
299
|
+
* typed read surface is the `data<U>()` method below - layer atoms
|
|
243
300
|
* call `this.ctx.data<T>()` to narrow without per-site casts.
|
|
244
301
|
*
|
|
245
|
-
* @internal
|
|
302
|
+
* @internal - alias for the public `data<U>()` method
|
|
246
303
|
*/
|
|
247
304
|
readonly dataInput: _angular_core.InputSignal<readonly T[]>;
|
|
248
305
|
readonly width: _angular_core.InputSignal<number | undefined>;
|
|
@@ -263,9 +320,9 @@ declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, nu
|
|
|
263
320
|
/**
|
|
264
321
|
* Controls when the SR-only data-table view is exposed to assistive
|
|
265
322
|
* technology. `'auto'` (default) shows the table whenever the data
|
|
266
|
-
* has more than one point
|
|
323
|
+
* has more than one point - a single value is announced via the
|
|
267
324
|
* `aria-label`, no table needed. `'off'` keeps the table hidden
|
|
268
|
-
* regardless. The table element is always present in the DOM
|
|
325
|
+
* regardless. The table element is always present in the DOM -
|
|
269
326
|
* visibility flips through `aria-hidden`, the linked id on
|
|
270
327
|
* `aria-describedby` never disappears.
|
|
271
328
|
*/
|
|
@@ -281,7 +338,7 @@ declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, nu
|
|
|
281
338
|
* Accepts the standard `CngxAsyncState<T>` shape (any producer:
|
|
282
339
|
* `createManualState`, `createAsyncState`, `injectAsyncState`,
|
|
283
340
|
* `fromHttpResource`, `tap*` pipeline output). The chart provides
|
|
284
|
-
* `CNGX_STATEFUL` for downstream bridge directives
|
|
341
|
+
* `CNGX_STATEFUL` for downstream bridge directives - composing
|
|
285
342
|
* `<cngx-toast-on />` etc. inside the chart works automatically.
|
|
286
343
|
*/
|
|
287
344
|
readonly state: _angular_core.InputSignal<CngxAsyncState<readonly T[]> | undefined>;
|
|
@@ -313,7 +370,7 @@ declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, nu
|
|
|
313
370
|
* ```
|
|
314
371
|
*
|
|
315
372
|
* Reads directly from the resize observer (host's actual painted
|
|
316
|
-
* size)
|
|
373
|
+
* size) - NOT from `dimensions()` which prefers the logical
|
|
317
374
|
* `[width]`/`[height]` inputs. This matters when an explicit
|
|
318
375
|
* `[width]="480"` chart squeezes via `max-width: 100%` on a narrow
|
|
319
376
|
* viewport: the rendered width is what the consumer cares about
|
|
@@ -321,7 +378,7 @@ declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, nu
|
|
|
321
378
|
*/
|
|
322
379
|
protected readonly slotContext: _angular_core.Signal<CngxChartSlotContext>;
|
|
323
380
|
/**
|
|
324
|
-
* Error-slot context
|
|
381
|
+
* Error-slot context - extends {@link slotContext} with the live
|
|
325
382
|
* error value under `$implicit` and `error` keys, so a consumer can
|
|
326
383
|
* render a typed message AND branch on chart size in the same
|
|
327
384
|
* template.
|
|
@@ -354,7 +411,7 @@ declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, nu
|
|
|
354
411
|
/**
|
|
355
412
|
* Auto-Summary derived from `data` and `<cngx-threshold>` content
|
|
356
413
|
* children. Drives the host's reactive `aria-label`. Layer atoms do
|
|
357
|
-
* not contribute to the summary on Phase 3
|
|
414
|
+
* not contribute to the summary on Phase 3 - Phase 5/6 may extend
|
|
358
415
|
* with per-layer hints.
|
|
359
416
|
*/
|
|
360
417
|
readonly summary: _angular_core.Signal<_cngx_common_chart.CngxChartSummary>;
|
|
@@ -400,7 +457,7 @@ declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, nu
|
|
|
400
457
|
protected readonly summaryValues: _angular_core.Signal<readonly number[]>;
|
|
401
458
|
/**
|
|
402
459
|
* Auto-mode predicate. Drives the data-table's `aria-hidden`
|
|
403
|
-
* binding. The id on `aria-describedby` is invariant
|
|
460
|
+
* binding. The id on `aria-describedby` is invariant - it stays on
|
|
404
461
|
* the host whether the table is active or not. Single-value charts
|
|
405
462
|
* speak via the `aria-label` summary; multi-value charts add the
|
|
406
463
|
* table for row-by-row exploration.
|
|
@@ -414,19 +471,25 @@ declare class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, nu
|
|
|
414
471
|
* Axis position. Top/bottom are X-axes; left/right are Y-axes. The
|
|
415
472
|
* parent `<cngx-chart>` collects content-child axes and routes their
|
|
416
473
|
* inputs to its `xScale` / `yScale` signals based on this discriminator.
|
|
474
|
+
*
|
|
475
|
+
* @category common/chart/axis
|
|
417
476
|
*/
|
|
418
477
|
type CngxAxisPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
419
478
|
/**
|
|
420
479
|
* Axis scale type. The chart's scale-builder picks the matching
|
|
421
480
|
* `create*Scale` factory at the boundary; the axis itself stays
|
|
422
481
|
* scale-implementation-agnostic.
|
|
482
|
+
*
|
|
483
|
+
* @category common/chart/axis
|
|
423
484
|
*/
|
|
424
485
|
type CngxAxisType = 'linear' | 'time' | 'band';
|
|
486
|
+
/** @internal */
|
|
425
487
|
interface AxisLabelGeometry {
|
|
426
488
|
readonly transform: string;
|
|
427
489
|
readonly anchor: 'start' | 'middle' | 'end';
|
|
428
490
|
readonly baseline: 'auto' | 'middle' | 'hanging';
|
|
429
491
|
}
|
|
492
|
+
/** @internal */
|
|
430
493
|
interface AxisGeometry {
|
|
431
494
|
readonly transform: string;
|
|
432
495
|
readonly line: {
|
|
@@ -436,6 +499,7 @@ interface AxisGeometry {
|
|
|
436
499
|
readonly y2: number;
|
|
437
500
|
};
|
|
438
501
|
}
|
|
502
|
+
/** @internal */
|
|
439
503
|
interface TickRendering {
|
|
440
504
|
readonly key: string;
|
|
441
505
|
readonly transform: string;
|
|
@@ -449,7 +513,7 @@ interface TickRendering {
|
|
|
449
513
|
* Endpoint of the gridline that extends from this tick across the
|
|
450
514
|
* chart's perpendicular dimension. `(x1, y1)` is always `(0, 0)`
|
|
451
515
|
* (the tick's local origin); `(x2, y2)` reaches the opposite side
|
|
452
|
-
* of the chart area. Always present in the tick rendering
|
|
516
|
+
* of the chart area. Always present in the tick rendering - the
|
|
453
517
|
* `[showGrid]` input controls whether the line is rendered, not
|
|
454
518
|
* whether the geometry is computed.
|
|
455
519
|
*/
|
|
@@ -471,16 +535,30 @@ interface TickRendering {
|
|
|
471
535
|
* parent's scale derivation. Renders SVG ticks and labels in the
|
|
472
536
|
* coordinate system the parent publishes via {@link CNGX_CHART_CONTEXT}.
|
|
473
537
|
*
|
|
474
|
-
* Attribute-selector on `<svg:g>`
|
|
538
|
+
* Attribute-selector on `<svg:g>` - the host element IS the SVG group.
|
|
475
539
|
* This keeps the namespace boundary clean: a `<cngx-axis>` element
|
|
476
540
|
* inside `<svg>` would be in the XHTML namespace and SVG layout would
|
|
477
541
|
* not flow through it. By making the directive attribute-only, the
|
|
478
542
|
* host stays in the SVG namespace and the browser lays out tick lines
|
|
479
543
|
* and labels exactly where the geometry says.
|
|
480
544
|
*
|
|
481
|
-
* Host carries `aria-hidden="true"`
|
|
545
|
+
* Host carries `aria-hidden="true"` - axis text is decoration; the
|
|
482
546
|
* semantic data view lives on the parent chart's auto-Summary and
|
|
483
547
|
* Data Table.
|
|
548
|
+
*
|
|
549
|
+
* @category common/chart/axis
|
|
550
|
+
* @docsKind primary
|
|
551
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/axis.component.ts
|
|
552
|
+
* @since 0.1.0
|
|
553
|
+
* @relatedTo CngxChart, CngxLine, CngxBar, CngxArea
|
|
554
|
+
*
|
|
555
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
556
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
557
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
558
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
559
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
560
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
561
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
484
562
|
*/
|
|
485
563
|
declare class CngxAxis {
|
|
486
564
|
readonly position: _angular_core.InputSignal<CngxAxisPosition>;
|
|
@@ -498,7 +576,7 @@ declare class CngxAxis {
|
|
|
498
576
|
*/
|
|
499
577
|
readonly showGrid: _angular_core.InputSignal<boolean>;
|
|
500
578
|
/**
|
|
501
|
-
* Optional axis title rendered alongside the tick labels
|
|
579
|
+
* Optional axis title rendered alongside the tick labels -
|
|
502
580
|
* "Months", "Revenue (k€)", etc. The title is positioned outside
|
|
503
581
|
* the tick labels (further from the chart area) and rotated -90°
|
|
504
582
|
* for left/right axes so it reads bottom-to-top. Theming via the
|
|
@@ -526,11 +604,13 @@ declare class CngxAxis {
|
|
|
526
604
|
}
|
|
527
605
|
|
|
528
606
|
/**
|
|
529
|
-
* Single legend entry. `color` is optional
|
|
607
|
+
* Single legend entry. `color` is optional - when omitted the swatch
|
|
530
608
|
* falls back to the chart-level primary token. `value` is intentionally
|
|
531
609
|
* unconstrained so consumers can carry their domain key (id, layer
|
|
532
610
|
* name, accessor return type, ...) for later interactions without a
|
|
533
611
|
* second lookup.
|
|
612
|
+
*
|
|
613
|
+
* @category common/chart/legend
|
|
534
614
|
*/
|
|
535
615
|
interface CngxChartLegendItem<T = unknown> {
|
|
536
616
|
readonly label: string;
|
|
@@ -538,7 +618,7 @@ interface CngxChartLegendItem<T = unknown> {
|
|
|
538
618
|
readonly value?: T;
|
|
539
619
|
}
|
|
540
620
|
/**
|
|
541
|
-
* Presentational legend atom
|
|
621
|
+
* Presentational legend atom - a row (or column) of coloured swatches
|
|
542
622
|
* paired with labels. Decoupled from `<cngx-chart>` and the layer
|
|
543
623
|
* atoms by design: the consumer drives the items array, so the
|
|
544
624
|
* legend stays a pure rendering surface with zero opinions about
|
|
@@ -565,6 +645,13 @@ interface CngxChartLegendItem<T = unknown> {
|
|
|
565
645
|
* `--cngx-chart-legend-font-size`. `[orientation]` flips between row
|
|
566
646
|
* and column; `[align]` aligns along the main axis (`start`, `center`,
|
|
567
647
|
* `end`).
|
|
648
|
+
*
|
|
649
|
+
* @category common/chart/legend
|
|
650
|
+
* @docsKind primary
|
|
651
|
+
* @wcag AA
|
|
652
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/legend/legend.component.ts
|
|
653
|
+
* @since 0.1.0
|
|
654
|
+
* @relatedTo CngxChart, CngxLine, CngxBar
|
|
568
655
|
*/
|
|
569
656
|
declare class CngxChartLegend<T = unknown> {
|
|
570
657
|
readonly items: _angular_core.InputSignal<readonly CngxChartLegendItem<T>[]>;
|
|
@@ -582,9 +669,15 @@ declare class CngxChartLegend<T = unknown> {
|
|
|
582
669
|
* trailing close commands.
|
|
583
670
|
*
|
|
584
671
|
* Pure TS, no DOM dependency, no Angular dep.
|
|
672
|
+
*
|
|
673
|
+
* @category common/chart/path
|
|
585
674
|
*/
|
|
586
675
|
type CngxCurve = 'linear' | 'monotone';
|
|
587
|
-
/**
|
|
676
|
+
/**
|
|
677
|
+
* Pixel-space point fed into {@link buildCurvePath}.
|
|
678
|
+
*
|
|
679
|
+
* @category common/chart/path
|
|
680
|
+
*/
|
|
588
681
|
interface PathPoint {
|
|
589
682
|
readonly x: number;
|
|
590
683
|
readonly y: number;
|
|
@@ -599,17 +692,29 @@ interface PathPoint {
|
|
|
599
692
|
* overshoots between data points.
|
|
600
693
|
* @returns The full path data starting with `M`. Returns `''` when
|
|
601
694
|
* the input is empty; `M x y` when the input has one point.
|
|
695
|
+
*
|
|
696
|
+
* @category common/chart/path
|
|
602
697
|
*/
|
|
603
698
|
declare function buildCurvePath(points: readonly PathPoint[], curve: CngxCurve): string;
|
|
604
699
|
|
|
605
|
-
/**
|
|
700
|
+
/**
|
|
701
|
+
* Reads the Y value of a data row at index `i`.
|
|
702
|
+
*
|
|
703
|
+
* @category common/chart/path
|
|
704
|
+
*/
|
|
606
705
|
type LineYAccessor<T> = (d: T, i: number) => number;
|
|
607
706
|
/**
|
|
608
707
|
* Reads the X value of a data row at index `i`. Default behaviour
|
|
609
708
|
* (when omitted on a builder) is the row's positional index.
|
|
709
|
+
*
|
|
710
|
+
* @category common/chart/path
|
|
610
711
|
*/
|
|
611
712
|
type LineXAccessor<T> = (d: T, i: number) => XScaleInput;
|
|
612
|
-
/**
|
|
713
|
+
/**
|
|
714
|
+
* Construction options for {@link createPathBuilder}.
|
|
715
|
+
*
|
|
716
|
+
* @category common/chart/path
|
|
717
|
+
*/
|
|
613
718
|
interface PathBuilderOptions<T> {
|
|
614
719
|
readonly y: LineYAccessor<T>;
|
|
615
720
|
readonly x?: LineXAccessor<T>;
|
|
@@ -619,6 +724,8 @@ interface PathBuilderOptions<T> {
|
|
|
619
724
|
* Single-slot LRU cache around an SVG `d`-attribute builder. Returned
|
|
620
725
|
* by {@link createPathBuilder}; consumed by the `<cngx-line>` /
|
|
621
726
|
* `<cngx-area>` family.
|
|
727
|
+
*
|
|
728
|
+
* @category common/chart/path
|
|
622
729
|
*/
|
|
623
730
|
interface PathBuilder<T> {
|
|
624
731
|
/**
|
|
@@ -638,7 +745,7 @@ interface PathBuilder<T> {
|
|
|
638
745
|
/**
|
|
639
746
|
* Pure-TS path builder with single-slot LRU memo on
|
|
640
747
|
* `(data, xScale, yScale)` reference identity. Pure TS, no Angular
|
|
641
|
-
* dep. Compute guard only
|
|
748
|
+
* dep. Compute guard only - does not know about signals or `equal`
|
|
642
749
|
* functions; the `d` computed in `<cngx-line>` carries the cascade
|
|
643
750
|
* guard separately.
|
|
644
751
|
*
|
|
@@ -647,13 +754,15 @@ interface PathBuilder<T> {
|
|
|
647
754
|
* triggers a rebuild and updates the slot.
|
|
648
755
|
*
|
|
649
756
|
* Each call to `createPathBuilder` returns a fresh builder with its
|
|
650
|
-
* own `lastData / lastX / lastY` slots
|
|
757
|
+
* own `lastData / lastX / lastY` slots - there is no cross-call /
|
|
651
758
|
* cross-consumer state. The cascade guard for layer atoms is the
|
|
652
759
|
* `equal: (a, b) => a === b` on the `builder` `computed`; combined
|
|
653
760
|
* with Angular signals' default behaviour of skipping re-emissions
|
|
654
761
|
* when the inputs to the `computed` are unchanged, two consecutive
|
|
655
762
|
* cascade ticks with the same `(y, x, curve)` produce the same
|
|
656
763
|
* builder instance.
|
|
764
|
+
*
|
|
765
|
+
* @category common/chart/path
|
|
657
766
|
*/
|
|
658
767
|
declare function createPathBuilder<T>(opts: PathBuilderOptions<T>): PathBuilder<T>;
|
|
659
768
|
|
|
@@ -672,6 +781,20 @@ declare function createPathBuilder<T>(opts: PathBuilderOptions<T>): PathBuilder<
|
|
|
672
781
|
* geometry actually changes. The `createPathBuilder` cache provides
|
|
673
782
|
* the **compute guard** — same `(data, xScale, yScale)` triple by
|
|
674
783
|
* reference skips the per-datapoint projection work.
|
|
784
|
+
*
|
|
785
|
+
* @category common/chart/layers
|
|
786
|
+
* @docsKind primary
|
|
787
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/line.component.ts
|
|
788
|
+
* @since 0.1.0
|
|
789
|
+
* @relatedTo CngxArea, CngxScatter, CngxBar, CngxChart
|
|
790
|
+
*
|
|
791
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
792
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
793
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
794
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
795
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
796
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
797
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
675
798
|
*/
|
|
676
799
|
declare class CngxLine<T = unknown> {
|
|
677
800
|
readonly accessor: _angular_core.InputSignal<LineYAccessor<T>>;
|
|
@@ -697,6 +820,20 @@ declare class CngxLine<T = unknown> {
|
|
|
697
820
|
*
|
|
698
821
|
* The `d` string is cascade-guarded with string equality on its
|
|
699
822
|
* `computed` so a no-op data refresh does not force a fill repaint.
|
|
823
|
+
*
|
|
824
|
+
* @category common/chart/layers
|
|
825
|
+
* @docsKind primary
|
|
826
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/area.component.ts
|
|
827
|
+
* @since 0.1.0
|
|
828
|
+
* @relatedTo CngxLine, CngxBand, CngxThreshold, CngxChart
|
|
829
|
+
*
|
|
830
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
831
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
832
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
833
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
834
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
835
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
836
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
700
837
|
*/
|
|
701
838
|
declare class CngxArea<T = unknown> {
|
|
702
839
|
readonly accessor: _angular_core.InputSignal<LineYAccessor<T>>;
|
|
@@ -713,8 +850,13 @@ declare class CngxArea<T = unknown> {
|
|
|
713
850
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxArea<any>, "[cngxArea]", ["cngxArea"], { "accessor": { "alias": "accessor"; "required": false; "isSignal": true; }; "xAccessor": { "alias": "xAccessor"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "curve": { "alias": "curve"; "required": false; "isSignal": true; }; "baseline": { "alias": "baseline"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
714
851
|
}
|
|
715
852
|
|
|
716
|
-
/**
|
|
853
|
+
/**
|
|
854
|
+
* Reads the bar height (data-space Y) of a data row at index `i`.
|
|
855
|
+
*
|
|
856
|
+
* @category common/chart/layers
|
|
857
|
+
*/
|
|
717
858
|
type BarYAccessor<T> = (d: T, i: number) => number;
|
|
859
|
+
/** @internal */
|
|
718
860
|
interface BarRect {
|
|
719
861
|
readonly key: number;
|
|
720
862
|
readonly x: number;
|
|
@@ -733,6 +875,20 @@ interface BarRect {
|
|
|
733
875
|
* interchangeably.
|
|
734
876
|
*
|
|
735
877
|
* Attribute-selector on `<svg:g>` — see {@link CngxLine} for why.
|
|
878
|
+
*
|
|
879
|
+
* @category common/chart/layers
|
|
880
|
+
* @docsKind primary
|
|
881
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/bar.component.ts
|
|
882
|
+
* @since 0.1.0
|
|
883
|
+
* @relatedTo CngxLine, CngxArea, CngxStackedBar, CngxChart
|
|
884
|
+
*
|
|
885
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
886
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
887
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
888
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
889
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
890
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
891
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
736
892
|
*/
|
|
737
893
|
declare class CngxBar<T = unknown> {
|
|
738
894
|
readonly accessor: _angular_core.InputSignal<BarYAccessor<T>>;
|
|
@@ -746,10 +902,19 @@ declare class CngxBar<T = unknown> {
|
|
|
746
902
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxBar<any>, "[cngxBar]", ["cngxBar"], { "accessor": { "alias": "accessor"; "required": false; "isSignal": true; }; "gap": { "alias": "gap"; "required": false; "isSignal": true; }; "baseline": { "alias": "baseline"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
747
903
|
}
|
|
748
904
|
|
|
749
|
-
/**
|
|
905
|
+
/**
|
|
906
|
+
* Reads the data-space X value of a scatter row at index `i`.
|
|
907
|
+
*
|
|
908
|
+
* @category common/chart/layers
|
|
909
|
+
*/
|
|
750
910
|
type ScatterXAccessor<T> = (d: T, i: number) => XScaleInput;
|
|
751
|
-
/**
|
|
911
|
+
/**
|
|
912
|
+
* Reads the data-space Y value of a scatter row at index `i`.
|
|
913
|
+
*
|
|
914
|
+
* @category common/chart/layers
|
|
915
|
+
*/
|
|
752
916
|
type ScatterYAccessor<T> = (d: T, i: number) => number;
|
|
917
|
+
/** @internal */
|
|
753
918
|
interface ScatterCircle {
|
|
754
919
|
readonly key: number;
|
|
755
920
|
readonly cx: number;
|
|
@@ -757,10 +922,24 @@ interface ScatterCircle {
|
|
|
757
922
|
}
|
|
758
923
|
/**
|
|
759
924
|
* Scatter layer atom. Renders one `<circle>` per datapoint. X and Y
|
|
760
|
-
* accessors are independent
|
|
925
|
+
* accessors are independent - neither defaults to index, since the
|
|
761
926
|
* defining trait of a scatter chart is two genuine data dimensions.
|
|
762
927
|
*
|
|
763
|
-
* Attribute-selector on `<svg:g>`
|
|
928
|
+
* Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.
|
|
929
|
+
*
|
|
930
|
+
* @category common/chart/layers
|
|
931
|
+
* @docsKind primary
|
|
932
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/scatter.component.ts
|
|
933
|
+
* @since 0.1.0
|
|
934
|
+
* @relatedTo CngxLine, CngxBar, CngxArea, CngxChart
|
|
935
|
+
*
|
|
936
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
937
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
938
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
939
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
940
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
941
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
942
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
764
943
|
*/
|
|
765
944
|
declare class CngxScatter<T = unknown> {
|
|
766
945
|
readonly x: _angular_core.InputSignal<ScatterXAccessor<T>>;
|
|
@@ -783,7 +962,21 @@ declare class CngxScatter<T = unknown> {
|
|
|
783
962
|
* "line at value" reference. Always reads scales from
|
|
784
963
|
* {@link CNGX_CHART_CONTEXT}.
|
|
785
964
|
*
|
|
786
|
-
* Attribute-selector on `<svg:g>`
|
|
965
|
+
* Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.
|
|
966
|
+
*
|
|
967
|
+
* @category common/chart/layers
|
|
968
|
+
* @docsKind primary
|
|
969
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/threshold.component.ts
|
|
970
|
+
* @since 0.1.0
|
|
971
|
+
* @relatedTo CngxBand, CngxChart, CngxLine
|
|
972
|
+
*
|
|
973
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
974
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
975
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
976
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
977
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
978
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
979
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
787
980
|
*/
|
|
788
981
|
declare class CngxThreshold {
|
|
789
982
|
readonly value: _angular_core.InputSignal<number>;
|
|
@@ -807,6 +1000,20 @@ declare class CngxThreshold {
|
|
|
807
1000
|
* band sits behind line / area / bar layers without dominating.
|
|
808
1001
|
*
|
|
809
1002
|
* Attribute-selector on `<svg:g>` — see {@link CngxLine} for why.
|
|
1003
|
+
*
|
|
1004
|
+
* @category common/chart/layers
|
|
1005
|
+
* @docsKind primary
|
|
1006
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/band.component.ts
|
|
1007
|
+
* @since 0.1.0
|
|
1008
|
+
* @relatedTo CngxThreshold, CngxArea, CngxChart
|
|
1009
|
+
*
|
|
1010
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>
|
|
1011
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>
|
|
1012
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>
|
|
1013
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>
|
|
1014
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>
|
|
1015
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>
|
|
1016
|
+
* <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>
|
|
810
1017
|
*/
|
|
811
1018
|
declare class CngxBand {
|
|
812
1019
|
readonly from: _angular_core.InputSignal<number>;
|
|
@@ -827,6 +1034,8 @@ declare class CngxBand {
|
|
|
827
1034
|
* Summary input describing the chart's current data shape. Consumed by
|
|
828
1035
|
* `CngxChartI18n.summary()` to produce the `aria-label` text the
|
|
829
1036
|
* `<cngx-chart>` host announces to screen readers.
|
|
1037
|
+
*
|
|
1038
|
+
* @category common/chart/i18n
|
|
830
1039
|
*/
|
|
831
1040
|
interface CngxChartSummary {
|
|
832
1041
|
readonly trend: 'up' | 'down' | 'flat';
|
|
@@ -837,8 +1046,10 @@ interface CngxChartSummary {
|
|
|
837
1046
|
}
|
|
838
1047
|
/**
|
|
839
1048
|
* i18n surface for `@cngx/common/chart`. Mirrors the `CNGX_RECYCLER_I18N`
|
|
840
|
-
* shape from `@cngx/common/data`
|
|
1049
|
+
* shape from `@cngx/common/data` - factory defaults supply English;
|
|
841
1050
|
* consumers override per-app via {@link provideChartI18n}.
|
|
1051
|
+
*
|
|
1052
|
+
* @category common/chart/i18n
|
|
842
1053
|
*/
|
|
843
1054
|
interface CngxChartI18n {
|
|
844
1055
|
readonly summary: (input: CngxChartSummary) => string;
|
|
@@ -853,6 +1064,11 @@ interface CngxChartI18n {
|
|
|
853
1064
|
/**
|
|
854
1065
|
* Injection token for chart i18n strings. Defaults to English via
|
|
855
1066
|
* `factory:`. Override at app root with {@link provideChartI18n}.
|
|
1067
|
+
*
|
|
1068
|
+
* @category common/chart/i18n
|
|
1069
|
+
* @wcag AA
|
|
1070
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/i18n/chart-i18n.ts
|
|
1071
|
+
* @since 0.1.0
|
|
856
1072
|
*/
|
|
857
1073
|
declare const CNGX_CHART_I18N: InjectionToken<CngxChartI18n>;
|
|
858
1074
|
/**
|
|
@@ -866,6 +1082,8 @@ declare const CNGX_CHART_I18N: InjectionToken<CngxChartI18n>;
|
|
|
866
1082
|
* // ...remaining keys
|
|
867
1083
|
* })]
|
|
868
1084
|
* ```
|
|
1085
|
+
*
|
|
1086
|
+
* @category common/chart/i18n
|
|
869
1087
|
*/
|
|
870
1088
|
declare function provideChartI18n(i18n: CngxChartI18n): {
|
|
871
1089
|
provide: typeof CNGX_CHART_I18N;
|
|
@@ -873,7 +1091,7 @@ declare function provideChartI18n(i18n: CngxChartI18n): {
|
|
|
873
1091
|
};
|
|
874
1092
|
|
|
875
1093
|
/**
|
|
876
|
-
* Inline sparkline
|
|
1094
|
+
* Inline sparkline - a tiny line chart for KPI cards and dashboard
|
|
877
1095
|
* tiles. Composes `<cngx-chart>` + `<cngx-line>` (+ optional
|
|
878
1096
|
* `<cngx-area>`) with hidden axes that publish the scale domain
|
|
879
1097
|
* derived from the `data` array.
|
|
@@ -885,6 +1103,17 @@ declare function provideChartI18n(i18n: CngxChartI18n): {
|
|
|
885
1103
|
* The host carries `role="img"` and a reactive `aria-label` derived
|
|
886
1104
|
* from the chart's auto-Summary; consumers can override via
|
|
887
1105
|
* `[ariaLabel]`.
|
|
1106
|
+
*
|
|
1107
|
+
* @category common/chart/presets
|
|
1108
|
+
* @docsKind primary
|
|
1109
|
+
* @wcag AA
|
|
1110
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/sparkline.component.ts
|
|
1111
|
+
* @since 0.1.0
|
|
1112
|
+
* @relatedTo CngxMiniArea, CngxMiniBar, CngxChart
|
|
1113
|
+
*
|
|
1114
|
+
* <example-url>http://localhost:4200/#/common/chart/sparkline/async-state-machine</example-url>
|
|
1115
|
+
* <example-url>http://localhost:4200/#/common/chart/sparkline/basic-sparklines</example-url>
|
|
1116
|
+
* <example-url>http://localhost:4200/#/common/chart/sparkline/with-area-fill</example-url>
|
|
888
1117
|
*/
|
|
889
1118
|
declare class CngxSparkline {
|
|
890
1119
|
readonly data: _angular_core.InputSignal<readonly number[]>;
|
|
@@ -904,11 +1133,21 @@ declare class CngxSparkline {
|
|
|
904
1133
|
}
|
|
905
1134
|
|
|
906
1135
|
/**
|
|
907
|
-
* Mini horizontal bar
|
|
1136
|
+
* Mini horizontal bar - a single-value bounded indicator. Renders
|
|
908
1137
|
* pure DOM (no SVG), positioned with CSS only. Host carries
|
|
909
1138
|
* `role="meter"` per the WAI-ARIA pattern for single-value bounded
|
|
910
1139
|
* indicators; `aria-valuenow` / `aria-valuemin` / `aria-valuemax`
|
|
911
1140
|
* tell AT the exact reading without a separate Summary.
|
|
1141
|
+
*
|
|
1142
|
+
* @category common/chart/presets
|
|
1143
|
+
* @docsKind primary
|
|
1144
|
+
* @wcag AA
|
|
1145
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/mini-bar.component.ts
|
|
1146
|
+
* @since 0.1.0
|
|
1147
|
+
* @relatedTo CngxMiniArea, CngxSparkline, CngxDonut, CngxBullet
|
|
1148
|
+
*
|
|
1149
|
+
* <example-url>http://localhost:4200/#/common/chart/mini-bar/async-state-machine</example-url>
|
|
1150
|
+
* <example-url>http://localhost:4200/#/common/chart/mini-bar/basic-readings</example-url>
|
|
912
1151
|
*/
|
|
913
1152
|
declare class CngxMiniBar {
|
|
914
1153
|
readonly value: _angular_core.InputSignal<number>;
|
|
@@ -926,13 +1165,23 @@ declare class CngxMiniBar {
|
|
|
926
1165
|
}
|
|
927
1166
|
|
|
928
1167
|
/**
|
|
929
|
-
* Mini deviation bar
|
|
1168
|
+
* Mini deviation bar - a single-value indicator that diverges from a
|
|
930
1169
|
* `[baseline]` (default `0`) in either direction. Negative deviations
|
|
931
1170
|
* render to the left of the baseline mark, positive to the right.
|
|
932
1171
|
* Pure DOM, no SVG. Host carries `role="meter"`.
|
|
933
1172
|
*
|
|
934
1173
|
* Use cases: budget variance ("$+45k over"), score deltas ("−12%
|
|
935
1174
|
* vs target"), KPI swing visualisations.
|
|
1175
|
+
*
|
|
1176
|
+
* @category common/chart/presets
|
|
1177
|
+
* @docsKind primary
|
|
1178
|
+
* @wcag AA
|
|
1179
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/deviation-bar.component.ts
|
|
1180
|
+
* @since 0.1.0
|
|
1181
|
+
* @relatedTo CngxMiniBar, CngxBullet, CngxStackedBar
|
|
1182
|
+
*
|
|
1183
|
+
* <example-url>http://localhost:4200/#/common/chart/deviation-bar/async-state-machine</example-url>
|
|
1184
|
+
* <example-url>http://localhost:4200/#/common/chart/deviation-bar/variance-readings</example-url>
|
|
936
1185
|
*/
|
|
937
1186
|
declare class CngxDeviationBar {
|
|
938
1187
|
readonly value: _angular_core.InputSignal<number>;
|
|
@@ -953,10 +1202,20 @@ declare class CngxDeviationBar {
|
|
|
953
1202
|
}
|
|
954
1203
|
|
|
955
1204
|
/**
|
|
956
|
-
* Inline mini area
|
|
1205
|
+
* Inline mini area - a tiny filled-area chart for KPI cards. Sibling
|
|
957
1206
|
* of {@link CngxSparkline}; renders only the area (no line stroke).
|
|
958
1207
|
* Default viewBox 80×24. Theming via `--cngx-mini-area-color`
|
|
959
1208
|
* (atom-local) → `--cngx-chart-primary` (chart-level) cascade.
|
|
1209
|
+
*
|
|
1210
|
+
* @category common/chart/presets
|
|
1211
|
+
* @docsKind primary
|
|
1212
|
+
* @wcag AA
|
|
1213
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/mini-area.component.ts
|
|
1214
|
+
* @since 0.1.0
|
|
1215
|
+
* @relatedTo CngxSparkline, CngxMiniBar, CngxChart
|
|
1216
|
+
*
|
|
1217
|
+
* <example-url>http://localhost:4200/#/common/chart/mini-area/async-state-machine</example-url>
|
|
1218
|
+
* <example-url>http://localhost:4200/#/common/chart/mini-area/inline-area-trends</example-url>
|
|
960
1219
|
*/
|
|
961
1220
|
declare class CngxMiniArea {
|
|
962
1221
|
readonly data: _angular_core.InputSignal<readonly number[]>;
|
|
@@ -975,10 +1234,20 @@ declare class CngxMiniArea {
|
|
|
975
1234
|
}
|
|
976
1235
|
|
|
977
1236
|
/**
|
|
978
|
-
* Circular donut gauge
|
|
1237
|
+
* Circular donut gauge - a single-value bounded indicator. Renders a
|
|
979
1238
|
* background ring + a foreground arc whose length is proportional to
|
|
980
1239
|
* `value / max`. Host carries `role="meter"`; the optional `[label]`
|
|
981
1240
|
* input renders an SR-only label inside the ring's centre.
|
|
1241
|
+
*
|
|
1242
|
+
* @category common/chart/presets
|
|
1243
|
+
* @docsKind primary
|
|
1244
|
+
* @wcag AA
|
|
1245
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/donut.component.ts
|
|
1246
|
+
* @since 0.1.0
|
|
1247
|
+
* @relatedTo CngxBullet, CngxMiniBar, CngxDeviationBar
|
|
1248
|
+
*
|
|
1249
|
+
* <example-url>http://localhost:4200/#/common/chart/donut/async-state-machine</example-url>
|
|
1250
|
+
* <example-url>http://localhost:4200/#/common/chart/donut/score-gauges</example-url>
|
|
982
1251
|
*/
|
|
983
1252
|
declare class CngxDonut {
|
|
984
1253
|
readonly value: _angular_core.InputSignal<number>;
|
|
@@ -1001,9 +1270,11 @@ declare class CngxDonut {
|
|
|
1001
1270
|
}
|
|
1002
1271
|
|
|
1003
1272
|
/**
|
|
1004
|
-
* Bullet chart range entry
|
|
1273
|
+
* Bullet chart range entry - a colour band stretching from one value
|
|
1005
1274
|
* to another along the bullet's axis. Typical use: traffic-light
|
|
1006
1275
|
* bands ("good" / "fair" / "poor") behind the actual+target bar.
|
|
1276
|
+
*
|
|
1277
|
+
* @category common/chart/presets
|
|
1007
1278
|
*/
|
|
1008
1279
|
interface CngxBulletRange {
|
|
1009
1280
|
readonly from: number;
|
|
@@ -1011,6 +1282,7 @@ interface CngxBulletRange {
|
|
|
1011
1282
|
readonly color?: string;
|
|
1012
1283
|
readonly label?: string;
|
|
1013
1284
|
}
|
|
1285
|
+
/** @internal */
|
|
1014
1286
|
interface RangeRendering {
|
|
1015
1287
|
readonly key: string;
|
|
1016
1288
|
readonly left: number;
|
|
@@ -1018,10 +1290,20 @@ interface RangeRendering {
|
|
|
1018
1290
|
readonly color: string | null;
|
|
1019
1291
|
}
|
|
1020
1292
|
/**
|
|
1021
|
-
* Bullet chart
|
|
1293
|
+
* Bullet chart - Stephen Few's compact KPI visualisation. Three
|
|
1022
1294
|
* stacked layers: background `[ranges]` (qualitative bands), an
|
|
1023
1295
|
* `[actual]` filled bar, and a `[target]` vertical marker. Pure DOM,
|
|
1024
1296
|
* no SVG. Host carries `role="meter"`.
|
|
1297
|
+
*
|
|
1298
|
+
* @category common/chart/presets
|
|
1299
|
+
* @docsKind primary
|
|
1300
|
+
* @wcag AA
|
|
1301
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/bullet.component.ts
|
|
1302
|
+
* @since 0.1.0
|
|
1303
|
+
* @relatedTo CngxDonut, CngxMiniBar, CngxDeviationBar
|
|
1304
|
+
*
|
|
1305
|
+
* <example-url>http://localhost:4200/#/common/chart/bullet/async-state-machine</example-url>
|
|
1306
|
+
* <example-url>http://localhost:4200/#/common/chart/bullet/performance-vs-target</example-url>
|
|
1025
1307
|
*/
|
|
1026
1308
|
declare class CngxBullet {
|
|
1027
1309
|
readonly actual: _angular_core.InputSignal<number>;
|
|
@@ -1041,12 +1323,17 @@ declare class CngxBullet {
|
|
|
1041
1323
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxBullet, "cngx-bullet", ["cngxBullet"], { "actual": { "alias": "actual"; "required": true; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "ranges": { "alias": "ranges"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1042
1324
|
}
|
|
1043
1325
|
|
|
1044
|
-
/**
|
|
1326
|
+
/**
|
|
1327
|
+
* One segment in a stacked-bar series: a value, a label, optional colour.
|
|
1328
|
+
*
|
|
1329
|
+
* @category common/chart/presets
|
|
1330
|
+
*/
|
|
1045
1331
|
interface CngxStackedSegment {
|
|
1046
1332
|
readonly value: number;
|
|
1047
1333
|
readonly color?: string;
|
|
1048
1334
|
readonly label: string;
|
|
1049
1335
|
}
|
|
1336
|
+
/** @internal */
|
|
1050
1337
|
interface SegmentRendering {
|
|
1051
1338
|
readonly key: string;
|
|
1052
1339
|
readonly left: number;
|
|
@@ -1056,11 +1343,21 @@ interface SegmentRendering {
|
|
|
1056
1343
|
readonly value: number;
|
|
1057
1344
|
}
|
|
1058
1345
|
/**
|
|
1059
|
-
* Single-bar stacked composition
|
|
1346
|
+
* Single-bar stacked composition - visualises proportional shares of
|
|
1060
1347
|
* a fixed total. Pure DOM, no SVG. Host carries `role="img"` because
|
|
1061
1348
|
* a stacked bar communicates a multi-segment ratio, not a single
|
|
1062
1349
|
* bounded reading; the SR description enumerates segments via the
|
|
1063
1350
|
* auto-generated `aria-label` (or the `[ariaLabel]` override).
|
|
1351
|
+
*
|
|
1352
|
+
* @category common/chart/presets
|
|
1353
|
+
* @docsKind primary
|
|
1354
|
+
* @wcag AA
|
|
1355
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/stacked-bar.component.ts
|
|
1356
|
+
* @since 0.1.0
|
|
1357
|
+
* @relatedTo CngxBar, CngxDeviationBar, CngxBullet
|
|
1358
|
+
*
|
|
1359
|
+
* <example-url>http://localhost:4200/#/common/chart/stacked-bar/async-state-machine</example-url>
|
|
1360
|
+
* <example-url>http://localhost:4200/#/common/chart/stacked-bar/proportional-share-strips</example-url>
|
|
1064
1361
|
*/
|
|
1065
1362
|
declare class CngxStackedBar {
|
|
1066
1363
|
readonly segments: _angular_core.InputSignal<readonly CngxStackedSegment[]>;
|