@lilt-ui/charts 0.12.2 → 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.
Files changed (72) hide show
  1. package/CHANGELOG.md +282 -270
  2. package/README.md +0 -45
  3. package/dist/cards/arc-bridges-card.d.ts +17 -0
  4. package/dist/cards/area-chart-card.d.ts +1 -10
  5. package/dist/cards/block-city-card.d.ts +21 -0
  6. package/dist/cards/calendar-heatmap-card.d.ts +31 -1
  7. package/dist/cards/cartesian-card.d.ts +8 -26
  8. package/dist/cards/chart-card.d.ts +1 -12
  9. package/dist/cards/chord-loom-card.d.ts +17 -0
  10. package/dist/cards/circle-archipelago-card.d.ts +9 -0
  11. package/dist/cards/cluster-constellation-card.d.ts +16 -0
  12. package/dist/cards/comparison-forms.d.ts +30 -0
  13. package/dist/cards/composition-forms.d.ts +10 -0
  14. package/dist/cards/contour-islands-card.d.ts +25 -0
  15. package/dist/cards/density-contours.d.ts +3 -0
  16. package/dist/cards/distribution-forms.d.ts +37 -0
  17. package/dist/cards/event-helix-card.d.ts +26 -0
  18. package/dist/cards/helix-ribbons-card.d.ts +14 -0
  19. package/dist/cards/hex-city-card.d.ts +25 -0
  20. package/dist/cards/hierarchy-layouts.d.ts +21 -0
  21. package/dist/cards/horizon-folds-card.d.ts +10 -0
  22. package/dist/cards/horizontal-bar-chart-card.d.ts +1 -1
  23. package/dist/cards/intersection-towers-card.d.ts +9 -0
  24. package/dist/cards/line-chart-card.d.ts +4 -11
  25. package/dist/cards/link-readings.d.ts +26 -0
  26. package/dist/cards/marimekko-blocks-card.d.ts +10 -0
  27. package/dist/cards/observations-card.d.ts +45 -2
  28. package/dist/cards/parallel-ribbons-card.d.ts +27 -0
  29. package/dist/cards/prism-grid.d.ts +58 -0
  30. package/dist/cards/prism.d.ts +42 -0
  31. package/dist/cards/progress-forms.d.ts +21 -0
  32. package/dist/cards/rank-ribbons-card.d.ts +22 -0
  33. package/dist/cards/ridgeline-card.d.ts +24 -0
  34. package/dist/cards/scatter-chart-card.d.ts +19 -1
  35. package/dist/cards/sculpted-geometry.d.ts +18 -0
  36. package/dist/cards/skyline-card.d.ts +12 -0
  37. package/dist/cards/spatial-composition-layouts.d.ts +14 -0
  38. package/dist/cards/spatial-geometry.d.ts +34 -0
  39. package/dist/cards/spatial-hierarchy.d.ts +10 -0
  40. package/dist/cards/spatial-point-layouts.d.ts +16 -0
  41. package/dist/cards/spatial-series-layouts.d.ts +12 -0
  42. package/dist/cards/spiral-year-card.d.ts +17 -0
  43. package/dist/cards/sunburst-terraces-card.d.ts +10 -0
  44. package/dist/cards/ternary-prism-card.d.ts +13 -0
  45. package/dist/cards/terrain-card.d.ts +21 -0
  46. package/dist/cards/treemap-chart-card.d.ts +3 -1
  47. package/dist/cards/trend-forms.d.ts +11 -0
  48. package/dist/cards/voxel-cloud-card.d.ts +16 -0
  49. package/dist/cards/voxel-waffle-card.d.ts +18 -0
  50. package/dist/cards/wind-rose-card.d.ts +11 -0
  51. package/dist/engine/domains.d.ts +0 -1
  52. package/dist/finance.js +310 -311
  53. package/dist/index.d.ts +39 -4
  54. package/dist/index.js +8919 -2948
  55. package/dist/{skeleton-block-DIgcA9t6.js → skeleton-block-BPoUJvcR.js} +3596 -2971
  56. package/dist/styles.css +1 -1
  57. package/package.json +80 -85
  58. package/dist/report-context-CIUa6iiD.js +0 -1101
  59. package/dist/watch/board/board-state.d.ts +0 -72
  60. package/dist/watch/board/board-toast.d.ts +0 -19
  61. package/dist/watch/board/chart-board.d.ts +0 -93
  62. package/dist/watch/board/report-context.d.ts +0 -3
  63. package/dist/watch/engine/describe.d.ts +0 -9
  64. package/dist/watch/engine/explain.d.ts +0 -48
  65. package/dist/watch/engine/normal.d.ts +0 -114
  66. package/dist/watch/engine/robust.d.ts +0 -7
  67. package/dist/watch/engine/rules.d.ts +0 -22
  68. package/dist/watch/engine/status.d.ts +0 -39
  69. package/dist/watch/index.d.ts +0 -14
  70. package/dist/watch/normal-layer.d.ts +0 -18
  71. package/dist/watch.d.ts +0 -2
  72. package/dist/watch.js +0 -636
package/README.md CHANGED
@@ -15,7 +15,6 @@
15
15
  <a href="https://liltui.vercel.app"><strong>Documentation</strong></a> ·
16
16
  <a href="https://liltui.vercel.app/charts/area">Charts</a> ·
17
17
  <a href="https://liltui.vercel.app/finance/candlestick">Finance</a> ·
18
- <a href="https://liltui.vercel.app/watch">Watch</a> ·
19
18
  <a href="https://liltui.vercel.app/llms.txt">llms.txt</a>
20
19
  </p>
21
20
 
@@ -159,49 +158,6 @@ export function MarketCard() {
159
158
 
160
159
  Candles draw into a handful of paths however many there are, so years of daily history stay fast. `scale="log"` spaces long histories by ratio, and `live` follows new rows as they arrive. The indicator math (`sma`, `ema`, `rsi`, `macd`, `bollinger`, `drawdown`, `depthLevels`) is exported too, for your own layouts.
161
160
 
162
- ## Watch
163
-
164
- Tell a chart what normal looks like, and it says when something isn't:
165
-
166
- ```tsx
167
- <LineChartCard
168
- title="Orders"
169
- data={lastTwoDays}
170
- x="hour"
171
- series={[{ key: 'orders' }]}
172
- normal={{
173
- history: earlierWeeks, // learn from weeks you don't draw
174
- learn: 'week', // same hour, same weekday
175
- limits: { min: 10 }, // a line you set
176
- when: (hour) => !hour.maintenance, // never judge downtime
177
- breakdown: (hour) => hour.devices, // say which device caused it
178
- }}
179
- />
180
- ```
181
-
182
- The card draws a calm band where the series should be, recolors unusual stretches, and says "Unusually low since Tue 2 PM". Hover an unusual reading and it says why: "98% of the drop is Mobile Safari". Every layer is off until you set it.
183
-
184
- Wrap cards in a board and the dashboard arranges itself around what needs attention:
185
-
186
- ```tsx
187
- import { BoardItem, ChartBoard } from '@lilt-ui/charts/watch';
188
-
189
- <ChartBoard aria-label="Store health" toast>
190
- <BoardItem id="orders" title="Orders">
191
- <AreaChartCard
192
- title="Orders"
193
- data={rows}
194
- x="hour"
195
- series={[{ key: 'orders' }]}
196
- normal={{ learn: 'week' }}
197
- />
198
- </BoardItem>
199
- {/* …more cards */}
200
- </ChartBoard>;
201
- ```
202
-
203
- Cards that need attention rise, what you've seen calms down, and what clears settles back. Nothing moves while you're reading, and a toast finds you when something breaks off screen.
204
-
205
161
  ## Built in, one prop away
206
162
 
207
163
  - **Linked hover.** Give cards the same `sync` name and they read the same moment together.
@@ -210,7 +166,6 @@ Cards that need attention rise, what you've seen calms down, and what clears set
210
166
  - **Honest data.** `null` is a gap, never a zero, and missing values say so.
211
167
  - **Loading and empty.** `loading` shows a skeleton that `"shimmer"`s, `"draw"`s, or `"breathe"`s in the chart's own shape, then hands over to the data. A period with no rows shows a still empty state, or your own with `empty`, and the headline reads a dash, never zero.
212
168
  - **Long series.** Line and area cards draw tens of thousands of points from four per pixel column; hover, tiles, and exports still read every row.
213
- - **Watch.** `normal` flags what's unusual and says why; a `ChartBoard` raises what needs attention.
214
169
  - **Calm by default.** Keyboard navigation, screen reader labels, and motion that respects reduced-motion settings.
215
170
 
216
171
  ## Fits your design system
@@ -0,0 +1,17 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
3
+ export interface ArcBridgesCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
4
+ source: TextKey<Row>;
5
+ target: TextKey<Row>;
6
+ value: Key;
7
+ /** Arch height as a fraction of the available plot height, 0.3–1. Default 0.85. */
8
+ rise?: number;
9
+ /** Maximum ribbon width in pixels, 4–28. Default 18. */
10
+ thickness?: number;
11
+ }
12
+ export declare function arcBridgesLayout<Row>(data: readonly Row[], source: string, target: string, value: string, width: number, height: number, options?: {
13
+ rise?: number;
14
+ thickness?: number;
15
+ color?: string;
16
+ }): ObservationScene<Row>;
17
+ export declare function ArcBridgesCard<Row, const Key extends NumericKey<Row>>({ source, target, value, rise, thickness, color, height, ...props }: ArcBridgesCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
- import { CardNormal, CartesianCardProps } from './cartesian-card';
2
+ import { CartesianCardProps } from './cartesian-card';
3
3
  import { NumericKey } from './keys';
4
- import { NormalReport } from '../watch/board/board-state';
5
4
  export type { CardRange, CardSeries } from './cartesian-card';
6
5
  export interface AreaChartCardProps<Row, Key extends NumericKey<Row>> extends CartesianCardProps<Row, Key> {
7
6
  /**
@@ -12,14 +11,6 @@ export interface AreaChartCardProps<Row, Key extends NumericKey<Row>> extends Ca
12
11
  stack?: boolean | 'percent';
13
12
  /** `smooth` uses a monotone curve; `linear` draws straight segments. */
14
13
  curve?: 'smooth' | 'linear';
15
- /**
16
- * Watch one series against what is normal for it: a calm band where it is expected, a ring on
17
- * each unusual reading, and a header note while it stays unusual. Every layer is off unless
18
- * set. Unstacked cards only.
19
- */
20
- normal?: CardNormal<Row, NoInfer<Key>>;
21
- /** Called when the watched series' status changes, such as when an incident starts or clears. */
22
- onNormalChange?: (report: NormalReport | null) => void;
23
14
  }
24
15
  /**
25
16
  * A complete area chart card: headline, delta, period, plot, and value tiles.
@@ -0,0 +1,21 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
3
+ import { PrismGridOptions } from './prism-grid';
4
+ export interface BlockCityCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'legend' | 'legendSwatch'>, PrismGridOptions {
5
+ /** Columns, running away to the right, in first-seen order. */
6
+ x: TextKey<Row>;
7
+ /** Rows, coming toward the viewer, in first-seen order. */
8
+ y: TextKey<Row>;
9
+ value: Key;
10
+ /** Fixed value domain that must contain every value. Defaults to zero through the largest. */
11
+ domain?: readonly [number, number];
12
+ }
13
+ /**
14
+ * Any two categories as a city block: one prism per pair, whose height and color both carry the
15
+ * value. Pairs without a row stay as a low slab so a gap never reads as zero.
16
+ */
17
+ export declare function blockCityLayout<Row>(data: readonly Row[], x: string, y: string, value: string, width: number, height: number, options?: PrismGridOptions & {
18
+ domain?: readonly [number, number];
19
+ color?: string;
20
+ }): ObservationScene<Row>;
21
+ export declare function BlockCityCard<Row, const Key extends NumericKey<Row>>({ x, y, value, domain, rise, gap, color, height, ...props }: BlockCityCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -14,5 +14,35 @@ export interface CalendarHeatmapCardProps<Row, Key extends NumericKey<Row>> exte
14
14
  today?: string | number | Date;
15
15
  domain?: readonly [number, number];
16
16
  }
17
- export declare function calendarLayout<Row>(data: readonly Row[], date: string, value: string, width: number, height: number, options?: Pick<CalendarHeatmapCardProps<Row, NumericKey<Row>>, 'from' | 'to' | 'today' | 'weekStartsOn' | 'domain' | 'color' | 'locale'>): ObservationScene<Row>;
17
+ export type CalendarOptions<Row> = Pick<CalendarHeatmapCardProps<Row, NumericKey<Row>>, 'from' | 'to' | 'today' | 'weekStartsOn' | 'domain' | 'color' | 'locale'>;
18
+ export interface CalendarCell<Row> {
19
+ day: number;
20
+ column: number;
21
+ row: number;
22
+ datum: Row | null;
23
+ reading: number | null;
24
+ /** Position of the reading in the domain, 0 to 1. */
25
+ share: number;
26
+ color: string;
27
+ future: boolean;
28
+ }
29
+ /** Validates the rows and places every day of the range in a week column and weekday row. */
30
+ export declare function calendarCells<Row>(data: readonly Row[], date: string, value: string, options: CalendarOptions<Row>): {
31
+ error?: string;
32
+ cells: CalendarCell<Row>[];
33
+ weeks: number;
34
+ weekStart: 0 | 1;
35
+ };
36
+ export declare function cellMark<Row>(cell: CalendarCell<Row>): {
37
+ id: string;
38
+ label: string;
39
+ datum: Row | null;
40
+ value: number | null;
41
+ color: string;
42
+ missing: boolean;
43
+ future: boolean;
44
+ detail: string | undefined;
45
+ };
46
+ export declare const monthFormatter: (locale: string | undefined) => Intl.DateTimeFormat;
47
+ export declare function calendarLayout<Row>(data: readonly Row[], date: string, value: string, width: number, height: number, options?: CalendarOptions<Row>): ObservationScene<Row>;
18
48
  export declare function CalendarHeatmapCard<Row, const Key extends NumericKey<Row>>({ date, value, from, to, weekStartsOn, today, domain, color, locale, ...props }: CalendarHeatmapCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -4,9 +4,6 @@ import { NumericKey, ResolvedX, XKey, XKind } from './keys';
4
4
  import { CardAggregate } from './format';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
6
6
  import { ChartEmptyShape } from '../lifecycle/chart-empty';
7
- import { NormalSpec } from '../watch/engine/normal';
8
- import { NormalBreakdown } from '../watch/engine/explain';
9
- import { NormalReport } from '../watch/board/board-state';
10
7
  export interface CardSeries<Key extends string> {
11
8
  /** A numeric field of each row. */
12
9
  key: Key;
@@ -27,6 +24,12 @@ export type CardTarget = number | {
27
24
  };
28
25
  /** Rows from `from` onward are projections rather than measurements. */
29
26
  export interface CardForecast<Row> {
27
+ /** Supplied uncertainty envelopes, ordered widest to narrowest. Values are never estimated. */
28
+ bands?: readonly {
29
+ lower: NumericKey<Row>;
30
+ upper: NumericKey<Row>;
31
+ label: string;
32
+ }[];
30
33
  /** The x value of the first projected row: a label, number, or Date. */
31
34
  from: string | number | Date;
32
35
  /** Fields holding the low and high end of the projection, drawn as a band around it. */
@@ -35,24 +38,6 @@ export interface CardForecast<Row> {
35
38
  /** Names the projected region and the hover caption. Defaults to "Forecast". */
36
39
  label?: string;
37
40
  }
38
- /**
39
- * What normal looks like for one series of a line or unstacked area card. Every layer is off
40
- * unless set; see `NormalSpec`. Projected rows are never judged.
41
- */
42
- export interface CardNormal<Row, Key extends string = string> extends NormalSpec<Row> {
43
- /** The watched series. Defaults to the headline series, then the first solid series. */
44
- series?: Key;
45
- /**
46
- * Earlier rows to learn from without drawing them, such as the weeks before the day on screen.
47
- * They come before `data`, in the same shape.
48
- */
49
- history?: readonly Row[];
50
- /**
51
- * Split a reading into the segments that add up to it, such as orders by device, so an unusual
52
- * reading can say which segment caused it: "91% of the drop is Mobile Safari".
53
- */
54
- breakdown?: NormalBreakdown<Row>;
55
- }
56
41
  export interface CardRange<Row> {
57
42
  id: string;
58
43
  label: string;
@@ -244,6 +229,7 @@ export type CardShape = {
244
229
  curve: ChartCurve;
245
230
  points: boolean;
246
231
  zero: boolean;
232
+ indexed?: boolean;
247
233
  } | {
248
234
  kind: 'bar';
249
235
  stack: CardStack;
@@ -309,7 +295,7 @@ export declare const CARD_PADDING = 20;
309
295
  * The shared card body: headline, delta, period, plot, and value tiles, with hover sync and
310
296
  * range comparison. Area, Line, and Bar cards differ only in their `shape`.
311
297
  */
312
- export declare function CartesianCard<Row, Key extends NumericKey<Row>>({ shape, title, header, 'aria-label': ariaLabel, data: suppliedData, x, series: seriesInput, headline: suppliedHeadline, aggregate: suppliedAggregate, headlineSeries, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, tiles, legend, legendSwatch, depth, height, valueFormat, locale, formatValue: suppliedFormatValue, formatAxisValue: suppliedFormatAxisValue, formatX, xType, compare, target: suppliedTarget, forecast, sync, axis, hover, hoverStyle, background, spotlight, decimate, surface, badge, numberStyle, palette, bleed, axisInset, pillSeries, pillValue, pillPosition, tooltipIndicator, loading, loadingStyle, empty, motion, className, style, panes, live, heading, restCaption, normal, onNormalChange, }: Omit<CartesianCardProps<Row, Key>, 'series'> & {
298
+ export declare function CartesianCard<Row, Key extends NumericKey<Row>>({ shape, title, header, 'aria-label': ariaLabel, data: suppliedData, x, series: seriesInput, headline: suppliedHeadline, aggregate: suppliedAggregate, headlineSeries, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, tiles, legend, legendSwatch, depth, height, valueFormat, locale, formatValue: suppliedFormatValue, formatAxisValue: suppliedFormatAxisValue, formatX, xType, compare, target: suppliedTarget, forecast, sync, axis, hover, hoverStyle, background, spotlight, decimate, surface, badge, numberStyle, palette, bleed, axisInset, pillSeries, pillValue, pillPosition, tooltipIndicator, loading, loadingStyle, empty, motion, className, style, panes, live, heading, restCaption, }: Omit<CartesianCardProps<Row, Key>, 'series'> & {
313
299
  series: readonly CoreSeries<Key>[];
314
300
  shape: CardShape;
315
301
  /** Linked panes under the plot, such as volume or indicators. */
@@ -320,10 +306,6 @@ export declare function CartesianCard<Row, Key extends NumericKey<Row>>({ shape,
320
306
  heading?: ReactNode;
321
307
  /** Text beside the delta at rest, such as an absolute change, from the active data. */
322
308
  restCaption?: (data: readonly Row[]) => ReactNode;
323
- /** Watch one series against its normal. Line and unstacked area cards only. */
324
- normal?: CardNormal<Row, NoInfer<Key>>;
325
- /** Called when the watched series' status changes. */
326
- onNormalChange?: (report: NormalReport | null) => void;
327
309
  }): ReactElement;
328
310
  /** The plot position where projections begin: a label's row, or the date or number itself. */
329
311
  export declare function forecastPosition<Row>(data: readonly Row[], x: string, resolved: ResolvedX<Row>, from: string | number): number | null;
@@ -21,19 +21,8 @@ export interface ChartCardProps {
21
21
  'aria-label'?: string;
22
22
  onKeyDown?: KeyboardEventHandler<HTMLElement>;
23
23
  }
24
- /**
25
- * What a container such as a watch board adds to the card directly inside it: a tab that takes
26
- * the badge's place, a tone for the card's edge, and a control that floats on the top edge.
27
- */
28
- export interface CardFrame {
29
- badge?: ReactNode;
30
- tone?: 'warning' | 'critical' | null;
31
- handle?: ReactNode;
32
- }
33
- /** Set by a container around one card. Cards nested inside that card do not see it. */
34
- export declare const CardFrameContext: import('react').Context<CardFrame | null>;
35
24
  /** The card surface every Lilt card shares: padding, radius, border, and theme tokens. */
36
- export declare function ChartCard({ children, surface, palette, motion, numberStyle, badge: ownBadge, className, style, 'aria-label': ariaLabel, onKeyDown, }: ChartCardProps): ReactElement;
25
+ export declare function ChartCard({ children, surface, palette, motion, numberStyle, badge, className, style, 'aria-label': ariaLabel, onKeyDown, }: ChartCardProps): ReactElement;
37
26
  export interface CardBadgeProps {
38
27
  children?: ReactNode;
39
28
  className?: string;
@@ -0,0 +1,17 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
3
+ export interface ChordLoomCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
4
+ source: TextKey<Row>;
5
+ target: TextKey<Row>;
6
+ value: Key;
7
+ /** Vertical proportion of the circular frame, 0.4–1. Default 0.68. */
8
+ tilt?: number;
9
+ /** Gap between node sectors in radians, 0–0.16. Default 0.06. */
10
+ gap?: number;
11
+ }
12
+ export declare function chordLoomLayout<Row>(data: readonly Row[], source: string, target: string, value: string, width: number, height: number, options?: {
13
+ tilt?: number;
14
+ gap?: number;
15
+ color?: string;
16
+ }): ObservationScene<Row>;
17
+ export declare function ChordLoomCard<Row, const Key extends NumericKey<Row>>({ source, target, value, tilt, gap, color, height, ...props }: ChordLoomCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps } from './observations-card';
3
+ export { circleArchipelagoLayout } from './hierarchy-layouts';
4
+ export interface CircleArchipelagoCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
5
+ path: TextKey<Row>;
6
+ value: Key;
7
+ padding?: number;
8
+ }
9
+ export declare function CircleArchipelagoCard<Row, const Key extends NumericKey<Row>>({ path, value, padding, color, height, depth, ...props }: CircleArchipelagoCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { NumericKey, TextKey, KeysOfType } from './keys';
2
+ import { ObservationsCardProps } from './observations-card';
3
+ export { clusterConstellationLayout } from './spatial-point-layouts';
4
+ export interface ClusterConstellationCardProps<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
+ connections: KeysOfType<Row, readonly string[]>;
11
+ group?: TextKey<Row>;
12
+ yaw?: number;
13
+ elevation?: number;
14
+ size?: number;
15
+ }
16
+ export declare function ClusterConstellationCard<Row, const Key extends NumericKey<Row>>({ label, x, y, z, value, connections, group, yaw, elevation, size, color, height, depth, ...props }: ClusterConstellationCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { CardSeries } from './cartesian-card';
3
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
4
+ export interface DivergingBarCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
5
+ category: TextKey<Row>;
6
+ series: readonly (CardSeries<Key> & {
7
+ side: 'negative' | 'neutral' | 'positive';
8
+ })[];
9
+ /** Normalize each complete response to 100%. Neutral responses straddle zero. */
10
+ percent?: boolean;
11
+ }
12
+ export interface MirroredBarCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
13
+ category: TextKey<Row>;
14
+ left: Key;
15
+ right: Key;
16
+ leftLabel?: string;
17
+ rightLabel?: string;
18
+ }
19
+ export interface ComparativeFunnelCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
20
+ stage: TextKey<Row>;
21
+ cohorts: readonly [CardSeries<Key>, CardSeries<Key>];
22
+ }
23
+ export declare function divergingLayout<Row>(data: readonly Row[], category: string, series: readonly (CardSeries<string> & {
24
+ side: 'negative' | 'neutral' | 'positive';
25
+ })[], percent: boolean, width: number, height: number): ObservationScene<Row>;
26
+ export declare function mirroredLayout<Row>(data: readonly Row[], category: string, keys: readonly [string, string], labels: readonly [string, string], width: number, height: number): ObservationScene<Row>;
27
+ export declare function comparativeFunnelLayout<Row>(data: readonly Row[], stage: string, cohorts: readonly CardSeries<string>[], width: number, height: number): ObservationScene<Row>;
28
+ export declare function DivergingBarCard<Row, const Key extends NumericKey<Row>>({ category, series, percent, ...props }: DivergingBarCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
29
+ export declare function MirroredBarCard<Row, const Key extends NumericKey<Row>>({ category, left, right, leftLabel, rightLabel, ...props }: MirroredBarCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
30
+ export declare function ComparativeFunnelCard<Row, const Key extends NumericKey<Row>>({ stage, cohorts, ...props }: ComparativeFunnelCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
3
+ export interface NestedDonutCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
4
+ /** Unique leaf paths separated by /. Parent totals are calculated from leaves. */
5
+ path: TextKey<Row>;
6
+ value: Key;
7
+ hole?: number;
8
+ }
9
+ export declare function nestedDonutLayout<Row>(data: readonly Row[], path: string, value: string, hole: number, width: number, height: number): ObservationScene<Row>;
10
+ export declare function NestedDonutCard<Row, const Key extends NumericKey<Row>>({ path, value, hole, ...props }: NestedDonutCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
3
+ export interface ContourIslandsCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'legend' | 'legendSwatch'> {
4
+ x: Key;
5
+ y: Key;
6
+ label: TextKey<Row>;
7
+ /** Optional nonnegative density weight. Without it each observation has weight one. */
8
+ weight?: Key;
9
+ /** Kernel bandwidth as a fraction of each axis span, 0.04–0.25. Default 0.1. */
10
+ bandwidth?: number;
11
+ /** Number of contour terraces, 3–9. Default 6. */
12
+ levels?: number;
13
+ }
14
+ export declare const placeholderCloud: {
15
+ name: string;
16
+ x: number;
17
+ y: number;
18
+ }[];
19
+ export declare function contourIslandsLayout<Row>(data: readonly Row[], xKey: string, yKey: string, label: string, width: number, height: number, options?: {
20
+ weight?: string;
21
+ bandwidth?: number;
22
+ levels?: number;
23
+ color?: string;
24
+ }): ObservationScene<Row>;
25
+ export declare function ContourIslandsCard<Row, const Key extends NumericKey<Row>>({ x, y, label, weight, bandwidth, levels, color, height, ...props }: ContourIslandsCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { Point } from './sculpted-geometry';
2
+ /** Marching squares on a padded density grid. Segments join into closed contour rings. */
3
+ export declare function densityContours(grid: readonly (readonly number[])[], threshold: number): Point[][];
@@ -0,0 +1,37 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { CardSeries } from './cartesian-card';
3
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
4
+ export interface ViolinCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
5
+ category: TextKey<Row>;
6
+ value: Key;
7
+ label?: TextKey<Row>;
8
+ points?: boolean;
9
+ /** Kernel bandwidth in measurement units; defaults to a data-derived bandwidth per group. */
10
+ bandwidth?: number;
11
+ scale?: 'width' | 'density';
12
+ }
13
+ export interface CorrelationMatrixCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
14
+ metrics: readonly CardSeries<Key>[];
15
+ /** Minimum complete pairs per coefficient; defaults to 3. */
16
+ minPairs?: number;
17
+ }
18
+ export declare function quantileSorted(values: readonly number[], p: number): number | null;
19
+ export declare function violinDensity(values: readonly number[], bandwidth?: number): {
20
+ points: {
21
+ x: number;
22
+ density: number;
23
+ }[];
24
+ median: number;
25
+ low: number;
26
+ high: number;
27
+ bandwidth: number;
28
+ } | null;
29
+ export declare function violinLayout<Row>(data: readonly Row[], category: string, value: string, label: string | undefined, points: boolean, bandwidth: number | undefined, scale: 'width' | 'density', width: number, height: number): ObservationScene<Row>;
30
+ /** Pearson correlation from complete pairs, scaled before centering to avoid overflow. */
31
+ export declare function pairedCorrelation(pairs: readonly (readonly [number | null, number | null])[], minPairs?: number): {
32
+ value: number | null;
33
+ count: number;
34
+ };
35
+ export declare function correlationLayout<Row>(data: readonly Row[], metrics: readonly CardSeries<string>[], minPairs: number, width: number, height: number): ObservationScene<Row>;
36
+ export declare function ViolinCard<Row, const Key extends NumericKey<Row>>({ category, value, label, points, bandwidth, scale, aggregate, ...props }: ViolinCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
37
+ export declare function CorrelationMatrixCard<Row, const Key extends NumericKey<Row>>({ metrics, minPairs, valueFormat, legend, ...props }: CorrelationMatrixCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { NumericKey, TextKey, XKey } from './keys';
2
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
3
+ export interface EventHelixCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
4
+ /** Unique event label, including for simultaneous events. */
5
+ label: TextKey<Row>;
6
+ date: XKey<Row>;
7
+ value: Key;
8
+ group?: TextKey<Row>;
9
+ /** One revolution per UTC day or week. Default day. */
10
+ cycle?: 'day' | 'week';
11
+ /** Vertical spacing between turns, 26–100 pixels. Default 54. */
12
+ pitch?: number;
13
+ }
14
+ export declare const placeholderEvents: {
15
+ event: string;
16
+ date: string;
17
+ value: number;
18
+ group: string;
19
+ }[];
20
+ export declare function eventHelixLayout<Row>(data: readonly Row[], label: string, date: string, value: string, width: number, height: number, options?: {
21
+ group?: string;
22
+ cycle?: 'day' | 'week';
23
+ pitch?: number;
24
+ color?: string;
25
+ }): ObservationScene<Row>;
26
+ export declare function EventHelixCard<Row, const Key extends NumericKey<Row>>({ label, date, value, group, cycle, pitch, color, height, ...props }: EventHelixCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps } from './observations-card';
3
+ export { helixRibbonsLayout } from './spatial-series-layouts';
4
+ export interface HelixRibbonsCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
5
+ series: TextKey<Row>;
6
+ cycle: NumericKey<Row>;
7
+ phase: NumericKey<Row>;
8
+ value: Key;
9
+ yaw?: number;
10
+ elevation?: number;
11
+ thickness?: number;
12
+ maxGap?: number;
13
+ }
14
+ export declare function HelixRibbonsCard<Row, const Key extends NumericKey<Row>>({ series, cycle, phase, value, yaw, elevation, thickness, maxGap, color, height, depth, ...props }: HelixRibbonsCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps, ObservationScene } from './observations-card';
3
+ export interface HexCityCardProps<Row, Key extends NumericKey<Row>> extends Omit<ObservationsCardProps<Row>, 'legendSwatch'> {
4
+ /** Unique name for each hexagon. */
5
+ label: TextKey<Row>;
6
+ value: Key;
7
+ /** Colors hexagons by a category and adds its legend. */
8
+ group?: TextKey<Row>;
9
+ /** `rank` (default) puts the largest value in the middle and works outward; `order` keeps rows in order. */
10
+ arrange?: 'rank' | 'order';
11
+ /** How many hexagon widths the largest value rises, default 2. */
12
+ rise?: number;
13
+ /** Space between hexagons as a share of their size, 0 to 0.5, default 0.12. */
14
+ gap?: number;
15
+ /** Fixed value domain that must contain every value. Defaults to zero through the largest. */
16
+ domain?: readonly [number, number];
17
+ }
18
+ /**
19
+ * A honeycomb of hexagonal prisms: one per row, standing as tall as its value. By default the
20
+ * largest value stands in the middle and the city falls away toward its edges.
21
+ */
22
+ export declare function hexCityLayout<Row>(data: readonly Row[], label: string, value: string, width: number, height: number, options?: Pick<HexCityCardProps<Row, NumericKey<Row>>, 'arrange' | 'rise' | 'gap' | 'domain' | 'color'> & {
23
+ group?: string;
24
+ }): ObservationScene<Row>;
25
+ export declare function HexCityCard<Row, const Key extends NumericKey<Row>>({ label, value, group, arrange, rise, gap, domain, color, legend, height, ...props }: HexCityCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { Branch } from './spatial-hierarchy';
2
+ import { Scene } from './spatial-geometry';
3
+ export declare function sunburstTerracesLayout<Row>(data: readonly Row[], path: string, value: string, width: number, height: number, options?: {
4
+ tilt?: number;
5
+ rise?: number;
6
+ color?: string;
7
+ }): Scene<Row>;
8
+ interface Packed<Row> {
9
+ node: Branch<Row>;
10
+ x: number;
11
+ y: number;
12
+ r: number;
13
+ children: Packed<Row>[];
14
+ }
15
+ /** Deterministic tangent candidates. Every leaf keeps the same area/value scale. */
16
+ export declare function packHierarchy<Row>(node: Branch<Row>, padding: number): Packed<Row>;
17
+ export declare function circleArchipelagoLayout<Row>(data: readonly Row[], path: string, value: string, width: number, height: number, options?: {
18
+ padding?: number;
19
+ color?: string;
20
+ }): Scene<Row>;
21
+ export {};
@@ -0,0 +1,10 @@
1
+ import { NumericKey, TextKey } from './keys';
2
+ import { ObservationsCardProps } from './observations-card';
3
+ export { horizonFoldsLayout } from './spatial-series-layouts';
4
+ export interface HorizonFoldsCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
5
+ series: TextKey<Row>;
6
+ time: NumericKey<Row>;
7
+ value: Key;
8
+ bands?: number;
9
+ }
10
+ export declare function HorizonFoldsCard<Row, const Key extends NumericKey<Row>>({ series, time, value, bands, color, height, depth, ...props }: HorizonFoldsCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -42,7 +42,7 @@ export interface HorizontalBarChartCardProps<Row, Key extends NumericKey<Row>> {
42
42
  * `isometric` draws a solid block under the label whose front ends at the value, with a lit
43
43
  * roof and a shaded end receding behind it.
44
44
  */
45
- barStyle?: 'inline' | 'track' | 'isometric';
45
+ barStyle?: 'inline' | 'track' | 'isometric' | 'lollipop';
46
46
  /** Shorthand for depth across every card family: here it makes `barStyle` default to `isometric`. */
47
47
  depth?: boolean;
48
48
  valueFormat?: Intl.NumberFormatOptions;
@@ -0,0 +1,9 @@
1
+ import { NumericKey, KeysOfType } from './keys';
2
+ import { ObservationsCardProps } from './observations-card';
3
+ export { intersectionTowersLayout } from './spatial-composition-layouts';
4
+ export interface IntersectionTowersCardProps<Row, Key extends NumericKey<Row>> extends ObservationsCardProps<Row> {
5
+ members: KeysOfType<Row, readonly string[]>;
6
+ value: Key;
7
+ sort?: 'value' | 'input';
8
+ }
9
+ export declare function IntersectionTowersCard<Row, const Key extends NumericKey<Row>>({ members, value, sort, color, height, depth, ...props }: IntersectionTowersCardProps<Row, Key>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import { ReactElement } from 'react';
2
- import { CardNormal, CartesianCardProps } from './cartesian-card';
2
+ import { CartesianCardProps } from './cartesian-card';
3
3
  import { NumericKey } from './keys';
4
- import { NormalReport } from '../watch/board/board-state';
5
4
  export interface LineChartCardProps<Row, Key extends NumericKey<Row>> extends CartesianCardProps<Row, Key> {
5
+ /** Rebase each series' first finite reading to 100. A zero baseline is unindexable. */
6
+ indexed?: boolean;
6
7
  /** `smooth` uses a monotone curve, `linear` straight segments, `step` holds each value flat. */
7
8
  curve?: 'smooth' | 'linear' | 'step';
8
9
  /** Mark every observation with a small dot. Defaults to false. */
@@ -12,17 +13,9 @@ export interface LineChartCardProps<Row, Key extends NumericKey<Row>> extends Ca
12
13
  * zero when the absolute level matters.
13
14
  */
14
15
  baseline?: 'auto' | 'zero';
15
- /**
16
- * Watch one series against what is normal for it: a calm band where it is expected, a ring on
17
- * each unusual reading, and a header note while it stays unusual. Every layer is off unless
18
- * set. Unstacked cards only.
19
- */
20
- normal?: CardNormal<Row, NoInfer<Key>>;
21
- /** Called when the watched series' status changes, such as when an incident starts or clears. */
22
- onNormalChange?: (report: NormalReport | null) => void;
23
16
  }
24
17
  /**
25
18
  * A complete line chart card: headline, delta, period, plot, and value tiles.
26
19
  * The headline and tiles follow the hovered point, and the y pill follows the nearest line.
27
20
  */
28
- export declare function LineChartCard<Row, const Key extends NumericKey<Row>>({ curve, points, baseline, ...props }: LineChartCardProps<Row, Key>): ReactElement;
21
+ export declare function LineChartCard<Row, const Key extends NumericKey<Row>>({ indexed, curve, points, baseline, ...props }: LineChartCardProps<Row, Key>): ReactElement;
@@ -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;