@bitforgehq/ui 0.3.0 → 0.3.2
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/CHANGELOG.md +598 -0
- package/README.md +18 -11
- package/ai/MANIFEST.index.json +306 -0
- package/ai/MANIFEST.json +8915 -3788
- package/ai/REFERENCE.index.json +476 -0
- package/ai/REFERENCE.json +5810 -2905
- package/ai/UI_GUIDE.md +212 -58
- package/ai/components/app-frame.md +328 -0
- package/ai/components/back-button.md +42 -2
- package/ai/components/badge.md +17 -7
- package/ai/components/bar-chart.md +188 -0
- package/ai/components/breadcrumb-item.md +121 -0
- package/ai/components/breadcrumb.md +277 -0
- package/ai/components/button.md +82 -15
- package/ai/components/calendar.md +300 -0
- package/ai/components/card.md +119 -4
- package/ai/components/chart-card.md +283 -0
- package/ai/components/combobox.md +411 -0
- package/ai/components/date-input.md +396 -0
- package/ai/components/datetime-input.md +215 -0
- package/ai/components/description-item.md +111 -0
- package/ai/components/description-list.md +160 -0
- package/ai/components/donut-chart.md +169 -0
- package/ai/components/empty-state.md +99 -6
- package/ai/components/header.md +71 -2
- package/ai/components/icon-button.md +74 -16
- package/ai/components/icon.md +63 -7
- package/ai/components/line-chart.md +234 -0
- package/ai/components/list.md +70 -6
- package/ai/components/menu.md +5 -0
- package/ai/components/multi-combobox.md +257 -0
- package/ai/components/nav-group.md +178 -0
- package/ai/components/nav-item.md +210 -0
- package/ai/components/page-header.md +237 -0
- package/ai/components/pagination.md +173 -0
- package/ai/components/popover.md +250 -0
- package/ai/components/side-panel.md +391 -0
- package/ai/components/sidebar-toggle.md +287 -0
- package/ai/components/sidebar.md +541 -0
- package/ai/components/skeleton.md +215 -0
- package/ai/components/sparkline.md +188 -0
- package/ai/components/stat.md +297 -0
- package/ai/components/tab-group.md +226 -0
- package/ai/components/tab-panel.md +163 -0
- package/ai/components/table.md +697 -0
- package/ai/components/tabs.md +46 -2
- package/ai/components/theme-menu-button.md +182 -0
- package/ai/components/theme-switch.md +170 -0
- package/ai/components/time-input.md +240 -0
- package/ai/components/toolbar.md +354 -0
- package/ai/components/tooltip.md +230 -0
- package/ai/components/top-nav.md +159 -0
- package/ai/reference/bf-app-frame-breakpoint.md +27 -0
- package/ai/reference/bf-app-frame-content-width.md +29 -0
- package/ai/reference/bf-badge-appearance.md +36 -0
- package/ai/reference/bf-badge-variant.md +1 -1
- package/ai/reference/bf-bar-chart-orientation.md +27 -0
- package/ai/reference/bf-button-appearance.md +36 -0
- package/ai/reference/bf-button-variant.md +1 -1
- package/ai/reference/bf-calendar-disabled-date.md +23 -0
- package/ai/reference/bf-calendar-harness.md +51 -0
- package/ai/reference/bf-calendar-weekday.md +31 -0
- package/ai/reference/bf-chart-card-heading-level.md +26 -0
- package/ai/reference/bf-chart-curve.md +28 -0
- package/ai/reference/bf-chart-harness.md +51 -0
- package/ai/reference/bf-chart-legend-position.md +30 -0
- package/ai/reference/bf-chart-series.md +23 -0
- package/ai/reference/bf-chart-value-format.md +23 -0
- package/ai/reference/bf-color-scheme-service.md +30 -0
- package/ai/reference/bf-color-scheme.md +31 -0
- package/ai/reference/bf-combobox-filter.md +27 -0
- package/ai/reference/bf-combobox-harness.md +89 -0
- package/ai/reference/bf-combobox-option.md +33 -0
- package/ai/reference/bf-compare-with.md +2 -0
- package/ai/reference/bf-date-input-harness.md +67 -0
- package/ai/reference/bf-date-input-picker.md +27 -0
- package/ai/reference/bf-date-time-input-harness.md +76 -0
- package/ai/reference/bf-date-time-input-picker.md +27 -0
- package/ai/reference/bf-description-list-layout.md +26 -0
- package/ai/reference/bf-donut-slice.md +22 -0
- package/ai/reference/bf-empty-state-heading-level.md +1 -1
- package/ai/reference/bf-empty-state-heading.md +33 -0
- package/ai/reference/bf-labels.md +73 -20
- package/ai/reference/bf-menu-button-variant.md +1 -0
- package/ai/reference/bf-menu-placement.md +1 -0
- package/ai/reference/bf-overlay-options.md +28 -27
- package/ai/reference/bf-overlay-placement.md +34 -0
- package/ai/reference/bf-overlay-position.md +1 -1
- package/ai/reference/bf-overlay-service.md +5 -3
- package/ai/reference/bf-page-header-heading-level.md +26 -0
- package/ai/reference/bf-pagination-harness.md +61 -0
- package/ai/reference/bf-platform-service.md +17 -15
- package/ai/reference/bf-popover-harness.md +42 -0
- package/ai/reference/bf-popover-placement.md +28 -0
- package/ai/reference/bf-popover-trigger-directive.md +56 -0
- package/ai/reference/bf-side-panel-config.md +35 -0
- package/ai/reference/bf-side-panel-harness.md +34 -0
- package/ai/reference/bf-side-panel-ref.md +44 -0
- package/ai/reference/bf-side-panel-service.md +43 -0
- package/ai/reference/bf-side-panel-template-context.md +32 -0
- package/ai/reference/bf-side-panel-width.md +28 -0
- package/ai/reference/bf-sidebar-state-service.md +21 -0
- package/ai/reference/bf-sidebar-toggle-harness.md +32 -0
- package/ai/reference/bf-size.md +13 -0
- package/ai/reference/bf-skeleton-shape.md +28 -0
- package/ai/reference/bf-stat-appearance.md +33 -0
- package/ai/reference/bf-stat-trend-intent.md +27 -0
- package/ai/reference/bf-stat-trend.md +27 -0
- package/ai/reference/bf-stat-variant.md +26 -0
- package/ai/reference/bf-tab-group-harness.md +44 -0
- package/ai/reference/bf-table-align.md +26 -0
- package/ai/reference/bf-table-cell-context.md +24 -0
- package/ai/reference/bf-table-cell-directive.md +22 -0
- package/ai/reference/bf-table-column.md +28 -0
- package/ai/reference/bf-table-harness.md +77 -0
- package/ai/reference/bf-table-row-key.md +21 -0
- package/ai/reference/bf-table-sort-direction.md +26 -0
- package/ai/reference/bf-table-sort.md +27 -0
- package/ai/reference/bf-table-stack.md +29 -0
- package/ai/reference/bf-theme.md +5 -4
- package/ai/reference/bf-time-input-harness.md +67 -0
- package/ai/reference/bf-time-input-hour-cycle.md +27 -0
- package/ai/reference/bf-time-input-picker.md +27 -0
- package/ai/reference/bf-tooltip-directive.md +43 -0
- package/ai/reference/bf-tooltip-harness.md +43 -0
- package/ai/reference/bf-tooltip-placement.md +28 -0
- package/ai/reference/bf_color_scheme_storage.md +20 -0
- package/ai/reference/bf_side_panel_data.md +17 -0
- package/ai/reference/bf_sidebar_state_storage.md +20 -0
- package/ai/reference/bf_theme_storage.md +3 -1
- package/ai/reference/provide-bf-color-scheme.md +20 -0
- package/ai/reference/provide-bf-labels.md +13 -4
- package/ai/reference/provide-bf-sidebar-state.md +20 -0
- package/ai/reference/slide-in-from-end.md +24 -0
- package/ai/reference/slide-out-to-end.md +24 -0
- package/bin/bf-ui.js +433 -3
- package/fesm2022/bitforgehq-ui-charts.mjs +3045 -0
- package/fesm2022/bitforgehq-ui-charts.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-icons.mjs +107 -3
- package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-mobile.mjs +14 -59
- package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-overlay.mjs +6566 -38
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +634 -1
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +5708 -137
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +26766 -14470
- package/llms.txt +106 -1
- package/package.json +7 -3
- package/theme.css +101 -0
- package/types/bitforgehq-ui-charts.d.ts +967 -0
- package/types/bitforgehq-ui-icons.d.ts +13 -1
- package/types/bitforgehq-ui-mobile.d.ts +25 -18
- package/types/bitforgehq-ui-overlay.d.ts +1895 -7
- package/types/bitforgehq-ui-testing.d.ts +782 -1
- package/types/bitforgehq-ui.d.ts +2393 -45
|
@@ -0,0 +1,967 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { InjectionToken, Signal } from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* One named row of values in a chart, one value per category; `null` leaves a gap.
|
|
5
|
+
*
|
|
6
|
+
* @summary One named series of chart values, one per category, null for a gap
|
|
7
|
+
* @since 0.3.1
|
|
8
|
+
*/
|
|
9
|
+
interface BfChartSeries {
|
|
10
|
+
/** The series name, shown in the legend, the tooltip and the data table. */
|
|
11
|
+
readonly name: string;
|
|
12
|
+
/** One value per category, in the categories' order; `null` where there is no value. */
|
|
13
|
+
readonly values: readonly (number | null)[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Formats a chart value for the axis, the tooltip, the announcements and the data table.
|
|
17
|
+
*
|
|
18
|
+
* @summary Function that formats one chart value for axes, tooltips and the table
|
|
19
|
+
* @since 0.3.1
|
|
20
|
+
*/
|
|
21
|
+
type BfChartValueFormat = (value: number) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Where a chart draws its legend: above the plot, below it, or not at all.
|
|
24
|
+
*
|
|
25
|
+
* @summary The legend positions of a chart, above or below the plot, or none
|
|
26
|
+
* @since 0.3.1
|
|
27
|
+
*/
|
|
28
|
+
type BfChartLegendPosition = 'top' | 'bottom' | 'none';
|
|
29
|
+
/**
|
|
30
|
+
* The line between two points of a line chart or a sparkline: straight, or a smooth monotone
|
|
31
|
+
* cubic curve that never overshoots the values.
|
|
32
|
+
*
|
|
33
|
+
* @summary The two line shapes, straight segments or a smooth monotone curve
|
|
34
|
+
* @since 0.3.1
|
|
35
|
+
*/
|
|
36
|
+
type BfChartCurve = 'linear' | 'smooth';
|
|
37
|
+
/**
|
|
38
|
+
* One slice of a `bf-donut-chart`.
|
|
39
|
+
*
|
|
40
|
+
* @summary One labelled slice of a donut chart with its value
|
|
41
|
+
* @since 0.3.1
|
|
42
|
+
*/
|
|
43
|
+
interface BfDonutSlice {
|
|
44
|
+
/** The slice name, shown in the legend, the tooltip and the data table. */
|
|
45
|
+
readonly label: string;
|
|
46
|
+
/** The slice's value; its share of the total sets its angle. Zero and negative values draw no
|
|
47
|
+
* slice. */
|
|
48
|
+
readonly value: number;
|
|
49
|
+
}
|
|
50
|
+
/** A keyboard move of a chart's active point. */
|
|
51
|
+
type ChartStep = 'previous' | 'next' | 'first' | 'last' | 'clear';
|
|
52
|
+
/**
|
|
53
|
+
* The interaction state every chart with a legend and a tooltip shares: which series the legend
|
|
54
|
+
* hides, which category (or slice) is active, and the polite announcement of a keyboard move.
|
|
55
|
+
* A plain class, created once per chart component; it holds signals, no DOM and no services.
|
|
56
|
+
*/
|
|
57
|
+
declare class ChartInteraction {
|
|
58
|
+
private readonly hiddenSet;
|
|
59
|
+
private readonly activeIndex;
|
|
60
|
+
private readonly spoken;
|
|
61
|
+
/** The indexes the legend hides. */
|
|
62
|
+
readonly hidden: import("@angular/core").Signal<ReadonlySet<number>>;
|
|
63
|
+
/** The active category or slice, or `null` (no tooltip). */
|
|
64
|
+
readonly active: import("@angular/core").Signal<number | null>;
|
|
65
|
+
/** The last keyboard move, as read out by the live region. */
|
|
66
|
+
readonly announcement: import("@angular/core").Signal<string>;
|
|
67
|
+
/** Whether anything is active. */
|
|
68
|
+
readonly hasActive: import("@angular/core").Signal<boolean>;
|
|
69
|
+
/** Whether the legend hides series (or slice) `index`. */
|
|
70
|
+
isHidden(index: number): boolean;
|
|
71
|
+
/** Shows or hides series (or slice) `index`. */
|
|
72
|
+
toggle(index: number): void;
|
|
73
|
+
/** Points at `index` (a hover), without an announcement; `null` clears. */
|
|
74
|
+
point(index: number | null): void;
|
|
75
|
+
/**
|
|
76
|
+
* Moves the active point by keyboard among `targets` (the indexes that can be active, in order)
|
|
77
|
+
* and announces it with `describe`; `clear` hides the tooltip. From nothing, `next` and
|
|
78
|
+
* `previous` start at the first and the last target.
|
|
79
|
+
*/
|
|
80
|
+
step(step: ChartStep, targets: readonly number[], describe: (index: number) => string): void;
|
|
81
|
+
}
|
|
82
|
+
/** One line of the tooltip: a swatch, a name and the formatted value. */
|
|
83
|
+
interface ChartTooltipRow {
|
|
84
|
+
readonly name: string;
|
|
85
|
+
readonly value: string;
|
|
86
|
+
readonly swatch: string;
|
|
87
|
+
}
|
|
88
|
+
/** The tooltip of the active point: a title (the category), its rows and where it points, in
|
|
89
|
+
* px from the plot's physical top left. */
|
|
90
|
+
interface ChartTooltip {
|
|
91
|
+
readonly title: string;
|
|
92
|
+
readonly rows: readonly ChartTooltipRow[];
|
|
93
|
+
readonly x: number;
|
|
94
|
+
readonly y: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The tooltip of a chart's active point, placed beside it inside the plot. Physical `left`: the
|
|
98
|
+
* plot's SVG coordinates are physical (the chart mirrors them under rtl), so the tooltip follows
|
|
99
|
+
* them; past the middle of the plot it flips to the point's other side, so it stays inside.
|
|
100
|
+
* Hidden from assistive technology: the live region reads the same values.
|
|
101
|
+
* @internal Not exported: used by the chart frame only.
|
|
102
|
+
*/
|
|
103
|
+
declare class BfChartTooltipComponent {
|
|
104
|
+
/** What the tooltip shows and where. */
|
|
105
|
+
readonly tip: import("@angular/core").InputSignal<ChartTooltip>;
|
|
106
|
+
/** The plot's width in px, to pick the side with room. */
|
|
107
|
+
readonly plotWidth: import("@angular/core").InputSignal<number>;
|
|
108
|
+
protected readonly hostClasses = "pointer-events-none absolute z-10 flex w-max min-w-32 max-w-60 flex-col gap-1 rounded-tile border border-border bg-surface px-3 py-2 text-caption text-text shadow-floating";
|
|
109
|
+
/** 12 px to the side with more room, centred on the point's height. */
|
|
110
|
+
protected readonly shift: import("@angular/core").Signal<string>;
|
|
111
|
+
/**
|
|
112
|
+
* A row's swatch classes.
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
swatch(swatch: string): string;
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfChartTooltipComponent, never>;
|
|
117
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfChartTooltipComponent, "bf-chart-tooltip", never, {
|
|
118
|
+
"tip": {
|
|
119
|
+
"alias": "tip";
|
|
120
|
+
"required": true;
|
|
121
|
+
"isSignal": true;
|
|
122
|
+
};
|
|
123
|
+
"plotWidth": {
|
|
124
|
+
"alias": "plotWidth";
|
|
125
|
+
"required": false;
|
|
126
|
+
"isSignal": true;
|
|
127
|
+
};
|
|
128
|
+
}, {}, never, never, true, never>;
|
|
129
|
+
}
|
|
130
|
+
/** One legend entry: a series (or slice) name, its swatch utility and whether it is hidden. */
|
|
131
|
+
interface ChartLegendItem {
|
|
132
|
+
readonly name: string;
|
|
133
|
+
readonly swatch: string;
|
|
134
|
+
readonly hidden: boolean;
|
|
135
|
+
}
|
|
136
|
+
/** The data as a table: the column headers, then one row per category (its first cell the
|
|
137
|
+
* category, a row header). */
|
|
138
|
+
interface ChartTable {
|
|
139
|
+
readonly head: readonly string[];
|
|
140
|
+
readonly rows: readonly (readonly string[])[];
|
|
141
|
+
}
|
|
142
|
+
/** A pointer position in px from the plot's physical top left. */
|
|
143
|
+
interface ChartPointer {
|
|
144
|
+
readonly x: number;
|
|
145
|
+
readonly y: number;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The shared figure around every chart's plot: the legend, the focusable plot with the tooltip,
|
|
149
|
+
* the polite live region, the Show data toggle and the data table. The chart draws its SVG into
|
|
150
|
+
* the default slot and owns every number; the frame only lays out and forwards input.
|
|
151
|
+
* @internal Not exported: used by the `/charts` components only.
|
|
152
|
+
*/
|
|
153
|
+
declare class BfChartFrameComponent {
|
|
154
|
+
/** The figure's accessible name. */
|
|
155
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
156
|
+
/** The plot's height in px. */
|
|
157
|
+
readonly height: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
158
|
+
/** The legend entries; none draws no legend. */
|
|
159
|
+
readonly legend: import("@angular/core").InputSignal<readonly ChartLegendItem[]>;
|
|
160
|
+
/** Where the legend goes. */
|
|
161
|
+
readonly legendPosition: import("@angular/core").InputSignal<BfChartLegendPosition>;
|
|
162
|
+
/** The active point's tooltip, or `null`. */
|
|
163
|
+
readonly tooltip: import("@angular/core").InputSignal<ChartTooltip | null>;
|
|
164
|
+
/** The live region's text: the last keyboard move. */
|
|
165
|
+
readonly announcement: import("@angular/core").InputSignal<string>;
|
|
166
|
+
/** The data as a table, for the Show data toggle. */
|
|
167
|
+
readonly table: import("@angular/core").InputSignal<ChartTable>;
|
|
168
|
+
/** Whether the Show data toggle is offered. */
|
|
169
|
+
readonly dataToggle: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
170
|
+
/** Whether Arrow Up and Down move too (categories that run down the plot). */
|
|
171
|
+
readonly vertical: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
172
|
+
/** Emitted with the index of the legend entry pressed. */
|
|
173
|
+
readonly legendToggled: import("@angular/core").OutputEmitterRef<number>;
|
|
174
|
+
/** Emitted with the pointer's position over the plot (a hover, or a tap). */
|
|
175
|
+
readonly pointed: import("@angular/core").OutputEmitterRef<ChartPointer>;
|
|
176
|
+
/** Emitted when the pointer leaves the plot. */
|
|
177
|
+
readonly left: import("@angular/core").OutputEmitterRef<void>;
|
|
178
|
+
/** Emitted with a keyboard move of the active point. */
|
|
179
|
+
readonly stepped: import("@angular/core").OutputEmitterRef<ChartStep>;
|
|
180
|
+
/** Emitted with `true` when the plot takes focus and `false` when it loses it. */
|
|
181
|
+
readonly focusChanged: import("@angular/core").OutputEmitterRef<boolean>;
|
|
182
|
+
protected readonly labels: import("@bitforgehq/ui").BfLabels;
|
|
183
|
+
protected readonly tableId: string;
|
|
184
|
+
/** Whether the data table shows. */
|
|
185
|
+
protected readonly showData: import("@angular/core").WritableSignal<boolean>;
|
|
186
|
+
private readonly plot;
|
|
187
|
+
/** The plot element, which the chart measures. */
|
|
188
|
+
readonly plotElement: import("@angular/core").Signal<HTMLElement>;
|
|
189
|
+
/** The plot's width as last laid out, for the tooltip's side. */
|
|
190
|
+
protected plotWidth(): number;
|
|
191
|
+
protected readonly plotClasses = "relative block h-(--bf-chart-height) rounded-tile touch-pan-y focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-ring";
|
|
192
|
+
protected readonly legendClasses = "flex flex-wrap items-center gap-x-1 gap-y-1";
|
|
193
|
+
protected readonly legendButtonClasses: string;
|
|
194
|
+
protected readonly dataButtonClasses: string;
|
|
195
|
+
protected readonly tableClasses = "w-full border-collapse text-start";
|
|
196
|
+
protected readonly thHeadClasses = "h-8 border-b border-border px-3 text-start align-middle text-label-xs font-bold text-text-muted";
|
|
197
|
+
protected readonly thValueClasses = "h-8 border-b border-border px-3 text-start align-middle text-label-xs font-bold text-text-muted text-end";
|
|
198
|
+
protected readonly thRowClasses = "h-10 border-b border-divider px-3 text-start align-middle text-label-sm font-bold text-text";
|
|
199
|
+
protected readonly tdClasses = "h-10 border-b border-divider px-3 text-end align-middle text-label-sm font-medium text-text tabular-nums";
|
|
200
|
+
/**
|
|
201
|
+
* A swatch's classes: its colour, or an empty ring while hidden.
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
swatchClasses(swatch: string, hidden: boolean): string;
|
|
205
|
+
/**
|
|
206
|
+
* Arrow keys (mirrored under `dir="rtl"`; Up and Down too for vertical categories), Home, End
|
|
207
|
+
* and Escape.
|
|
208
|
+
* @internal
|
|
209
|
+
*/
|
|
210
|
+
onKeydown(event: KeyboardEvent): void;
|
|
211
|
+
/**
|
|
212
|
+
* Forwards the pointer's position over the plot.
|
|
213
|
+
* @internal
|
|
214
|
+
*/
|
|
215
|
+
onPointer(event: PointerEvent): void;
|
|
216
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfChartFrameComponent, never>;
|
|
217
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfChartFrameComponent, "bf-chart-frame", never, {
|
|
218
|
+
"label": {
|
|
219
|
+
"alias": "label";
|
|
220
|
+
"required": true;
|
|
221
|
+
"isSignal": true;
|
|
222
|
+
};
|
|
223
|
+
"height": {
|
|
224
|
+
"alias": "height";
|
|
225
|
+
"required": true;
|
|
226
|
+
"isSignal": true;
|
|
227
|
+
};
|
|
228
|
+
"legend": {
|
|
229
|
+
"alias": "legend";
|
|
230
|
+
"required": false;
|
|
231
|
+
"isSignal": true;
|
|
232
|
+
};
|
|
233
|
+
"legendPosition": {
|
|
234
|
+
"alias": "legendPosition";
|
|
235
|
+
"required": false;
|
|
236
|
+
"isSignal": true;
|
|
237
|
+
};
|
|
238
|
+
"tooltip": {
|
|
239
|
+
"alias": "tooltip";
|
|
240
|
+
"required": false;
|
|
241
|
+
"isSignal": true;
|
|
242
|
+
};
|
|
243
|
+
"announcement": {
|
|
244
|
+
"alias": "announcement";
|
|
245
|
+
"required": false;
|
|
246
|
+
"isSignal": true;
|
|
247
|
+
};
|
|
248
|
+
"table": {
|
|
249
|
+
"alias": "table";
|
|
250
|
+
"required": false;
|
|
251
|
+
"isSignal": true;
|
|
252
|
+
};
|
|
253
|
+
"dataToggle": {
|
|
254
|
+
"alias": "dataToggle";
|
|
255
|
+
"required": false;
|
|
256
|
+
"isSignal": true;
|
|
257
|
+
};
|
|
258
|
+
"vertical": {
|
|
259
|
+
"alias": "vertical";
|
|
260
|
+
"required": false;
|
|
261
|
+
"isSignal": true;
|
|
262
|
+
};
|
|
263
|
+
}, {
|
|
264
|
+
"legendToggled": "legendToggled";
|
|
265
|
+
"pointed": "pointed";
|
|
266
|
+
"left": "left";
|
|
267
|
+
"stepped": "stepped";
|
|
268
|
+
"focusChanged": "focusChanged";
|
|
269
|
+
}, never, ["*"], true, never>;
|
|
270
|
+
}
|
|
271
|
+
/** A point in the plot's pixel space. */
|
|
272
|
+
interface ChartPoint {
|
|
273
|
+
readonly x: number;
|
|
274
|
+
readonly y: number;
|
|
275
|
+
}
|
|
276
|
+
/** A coordinate rounded to 0.01 px, so a path stays short and its text stable. */
|
|
277
|
+
declare function px(value: number): number;
|
|
278
|
+
/** The runs of consecutive points between the gaps (`null`), each with at least one point. */
|
|
279
|
+
declare function segments(points: readonly (ChartPoint | null)[]): ChartPoint[][];
|
|
280
|
+
/**
|
|
281
|
+
* The SVG path of a line through `points`, broken at each gap; a run of one point is a dot-sized
|
|
282
|
+
* move with no line (the chart draws it as a marker). `smooth` is a monotone cubic curve.
|
|
283
|
+
*/
|
|
284
|
+
declare function linePath(points: readonly (ChartPoint | null)[], curve: BfChartCurve): string;
|
|
285
|
+
/**
|
|
286
|
+
* The SVG path of the area between the line through `points` and the horizontal `baseline`, one
|
|
287
|
+
* closed shape per run between gaps.
|
|
288
|
+
*/
|
|
289
|
+
declare function areaPath(points: readonly (ChartPoint | null)[], curve: BfChartCurve, baseline: number): string;
|
|
290
|
+
/** One drawn series: its index (the palette slot) and its line and area paths. */
|
|
291
|
+
interface LineMark {
|
|
292
|
+
readonly index: number;
|
|
293
|
+
readonly line: string;
|
|
294
|
+
readonly area: string;
|
|
295
|
+
/** Points with no neighbour (between two gaps), drawn as dots so they show. */
|
|
296
|
+
readonly dots: readonly ChartPoint[];
|
|
297
|
+
}
|
|
298
|
+
/** A text label on an axis. */
|
|
299
|
+
interface AxisLabel$1 {
|
|
300
|
+
readonly key: number;
|
|
301
|
+
readonly text: string;
|
|
302
|
+
readonly x: number;
|
|
303
|
+
readonly y: number;
|
|
304
|
+
readonly anchor: 'start' | 'middle' | 'end';
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* A line chart of one or more series over shared categories (months, days, steps), drawn in SVG
|
|
308
|
+
* with the chart palette: value axis with nice ticks and grid lines, a legend that shows and
|
|
309
|
+
* hides series, a crosshair tooltip on hover and on keyboard focus (Arrow keys move between the
|
|
310
|
+
* categories and a polite live region reads each one) and a Show data table. `area` fills under
|
|
311
|
+
* each line; `curve="smooth"` draws a monotone curve. The lines draw in on the first render and on
|
|
312
|
+
* every data change, still under reduced motion; under `dir="rtl"` the categories run from the
|
|
313
|
+
* right.
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* <bf-line-chart
|
|
317
|
+
* label="Revenue"
|
|
318
|
+
* [categories]="['Jan', 'Feb', 'Mar']"
|
|
319
|
+
* [series]="[{ name: 'Online', values: [12, 18, 15] }, { name: 'Store', values: [8, 9, 11] }]"
|
|
320
|
+
* />
|
|
321
|
+
* @summary Line chart of series over categories, with tooltip, legend and data table
|
|
322
|
+
* @category Data display
|
|
323
|
+
* @since 0.3.1
|
|
324
|
+
*/
|
|
325
|
+
export declare class BfLineChartComponent {
|
|
326
|
+
/** The series to draw, each with one value per category. */
|
|
327
|
+
readonly series: import("@angular/core").InputSignal<readonly BfChartSeries[]>;
|
|
328
|
+
/** The category names along the horizontal axis, in order. */
|
|
329
|
+
readonly categories: import("@angular/core").InputSignal<readonly string[]>;
|
|
330
|
+
/** The chart's accessible name; empty falls back to the `bf-chart-card` title, then to
|
|
331
|
+
* `provideBfLabels()`'s `chart` ("Chart"). */
|
|
332
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
333
|
+
/** The plot's height in px; the width follows the container. */
|
|
334
|
+
readonly height: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
335
|
+
/** Fills the area under each line in the series' colour (the value axis then starts at zero). */
|
|
336
|
+
readonly area: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
337
|
+
/** The line between points: `linear` (default) or `smooth`, a monotone curve. */
|
|
338
|
+
readonly curve: import("@angular/core").InputSignal<BfChartCurve>;
|
|
339
|
+
/** Formats the values on the axis, in the tooltip and in the table; unset uses
|
|
340
|
+
* `Intl.NumberFormat` in the document's language. */
|
|
341
|
+
readonly valueFormat: import("@angular/core").InputSignal<BfChartValueFormat | undefined>;
|
|
342
|
+
/** Where the legend goes; unset follows the `bf-chart-card`, else `bottom`. A single series
|
|
343
|
+
* draws no legend. */
|
|
344
|
+
readonly legend: import("@angular/core").InputSignal<BfChartLegendPosition | undefined>;
|
|
345
|
+
protected readonly interaction: ChartInteraction;
|
|
346
|
+
private readonly labels;
|
|
347
|
+
private readonly card;
|
|
348
|
+
private readonly document;
|
|
349
|
+
private readonly frame;
|
|
350
|
+
private readonly box;
|
|
351
|
+
protected readonly axisTextClasses = "fill-text-muted text-micro";
|
|
352
|
+
/** The figure's name: `label`, else the card's title, else the `chart` label. */
|
|
353
|
+
protected readonly name: import("@angular/core").Signal<string>;
|
|
354
|
+
protected readonly legendPosition: import("@angular/core").Signal<BfChartLegendPosition>;
|
|
355
|
+
private readonly format;
|
|
356
|
+
/** A new array on every data change: the key that re-creates the marks. */
|
|
357
|
+
protected readonly generations: import("@angular/core").Signal<{
|
|
358
|
+
series: readonly BfChartSeries[];
|
|
359
|
+
categories: readonly string[];
|
|
360
|
+
}[]>;
|
|
361
|
+
protected readonly viewBox: import("@angular/core").Signal<string>;
|
|
362
|
+
/** The indexes of the series the legend shows. */
|
|
363
|
+
private readonly visible;
|
|
364
|
+
/** Everything the SVG draws, in px of the plot's physical box. */
|
|
365
|
+
protected readonly geometry: import("@angular/core").Signal<{
|
|
366
|
+
width: number;
|
|
367
|
+
top: number;
|
|
368
|
+
baseline: number;
|
|
369
|
+
left: number;
|
|
370
|
+
right: number;
|
|
371
|
+
ticks: AxisLabel$1[];
|
|
372
|
+
categoryLabels: AxisLabel$1[];
|
|
373
|
+
marks: LineMark[];
|
|
374
|
+
xAt: (i: number) => number;
|
|
375
|
+
yAt: (v: number) => number;
|
|
376
|
+
}>;
|
|
377
|
+
/** The legend: every series, or none for a single series. */
|
|
378
|
+
protected readonly legendItems: import("@angular/core").Signal<ChartLegendItem[]>;
|
|
379
|
+
/** The active category, within range. */
|
|
380
|
+
private readonly active;
|
|
381
|
+
protected readonly crosshairX: import("@angular/core").Signal<number | null>;
|
|
382
|
+
protected readonly markers: import("@angular/core").Signal<{
|
|
383
|
+
index: number;
|
|
384
|
+
x: number;
|
|
385
|
+
y: number;
|
|
386
|
+
}[]>;
|
|
387
|
+
protected readonly tooltip: import("@angular/core").Signal<ChartTooltip | null>;
|
|
388
|
+
protected readonly table: import("@angular/core").Signal<ChartTable>;
|
|
389
|
+
/**
|
|
390
|
+
* The stroke classes of series `index`'s line.
|
|
391
|
+
* @internal
|
|
392
|
+
*/
|
|
393
|
+
lineClasses(index: number): string;
|
|
394
|
+
/**
|
|
395
|
+
* The fill classes of series `index`'s area.
|
|
396
|
+
* @internal
|
|
397
|
+
*/
|
|
398
|
+
areaClasses(index: number): string;
|
|
399
|
+
/**
|
|
400
|
+
* The fill of series `index`'s lone dots.
|
|
401
|
+
* @internal
|
|
402
|
+
*/
|
|
403
|
+
dotClasses(index: number): string;
|
|
404
|
+
/**
|
|
405
|
+
* The ring of series `index`'s hover marker.
|
|
406
|
+
* @internal
|
|
407
|
+
*/
|
|
408
|
+
markerClasses(index: number): string;
|
|
409
|
+
/**
|
|
410
|
+
* Points at the category nearest the pointer.
|
|
411
|
+
* @internal
|
|
412
|
+
*/
|
|
413
|
+
onPointed(pointer: ChartPointer): void;
|
|
414
|
+
/**
|
|
415
|
+
* Moves the active category by keyboard and announces it.
|
|
416
|
+
* @internal
|
|
417
|
+
*/
|
|
418
|
+
onStep(step: ChartStep): void;
|
|
419
|
+
/**
|
|
420
|
+
* On focus, shows the first category (or keeps the hovered one); on blur, hides the tooltip.
|
|
421
|
+
* @internal
|
|
422
|
+
*/
|
|
423
|
+
onFocus(focused: boolean): void;
|
|
424
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfLineChartComponent, never>;
|
|
425
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfLineChartComponent, "bf-line-chart", never, {
|
|
426
|
+
"series": {
|
|
427
|
+
"alias": "series";
|
|
428
|
+
"required": true;
|
|
429
|
+
"isSignal": true;
|
|
430
|
+
};
|
|
431
|
+
"categories": {
|
|
432
|
+
"alias": "categories";
|
|
433
|
+
"required": true;
|
|
434
|
+
"isSignal": true;
|
|
435
|
+
};
|
|
436
|
+
"label": {
|
|
437
|
+
"alias": "label";
|
|
438
|
+
"required": false;
|
|
439
|
+
"isSignal": true;
|
|
440
|
+
};
|
|
441
|
+
"height": {
|
|
442
|
+
"alias": "height";
|
|
443
|
+
"required": false;
|
|
444
|
+
"isSignal": true;
|
|
445
|
+
};
|
|
446
|
+
"area": {
|
|
447
|
+
"alias": "area";
|
|
448
|
+
"required": false;
|
|
449
|
+
"isSignal": true;
|
|
450
|
+
};
|
|
451
|
+
"curve": {
|
|
452
|
+
"alias": "curve";
|
|
453
|
+
"required": false;
|
|
454
|
+
"isSignal": true;
|
|
455
|
+
};
|
|
456
|
+
"valueFormat": {
|
|
457
|
+
"alias": "valueFormat";
|
|
458
|
+
"required": false;
|
|
459
|
+
"isSignal": true;
|
|
460
|
+
};
|
|
461
|
+
"legend": {
|
|
462
|
+
"alias": "legend";
|
|
463
|
+
"required": false;
|
|
464
|
+
"isSignal": true;
|
|
465
|
+
};
|
|
466
|
+
}, {}, never, never, true, never>;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* The direction of a `bf-bar-chart`'s bars: up from a horizontal baseline, or along from a
|
|
470
|
+
* vertical one (for long category names or many categories).
|
|
471
|
+
*
|
|
472
|
+
* @summary The two bar directions, vertical columns or horizontal bars
|
|
473
|
+
* @since 0.3.1
|
|
474
|
+
*/
|
|
475
|
+
type BfBarChartOrientation = 'vertical' | 'horizontal';
|
|
476
|
+
declare const GROW: Record<'up' | 'down' | 'left' | 'right', string>;
|
|
477
|
+
/** One bar (or stacked segment) in px of the plot's physical box. */
|
|
478
|
+
interface BarMark {
|
|
479
|
+
readonly key: string;
|
|
480
|
+
readonly index: number;
|
|
481
|
+
readonly x: number;
|
|
482
|
+
readonly y: number;
|
|
483
|
+
readonly width: number;
|
|
484
|
+
readonly height: number;
|
|
485
|
+
readonly grow: keyof typeof GROW;
|
|
486
|
+
}
|
|
487
|
+
/** A text label on an axis. */
|
|
488
|
+
interface AxisLabel {
|
|
489
|
+
readonly key: number;
|
|
490
|
+
readonly text: string;
|
|
491
|
+
readonly x: number;
|
|
492
|
+
readonly y: number;
|
|
493
|
+
readonly anchor: 'start' | 'middle' | 'end';
|
|
494
|
+
}
|
|
495
|
+
/** A grid line from (x1, y1) to (x2, y2). */
|
|
496
|
+
interface GridLine {
|
|
497
|
+
readonly key: number;
|
|
498
|
+
readonly x1: number;
|
|
499
|
+
readonly y1: number;
|
|
500
|
+
readonly x2: number;
|
|
501
|
+
readonly y2: number;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* A bar chart of one or more series over shared categories, drawn in SVG with the chart palette:
|
|
505
|
+
* bars side by side per category (or `stacked`), up from the baseline (or `horizontal`, along
|
|
506
|
+
* from it), with a value axis of nice ticks, a legend that shows and hides series, a tooltip on
|
|
507
|
+
* hover and on keyboard focus (Arrow keys move between the categories and a polite live region
|
|
508
|
+
* reads each one) and a Show data table. Bars grow in on the first render and on every data
|
|
509
|
+
* change, still under reduced motion; under `dir="rtl"` the horizontal axis runs from the right.
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* <bf-bar-chart
|
|
513
|
+
* label="Tickets"
|
|
514
|
+
* [categories]="['Mon', 'Tue', 'Wed']"
|
|
515
|
+
* [series]="[{ name: 'Opened', values: [14, 9, 12] }, { name: 'Closed', values: [11, 12, 8] }]"
|
|
516
|
+
* />
|
|
517
|
+
* @summary Bar chart of series over categories, grouped or stacked, vertical or horizontal
|
|
518
|
+
* @category Data display
|
|
519
|
+
* @since 0.3.1
|
|
520
|
+
*/
|
|
521
|
+
export declare class BfBarChartComponent {
|
|
522
|
+
/** The series to draw, each with one value per category. */
|
|
523
|
+
readonly series: import("@angular/core").InputSignal<readonly BfChartSeries[]>;
|
|
524
|
+
/** The category names along the category axis, in order. */
|
|
525
|
+
readonly categories: import("@angular/core").InputSignal<readonly string[]>;
|
|
526
|
+
/** The chart's accessible name; empty falls back to the `bf-chart-card` title, then to
|
|
527
|
+
* `provideBfLabels()`'s `chart` ("Chart"). */
|
|
528
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
529
|
+
/** The plot's height in px; the width follows the container. */
|
|
530
|
+
readonly height: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
531
|
+
/** `vertical` (default) bars rise from a horizontal baseline; `horizontal` bars run along from
|
|
532
|
+
* a vertical one, the categories down the start side. */
|
|
533
|
+
readonly orientation: import("@angular/core").InputSignal<BfBarChartOrientation>;
|
|
534
|
+
/** Stacks the series of a category into one bar instead of side by side. */
|
|
535
|
+
readonly stacked: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
536
|
+
/** Formats the values on the axis, in the tooltip and in the table; unset uses
|
|
537
|
+
* `Intl.NumberFormat` in the document's language. */
|
|
538
|
+
readonly valueFormat: import("@angular/core").InputSignal<BfChartValueFormat | undefined>;
|
|
539
|
+
/** Where the legend goes; unset follows the `bf-chart-card`, else `bottom`. A single series
|
|
540
|
+
* draws no legend. */
|
|
541
|
+
readonly legend: import("@angular/core").InputSignal<BfChartLegendPosition | undefined>;
|
|
542
|
+
protected readonly interaction: ChartInteraction;
|
|
543
|
+
private readonly labels;
|
|
544
|
+
private readonly card;
|
|
545
|
+
private readonly document;
|
|
546
|
+
private readonly frame;
|
|
547
|
+
private readonly box;
|
|
548
|
+
protected readonly axisTextClasses = "fill-text-muted text-micro";
|
|
549
|
+
/** The figure's name: `label`, else the card's title, else the `chart` label. */
|
|
550
|
+
protected readonly name: import("@angular/core").Signal<string>;
|
|
551
|
+
protected readonly legendPosition: import("@angular/core").Signal<BfChartLegendPosition>;
|
|
552
|
+
private readonly format;
|
|
553
|
+
/** A new array on every data change: the key that re-creates the bars. */
|
|
554
|
+
protected readonly generations: import("@angular/core").Signal<{
|
|
555
|
+
series: readonly BfChartSeries[];
|
|
556
|
+
categories: readonly string[];
|
|
557
|
+
stacked: boolean;
|
|
558
|
+
}[]>;
|
|
559
|
+
protected readonly viewBox: import("@angular/core").Signal<string>;
|
|
560
|
+
private readonly visible;
|
|
561
|
+
/** The value range the bars span: from zero, per bar or per stack. */
|
|
562
|
+
private readonly extent;
|
|
563
|
+
/** Everything the SVG draws, in px of the plot's physical box. */
|
|
564
|
+
protected readonly geometry: import("@angular/core").Signal<{
|
|
565
|
+
bars: BarMark[];
|
|
566
|
+
grid: GridLine[];
|
|
567
|
+
axis: {
|
|
568
|
+
x1: number;
|
|
569
|
+
x2: number;
|
|
570
|
+
y1: number;
|
|
571
|
+
y2: number;
|
|
572
|
+
};
|
|
573
|
+
labels: AxisLabel[];
|
|
574
|
+
horizontal: boolean;
|
|
575
|
+
rtl: boolean;
|
|
576
|
+
width: number;
|
|
577
|
+
start: number;
|
|
578
|
+
plotWidth: number;
|
|
579
|
+
plotHeight: number;
|
|
580
|
+
bandSize: number;
|
|
581
|
+
bandStart: (j: number) => number;
|
|
582
|
+
zero: number;
|
|
583
|
+
}>;
|
|
584
|
+
protected readonly legendItems: import("@angular/core").Signal<ChartLegendItem[]>;
|
|
585
|
+
/** The active category, within range. */
|
|
586
|
+
private readonly active;
|
|
587
|
+
/** The highlight band behind the active category. */
|
|
588
|
+
protected readonly activeBand: import("@angular/core").Signal<{
|
|
589
|
+
x: number;
|
|
590
|
+
y: number;
|
|
591
|
+
width: number;
|
|
592
|
+
height: number;
|
|
593
|
+
} | null>;
|
|
594
|
+
protected readonly tooltip: import("@angular/core").Signal<ChartTooltip | null>;
|
|
595
|
+
protected readonly table: import("@angular/core").Signal<ChartTable>;
|
|
596
|
+
/**
|
|
597
|
+
* The classes of one bar: its series colour and its grow motion.
|
|
598
|
+
* @internal
|
|
599
|
+
*/
|
|
600
|
+
barClasses(bar: BarMark): string;
|
|
601
|
+
/**
|
|
602
|
+
* Points at the category under the pointer.
|
|
603
|
+
* @internal
|
|
604
|
+
*/
|
|
605
|
+
onPointed(pointer: ChartPointer): void;
|
|
606
|
+
/**
|
|
607
|
+
* Moves the active category by keyboard and announces it.
|
|
608
|
+
* @internal
|
|
609
|
+
*/
|
|
610
|
+
onStep(step: ChartStep): void;
|
|
611
|
+
/**
|
|
612
|
+
* On focus, shows the first category (or keeps the hovered one); on blur, hides the tooltip.
|
|
613
|
+
* @internal
|
|
614
|
+
*/
|
|
615
|
+
onFocus(focused: boolean): void;
|
|
616
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfBarChartComponent, never>;
|
|
617
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfBarChartComponent, "bf-bar-chart", never, {
|
|
618
|
+
"series": {
|
|
619
|
+
"alias": "series";
|
|
620
|
+
"required": true;
|
|
621
|
+
"isSignal": true;
|
|
622
|
+
};
|
|
623
|
+
"categories": {
|
|
624
|
+
"alias": "categories";
|
|
625
|
+
"required": true;
|
|
626
|
+
"isSignal": true;
|
|
627
|
+
};
|
|
628
|
+
"label": {
|
|
629
|
+
"alias": "label";
|
|
630
|
+
"required": false;
|
|
631
|
+
"isSignal": true;
|
|
632
|
+
};
|
|
633
|
+
"height": {
|
|
634
|
+
"alias": "height";
|
|
635
|
+
"required": false;
|
|
636
|
+
"isSignal": true;
|
|
637
|
+
};
|
|
638
|
+
"orientation": {
|
|
639
|
+
"alias": "orientation";
|
|
640
|
+
"required": false;
|
|
641
|
+
"isSignal": true;
|
|
642
|
+
};
|
|
643
|
+
"stacked": {
|
|
644
|
+
"alias": "stacked";
|
|
645
|
+
"required": false;
|
|
646
|
+
"isSignal": true;
|
|
647
|
+
};
|
|
648
|
+
"valueFormat": {
|
|
649
|
+
"alias": "valueFormat";
|
|
650
|
+
"required": false;
|
|
651
|
+
"isSignal": true;
|
|
652
|
+
};
|
|
653
|
+
"legend": {
|
|
654
|
+
"alias": "legend";
|
|
655
|
+
"required": false;
|
|
656
|
+
"isSignal": true;
|
|
657
|
+
};
|
|
658
|
+
}, {}, never, never, true, never>;
|
|
659
|
+
}
|
|
660
|
+
/** One drawn slice: its index (the palette slot), its arc and its angles (0 at the top,
|
|
661
|
+
* clockwise, in radians). */
|
|
662
|
+
interface SliceMark {
|
|
663
|
+
readonly index: number;
|
|
664
|
+
readonly d: string;
|
|
665
|
+
readonly start: number;
|
|
666
|
+
readonly end: number;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* A donut chart of one set of slices, the parts of a whole (a budget by category, traffic by
|
|
670
|
+
* source), drawn in SVG with the chart palette: each slice's angle is its share of the total.
|
|
671
|
+
* A legend shows and hides slices (the total follows), a tooltip shows a slice's value and share
|
|
672
|
+
* on hover and on keyboard focus (Arrow keys move between the slices and a polite live region
|
|
673
|
+
* reads each one), and a Show data table lists them. The `center` slot holds a total or a label
|
|
674
|
+
* in the ring's hole. Slices draw in on the first render and on every data change, still under
|
|
675
|
+
* reduced motion; under `dir="rtl"` the slices run counter-clockwise.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* <bf-donut-chart
|
|
679
|
+
* label="Budget"
|
|
680
|
+
* [slices]="[{ label: 'Rent', value: 1200 }, { label: 'Food', value: 450 }]"
|
|
681
|
+
* >
|
|
682
|
+
* <span bfSlot="center" class="text-title">1,650</span>
|
|
683
|
+
* </bf-donut-chart>
|
|
684
|
+
* @summary Donut chart of the parts of a whole, with a legend, tooltip and centre slot
|
|
685
|
+
* @category Data display
|
|
686
|
+
* @since 0.3.1
|
|
687
|
+
* @slot center Content in the ring's hole, such as the total and its label.
|
|
688
|
+
*/
|
|
689
|
+
export declare class BfDonutChartComponent {
|
|
690
|
+
/** The slices, in order clockwise from the top. */
|
|
691
|
+
readonly slices: import("@angular/core").InputSignal<readonly BfDonutSlice[]>;
|
|
692
|
+
/** The chart's accessible name; empty falls back to the `bf-chart-card` title, then to
|
|
693
|
+
* `provideBfLabels()`'s `chart` ("Chart"). */
|
|
694
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
695
|
+
/** The plot's height in px; the ring fits the smaller of it and the container's width. */
|
|
696
|
+
readonly height: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
697
|
+
/** The ring's thickness in px (at most the radius, a full pie). */
|
|
698
|
+
readonly thickness: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
699
|
+
/** Formats the values in the tooltip, the announcements and the table; unset uses
|
|
700
|
+
* `Intl.NumberFormat` in the document's language. */
|
|
701
|
+
readonly valueFormat: import("@angular/core").InputSignal<BfChartValueFormat | undefined>;
|
|
702
|
+
/** Where the legend goes; unset follows the `bf-chart-card`, else `bottom`. A single slice
|
|
703
|
+
* draws no legend. */
|
|
704
|
+
readonly legend: import("@angular/core").InputSignal<BfChartLegendPosition | undefined>;
|
|
705
|
+
protected readonly interaction: ChartInteraction;
|
|
706
|
+
private readonly labels;
|
|
707
|
+
private readonly card;
|
|
708
|
+
private readonly document;
|
|
709
|
+
private readonly frame;
|
|
710
|
+
private readonly box;
|
|
711
|
+
private readonly percent;
|
|
712
|
+
protected readonly growBy = 6;
|
|
713
|
+
/** The figure's name: `label`, else the card's title, else the `chart` label. */
|
|
714
|
+
protected readonly name: import("@angular/core").Signal<string>;
|
|
715
|
+
protected readonly legendPosition: import("@angular/core").Signal<BfChartLegendPosition>;
|
|
716
|
+
private readonly format;
|
|
717
|
+
/** A new array on every data change: the key that re-creates the slices. */
|
|
718
|
+
protected readonly generations: import("@angular/core").Signal<{
|
|
719
|
+
slices: readonly BfDonutSlice[];
|
|
720
|
+
}[]>;
|
|
721
|
+
protected readonly viewBox: import("@angular/core").Signal<string>;
|
|
722
|
+
/** The indexes of the slices drawn: shown in the legend, with a positive value. */
|
|
723
|
+
private readonly drawn;
|
|
724
|
+
/** The total of the drawn slices. */
|
|
725
|
+
private readonly total;
|
|
726
|
+
/** Slice `index`'s positive, finite value, else 0. */
|
|
727
|
+
private share;
|
|
728
|
+
/** The ring and its arcs, in px of the plot's physical box. */
|
|
729
|
+
protected readonly geometry: import("@angular/core").Signal<{
|
|
730
|
+
width: number;
|
|
731
|
+
cx: number;
|
|
732
|
+
cy: number;
|
|
733
|
+
r: number;
|
|
734
|
+
thickness: number;
|
|
735
|
+
rtl: boolean;
|
|
736
|
+
slices: SliceMark[];
|
|
737
|
+
at: (angle: number, radius?: number) => {
|
|
738
|
+
x: number;
|
|
739
|
+
y: number;
|
|
740
|
+
};
|
|
741
|
+
}>;
|
|
742
|
+
protected readonly legendItems: import("@angular/core").Signal<ChartLegendItem[]>;
|
|
743
|
+
/** The active slice, if it is drawn. */
|
|
744
|
+
protected readonly active: import("@angular/core").Signal<number | null>;
|
|
745
|
+
/** "Rent: 1,200 (73%)", the value of slice `index` with its share. */
|
|
746
|
+
private valueText;
|
|
747
|
+
protected readonly tooltip: import("@angular/core").Signal<ChartTooltip | null>;
|
|
748
|
+
protected readonly table: import("@angular/core").Signal<ChartTable>;
|
|
749
|
+
/**
|
|
750
|
+
* The stroke classes of slice `index`.
|
|
751
|
+
* @internal
|
|
752
|
+
*/
|
|
753
|
+
sliceClasses(index: number): string;
|
|
754
|
+
/**
|
|
755
|
+
* Points at the slice under the pointer, or at none off the ring.
|
|
756
|
+
* @internal
|
|
757
|
+
*/
|
|
758
|
+
onPointed(pointer: ChartPointer): void;
|
|
759
|
+
/**
|
|
760
|
+
* Moves the active slice by keyboard and announces it.
|
|
761
|
+
* @internal
|
|
762
|
+
*/
|
|
763
|
+
onStep(step: ChartStep): void;
|
|
764
|
+
/**
|
|
765
|
+
* On focus, shows the first slice (or keeps the hovered one); on blur, hides the tooltip.
|
|
766
|
+
* @internal
|
|
767
|
+
*/
|
|
768
|
+
onFocus(focused: boolean): void;
|
|
769
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfDonutChartComponent, never>;
|
|
770
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfDonutChartComponent, "bf-donut-chart", never, {
|
|
771
|
+
"slices": {
|
|
772
|
+
"alias": "slices";
|
|
773
|
+
"required": true;
|
|
774
|
+
"isSignal": true;
|
|
775
|
+
};
|
|
776
|
+
"label": {
|
|
777
|
+
"alias": "label";
|
|
778
|
+
"required": false;
|
|
779
|
+
"isSignal": true;
|
|
780
|
+
};
|
|
781
|
+
"height": {
|
|
782
|
+
"alias": "height";
|
|
783
|
+
"required": false;
|
|
784
|
+
"isSignal": true;
|
|
785
|
+
};
|
|
786
|
+
"thickness": {
|
|
787
|
+
"alias": "thickness";
|
|
788
|
+
"required": false;
|
|
789
|
+
"isSignal": true;
|
|
790
|
+
};
|
|
791
|
+
"valueFormat": {
|
|
792
|
+
"alias": "valueFormat";
|
|
793
|
+
"required": false;
|
|
794
|
+
"isSignal": true;
|
|
795
|
+
};
|
|
796
|
+
"legend": {
|
|
797
|
+
"alias": "legend";
|
|
798
|
+
"required": false;
|
|
799
|
+
"isSignal": true;
|
|
800
|
+
};
|
|
801
|
+
}, {}, never, ["[bfSlot=center]"], true, never>;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* A tiny line of one series with no axes, legend or tooltip, for a trend beside a figure (in a
|
|
805
|
+
* `bf-stat`'s supporting line, a table cell). Its scale spans the values' own range, so it shows
|
|
806
|
+
* the shape of the trend, not its size; a dot marks the latest value. With a `label` it is an
|
|
807
|
+
* image with that name (say what the trend means, such as "Revenue up 12% over 30 days"); without
|
|
808
|
+
* one it is decorative and hidden from assistive technology. It draws in on the first render and
|
|
809
|
+
* on every data change, still under reduced motion; under `dir="rtl"` it runs from the right.
|
|
810
|
+
*
|
|
811
|
+
* @example
|
|
812
|
+
* <bf-stat label="Revenue" value="$48,200">
|
|
813
|
+
* <bf-sparkline [values]="[31, 34, 33, 39, 42, 48]" label="Revenue rising over six months" />
|
|
814
|
+
* </bf-stat>
|
|
815
|
+
* @summary Tiny trend line with no axes or legend, for stats and table cells
|
|
816
|
+
* @category Data display
|
|
817
|
+
* @since 0.3.1
|
|
818
|
+
*/
|
|
819
|
+
export declare class BfSparklineComponent {
|
|
820
|
+
/** The values in order, oldest first; `null` leaves a gap. */
|
|
821
|
+
readonly values: import("@angular/core").InputSignal<readonly (number | null)[]>;
|
|
822
|
+
/** What the trend means, its accessible name ("Revenue up 12% this month"); empty makes the
|
|
823
|
+
* sparkline decorative. */
|
|
824
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
825
|
+
/** Height in px; the width follows the container. */
|
|
826
|
+
readonly height: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
827
|
+
/** Fills the area under the line. */
|
|
828
|
+
readonly area: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
829
|
+
/** The line between points: `linear` (default) or `smooth`, a monotone curve. */
|
|
830
|
+
readonly curve: import("@angular/core").InputSignal<BfChartCurve>;
|
|
831
|
+
private readonly host;
|
|
832
|
+
private readonly box;
|
|
833
|
+
protected readonly lineClasses = "fill-none stroke-chart-1 [stroke-dasharray:1] animate-chart-draw motion-reduce:animate-none";
|
|
834
|
+
protected readonly areaClasses = "fill-chart-1/16 stroke-none animate-chart-fade motion-reduce:animate-none";
|
|
835
|
+
protected readonly dotClasses = "fill-chart-1 animate-chart-fade motion-reduce:animate-none";
|
|
836
|
+
/** A new array on every data change: the key that re-creates the line. */
|
|
837
|
+
protected readonly generations: import("@angular/core").Signal<{
|
|
838
|
+
values: readonly (number | null)[];
|
|
839
|
+
}[]>;
|
|
840
|
+
protected readonly viewBox: import("@angular/core").Signal<string>;
|
|
841
|
+
protected readonly geometry: import("@angular/core").Signal<{
|
|
842
|
+
line: string;
|
|
843
|
+
area: string;
|
|
844
|
+
last: {
|
|
845
|
+
x: number;
|
|
846
|
+
y: number;
|
|
847
|
+
} | null;
|
|
848
|
+
}>;
|
|
849
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfSparklineComponent, never>;
|
|
850
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfSparklineComponent, "bf-sparkline", never, {
|
|
851
|
+
"values": {
|
|
852
|
+
"alias": "values";
|
|
853
|
+
"required": true;
|
|
854
|
+
"isSignal": true;
|
|
855
|
+
};
|
|
856
|
+
"label": {
|
|
857
|
+
"alias": "label";
|
|
858
|
+
"required": false;
|
|
859
|
+
"isSignal": true;
|
|
860
|
+
};
|
|
861
|
+
"height": {
|
|
862
|
+
"alias": "height";
|
|
863
|
+
"required": false;
|
|
864
|
+
"isSignal": true;
|
|
865
|
+
};
|
|
866
|
+
"area": {
|
|
867
|
+
"alias": "area";
|
|
868
|
+
"required": false;
|
|
869
|
+
"isSignal": true;
|
|
870
|
+
};
|
|
871
|
+
"curve": {
|
|
872
|
+
"alias": "curve";
|
|
873
|
+
"required": false;
|
|
874
|
+
"isSignal": true;
|
|
875
|
+
};
|
|
876
|
+
}, {}, never, never, true, never>;
|
|
877
|
+
}
|
|
878
|
+
/** What a `bf-chart-card` hands the chart inside it: its title and its legend placement. */
|
|
879
|
+
interface ChartCardHost {
|
|
880
|
+
/** The card's title, the chart's name when the chart has no `label`. */
|
|
881
|
+
readonly title: Signal<string>;
|
|
882
|
+
/** The card's legend placement, used when the chart sets none. */
|
|
883
|
+
readonly legend: Signal<BfChartLegendPosition>;
|
|
884
|
+
}
|
|
885
|
+
/** Provided by `bf-chart-card` for the chart it holds. */
|
|
886
|
+
declare const BF_CHART_CARD: InjectionToken<ChartCardHost>;
|
|
887
|
+
/**
|
|
888
|
+
* The heading level of a `bf-chart-card` title: `2` for a card on a page, `3` inside a section.
|
|
889
|
+
*
|
|
890
|
+
* @summary Heading level of a chart card title, two on a page or three inside
|
|
891
|
+
* @since 0.3.1
|
|
892
|
+
*/
|
|
893
|
+
type BfChartCardHeadingLevel = 2 | 3;
|
|
894
|
+
/**
|
|
895
|
+
* A card around one chart: a title, a `period` slot for the range control (a `bf-segmented` or a
|
|
896
|
+
* `bf-select`), and the chart, or its loading placeholder (a `bf-skeleton`), its empty state or
|
|
897
|
+
* its error. The chart inside takes the card's title as its name when it has no `label`, and the
|
|
898
|
+
* card's `legend` placement when it sets none.
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
901
|
+
* <bf-chart-card title="Revenue" [loading]="revenue.isLoading()">
|
|
902
|
+
* <bf-segmented bfSlot="period" label="Period" [options]="periods" [(value)]="period" />
|
|
903
|
+
* <bf-line-chart [series]="series()" [categories]="months()" />
|
|
904
|
+
* </bf-chart-card>
|
|
905
|
+
* @summary Card around one chart with a title, period control and loading, empty and error states
|
|
906
|
+
* @category Data display
|
|
907
|
+
* @since 0.3.1
|
|
908
|
+
* @slot default The chart.
|
|
909
|
+
* @slot period The range control at the top end, such as a bf-segmented or a bf-select.
|
|
910
|
+
* @slot empty What shows when `empty` is set; without it, the `chartEmpty` label.
|
|
911
|
+
* @slot error What shows when `error` is set, such as a message and a retry button; without it,
|
|
912
|
+
* the `chartError` label.
|
|
913
|
+
*/
|
|
914
|
+
export declare class BfChartCardComponent implements ChartCardHost {
|
|
915
|
+
/** The card's heading; also the chart's name when the chart has no `label`. */
|
|
916
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
917
|
+
/** Heading level of the title so the card fits the page outline. */
|
|
918
|
+
readonly headingLevel: import("@angular/core").InputSignal<BfChartCardHeadingLevel>;
|
|
919
|
+
/** Where the chart inside draws its legend, unless it sets its own `legend`. */
|
|
920
|
+
readonly legend: import("@angular/core").InputSignal<BfChartLegendPosition>;
|
|
921
|
+
/** Shows a placeholder instead of the chart while its data loads, and marks the body
|
|
922
|
+
* `aria-busy`. */
|
|
923
|
+
readonly loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
924
|
+
/** Shows the `empty` slot (or the `chartEmpty` label) instead of the chart: there is no data
|
|
925
|
+
* for the period. */
|
|
926
|
+
readonly empty: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
927
|
+
/** Shows the `error` slot (or the `chartError` label) instead of the chart: the data failed to
|
|
928
|
+
* load. Wins over `empty`; `loading` wins over both. */
|
|
929
|
+
readonly error: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
930
|
+
protected readonly labels: import("@bitforgehq/ui").BfLabels;
|
|
931
|
+
protected readonly hostClasses = "flex h-full min-w-0 flex-col gap-4 rounded-card border-[1.5px] border-border-strong bg-surface p-card text-start text-text";
|
|
932
|
+
protected readonly stateClasses = "flex min-h-60 flex-col items-center justify-center gap-2 rounded-tile text-center text-body text-text-muted";
|
|
933
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfChartCardComponent, never>;
|
|
934
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfChartCardComponent, "bf-chart-card", never, {
|
|
935
|
+
"title": {
|
|
936
|
+
"alias": "title";
|
|
937
|
+
"required": true;
|
|
938
|
+
"isSignal": true;
|
|
939
|
+
};
|
|
940
|
+
"headingLevel": {
|
|
941
|
+
"alias": "headingLevel";
|
|
942
|
+
"required": false;
|
|
943
|
+
"isSignal": true;
|
|
944
|
+
};
|
|
945
|
+
"legend": {
|
|
946
|
+
"alias": "legend";
|
|
947
|
+
"required": false;
|
|
948
|
+
"isSignal": true;
|
|
949
|
+
};
|
|
950
|
+
"loading": {
|
|
951
|
+
"alias": "loading";
|
|
952
|
+
"required": false;
|
|
953
|
+
"isSignal": true;
|
|
954
|
+
};
|
|
955
|
+
"empty": {
|
|
956
|
+
"alias": "empty";
|
|
957
|
+
"required": false;
|
|
958
|
+
"isSignal": true;
|
|
959
|
+
};
|
|
960
|
+
"error": {
|
|
961
|
+
"alias": "error";
|
|
962
|
+
"required": false;
|
|
963
|
+
"isSignal": true;
|
|
964
|
+
};
|
|
965
|
+
}, {}, never, ["[bfSlot=period]", "[bfSlot=error]", "[bfSlot=empty]", "*"], true, never>;
|
|
966
|
+
}
|
|
967
|
+
export type { BfBarChartOrientation, BfChartCardHeadingLevel, BfChartCurve, BfChartLegendPosition, BfChartSeries, BfChartValueFormat, BfDonutSlice };
|