@lilt-ui/charts 0.12.1 → 0.13.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.
- package/CHANGELOG.md +20 -0
- package/README.md +0 -45
- package/dist/cards/arc-bridges-card.d.ts +17 -0
- package/dist/cards/area-chart-card.d.ts +1 -10
- package/dist/cards/block-city-card.d.ts +21 -0
- package/dist/cards/calendar-heatmap-card.d.ts +31 -1
- package/dist/cards/cartesian-card.d.ts +8 -26
- package/dist/cards/chart-card.d.ts +1 -12
- package/dist/cards/chord-loom-card.d.ts +17 -0
- package/dist/cards/circle-archipelago-card.d.ts +9 -0
- package/dist/cards/cluster-constellation-card.d.ts +16 -0
- package/dist/cards/comparison-forms.d.ts +30 -0
- package/dist/cards/composition-forms.d.ts +10 -0
- package/dist/cards/contour-islands-card.d.ts +25 -0
- package/dist/cards/density-contours.d.ts +3 -0
- package/dist/cards/distribution-forms.d.ts +37 -0
- package/dist/cards/event-helix-card.d.ts +26 -0
- package/dist/cards/helix-ribbons-card.d.ts +14 -0
- package/dist/cards/hex-city-card.d.ts +25 -0
- package/dist/cards/hierarchy-layouts.d.ts +21 -0
- package/dist/cards/horizon-folds-card.d.ts +10 -0
- package/dist/cards/horizontal-bar-chart-card.d.ts +1 -1
- package/dist/cards/intersection-towers-card.d.ts +9 -0
- package/dist/cards/line-chart-card.d.ts +4 -11
- package/dist/cards/link-readings.d.ts +26 -0
- package/dist/cards/marimekko-blocks-card.d.ts +10 -0
- package/dist/cards/observations-card.d.ts +45 -2
- package/dist/cards/parallel-ribbons-card.d.ts +27 -0
- package/dist/cards/prism-grid.d.ts +58 -0
- package/dist/cards/prism.d.ts +42 -0
- package/dist/cards/progress-forms.d.ts +21 -0
- package/dist/cards/rank-ribbons-card.d.ts +22 -0
- package/dist/cards/ridgeline-card.d.ts +24 -0
- package/dist/cards/scatter-chart-card.d.ts +19 -1
- package/dist/cards/sculpted-geometry.d.ts +18 -0
- package/dist/cards/skyline-card.d.ts +12 -0
- package/dist/cards/spatial-composition-layouts.d.ts +14 -0
- package/dist/cards/spatial-geometry.d.ts +34 -0
- package/dist/cards/spatial-hierarchy.d.ts +10 -0
- package/dist/cards/spatial-point-layouts.d.ts +16 -0
- package/dist/cards/spatial-series-layouts.d.ts +12 -0
- package/dist/cards/spiral-year-card.d.ts +17 -0
- package/dist/cards/sunburst-terraces-card.d.ts +10 -0
- package/dist/cards/ternary-prism-card.d.ts +13 -0
- package/dist/cards/terrain-card.d.ts +21 -0
- package/dist/cards/treemap-chart-card.d.ts +3 -1
- package/dist/cards/trend-forms.d.ts +11 -0
- package/dist/cards/voxel-cloud-card.d.ts +16 -0
- package/dist/cards/voxel-waffle-card.d.ts +18 -0
- package/dist/cards/wind-rose-card.d.ts +11 -0
- package/dist/engine/domains.d.ts +0 -1
- package/dist/finance.js +310 -311
- package/dist/index.d.ts +39 -4
- package/dist/index.js +8919 -2948
- package/dist/interaction/comparison-layer.d.ts +3 -1
- package/dist/{skeleton-block-ClcPgFdK.js → skeleton-block-BPoUJvcR.js} +3689 -2959
- package/dist/styles.css +1 -1
- package/package.json +1 -6
- package/dist/report-context-DLA3I57K.js +0 -1100
- package/dist/watch/board/board-state.d.ts +0 -72
- package/dist/watch/board/board-toast.d.ts +0 -19
- package/dist/watch/board/chart-board.d.ts +0 -93
- package/dist/watch/board/report-context.d.ts +0 -3
- package/dist/watch/engine/describe.d.ts +0 -9
- package/dist/watch/engine/explain.d.ts +0 -48
- package/dist/watch/engine/normal.d.ts +0 -114
- package/dist/watch/engine/robust.d.ts +0 -7
- package/dist/watch/engine/rules.d.ts +0 -22
- package/dist/watch/engine/status.d.ts +0 -39
- package/dist/watch/index.d.ts +0 -14
- package/dist/watch/normal-layer.d.ts +0 -18
- package/dist/watch.d.ts +0 -2
- package/dist/watch.js +0 -636
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare function linkReadings<Row>(data: readonly Row[], source: string, target: string, value: string): {
|
|
2
|
+
names: string[];
|
|
3
|
+
links: {
|
|
4
|
+
id: string;
|
|
5
|
+
source: string;
|
|
6
|
+
target: string;
|
|
7
|
+
value: number | null;
|
|
8
|
+
datum: Row;
|
|
9
|
+
}[];
|
|
10
|
+
error: string;
|
|
11
|
+
} | {
|
|
12
|
+
names: string[];
|
|
13
|
+
links: {
|
|
14
|
+
id: string;
|
|
15
|
+
source: string;
|
|
16
|
+
target: string;
|
|
17
|
+
value: number | null;
|
|
18
|
+
datum: Row;
|
|
19
|
+
}[];
|
|
20
|
+
error?: undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare const placeholderLinks: {
|
|
23
|
+
source: string;
|
|
24
|
+
target: string;
|
|
25
|
+
value: number;
|
|
26
|
+
}[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps } from './observations-card';
|
|
3
|
+
export { marimekkoBlocksLayout } from './spatial-composition-layouts';
|
|
4
|
+
export interface MarimekkoBlocksCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
5
|
+
category: TextKey<Row>;
|
|
6
|
+
segment: TextKey<Row>;
|
|
7
|
+
value: Key;
|
|
8
|
+
gap?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function MarimekkoBlocksCard<Row, const Key extends NumericKey<Row>>({ category, segment, value, gap, color, height, depth, ...props }: MarimekkoBlocksCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { CardLegend, ChartLegendSwatch, ChartLoadingStyle, ChartEmptyState, CategorySelection } from '../types';
|
|
3
3
|
import { ChartCardProps } from './chart-card';
|
|
4
|
+
import { ObservationPrism } from './prism';
|
|
4
5
|
import { CardRange } from './cartesian-card';
|
|
6
|
+
export type { ObservationPrism } from './prism';
|
|
5
7
|
/** Shared presentation options for observation-based cards. */
|
|
6
8
|
export interface ObservationsCardProps<Row> extends Omit<ChartCardProps, 'children'> {
|
|
7
9
|
title?: string;
|
|
@@ -44,14 +46,52 @@ export interface ObservationMark<Row> {
|
|
|
44
46
|
height: number;
|
|
45
47
|
color: string;
|
|
46
48
|
group?: string;
|
|
49
|
+
/** Neighbour mark IDs retained when this mark is inspected. */
|
|
50
|
+
related?: readonly string[];
|
|
47
51
|
text?: string;
|
|
48
52
|
detail?: string;
|
|
49
|
-
|
|
53
|
+
/** Extra context alongside the formatted numeric value; detail instead replaces it. */
|
|
54
|
+
description?: string;
|
|
55
|
+
shape?: 'dot' | 'bar' | 'tile' | 'prism' | 'point' | 'ribbon';
|
|
56
|
+
/** Closed SVG silhouette in local coordinates; also used for exact pointer hit testing. */
|
|
57
|
+
ribbon?: string;
|
|
58
|
+
/** Degrees clockwise about the mark's bottom centre, so a bar can point away from a centre. */
|
|
59
|
+
rotate?: number;
|
|
60
|
+
/** Stacking order where hit areas overlap: higher layers sit in front. */
|
|
61
|
+
layer?: number;
|
|
62
|
+
/** 0 to 1: where the mark falls in the order the chart builds, for entry and skeleton waves. */
|
|
63
|
+
wave?: number;
|
|
64
|
+
/** `grow` rises from the mark's foot; `drop` falls into place from above. */
|
|
65
|
+
enter?: 'grow' | 'drop';
|
|
66
|
+
/** A square prism seen from above, filling the mark's box: its top sits `lift` above the floor. */
|
|
67
|
+
prism?: ObservationPrism;
|
|
50
68
|
missing?: boolean;
|
|
51
69
|
future?: boolean;
|
|
52
70
|
}
|
|
53
71
|
export interface ObservationScene<Row> {
|
|
54
72
|
marks: ObservationMark<Row>[];
|
|
73
|
+
/** Keep every segment of an inspected series lit. */
|
|
74
|
+
highlightGroup?: boolean;
|
|
75
|
+
/** A family-specific resting summary, calculated from accepted data. */
|
|
76
|
+
headline?: number | null;
|
|
77
|
+
/** Shapes painted under the marks, in order; `group` mutes with the active mark's group. */
|
|
78
|
+
paths?: {
|
|
79
|
+
id: string;
|
|
80
|
+
d: string;
|
|
81
|
+
fill?: string;
|
|
82
|
+
stroke?: string;
|
|
83
|
+
group?: string;
|
|
84
|
+
/** Endpoint IDs: this path stays lit when either endpoint is inspected. */
|
|
85
|
+
related?: readonly string[];
|
|
86
|
+
/** `rise` grows up from the shape's baseline; `draw` strokes along the path. */
|
|
87
|
+
enter?: 'rise' | 'draw';
|
|
88
|
+
/** 0 to 1: the order shapes build in. */
|
|
89
|
+
wave?: number;
|
|
90
|
+
/** The shape it grows from on entry, such as a surface laid flat on its floor. */
|
|
91
|
+
from?: string;
|
|
92
|
+
/** 0 lit to 1 in shade, so the placeholder keeps the scene's light. */
|
|
93
|
+
shade?: number;
|
|
94
|
+
}[];
|
|
55
95
|
labels?: {
|
|
56
96
|
x: number;
|
|
57
97
|
y: number;
|
|
@@ -64,6 +104,7 @@ export interface ObservationScene<Row> {
|
|
|
64
104
|
label: string;
|
|
65
105
|
value: number | null;
|
|
66
106
|
detail?: string;
|
|
107
|
+
description?: string;
|
|
67
108
|
}[];
|
|
68
109
|
groups?: {
|
|
69
110
|
id: string;
|
|
@@ -80,8 +121,10 @@ export declare const seriesColor: (index: number) => string;
|
|
|
80
121
|
export declare const readField: (row: unknown, key: string) => unknown;
|
|
81
122
|
export declare const readNumber: (row: unknown, key: string) => number | null;
|
|
82
123
|
/** Private shell: every family uses the same inspection, card and skeleton lifecycle. */
|
|
83
|
-
export declare function ObservationsCard<Row>({ title, header, data: suppliedData, height, depth, headline, aggregate, delta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue, legend, legendSwatch, loading, loadingStyle, empty: emptyState, onSelectionChange, renderReadout, motion, className, color, layout, placeholder, family, ...frame }: ObservationsCardProps<Row> & {
|
|
124
|
+
export declare function ObservationsCard<Row>({ title, header, data: suppliedData, height, depth, headline, aggregate, delta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue, legend, legendSwatch, loading, loadingStyle, empty: emptyState, onSelectionChange, renderReadout, motion, className, color, layout, placeholder, family, scope, renderControls, ...frame }: ObservationsCardProps<Row> & {
|
|
84
125
|
family: string;
|
|
126
|
+
scope?: string;
|
|
127
|
+
renderControls?: (scene: ObservationScene<Row>, active: ObservationMark<Row> | undefined) => ReactNode;
|
|
85
128
|
layout: (data: readonly Row[], width: number, height: number) => ObservationScene<Row>;
|
|
86
129
|
placeholder: (width: number, height: number) => ObservationScene<Row>;
|
|
87
130
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
3
|
+
export interface ParallelRibbonsCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'aggregate'> {
|
|
4
|
+
label: TextKey<Row>;
|
|
5
|
+
/** Two or more numeric keys, ordered left to right. Each axis has its own scale. */
|
|
6
|
+
metrics: readonly Key[];
|
|
7
|
+
/** Optional display names for the metric keys. */
|
|
8
|
+
metricLabels?: Partial<Record<Key, string>>;
|
|
9
|
+
/** Fixed domains must contain all readings on their axis. */
|
|
10
|
+
domains?: Partial<Record<Key, readonly [number, number]>>;
|
|
11
|
+
/** Ribbon width in pixels, 2–14. Default 5. */
|
|
12
|
+
thickness?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const placeholderProfiles: {
|
|
15
|
+
name: string;
|
|
16
|
+
speed: number;
|
|
17
|
+
quality: number;
|
|
18
|
+
cost: number;
|
|
19
|
+
reach: number;
|
|
20
|
+
}[];
|
|
21
|
+
export declare function parallelRibbonsLayout<Row>(data: readonly Row[], label: string, metrics: readonly string[], width: number, height: number, options?: {
|
|
22
|
+
thickness?: number;
|
|
23
|
+
color?: string;
|
|
24
|
+
metricLabels?: Readonly<Record<string, string | undefined>>;
|
|
25
|
+
domains?: Readonly<Record<string, readonly [number, number] | undefined>>;
|
|
26
|
+
}): ObservationScene<Row>;
|
|
27
|
+
export declare function ParallelRibbonsCard<Row, const Key extends NumericKey<Row>>({ label, metrics, metricLabels, domains, thickness, color, height, ...props }: ParallelRibbonsCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ObservationMark, ObservationScene } from './observations-card';
|
|
2
|
+
/** One grid cell for a prism layout: everything but its geometry. */
|
|
3
|
+
export interface PrismCell<Row> extends Omit<ObservationMark<Row>, 'x' | 'y' | 'width' | 'height' | 'shape' | 'prism'> {
|
|
4
|
+
column: number;
|
|
5
|
+
row: number;
|
|
6
|
+
/** Position of the value in the domain, 0 to 1; ignored for missing and future cells. */
|
|
7
|
+
share: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PrismGridOptions {
|
|
10
|
+
/** The tallest cell rises this many cell lengths above the floor. Default 5. */
|
|
11
|
+
rise?: number;
|
|
12
|
+
/** Space between neighbouring prisms as a share of a cell, 0 to 0.6. Default 0.2. */
|
|
13
|
+
gap?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Columns recede shallowly to the right and rows more steeply toward the viewer, so a long grid
|
|
17
|
+
* reads as a low street rather than a steep isometric strip.
|
|
18
|
+
*/
|
|
19
|
+
export declare const COLUMN_AXIS: readonly [number, number];
|
|
20
|
+
export declare const ROW_AXIS: readonly [number, number];
|
|
21
|
+
/** Screen offset of a floor point `x` along the columns and `y` along the rows, `z` up. */
|
|
22
|
+
export declare const project: (x: number, y: number, z?: number) => readonly [number, number];
|
|
23
|
+
/**
|
|
24
|
+
* Stands a grid of cells up as square prisms seen from above and in front. Height and color both
|
|
25
|
+
* carry the value; missing cells keep a low slab on the floor and future cells lie flat as
|
|
26
|
+
* outlines. Column labels run along the front edge, row labels along the right end.
|
|
27
|
+
*/
|
|
28
|
+
export declare function prismGridLayout<Row>(cells: readonly PrismCell<Row>[], columns: number, rows: number, width: number, height: number, { rise, gap, columnLabels, rowLabels, note, }: PrismGridOptions & {
|
|
29
|
+
columnLabels?: readonly {
|
|
30
|
+
column: number;
|
|
31
|
+
text: string;
|
|
32
|
+
}[];
|
|
33
|
+
rowLabels?: readonly {
|
|
34
|
+
row: number;
|
|
35
|
+
text: string;
|
|
36
|
+
}[];
|
|
37
|
+
note?: string;
|
|
38
|
+
}): ObservationScene<Row>;
|
|
39
|
+
/** A prism described on the floor: its footprint in floor units, where it starts and how tall. */
|
|
40
|
+
export interface FloorPrism<Row> extends Omit<ObservationMark<Row>, 'x' | 'y' | 'width' | 'height' | 'shape' | 'prism'> {
|
|
41
|
+
footprint: readonly (readonly [number, number])[];
|
|
42
|
+
/** Height of its floor and of the prism itself, in floor units. */
|
|
43
|
+
base: number;
|
|
44
|
+
rise: number;
|
|
45
|
+
depth: number;
|
|
46
|
+
wave: number;
|
|
47
|
+
}
|
|
48
|
+
/** Scales a set of floor prisms to fill the card, centred, and turns each into a prism mark. */
|
|
49
|
+
export declare function fitFloorPrisms<Row>(items: readonly FloorPrism<Row>[], width: number, height: number, { headroom, below }?: {
|
|
50
|
+
headroom?: number;
|
|
51
|
+
below?: number;
|
|
52
|
+
}): {
|
|
53
|
+
marks: ObservationMark<Row>[];
|
|
54
|
+
scale: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
toScreen: (x: number, y: number, z?: number) => readonly [number, number];
|
|
58
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type Point = readonly [number, number];
|
|
2
|
+
/**
|
|
3
|
+
* A prism standing on the floor, seen from above and in front. `top` is its convex top face in
|
|
4
|
+
* the mark's box, already lifted; the floor sits `lift` pixels below it.
|
|
5
|
+
*/
|
|
6
|
+
export interface ObservationPrism {
|
|
7
|
+
top: readonly Point[];
|
|
8
|
+
/** Height above the floor in pixels. */
|
|
9
|
+
lift: number;
|
|
10
|
+
/** Painter's order: nearer prisms have a larger depth and cover farther ones. */
|
|
11
|
+
depth: number;
|
|
12
|
+
/** 0 at the back of the scene to 1 at the front, for the rising stagger. */
|
|
13
|
+
wave: number;
|
|
14
|
+
}
|
|
15
|
+
/** The prism's silhouette in its box, for hit testing and the loading mask. */
|
|
16
|
+
export declare const prismOutline: ({ top, lift }: ObservationPrism) => Point[];
|
|
17
|
+
/**
|
|
18
|
+
* The side faces a viewer above and in front can see: edges whose outward normal points down the
|
|
19
|
+
* screen. `shade` runs from 0 for a face turned to the light (left) to 1 for one turned away.
|
|
20
|
+
*/
|
|
21
|
+
export declare function visibleFaces({ top }: ObservationPrism): {
|
|
22
|
+
left: Point;
|
|
23
|
+
width: number;
|
|
24
|
+
angle: number;
|
|
25
|
+
shade: number;
|
|
26
|
+
}[];
|
|
27
|
+
/**
|
|
28
|
+
* Lit from above and to the left, like Lilt's isometric bars: the top is brightest, faces turned
|
|
29
|
+
* to the light are lit and faces turned away fall into shade. Each side is a skewed rectangle so
|
|
30
|
+
* it can rise from the floor on entry while the top travels up with it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Prism({ prism }: {
|
|
33
|
+
prism: ObservationPrism;
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
/** The loading prism: the same faces in skeleton tones, or its silhouette for the shimmer mask. */
|
|
36
|
+
export declare function PrismSkeleton({ prism, x, y, painted, }: {
|
|
37
|
+
prism: ObservationPrism;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
painted: boolean;
|
|
41
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
3
|
+
export interface GoalPacingCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
4
|
+
/** Numeric elapsed period, e.g. day of the quarter. */
|
|
5
|
+
x: NumericKey<Row>;
|
|
6
|
+
actual: Key;
|
|
7
|
+
expected: Key;
|
|
8
|
+
/** Explicit current period; this chart never consults the wall clock. */
|
|
9
|
+
at: number;
|
|
10
|
+
target: number;
|
|
11
|
+
}
|
|
12
|
+
export interface MilestoneProgressCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
13
|
+
label: TextKey<Row>;
|
|
14
|
+
position: Key;
|
|
15
|
+
current: number | null;
|
|
16
|
+
target?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function pacingLayout<Row>(data: readonly Row[], x: string, actual: string, expected: string, at: number, target: number, width: number, height: number, format?: (value: number) => string): ObservationScene<Row>;
|
|
19
|
+
export declare function milestoneLayout<Row>(data: readonly Row[], label: string, position: string, current: number | null, target: number, width: number, height: number): ObservationScene<Row>;
|
|
20
|
+
export declare function GoalPacingCard<Row, const Key extends NumericKey<Row>>({ x, actual, expected, at, target, ...props }: GoalPacingCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function MilestoneProgressCard<Row, const Key extends NumericKey<Row>>({ label, position, current, target, height, ...props }: MilestoneProgressCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
3
|
+
export interface RankRibbonsCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
4
|
+
series: TextKey<Row>;
|
|
5
|
+
period: TextKey<Row>;
|
|
6
|
+
value: Key;
|
|
7
|
+
/** Descending puts the largest score first; ascending puts the smallest first. */
|
|
8
|
+
order?: 'descending' | 'ascending';
|
|
9
|
+
/** Ribbon width in pixels, 3–18. Default 10. */
|
|
10
|
+
thickness?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const placeholderRanks: {
|
|
13
|
+
team: string;
|
|
14
|
+
month: string;
|
|
15
|
+
score: number;
|
|
16
|
+
}[];
|
|
17
|
+
export declare function rankRibbonsLayout<Row>(data: readonly Row[], series: string, period: string, value: string, width: number, height: number, options?: {
|
|
18
|
+
order?: 'descending' | 'ascending';
|
|
19
|
+
thickness?: number;
|
|
20
|
+
color?: string;
|
|
21
|
+
}): ObservationScene<Row>;
|
|
22
|
+
export declare function RankRibbonsCard<Row, const Key extends NumericKey<Row>>({ series, period, value, order, thickness, color, height, aggregate, ...props }: RankRibbonsCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NumericKey, TextKey, XKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
3
|
+
export interface RidgelineCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'legend' | 'legendSwatch'> {
|
|
4
|
+
/** One ridge per series, back to front in first-seen order. */
|
|
5
|
+
series: TextKey<Row>;
|
|
6
|
+
/** Position along each ridge, in first-seen order. */
|
|
7
|
+
x: XKey<Row>;
|
|
8
|
+
value: Key;
|
|
9
|
+
/** How many rows the tallest peak rises over the ridges behind it. Default 2.2. */
|
|
10
|
+
overlap?: number;
|
|
11
|
+
/** Fixed value domain that must contain every value. Defaults to zero through the largest. */
|
|
12
|
+
domain?: readonly [number, number];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Layered distributions receding into depth. Each series is a ridge that rises over the ones
|
|
16
|
+
* behind it and hides them where it is taller, so the shape of every row reads at a glance while
|
|
17
|
+
* every value stays inspectable.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ridgelineLayout<Row>(data: readonly Row[], series: string, x: string, value: string, width: number, height: number, options?: {
|
|
20
|
+
overlap?: number;
|
|
21
|
+
domain?: readonly [number, number];
|
|
22
|
+
color?: string;
|
|
23
|
+
}): ObservationScene<Row>;
|
|
24
|
+
export declare function RidgelineCard<Row, const Key extends NumericKey<Row>>({ series, x, value, overlap, domain, color, height, ...props }: RidgelineCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -31,6 +31,10 @@ export interface ScatterChartCardProps<Row, Key extends NumericKey<Row>> {
|
|
|
31
31
|
yLabel?: string;
|
|
32
32
|
/** A least-squares line through the points, with its r² in the footer. */
|
|
33
33
|
trend?: boolean;
|
|
34
|
+
/** Connect successive observations in each group. Missing coordinates break the trail. */
|
|
35
|
+
trails?: boolean;
|
|
36
|
+
/** Numeric time/order field for trails. Defaults to the supplied row order. */
|
|
37
|
+
trailOrder?: NumericKey<Row>;
|
|
34
38
|
/** Draws each point as a lit sphere with a soft contact shadow; centers and sizes stay exact. */
|
|
35
39
|
depth?: boolean;
|
|
36
40
|
/** Plot height in pixels, including the axes. Defaults to 260. */
|
|
@@ -82,6 +86,20 @@ export interface ScatterChartCardProps<Row, Key extends NumericKey<Row>> {
|
|
|
82
86
|
className?: string;
|
|
83
87
|
style?: CSSProperties | ChartStyle;
|
|
84
88
|
}
|
|
89
|
+
/** Keep input identity and never bridge an unknown reading or an ambiguous duplicate time. */
|
|
90
|
+
export declare function scatterTrails<T extends {
|
|
91
|
+
id: string;
|
|
92
|
+
group: string | null;
|
|
93
|
+
x: number | null;
|
|
94
|
+
y: number | null;
|
|
95
|
+
order: number | null;
|
|
96
|
+
}>(rows: readonly T[]): [T & {
|
|
97
|
+
x: number;
|
|
98
|
+
y: number;
|
|
99
|
+
}, T & {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
}][];
|
|
85
103
|
/**
|
|
86
104
|
* A readable domain for one axis: rounded to the same ticks the axis draws, anchored at zero when
|
|
87
105
|
* the data starts near it, and never zero-width.
|
|
@@ -109,4 +127,4 @@ export declare function clipTrend(fit: {
|
|
|
109
127
|
* and colored by group. Hovering or stepping through points with the arrow keys reads each one in
|
|
110
128
|
* the headline, with its position marked on both axes.
|
|
111
129
|
*/
|
|
112
|
-
export declare function ScatterChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, x, y, size, sizeLabel, group, label, xLabel, yLabel, trend, depth, height, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, xFormat, locale, formatValue: suppliedFormatValue, formatX: suppliedFormatX, color, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: ScatterChartCardProps<Row, Key>): ReactElement;
|
|
130
|
+
export declare function ScatterChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, x, y, size, sizeLabel, group, label, xLabel, yLabel, trend, trails, trailOrder, depth, height, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, xFormat, locale, formatValue: suppliedFormatValue, formatX: suppliedFormatX, color, surface, badge, numberStyle, palette, loading: pending, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: ScatterChartCardProps<Row, Key>): ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ObservationMark, ObservationScene } from './observations-card';
|
|
2
|
+
export type Point = readonly [number, number];
|
|
3
|
+
export declare const fixed: (n: number) => number;
|
|
4
|
+
export declare const xy: ([x, y]: Point) => string;
|
|
5
|
+
export declare const polygon: (points: readonly Point[]) => string;
|
|
6
|
+
export declare const clamp: (value: number | undefined, fallback: number, min: number, max: number) => number;
|
|
7
|
+
export declare const identity: (...parts: (string | number)[]) => string;
|
|
8
|
+
export declare const bad: <Row>(error: string) => ObservationScene<Row>;
|
|
9
|
+
export declare const frame: (width: number, height: number) => {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
/** A sampled ribbon keeps a closed silhouette for both paint and pointer hit testing. */
|
|
14
|
+
export declare function ribbonMark<Row>(mark: Omit<ObservationMark<Row>, 'x' | 'y' | 'width' | 'height' | 'shape'>, points: readonly Point[]): ObservationMark<Row>;
|
|
15
|
+
export declare function bezier(a: Point, b: Point, c: Point, d: Point, steps?: number): Point[];
|
|
16
|
+
/** A constant-width ribbon around a polyline, with normals averaged at bends. */
|
|
17
|
+
export declare function strokeRibbon(points: readonly Point[], width: number): Point[];
|
|
18
|
+
export declare const tint: (color: string, percent: number) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NumericKey } from './keys';
|
|
2
|
+
import { ObservationScene } from './observations-card';
|
|
3
|
+
import { CalendarHeatmapCardProps, CalendarOptions } from './calendar-heatmap-card';
|
|
4
|
+
import { PrismGridOptions } from './prism-grid';
|
|
5
|
+
export interface SkylineCardProps<Row, Key extends NumericKey<Row>> extends CalendarHeatmapCardProps<Row, Key>, PrismGridOptions {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A calendar stood up in three dimensions: weeks run away to the right, weekdays come toward the
|
|
9
|
+
* viewer, and each day is a prism whose height and color both carry its value.
|
|
10
|
+
*/
|
|
11
|
+
export declare function skylineLayout<Row>(data: readonly Row[], date: string, value: string, width: number, height: number, options?: CalendarOptions<Row> & PrismGridOptions): ObservationScene<Row>;
|
|
12
|
+
export declare function SkylineCard<Row, const Key extends NumericKey<Row>>({ date, value, from, to, weekStartsOn, today, domain, rise, gap, color, locale, height, ...props }: SkylineCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Scene } from './spatial-geometry';
|
|
2
|
+
export declare function windRoseLayout<Row>(data: readonly Row[], direction: string, band: string, value: string, width: number, height: number, options?: {
|
|
3
|
+
sectors?: number;
|
|
4
|
+
tilt?: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
}): Scene<Row>;
|
|
7
|
+
export declare function marimekkoBlocksLayout<Row>(data: readonly Row[], category: string, segment: string, value: string, width: number, height: number, options?: {
|
|
8
|
+
gap?: number;
|
|
9
|
+
color?: string;
|
|
10
|
+
}): Scene<Row>;
|
|
11
|
+
export declare function intersectionTowersLayout<Row>(data: readonly Row[], members: string, value: string, width: number, height: number, options?: {
|
|
12
|
+
sort?: 'value' | 'input';
|
|
13
|
+
color?: string;
|
|
14
|
+
}): Scene<Row>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ObservationMark, ObservationScene } from './observations-card';
|
|
2
|
+
import { polygon, Point } from './sculpted-geometry';
|
|
3
|
+
export declare const TAU: number;
|
|
4
|
+
export type XYZ = readonly [number, number, number];
|
|
5
|
+
export type Scene<Row> = ObservationScene<Row>;
|
|
6
|
+
export declare const ink = "var(--lilt-muted)";
|
|
7
|
+
export declare function names<Row>(data: readonly Row[], key: string): string[] | string;
|
|
8
|
+
export declare function readings<Row>(data: readonly Row[], labels: readonly string[], key: string): {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
value: number | null;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const paint: (index: number, color?: string) => string;
|
|
14
|
+
export declare const sum: (values: readonly (number | null)[]) => number;
|
|
15
|
+
export declare const negative: <Row>(data: readonly Row[], key: string) => boolean;
|
|
16
|
+
export declare function sector(cx: number, cy: number, inner: number, outer: number, start: number, end: number, tilt?: number): Point[];
|
|
17
|
+
/** Orthographic camera: metric axes stay linear; z remains vertical during yaw. */
|
|
18
|
+
export declare function camera(width: number, height: number, yaw?: number, elevation?: number): (p: XYZ) => {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
depth: number;
|
|
22
|
+
scale: number;
|
|
23
|
+
lift: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function normalize(values: readonly (number | null)[]): {
|
|
26
|
+
low: number;
|
|
27
|
+
high: number;
|
|
28
|
+
at: (v: number) => number;
|
|
29
|
+
};
|
|
30
|
+
export declare function axes<Row>(project: ReturnType<typeof camera>, keys: readonly string[]): Pick<Scene<Row>, 'paths' | 'labels'>;
|
|
31
|
+
export declare function cube<Row>(mark: Omit<ObservationMark<Row>, 'x' | 'y' | 'width' | 'height'>, p: XYZ, radius: number, project: ReturnType<typeof camera>): ObservationMark<Row>;
|
|
32
|
+
export declare function slab<Row>(mark: Omit<ObservationMark<Row>, 'x' | 'y' | 'width' | 'height'>, x: number, y: number, width: number, height: number, lift: number): ObservationMark<Row>;
|
|
33
|
+
export declare function ribbon<Row>(mark: Omit<ObservationMark<Row>, 'x' | 'y' | 'width' | 'height' | 'shape'>, points: readonly Point[]): ObservationMark<Row>;
|
|
34
|
+
export { polygon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface Branch<Row> {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
depth: number;
|
|
5
|
+
value: number;
|
|
6
|
+
datum: Row | null;
|
|
7
|
+
children: Branch<Row>[];
|
|
8
|
+
}
|
|
9
|
+
/** Leaf-only paths avoid ambiguous parent totals and reject ancestor/leaf collisions. */
|
|
10
|
+
export declare function hierarchy<Row>(data: readonly Row[], path: string, value: string): Branch<Row> | string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Scene } from './spatial-geometry';
|
|
2
|
+
export interface SpatialOptions {
|
|
3
|
+
yaw?: number;
|
|
4
|
+
elevation?: number;
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
group?: string;
|
|
8
|
+
slice?: readonly [number, number];
|
|
9
|
+
}
|
|
10
|
+
export declare function voxelCloudLayout<Row>(data: readonly Row[], label: string, x: string, y: string, z: string, value: string, width: number, height: number, options?: SpatialOptions): Scene<Row>;
|
|
11
|
+
export declare function clusterConstellationLayout<Row>(data: readonly Row[], label: string, x: string, y: string, z: string, value: string, connections: string, width: number, height: number, options?: SpatialOptions): Scene<Row>;
|
|
12
|
+
export declare function ternaryPrismLayout<Row>(data: readonly Row[], label: string, a: string, b: string, c: string, value: string, width: number, height: number, options?: {
|
|
13
|
+
tilt?: number;
|
|
14
|
+
rise?: number;
|
|
15
|
+
color?: string;
|
|
16
|
+
}): Scene<Row>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Scene } from './spatial-geometry';
|
|
2
|
+
export declare function horizonFoldsLayout<Row>(data: readonly Row[], series: string, time: string, value: string, width: number, height: number, options?: {
|
|
3
|
+
bands?: number;
|
|
4
|
+
color?: string;
|
|
5
|
+
}): Scene<Row>;
|
|
6
|
+
export declare function helixRibbonsLayout<Row>(data: readonly Row[], series: string, cycle: string, phase: string, value: string, width: number, height: number, options?: {
|
|
7
|
+
yaw?: number;
|
|
8
|
+
elevation?: number;
|
|
9
|
+
thickness?: number;
|
|
10
|
+
maxGap?: number;
|
|
11
|
+
color?: string;
|
|
12
|
+
}): Scene<Row>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NumericKey, TimeKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
3
|
+
export interface SpiralYearCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'legend' | 'legendSwatch'> {
|
|
4
|
+
date: TimeKey<Row>;
|
|
5
|
+
value: Key;
|
|
6
|
+
/** Inclusive UTC date bounds. Default to the observed range; at most ten years. */
|
|
7
|
+
from?: string | number | Date;
|
|
8
|
+
to?: string | number | Date;
|
|
9
|
+
/** Fixed value domain that must contain every value. Defaults to zero through the largest. */
|
|
10
|
+
domain?: readonly [number, number];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Time as a coil: one turn per year with January at the top, so the same season lines up on every
|
|
14
|
+
* turn. Each day is a bar standing out from the coil whose length and color carry its value.
|
|
15
|
+
*/
|
|
16
|
+
export declare function spiralLayout<Row>(data: readonly Row[], date: string, value: string, width: number, height: number, options?: Pick<SpiralYearCardProps<Row, NumericKey<Row>>, 'from' | 'to' | 'domain' | 'color' | 'locale'>): ObservationScene<Row>;
|
|
17
|
+
export declare function SpiralYearCard<Row, const Key extends NumericKey<Row>>({ date, value, from, to, domain, color, locale, height, ...props }: SpiralYearCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps } from './observations-card';
|
|
3
|
+
export { sunburstTerracesLayout } from './hierarchy-layouts';
|
|
4
|
+
export interface SunburstTerracesCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
5
|
+
path: TextKey<Row>;
|
|
6
|
+
value: Key;
|
|
7
|
+
tilt?: number;
|
|
8
|
+
rise?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function SunburstTerracesCard<Row, const Key extends NumericKey<Row>>({ path, value, tilt, rise, color, height, depth, ...props }: SunburstTerracesCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps } from './observations-card';
|
|
3
|
+
export { ternaryPrismLayout } from './spatial-point-layouts';
|
|
4
|
+
export interface TernaryPrismCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
5
|
+
label: TextKey<Row>;
|
|
6
|
+
a: NumericKey<Row>;
|
|
7
|
+
b: NumericKey<Row>;
|
|
8
|
+
c: NumericKey<Row>;
|
|
9
|
+
value: Key;
|
|
10
|
+
tilt?: number;
|
|
11
|
+
rise?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function TernaryPrismCard<Row, const Key extends NumericKey<Row>>({ label, a, b, c, value, tilt, rise, color, height, depth, ...props }: TernaryPrismCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
3
|
+
export interface TerrainCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'legend' | 'legendSwatch'> {
|
|
4
|
+
/** Columns, running away to the right, in first-seen order. */
|
|
5
|
+
x: TextKey<Row>;
|
|
6
|
+
/** Rows, coming toward the viewer, in first-seen order. */
|
|
7
|
+
y: TextKey<Row>;
|
|
8
|
+
value: Key;
|
|
9
|
+
/** How many cell lengths the highest value rises, default 3. */
|
|
10
|
+
rise?: number;
|
|
11
|
+
/** Surface samples between neighbouring readings, 1 to 6, default 4. Higher is smoother. */
|
|
12
|
+
smoothing?: number;
|
|
13
|
+
/** Fixed value domain that must contain every value. Defaults to zero through the largest. */
|
|
14
|
+
domain?: readonly [number, number];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A grid of readings as a lit landscape. The surface passes through every reading, peaks catch
|
|
18
|
+
* the light and slopes facing away fall into shade, and hovering drops a pin onto the reading.
|
|
19
|
+
*/
|
|
20
|
+
export declare function terrainLayout<Row>(data: readonly Row[], x: string, y: string, value: string, width: number, height: number, options?: Pick<TerrainCardProps<Row, NumericKey<Row>>, 'rise' | 'smoothing' | 'domain' | 'color'>): ObservationScene<Row>;
|
|
21
|
+
export declare function TerrainCard<Row, const Key extends NumericKey<Row>>({ x, y, value, rise, smoothing, domain, color, height, ...props }: TerrainCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,8 @@ export interface TreemapChartCardProps<Row, Key extends NumericKey<Row>> extends
|
|
|
7
7
|
value: Key;
|
|
8
8
|
/** Optional parent category. Input rows are leaves, never parent totals. */
|
|
9
9
|
group?: TextKey<Row>;
|
|
10
|
+
/** Explore a parent group, with a breadcrumb back to all leaves. */
|
|
11
|
+
drilldown?: boolean;
|
|
10
12
|
}
|
|
11
13
|
interface Rect {
|
|
12
14
|
x: number;
|
|
@@ -20,5 +22,5 @@ export declare function tileAreas<T>(items: readonly T[], weight: (item: T) => n
|
|
|
20
22
|
rect: Rect;
|
|
21
23
|
}[];
|
|
22
24
|
export declare function treemapLayout<Row>(data: readonly Row[], label: string, value: string, group: string | undefined, width: number, height: number, color?: string): ObservationScene<Row>;
|
|
23
|
-
export declare function TreemapChartCard<Row, const Key extends NumericKey<Row>>({ label, value, group, color, ...props }: TreemapChartCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function TreemapChartCard<Row, const Key extends NumericKey<Row>>({ label, value, group, color, drilldown, ...props }: TreemapChartCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
24
26
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CardSeries } from './cartesian-card';
|
|
2
|
+
import { NumericKey, XKey } from './keys';
|
|
3
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
4
|
+
export interface StreamgraphCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
5
|
+
x: XKey<Row>;
|
|
6
|
+
series: readonly CardSeries<Key>[];
|
|
7
|
+
curve?: 'smooth' | 'linear';
|
|
8
|
+
}
|
|
9
|
+
/** A centered, additive silhouette. Nonnegative thicknesses share one interpolator. */
|
|
10
|
+
export declare function streamgraphLayout<Row>(data: readonly Row[], x: string, series: readonly CardSeries<string>[], curve: 'smooth' | 'linear', width: number, height: number): ObservationScene<Row>;
|
|
11
|
+
export declare function StreamgraphCard<Row, const Key extends NumericKey<Row>>({ x, series, curve, ...props }: StreamgraphCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps } from './observations-card';
|
|
3
|
+
export { voxelCloudLayout } from './spatial-point-layouts';
|
|
4
|
+
export interface VoxelCloudCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
|
|
5
|
+
label: TextKey<Row>;
|
|
6
|
+
x: NumericKey<Row>;
|
|
7
|
+
y: NumericKey<Row>;
|
|
8
|
+
z: NumericKey<Row>;
|
|
9
|
+
value: Key;
|
|
10
|
+
group?: TextKey<Row>;
|
|
11
|
+
yaw?: number;
|
|
12
|
+
elevation?: number;
|
|
13
|
+
size?: number;
|
|
14
|
+
slice?: readonly [number, number];
|
|
15
|
+
}
|
|
16
|
+
export declare function VoxelCloudCard<Row, const Key extends NumericKey<Row>>({ label, x, y, z, value, group, yaw, elevation, size, slice, color, height, depth, ...props }: VoxelCloudCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NumericKey, TextKey } from './keys';
|
|
2
|
+
import { ObservationsCardProps, ObservationScene } from './observations-card';
|
|
3
|
+
export interface VoxelWaffleCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'legendSwatch'> {
|
|
4
|
+
category: TextKey<Row>;
|
|
5
|
+
value: Key;
|
|
6
|
+
/** How many cubes make the whole, default 100. */
|
|
7
|
+
units?: number;
|
|
8
|
+
/** Cubes along each side of a layer, default 5. */
|
|
9
|
+
footprint?: number;
|
|
10
|
+
}
|
|
11
|
+
/** Whole cubes per category that add up to exactly `units`, by largest remainder. */
|
|
12
|
+
export declare function allocateUnits(values: readonly number[], units: number): number[];
|
|
13
|
+
/**
|
|
14
|
+
* Shares of a whole as a block of cubes: each category fills its share of `units` cubes, layer by
|
|
15
|
+
* layer from the floor up, so the block reads like a stacked waffle you can count.
|
|
16
|
+
*/
|
|
17
|
+
export declare function voxelLayout<Row>(data: readonly Row[], category: string, value: string, width: number, height: number, options?: Pick<VoxelWaffleCardProps<Row, NumericKey<Row>>, 'units' | 'footprint' | 'color'>): ObservationScene<Row>;
|
|
18
|
+
export declare function VoxelWaffleCard<Row, const Key extends NumericKey<Row>>({ category, value, units, footprint, color, height, ...props }: VoxelWaffleCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
|