@alfadocs/ui-kit 1.65.0 → 1.66.0

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.
Files changed (73) hide show
  1. package/dist/_chunks/chart-CwmyCuWe.js +1340 -0
  2. package/dist/_chunks/heatmap-C1TeC7wT.js +3650 -0
  3. package/dist/agent-catalog.json +1 -1
  4. package/dist/components/_shared/use-apex-radial-centre.d.ts +7 -4
  5. package/dist/components/chart/index.js +1 -1
  6. package/dist/components/heatmap/heatmap-context.d.ts +3 -0
  7. package/dist/components/heatmap/heatmap-disclosure.d.ts +67 -0
  8. package/dist/components/heatmap/heatmap-grid.d.ts +1 -1
  9. package/dist/components/heatmap/heatmap-legend.d.ts +5 -2
  10. package/dist/components/heatmap/heatmap-model.d.ts +107 -15
  11. package/dist/components/heatmap/heatmap-table-view.d.ts +3 -2
  12. package/dist/components/heatmap/heatmap.d.ts +33 -7
  13. package/dist/components/heatmap/index.d.ts +1 -1
  14. package/dist/components/heatmap/index.js +1 -1
  15. package/dist/i18n/locales/ar.d.ts +2 -0
  16. package/dist/i18n/locales/ar.js +2 -0
  17. package/dist/i18n/locales/de.d.ts +2 -0
  18. package/dist/i18n/locales/de.js +2 -0
  19. package/dist/i18n/locales/el.d.ts +2 -0
  20. package/dist/i18n/locales/el.js +2 -0
  21. package/dist/i18n/locales/en.d.ts +2 -0
  22. package/dist/i18n/locales/en.js +2 -0
  23. package/dist/i18n/locales/es.d.ts +2 -0
  24. package/dist/i18n/locales/es.js +2 -0
  25. package/dist/i18n/locales/fr.d.ts +2 -0
  26. package/dist/i18n/locales/fr.js +2 -0
  27. package/dist/i18n/locales/hi.d.ts +2 -0
  28. package/dist/i18n/locales/hi.js +2 -0
  29. package/dist/i18n/locales/it.d.ts +2 -0
  30. package/dist/i18n/locales/it.js +2 -0
  31. package/dist/i18n/locales/ja.d.ts +2 -0
  32. package/dist/i18n/locales/ja.js +2 -0
  33. package/dist/i18n/locales/nl.d.ts +2 -0
  34. package/dist/i18n/locales/nl.js +2 -0
  35. package/dist/i18n/locales/pl.d.ts +2 -0
  36. package/dist/i18n/locales/pl.js +2 -0
  37. package/dist/i18n/locales/pt.d.ts +2 -0
  38. package/dist/i18n/locales/pt.js +2 -0
  39. package/dist/i18n/locales/ro.d.ts +2 -0
  40. package/dist/i18n/locales/ro.js +2 -0
  41. package/dist/i18n/locales/ru.d.ts +2 -0
  42. package/dist/i18n/locales/ru.js +2 -0
  43. package/dist/i18n/locales/sq.d.ts +2 -0
  44. package/dist/i18n/locales/sq.js +2 -0
  45. package/dist/i18n/locales/sv.d.ts +2 -0
  46. package/dist/i18n/locales/sv.js +2 -0
  47. package/dist/i18n/locales/tr.d.ts +2 -0
  48. package/dist/i18n/locales/tr.js +2 -0
  49. package/dist/i18n/locales/zh.d.ts +2 -0
  50. package/dist/i18n/locales/zh.js +2 -0
  51. package/dist/index.js +2 -2
  52. package/dist/locales/ar.json +2 -0
  53. package/dist/locales/de.json +2 -0
  54. package/dist/locales/el.json +2 -0
  55. package/dist/locales/en.json +2 -0
  56. package/dist/locales/es.json +2 -0
  57. package/dist/locales/fr.json +2 -0
  58. package/dist/locales/hi.json +2 -0
  59. package/dist/locales/it.json +2 -0
  60. package/dist/locales/ja.json +2 -0
  61. package/dist/locales/nl.json +2 -0
  62. package/dist/locales/pl.json +2 -0
  63. package/dist/locales/pt.json +2 -0
  64. package/dist/locales/ro.json +2 -0
  65. package/dist/locales/ru.json +2 -0
  66. package/dist/locales/sq.json +2 -0
  67. package/dist/locales/sv.json +2 -0
  68. package/dist/locales/tr.json +2 -0
  69. package/dist/locales/zh.json +2 -0
  70. package/dist/tokens.css +1 -1
  71. package/package.json +1 -1
  72. package/dist/_chunks/chart-CIzXxNeM.js +0 -1322
  73. package/dist/_chunks/heatmap-BxRHM8Et.js +0 -2865
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.65.0",
3
+ "packageVersion": "1.66.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -8,10 +8,13 @@ export declare function splits(name: string, locale: string): string[][];
8
8
  * at its own size unless the hole is too small for it alone, and never below
9
9
  * the label role; the name fits the chord of the hole at each of its lines,
10
10
  * first on one line, then on two, then smaller, down to the label role, and
11
- * is hidden when it still cannot fit. The hole is measured from what
12
- * ApexCharts drew, on every redraw and hover, before the page paints, and
13
- * again once a web font loads or a theme around the chart changes. The name
14
- * stays the chart's to announce: the summary table carries it.
11
+ * is hidden when it still cannot fit. The name and value sit centred as one
12
+ * block; a name that fits nowhere centred gets one more try, at the label
13
+ * role and a little lower (at most 6% of the hole), where a long top line
14
+ * meets a wider chord. The hole is measured from what ApexCharts drew, on
15
+ * every redraw and hover, before the page paints, and again once a web font
16
+ * loads or a theme around the chart changes. The name stays the chart's to
17
+ * announce: the summary table carries it.
15
18
  */
16
19
  export declare function useApexRadialCentre(root: HTMLElement | null, enabled: boolean,
17
20
  /** The chart's locale, for where a name may break. */
@@ -1,4 +1,4 @@
1
- import { C as t, c as s, a as c } from "../../_chunks/chart-CIzXxNeM.js";
1
+ import { C as t, c as s, a as c } from "../../_chunks/chart-CwmyCuWe.js";
2
2
  export {
3
3
  t as Chart,
4
4
  s as chartAgent,
@@ -8,6 +8,9 @@ export interface HeatmapContextValue {
8
8
  describer: HeatmapDescriber;
9
9
  /** True when some cells fall below `minCount`, so the legend explains it. */
10
10
  hasLowSample: boolean;
11
+ /** True when a total the grid draws is withheld to protect small
12
+ * numbers. It may rest on many records, so the legend keys it apart. */
13
+ hasWithheldTotal: boolean;
11
14
  /** True when some cells have no data. */
12
15
  hasEmpty: boolean;
13
16
  /** The sample threshold, when one is set. */
@@ -0,0 +1,67 @@
1
+ /**
2
+ * How narrow a hidden cell's interval may be.
3
+ * - `rate`: the numerator lies in [0, records]. The interval must span at
4
+ * least half that range and, for whole numbers, at least two values.
5
+ * - `scaled`: values are non-negative with no upper bound. The interval
6
+ * must reach down to half its own top or below (and not be a point).
7
+ * - `free`: values have no bounds. The cell must not be pinned.
8
+ */
9
+ export type ProtectionMode = 'rate' | 'scaled' | 'free';
10
+ /** A hidden cell: an arc from its row node to its column-side node. */
11
+ export interface AuditCell {
12
+ from: number;
13
+ to: number;
14
+ /** Bounds of its unknown, in audit units. */
15
+ lo: number;
16
+ hi: number;
17
+ /** The records behind it (its count). */
18
+ records: number;
19
+ }
20
+ /** A total: an arc of the tree above or below the cells. */
21
+ export interface AuditTotal {
22
+ from: number;
23
+ to: number;
24
+ /** The hidden part of the total, in audit units, when it is shown. */
25
+ value: number;
26
+ /** Shown before the audit: drawn, with a value, and not withheld. */
27
+ shown: boolean;
28
+ /** The records behind the total: what withholding it loses. */
29
+ records: number;
30
+ }
31
+ export interface AuditProblem {
32
+ nodeCount: number;
33
+ /** The sink and source the closing arc joins (sink to source). */
34
+ sink: number;
35
+ source: number;
36
+ cells: readonly AuditCell[];
37
+ totals: readonly AuditTotal[];
38
+ /** For each cell, the totals whose scope holds it. */
39
+ cellTotals: readonly (readonly number[])[];
40
+ mode: ProtectionMode;
41
+ /** Whole-number data: numerators and shown totals are integers. */
42
+ integral: boolean;
43
+ minCount: number;
44
+ }
45
+ /**
46
+ * A cap on the audit's work, in edges looked at, so a very large grid
47
+ * cannot stall the page: past it, every total that holds a hidden cell is
48
+ * withheld, which is always safe. Counted, not timed, so the same data
49
+ * always gives the same result on every device. A 60 x 24 grid with 6
50
+ * groups and 10% of cells hidden uses 2.5 million for rates and 3.15
51
+ * million for plain sums, about half the cap (measured at about 12 ms in
52
+ * Chromium on a desktop, not a guarantee); with 20% hidden, or 100 rows,
53
+ * it runs out. Tests hold the count, not the time. Running out while offering totals back keeps the safe set already
54
+ * found; running out before that takes the safe rule. When rates are
55
+ * audited twice (printed and exact), the two passes share the cap.
56
+ */
57
+ export declare const AUDIT_WORK_LIMIT = 5000000;
58
+ /**
59
+ * Which totals may be shown: true at index i when total i may be shown.
60
+ * Starts from `total.shown` and only ever withholds more. `spentBefore`
61
+ * carries the work of an earlier pass over the same data, so that passes
62
+ * share one budget (see auditWorkSpent).
63
+ */
64
+ export declare function secureTotals(problem: AuditProblem, spentBefore?: number): boolean[];
65
+ /** The work the last secureTotals call ended on, for a following pass. */
66
+ export declare function auditWorkSpent(): number;
67
+ //# sourceMappingURL=heatmap-disclosure.d.ts.map
@@ -26,6 +26,7 @@ export interface HeatmapGridProps {
26
26
  palette: HeatmapPalette;
27
27
  describer: HeatmapDescriber;
28
28
  showValues: boolean;
29
+ /** Every total, withheld ones already reduced to a value-less cell. */
29
30
  totals: HeatmapTotals | null;
30
31
  rowTotals: HeatmapAggregate | false;
31
32
  columnTotals: HeatmapAggregate | false;
@@ -33,7 +34,6 @@ export interface HeatmapGridProps {
33
34
  groupColumnMethod: HeatmapAggregate;
34
35
  /** Each group's public id: what DOM hooks carry, never a label. */
35
36
  groupIds: ReadonlyMap<string, string>;
36
- minCount?: number;
37
37
  selectionMode: HeatmapSelectionMode;
38
38
  /** Selection keys (row id + column id) of the selected cells. */
39
39
  selected: ReadonlySet<string>;
@@ -17,8 +17,11 @@ export interface HeatmapLegendProps {
17
17
  valueFormatter?: (value: number) => string;
18
18
  /** Show the key for empty cells. Inside a Heatmap: when any cell is empty. */
19
19
  showEmpty?: boolean;
20
- /** Show the key for low-sample cells. Inside a Heatmap: when any is. */
20
+ /** Show the key for low-sample cells. Inside a Heatmap: when any cell is. */
21
21
  showLowSample?: boolean;
22
+ /** Show the key for totals withheld to protect small numbers. Inside a
23
+ * Heatmap: when any total it draws is withheld. */
24
+ showWithheldTotal?: boolean;
22
25
  /** The sample threshold, named in the low-sample key. Inside a Heatmap it
23
26
  * defaults to the Heatmap's `minCount`. */
24
27
  minCount?: number;
@@ -26,7 +29,7 @@ export interface HeatmapLegendProps {
26
29
  }
27
30
  /**
28
31
  * Heatmap.Legend: the colour steps with the low and high ends of the scale,
29
- * plus keys for empty and low-sample cells. A diverging scale shows its
32
+ * plus keys for empty and low-sample cells and withheld totals. A diverging scale shows its
30
33
  * midpoint between the two hues as a neutral swatch carrying the midpoint
31
34
  * value, the colour of a cell exactly on it. Inside a Heatmap it reads the
32
35
  * Heatmap's scale; render it elsewhere with `legend={false}` on the Heatmap
@@ -1,4 +1,4 @@
1
- import { type AggregateResult, type HeatmapAggregate } from './heatmap-scale';
1
+ import { type HeatmapAggregate } from './heatmap-scale';
2
2
  /** One row of the heatmap. */
3
3
  export interface HeatmapRow {
4
4
  /** Stable, opaque id. Emitted in DOM hooks, so never a name. */
@@ -97,6 +97,10 @@ export interface ModelCell {
97
97
  count?: number;
98
98
  label?: string;
99
99
  status: HeatmapCellStatus;
100
+ /** A total withheld to protect hidden cells. Its status stays
101
+ * `low-sample`, but it may rest on many records, so it is worded apart
102
+ * from a cell that is too few to show. */
103
+ withheld?: true;
100
104
  }
101
105
  /** How rows are ordered (within their group when grouped). */
102
106
  export type HeatmapSortRows = 'none' | 'label' | 'total-asc' | 'total-desc';
@@ -110,26 +114,114 @@ export declare function buildMatrix(rows: readonly HeatmapRow[], columns: readon
110
114
  export declare function shownValues(matrix: readonly ModelCell[][]): number[];
111
115
  /** Whether at least one cell carries data (a value or a low sample). */
112
116
  export declare function hasAnyData(matrix: readonly ModelCell[][]): boolean;
117
+ /**
118
+ * Which total `getTotal` is asked for, with the rows, columns and group it
119
+ * covers. `method` is how the kit combines the cells for it: the
120
+ * `rowTotals` method for a row, a group and the grand total, the
121
+ * `columnTotals` method for a column, and the column method (else the row
122
+ * method) for a group header cell.
123
+ */
124
+ export type HeatmapTotalScope = {
125
+ /** A row's total, in the totals column. */
126
+ kind: 'row';
127
+ method: HeatmapAggregate;
128
+ row: HeatmapRow;
129
+ rowId: string;
130
+ /** Index into the `rows` prop. */
131
+ rowIndex: number;
132
+ } | {
133
+ /** A column's total, in the totals row. */
134
+ kind: 'column';
135
+ method: HeatmapAggregate;
136
+ column: HeatmapColumn;
137
+ columnId: string | number;
138
+ /** Index into the `columns` prop. */
139
+ columnIndex: number;
140
+ } | {
141
+ /** A group's total, in the totals column of its header row. */
142
+ kind: 'group';
143
+ method: HeatmapAggregate;
144
+ /** The id the group's rows carry in `group`. */
145
+ groupId: string;
146
+ /** The group's entry in `groups`, when it has one. */
147
+ group?: HeatmapGroup;
148
+ /** The group's rows, in the order of the `rows` prop. */
149
+ rows: readonly HeatmapRow[];
150
+ rowIndexes: readonly number[];
151
+ } | {
152
+ /** One column's total within a group, in the group's header row. */
153
+ kind: 'group-column';
154
+ method: HeatmapAggregate;
155
+ groupId: string;
156
+ group?: HeatmapGroup;
157
+ rows: readonly HeatmapRow[];
158
+ rowIndexes: readonly number[];
159
+ column: HeatmapColumn;
160
+ columnId: string | number;
161
+ columnIndex: number;
162
+ } | {
163
+ /** The grand total of every cell, in the corner. */
164
+ kind: 'grand';
165
+ method: HeatmapAggregate;
166
+ };
167
+ /** Returns a total, or undefined to let the kit work it out from the cells. */
168
+ export type HeatmapGetTotal = (scope: HeatmapTotalScope) => HeatmapCellInput | undefined;
169
+ /**
170
+ * Every margin, ready to render. A withheld total is `{ value: null,
171
+ * status: 'low-sample', withheld: true }`: no value and no count, so
172
+ * nothing that reads it (the grid, the table view, a sort by total) can
173
+ * pass one on.
174
+ */
113
175
  export interface HeatmapTotals {
114
176
  /** Per row index (props order), by the row method. */
115
- rows: AggregateResult[];
177
+ rows: ModelCell[];
116
178
  /** Per column index, by the column method. */
117
- columns: AggregateResult[];
179
+ columns: ModelCell[];
118
180
  /** Every cell, by the row method (it sits in the row-totals column). */
119
- grand: AggregateResult;
120
- /** Per group id: one result per column, by the group column method. */
121
- groupColumns: Map<string, AggregateResult[]>;
122
- /** Per group id: every cell in the group, by the row method (it sits in
123
- * the row-totals column). */
124
- groups: Map<string, AggregateResult>;
181
+ grand: ModelCell;
182
+ /** Per group id, whenever rows carry a group: one per column, by the
183
+ * group column method. */
184
+ groupColumns: Map<string, ModelCell[]>;
185
+ /** Per group id, whenever rows carry a group: every cell in the group,
186
+ * by the row method (it sits in the row-totals column). */
187
+ groups: Map<string, ModelCell>;
188
+ }
189
+ /** Which totals the viewer sees: drawn, or, for rows, ordering the rows. */
190
+ export interface ShownTotals {
191
+ rows: boolean;
192
+ columns: boolean;
193
+ grand: boolean;
194
+ groups: boolean;
195
+ groupColumns: boolean;
196
+ }
197
+ export interface TotalsOptions {
198
+ rowMethod: HeatmapAggregate;
199
+ columnMethod: HeatmapAggregate;
200
+ groupColumnMethod: HeatmapAggregate;
201
+ groups?: readonly HeatmapGroup[];
202
+ minCount?: number;
203
+ getTotal?: HeatmapGetTotal;
204
+ /** `rate` values are proportions of their count. Default `number`. */
205
+ valueType?: 'number' | 'rate';
206
+ /** Which totals the viewer sees. Default: every one. */
207
+ shown?: ShownTotals;
125
208
  }
126
209
  /**
127
- * Works out every margin. A total in the row-totals column (a row's, a
128
- * group's, the grand total) uses the row method, so the column means one
129
- * thing; a group's per-column totals use the group column method. Low-sample
130
- * cells count: their data is real, only too thin to show on its own.
210
+ * Works out every margin, then withholds whatever would let someone work
211
+ * out a hidden cell (status `low-sample`), alone or with any combination
212
+ * of the other totals shown, the shown cells and the known bounds. A total
213
+ * in the row-totals column (a row's, a group's, the grand total) uses the
214
+ * row method, so the column means one thing; a group's per-column totals
215
+ * use the group column method. Low-sample cells count: their data is real,
216
+ * only too thin to show on its own. `getTotal` may supply any total
217
+ * instead; the same rule applies.
218
+ *
219
+ * Primary: a total under minCount on its own count, one the kit would work
220
+ * out over a value it never had, and one whose hidden cells hold fewer
221
+ * than minCount records. Secondary: the disclosure audit in
222
+ * heatmap-disclosure.ts, over every total the viewer sees.
131
223
  */
132
- export declare function computeTotals(matrix: readonly ModelCell[][], rows: readonly HeatmapRow[], columnCount: number, rowMethod: HeatmapAggregate, columnMethod: HeatmapAggregate, groupColumnMethod: HeatmapAggregate): HeatmapTotals;
224
+ export declare function computeTotals(matrix: readonly ModelCell[][], rows: readonly HeatmapRow[], columns: readonly HeatmapColumn[], options: TotalsOptions): HeatmapTotals;
133
225
  /** A row the grid body renders. */
134
226
  export type BodyRow = {
135
227
  kind: 'group';
@@ -149,7 +241,7 @@ export declare const dataRowKey: (rowId: string) => string;
149
241
  export declare const groupRowKey: (groupId: string) => string;
150
242
  export declare const FOOTER_ROW_KEY = "f";
151
243
  /** Orders row indexes. Ties keep the props order (a stable sort). */
152
- export declare function sortRowIndexes(indexes: readonly number[], rows: readonly HeatmapRow[], totals: readonly AggregateResult[], sort: HeatmapSortRows, collator: Intl.Collator): number[];
244
+ export declare function sortRowIndexes(indexes: readonly number[], rows: readonly HeatmapRow[], totals: readonly ModelCell[], sort: HeatmapSortRows, collator: Intl.Collator): number[];
153
245
  /** Builds the body: group headers (when grouping) and data rows. */
154
246
  export declare function buildBodyRows(rows: readonly HeatmapRow[], sortedIndexes: readonly number[], groupRows: boolean, collapsed: ReadonlySet<string>): BodyRow[];
155
247
  //# sourceMappingURL=heatmap-model.d.ts.map
@@ -16,11 +16,12 @@ export interface HeatmapTableViewProps {
16
16
  /** Each group's public id, for the table's row ids (never a label). */
17
17
  groupIds: ReadonlyMap<string, string>;
18
18
  describer: HeatmapDescriber;
19
+ /** The grid's totals, withheld ones already reduced to a value-less
20
+ * cell, so the table can show nothing the grid does not. */
19
21
  totals: HeatmapTotals | null;
20
22
  rowTotals: HeatmapAggregate | false;
21
23
  columnTotals: HeatmapAggregate | false;
22
24
  groupColumnMethod: HeatmapAggregate;
23
- minCount?: number;
24
25
  /** The table failed to load or render (announced by the heatmap). */
25
26
  onLoadError?: () => void;
26
27
  }
@@ -31,5 +32,5 @@ export interface HeatmapTableViewProps {
31
32
  * their groups in the grid's order. Labels go through the same privacy
32
33
  * masking as the grid.
33
34
  */
34
- export declare function HeatmapTableView({ title, rowsLabel, rows, columns, matrix, body, grouped, groupIds, describer, totals, rowTotals, columnTotals, groupColumnMethod, minCount, onLoadError, }: HeatmapTableViewProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function HeatmapTableView({ title, rowsLabel, rows, columns, matrix, body, grouped, groupIds, describer, totals, rowTotals, columnTotals, groupColumnMethod, onLoadError, }: HeatmapTableViewProps): import("react/jsx-runtime").JSX.Element;
35
36
  //# sourceMappingURL=heatmap-table-view.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type HeatmapPrivacyScope, type HeatmapValueType } from './heatmap-format';
3
3
  import { type HeatmapSelectionMode } from './heatmap-grid';
4
- import { type HeatmapCellInfo, type HeatmapCellInput, type HeatmapCellKey, type HeatmapColumn, type HeatmapGroup, type HeatmapRow, type HeatmapSortRows } from './heatmap-model';
4
+ import { type HeatmapCellInfo, type HeatmapCellInput, type HeatmapCellKey, type HeatmapColumn, type HeatmapGetTotal, type HeatmapGroup, type HeatmapRow, type HeatmapSortRows } from './heatmap-model';
5
5
  import { type HeatmapAggregate, type HeatmapScale } from './heatmap-scale';
6
6
  import { HeatmapTooltip } from './heatmap-tooltip';
7
7
  import { type HeatmapPalette } from './heatmap-variants';
8
- export type { HeatmapCellData, HeatmapCellInfo, HeatmapCellInput, HeatmapCellKey, HeatmapCellStatus, HeatmapColumn, HeatmapGroup, HeatmapRow, HeatmapSortRows, } from './heatmap-model';
8
+ export type { HeatmapCellData, HeatmapCellInfo, HeatmapCellInput, HeatmapCellKey, HeatmapCellStatus, HeatmapColumn, HeatmapGetTotal, HeatmapGroup, HeatmapRow, HeatmapSortRows, HeatmapTotalScope, } from './heatmap-model';
9
9
  export type { HeatmapAggregate, HeatmapScale } from './heatmap-scale';
10
10
  export type { HeatmapPalette } from './heatmap-variants';
11
11
  export type { HeatmapPrivacyScope, HeatmapValueType } from './heatmap-format';
@@ -85,12 +85,32 @@ export interface HeatmapProps {
85
85
  valueType?: HeatmapValueType;
86
86
  /**
87
87
  * Cells with a count below this render as "too few to show", hatched.
88
- * A display rule, not disclosure control: `read_cell`, `onCellClick`,
89
- * `onSelectionChange` and the totals still carry any value you pass. To
90
- * keep a value off the page, send `{ value: null, count }`: it still
88
+ * For a cell it is a display rule, not disclosure control: `read_cell`,
89
+ * `onCellClick` and `onSelectionChange` still carry any value you pass.
90
+ * To keep a value off the page, send `{ value: null, count }`: it still
91
91
  * renders as too few, and nothing can read a value the kit never had.
92
+ * Totals follow small-number disclosure control: any total that, in any
93
+ * combination with the other totals and cells, would pin down a hidden
94
+ * cell, narrow it below the protection level (half its range, for a
95
+ * rate), or determine a set of hidden cells with fewer than minCount
96
+ * records, is withheld too, and carries no value anywhere. Every total
97
+ * the data could show is audited, drawn or not. See `getTotal` and
98
+ * heatmap.mdx.
92
99
  */
93
100
  minCount?: number;
101
+ /**
102
+ * Supplies a total: a row's, a column's, a group's, a group header cell
103
+ * or the grand total, as `scope.kind` says. Return a cell input (`null`
104
+ * for no total), or `undefined` to let the kit work it out from the
105
+ * cells. Needed when you withhold values (`value: null`): the kit cannot
106
+ * add up a value it never had, so it withholds any total it would get
107
+ * wrong. `minCount` and the disclosure audit apply to a supplied total
108
+ * exactly as to a worked-out one, which must be the exact count-weighted
109
+ * mean (or sum) of its cells. Asked for every row, every column and the
110
+ * grand total, and, whenever rows carry a group, every group and group
111
+ * header cell, drawn or not. Keep it stable (`useCallback`).
112
+ */
113
+ getTotal?: HeatmapGetTotal;
94
114
  /** Formats a value. Default: Intl in the active locale. Keep it stable. */
95
115
  valueFormatter?: (value: number) => string;
96
116
  /** Print the value inside each cell. */
@@ -100,18 +120,24 @@ export interface HeatmapProps {
100
120
  /**
101
121
  * A totals column at the row ends. A mean weights by count. Everything in
102
122
  * that column uses this method: each row's total, each group's and the
103
- * grand total in the corner.
123
+ * grand total in the corner. With `minCount`, a mean of plain numbers
124
+ * (`valueType="number"`) is not audited for hidden cells: every such
125
+ * average that holds one is withheld, so use `sum` for plain numbers.
104
126
  */
105
127
  rowTotals?: HeatmapAggregate | false;
106
128
  /**
107
129
  * A totals row under the columns. A mean weights by count. A group
108
130
  * header's per-column totals use this method too (else `rowTotals`).
131
+ * With `minCount`, a mean of plain numbers is withheld wherever it holds
132
+ * a hidden cell, as for `rowTotals`: use `sum` for plain numbers.
109
133
  */
110
134
  columnTotals?: HeatmapAggregate | false;
111
135
  /**
112
136
  * Row order (within each group). Controlled when set. In privacy mode
113
137
  * `label` keeps the given order: sorting by masked names would reveal
114
- * their order.
138
+ * their order. A sort by total reads each row's total by the
139
+ * `rowTotals` method (else the `columnTotals` one, else mean); a row
140
+ * whose total is withheld sorts last.
115
141
  */
116
142
  sortRows?: HeatmapSortRows;
117
143
  /** Initial row order when uncontrolled. Default `none`. */
@@ -1,5 +1,5 @@
1
1
  export { Heatmap } from './heatmap';
2
- export type { HeatmapProps, HeatmapHandle, HeatmapView, HeatmapCellReading, HeatmapCellData, HeatmapCellInfo, HeatmapCellInput, HeatmapCellKey, HeatmapCellStatus, HeatmapColumn, HeatmapGroup, HeatmapRow, HeatmapSortRows, HeatmapAggregate, HeatmapScale, HeatmapPalette, HeatmapValueType, HeatmapSelectionMode, HeatmapPrivacyScope, HeatmapTooltipContext, } from './heatmap';
2
+ export type { HeatmapProps, HeatmapHandle, HeatmapView, HeatmapCellReading, HeatmapCellData, HeatmapCellInfo, HeatmapCellInput, HeatmapCellKey, HeatmapCellStatus, HeatmapColumn, HeatmapGetTotal, HeatmapGroup, HeatmapRow, HeatmapSortRows, HeatmapTotalScope, HeatmapAggregate, HeatmapScale, HeatmapPalette, HeatmapValueType, HeatmapSelectionMode, HeatmapPrivacyScope, HeatmapTooltipContext, } from './heatmap';
3
3
  export { HeatmapLegend } from './heatmap-legend';
4
4
  export type { HeatmapLegendProps } from './heatmap-legend';
5
5
  export { HeatmapTooltip } from './heatmap-tooltip';
@@ -1,4 +1,4 @@
1
- import { H as t, a as p, b as m, h as o } from "../../_chunks/heatmap-BxRHM8Et.js";
1
+ import { H as t, a as p, b as m, h as o } from "../../_chunks/heatmap-C1TeC7wT.js";
2
2
  export {
3
3
  t as Heatmap,
4
4
  p as HeatmapLegend,
@@ -1553,6 +1553,7 @@ export declare const arUi: {
1553
1553
  readonly allCells: "كل الخلايا";
1554
1554
  readonly noData: "لا توجد بيانات";
1555
1555
  readonly lowSample: "بيانات غير كافية";
1556
+ readonly totalWithheld: "مخفي لحماية الأعداد الصغيرة";
1556
1557
  readonly countOf: "{{part}} من {{total}}";
1557
1558
  readonly records_zero: "عدد السجلات: {{formatted}}";
1558
1559
  readonly records_one: "عدد السجلات: {{formatted}}";
@@ -1581,6 +1582,7 @@ export declare const arUi: {
1581
1582
  readonly noData: "لا توجد بيانات";
1582
1583
  readonly lowSample: "بيانات غير كافية";
1583
1584
  readonly lowSampleUnder: "بيانات غير كافية (أقل من {{value}})";
1585
+ readonly totalWithheld: "الإجماليات مخفية لحماية الأعداد الصغيرة";
1584
1586
  readonly descriptionBands_zero: "مقياس الألوان مقسّم إلى فئات عددها {{formatted}}، وحدود التقسيم عند {{edges}}.";
1585
1587
  readonly descriptionBands_one: "مقياس الألوان مقسّم إلى فئات عددها {{formatted}}، وحدود التقسيم عند {{edges}}.";
1586
1588
  readonly descriptionBands_two: "مقياس الألوان مقسّم إلى فئات عددها {{formatted}}، وحدود التقسيم عند {{edges}}.";
@@ -1548,6 +1548,7 @@ const e = {
1548
1548
  allCells: "كل الخلايا",
1549
1549
  noData: "لا توجد بيانات",
1550
1550
  lowSample: "بيانات غير كافية",
1551
+ totalWithheld: "مخفي لحماية الأعداد الصغيرة",
1551
1552
  countOf: "{{part}} من {{total}}",
1552
1553
  records_zero: "عدد السجلات: {{formatted}}",
1553
1554
  records_one: "عدد السجلات: {{formatted}}",
@@ -1576,6 +1577,7 @@ const e = {
1576
1577
  noData: "لا توجد بيانات",
1577
1578
  lowSample: "بيانات غير كافية",
1578
1579
  lowSampleUnder: "بيانات غير كافية (أقل من {{value}})",
1580
+ totalWithheld: "الإجماليات مخفية لحماية الأعداد الصغيرة",
1579
1581
  descriptionBands_zero: "مقياس الألوان مقسّم إلى فئات عددها {{formatted}}، وحدود التقسيم عند {{edges}}.",
1580
1582
  descriptionBands_one: "مقياس الألوان مقسّم إلى فئات عددها {{formatted}}، وحدود التقسيم عند {{edges}}.",
1581
1583
  descriptionBands_two: "مقياس الألوان مقسّم إلى فئات عددها {{formatted}}، وحدود التقسيم عند {{edges}}.",
@@ -1549,6 +1549,7 @@ export declare const deUi: {
1549
1549
  readonly allCells: "Alle Zellen";
1550
1550
  readonly noData: "keine Daten";
1551
1551
  readonly lowSample: "nicht genügend Daten";
1552
+ readonly totalWithheld: "ausgeblendet zum Schutz kleiner Zahlen";
1552
1553
  readonly countOf: "{{part}} von {{total}}";
1553
1554
  readonly records_zero: "{{formatted}} Datensätze";
1554
1555
  readonly records_one: "{{formatted}} Datensatz";
@@ -1577,6 +1578,7 @@ export declare const deUi: {
1577
1578
  readonly noData: "Keine Daten";
1578
1579
  readonly lowSample: "Nicht genügend Daten";
1579
1580
  readonly lowSampleUnder: "Nicht genügend Daten (weniger als {{value}})";
1581
+ readonly totalWithheld: "Gesamtwerte ausgeblendet zum Schutz kleiner Zahlen";
1580
1582
  readonly descriptionBands_zero: "Farbskala mit {{formatted}} Stufen, Grenzen bei {{edges}}.";
1581
1583
  readonly descriptionBands_one: "Farbskala mit {{formatted}} Stufe, Grenzen bei {{edges}}.";
1582
1584
  readonly descriptionBands_two: "Farbskala mit {{formatted}} Stufen, Grenzen bei {{edges}}.";
@@ -1544,6 +1544,7 @@ const e = {
1544
1544
  allCells: "Alle Zellen",
1545
1545
  noData: "keine Daten",
1546
1546
  lowSample: "nicht genügend Daten",
1547
+ totalWithheld: "ausgeblendet zum Schutz kleiner Zahlen",
1547
1548
  countOf: "{{part}} von {{total}}",
1548
1549
  records_zero: "{{formatted}} Datensätze",
1549
1550
  records_one: "{{formatted}} Datensatz",
@@ -1572,6 +1573,7 @@ const e = {
1572
1573
  noData: "Keine Daten",
1573
1574
  lowSample: "Nicht genügend Daten",
1574
1575
  lowSampleUnder: "Nicht genügend Daten (weniger als {{value}})",
1576
+ totalWithheld: "Gesamtwerte ausgeblendet zum Schutz kleiner Zahlen",
1575
1577
  descriptionBands_zero: "Farbskala mit {{formatted}} Stufen, Grenzen bei {{edges}}.",
1576
1578
  descriptionBands_one: "Farbskala mit {{formatted}} Stufe, Grenzen bei {{edges}}.",
1577
1579
  descriptionBands_two: "Farbskala mit {{formatted}} Stufen, Grenzen bei {{edges}}.",
@@ -1546,6 +1546,7 @@ export declare const elUi: {
1546
1546
  readonly allCells: "Όλα τα κελιά";
1547
1547
  readonly noData: "χωρίς δεδομένα";
1548
1548
  readonly lowSample: "ανεπαρκή δεδομένα";
1549
+ readonly totalWithheld: "κρυμμένο για την προστασία μικρών αριθμών";
1549
1550
  readonly countOf: "{{part}} από {{total}}";
1550
1551
  readonly records_zero: "{{formatted}} εγγραφές";
1551
1552
  readonly records_one: "{{formatted}} εγγραφή";
@@ -1574,6 +1575,7 @@ export declare const elUi: {
1574
1575
  readonly noData: "Δεν υπάρχουν δεδομένα";
1575
1576
  readonly lowSample: "Ανεπαρκή δεδομένα";
1576
1577
  readonly lowSampleUnder: "Ανεπαρκή δεδομένα (κάτω από {{value}})";
1578
+ readonly totalWithheld: "Σύνολα κρυμμένα για την προστασία μικρών αριθμών";
1577
1579
  readonly descriptionBands_zero: "Χρωματική κλίμακα με {{formatted}} ζώνες, όρια στα {{edges}}.";
1578
1580
  readonly descriptionBands_one: "Χρωματική κλίμακα με {{formatted}} ζώνη, όρια στα {{edges}}.";
1579
1581
  readonly descriptionBands_two: "Χρωματική κλίμακα με {{formatted}} ζώνες, όρια στα {{edges}}.";
@@ -1544,6 +1544,7 @@ const e = {
1544
1544
  allCells: "Όλα τα κελιά",
1545
1545
  noData: "χωρίς δεδομένα",
1546
1546
  lowSample: "ανεπαρκή δεδομένα",
1547
+ totalWithheld: "κρυμμένο για την προστασία μικρών αριθμών",
1547
1548
  countOf: "{{part}} από {{total}}",
1548
1549
  records_zero: "{{formatted}} εγγραφές",
1549
1550
  records_one: "{{formatted}} εγγραφή",
@@ -1572,6 +1573,7 @@ const e = {
1572
1573
  noData: "Δεν υπάρχουν δεδομένα",
1573
1574
  lowSample: "Ανεπαρκή δεδομένα",
1574
1575
  lowSampleUnder: "Ανεπαρκή δεδομένα (κάτω από {{value}})",
1576
+ totalWithheld: "Σύνολα κρυμμένα για την προστασία μικρών αριθμών",
1575
1577
  descriptionBands_zero: "Χρωματική κλίμακα με {{formatted}} ζώνες, όρια στα {{edges}}.",
1576
1578
  descriptionBands_one: "Χρωματική κλίμακα με {{formatted}} ζώνη, όρια στα {{edges}}.",
1577
1579
  descriptionBands_two: "Χρωματική κλίμακα με {{formatted}} ζώνες, όρια στα {{edges}}.",
@@ -1579,6 +1579,7 @@ export declare const enUi: {
1579
1579
  readonly allCells: "All cells";
1580
1580
  readonly noData: "no data";
1581
1581
  readonly lowSample: "too few to show";
1582
+ readonly totalWithheld: "hidden to protect small numbers";
1582
1583
  readonly countOf: "{{part}} of {{total}}";
1583
1584
  readonly records_zero: "{{formatted}} records";
1584
1585
  readonly records_one: "{{formatted}} record";
@@ -1607,6 +1608,7 @@ export declare const enUi: {
1607
1608
  readonly noData: "No data";
1608
1609
  readonly lowSample: "Too few to show";
1609
1610
  readonly lowSampleUnder: "Too few to show (under {{value}})";
1611
+ readonly totalWithheld: "Totals hidden to protect small numbers";
1610
1612
  readonly descriptionBands_zero: "Colour scale in {{formatted}} bands, cut at {{edges}}.";
1611
1613
  readonly descriptionBands_one: "Colour scale in {{formatted}} band, cut at {{edges}}.";
1612
1614
  readonly descriptionBands_two: "Colour scale in {{formatted}} bands, cut at {{edges}}.";
@@ -1561,6 +1561,7 @@ const e = {
1561
1561
  allCells: "All cells",
1562
1562
  noData: "no data",
1563
1563
  lowSample: "too few to show",
1564
+ totalWithheld: "hidden to protect small numbers",
1564
1565
  countOf: "{{part}} of {{total}}",
1565
1566
  records_zero: "{{formatted}} records",
1566
1567
  records_one: "{{formatted}} record",
@@ -1589,6 +1590,7 @@ const e = {
1589
1590
  noData: "No data",
1590
1591
  lowSample: "Too few to show",
1591
1592
  lowSampleUnder: "Too few to show (under {{value}})",
1593
+ totalWithheld: "Totals hidden to protect small numbers",
1592
1594
  descriptionBands_zero: "Colour scale in {{formatted}} bands, cut at {{edges}}.",
1593
1595
  descriptionBands_one: "Colour scale in {{formatted}} band, cut at {{edges}}.",
1594
1596
  descriptionBands_two: "Colour scale in {{formatted}} bands, cut at {{edges}}.",
@@ -1547,6 +1547,7 @@ export declare const esUi: {
1547
1547
  readonly allCells: "Todas las celdas";
1548
1548
  readonly noData: "sin datos";
1549
1549
  readonly lowSample: "datos insuficientes";
1550
+ readonly totalWithheld: "oculto para proteger cifras pequeñas";
1550
1551
  readonly countOf: "{{part}} de {{total}}";
1551
1552
  readonly records_zero: "{{formatted}} registros";
1552
1553
  readonly records_one: "{{formatted}} registro";
@@ -1575,6 +1576,7 @@ export declare const esUi: {
1575
1576
  readonly noData: "Sin datos";
1576
1577
  readonly lowSample: "Datos insuficientes";
1577
1578
  readonly lowSampleUnder: "Datos insuficientes (menos de {{value}})";
1579
+ readonly totalWithheld: "Totales ocultos para proteger cifras pequeñas";
1578
1580
  readonly descriptionBands_zero: "Escala de color en {{formatted}} intervalos, con cortes en {{edges}}.";
1579
1581
  readonly descriptionBands_one: "Escala de color en {{formatted}} intervalo, con cortes en {{edges}}.";
1580
1582
  readonly descriptionBands_two: "Escala de color en {{formatted}} intervalos, con cortes en {{edges}}.";
@@ -1545,6 +1545,7 @@ const e = {
1545
1545
  allCells: "Todas las celdas",
1546
1546
  noData: "sin datos",
1547
1547
  lowSample: "datos insuficientes",
1548
+ totalWithheld: "oculto para proteger cifras pequeñas",
1548
1549
  countOf: "{{part}} de {{total}}",
1549
1550
  records_zero: "{{formatted}} registros",
1550
1551
  records_one: "{{formatted}} registro",
@@ -1573,6 +1574,7 @@ const e = {
1573
1574
  noData: "Sin datos",
1574
1575
  lowSample: "Datos insuficientes",
1575
1576
  lowSampleUnder: "Datos insuficientes (menos de {{value}})",
1577
+ totalWithheld: "Totales ocultos para proteger cifras pequeñas",
1576
1578
  descriptionBands_zero: "Escala de color en {{formatted}} intervalos, con cortes en {{edges}}.",
1577
1579
  descriptionBands_one: "Escala de color en {{formatted}} intervalo, con cortes en {{edges}}.",
1578
1580
  descriptionBands_two: "Escala de color en {{formatted}} intervalos, con cortes en {{edges}}.",
@@ -1547,6 +1547,7 @@ export declare const frUi: {
1547
1547
  readonly allCells: "Toutes les cellules";
1548
1548
  readonly noData: "aucune donnée";
1549
1549
  readonly lowSample: "données insuffisantes";
1550
+ readonly totalWithheld: "masqué pour protéger les petits nombres";
1550
1551
  readonly countOf: "{{part}} sur {{total}}";
1551
1552
  readonly records_zero: "{{formatted}} enregistrement";
1552
1553
  readonly records_one: "{{formatted}} enregistrement";
@@ -1575,6 +1576,7 @@ export declare const frUi: {
1575
1576
  readonly noData: "Aucune donnée";
1576
1577
  readonly lowSample: "Données insuffisantes";
1577
1578
  readonly lowSampleUnder: "Données insuffisantes (moins de {{value}})";
1579
+ readonly totalWithheld: "Totaux masqués pour protéger les petits nombres";
1578
1580
  readonly descriptionBands_zero: "Échelle de couleurs en {{formatted}} tranche, seuils à {{edges}}.";
1579
1581
  readonly descriptionBands_one: "Échelle de couleurs en {{formatted}} tranche, seuils à {{edges}}.";
1580
1582
  readonly descriptionBands_two: "Échelle de couleurs en {{formatted}} tranches, seuils à {{edges}}.";
@@ -1545,6 +1545,7 @@ const e = {
1545
1545
  allCells: "Toutes les cellules",
1546
1546
  noData: "aucune donnée",
1547
1547
  lowSample: "données insuffisantes",
1548
+ totalWithheld: "masqué pour protéger les petits nombres",
1548
1549
  countOf: "{{part}} sur {{total}}",
1549
1550
  records_zero: "{{formatted}} enregistrement",
1550
1551
  records_one: "{{formatted}} enregistrement",
@@ -1573,6 +1574,7 @@ const e = {
1573
1574
  noData: "Aucune donnée",
1574
1575
  lowSample: "Données insuffisantes",
1575
1576
  lowSampleUnder: "Données insuffisantes (moins de {{value}})",
1577
+ totalWithheld: "Totaux masqués pour protéger les petits nombres",
1576
1578
  descriptionBands_zero: "Échelle de couleurs en {{formatted}} tranche, seuils à {{edges}}.",
1577
1579
  descriptionBands_one: "Échelle de couleurs en {{formatted}} tranche, seuils à {{edges}}.",
1578
1580
  descriptionBands_two: "Échelle de couleurs en {{formatted}} tranches, seuils à {{edges}}.",