@lilt-ui/charts 0.4.0 → 0.5.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 (38) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/activity-ring.d.ts +3 -1
  3. package/dist/cards/activity-ring-card.d.ts +3 -1
  4. package/dist/cards/bar-chart-card.d.ts +5 -2
  5. package/dist/cards/box-plot-card.d.ts +3 -1
  6. package/dist/cards/cartesian-card.d.ts +15 -3
  7. package/dist/cards/combo-chart-card.d.ts +4 -2
  8. package/dist/cards/funnel-chart-card.d.ts +26 -2
  9. package/dist/cards/heatmap-chart-card.d.ts +6 -1
  10. package/dist/cards/horizontal-bar-chart-card.d.ts +7 -3
  11. package/dist/cards/progress-card.d.ts +6 -1
  12. package/dist/cards/radar-chart-card.d.ts +9 -2
  13. package/dist/cards/radial-chart-card.d.ts +14 -5
  14. package/dist/cards/range-chart-card.d.ts +3 -1
  15. package/dist/cards/sankey-chart-card.d.ts +6 -1
  16. package/dist/cards/scatter-chart-card.d.ts +11 -2
  17. package/dist/cards/slope-chart-card.d.ts +6 -1
  18. package/dist/cards/stat-card.d.ts +7 -2
  19. package/dist/{cartesian-card-Cj1o38DC.js → cartesian-card-7DAiMU3w.js} +2023 -1604
  20. package/dist/engine/depth.d.ts +42 -0
  21. package/dist/engine/isometric-bars.d.ts +25 -0
  22. package/dist/engine/ranges.d.ts +31 -0
  23. package/dist/finance/candle-geometry.d.ts +13 -2
  24. package/dist/finance/candles.d.ts +5 -0
  25. package/dist/finance/cards/candlestick-chart-card.d.ts +6 -1
  26. package/dist/finance/cards/depth-chart-card.d.ts +3 -1
  27. package/dist/finance/order-book.d.ts +4 -2
  28. package/dist/finance.js +492 -447
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +2276 -1765
  31. package/dist/interaction/legend-meter.d.ts +11 -0
  32. package/dist/interaction/value-legend.d.ts +8 -2
  33. package/dist/marks/use-range-mark.d.ts +8 -0
  34. package/dist/primitives/depth-paint.d.ts +103 -0
  35. package/dist/primitives/isometric-bar.d.ts +18 -0
  36. package/dist/styles.css +1 -1
  37. package/dist/types.d.ts +30 -4
  38. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ Every chart that can carry it gets depth with one prop, and legends come in five layouts.
6
+
7
+ ### Depth
8
+
9
+ - `depth` gives a card depth. Every shape keeps its exact value; depth only adds light, shade and shadow, lit from the upper left.
10
+ - Bars, stacks, Combo and stat card bars become square blocks with a lit top and a shaded side; the front keeps the measured height. `barStyle="isometric"` gives the same look.
11
+ - Range bars, box plots and candle bodies become solid blocks. Box plot whiskers run through the middle of each block and the median wraps around it; candle wicks pass through the body.
12
+ - Radial donuts, pies, half donuts and rings, Progress rings and the stat card ring are lit tubes, with tracks cut into the card as grooves. Angles stay exact.
13
+ - Lines on Line, Area, Combo, stat card, Price, Indicator and Depth charts are lit tubes along their own path, with a soft shadow. Dashed references stay flat.
14
+ - Scatter points are lit spheres; Slope draws a tube between two spheres, and dumbbells match.
15
+ - The Funnel is a pipe: each stage shaded as a cylinder of its own thickness, with curved seams and rounded ends.
16
+ - Sankey flows are lit pipes of their exact width and nodes are small blocks.
17
+ - Heatmap cells are low tiles of one height; color alone still carries the value.
18
+ - Horizontal Bar (`barStyle="isometric"`), the stat card meter and Order book levels are solid blocks; Activity Ring dots are small pucks.
19
+
20
+ ### Legends
21
+
22
+ - Cards take `legend`: `tiles` (the default), `inline`, `list` rows, tinted `pills`, or `bars` that draw each value against the largest. Radial keeps its own `list` with shares.
23
+ - `legendSwatch` sets the mark beside each label: `square` (the default), `dot`, or `line`.
24
+ - `Legend` and `ValueLegend` take the same layouts as `variant`, and the marks as `swatch`.
25
+
26
+ ### Breaking
27
+
28
+ - `OrderBook` names its level count `levels`; `depth` is the 3D switch on every card.
29
+
3
30
  ## 0.4.0
4
31
 
5
32
  Every chart works with a finger, and pins shared across linked charts glide from point to point.
@@ -27,6 +27,8 @@ export interface ActivityRingProps<Row> {
27
27
  resetKey?: string | number;
28
28
  motion?: ChartMotion;
29
29
  height?: number;
30
+ /** Turns each dot into a small puck with walls receding up and to the right. */
31
+ depth?: boolean;
30
32
  'aria-label': string;
31
33
  className?: string;
32
34
  }
@@ -40,5 +42,5 @@ export declare function activitySlots<Row>(data: readonly Row[], hour: (row: Row
40
42
  * The 24-hour dot ring inside `ActivityRingCard`: one column of dots per time slot, filled by
41
43
  * how much happened then. One tab stop; arrow keys step around the day and Enter pins a slot.
42
44
  */
43
- export declare function ActivityRing<Row>({ data, hour, value, maximum, bucketMinutes, dotDensity, unit, formatValue, center, onSelectionChange, status, resetKey, motion, height, className, 'aria-label': ariaLabel, }: ActivityRingProps<Row>): import("react/jsx-runtime").JSX.Element;
45
+ export declare function ActivityRing<Row>({ data, hour, value, maximum, bucketMinutes, dotDensity, unit, formatValue, center, onSelectionChange, status, resetKey, motion, height, depth, className, 'aria-label': ariaLabel, }: ActivityRingProps<Row>): import("react/jsx-runtime").JSX.Element;
44
46
  export {};
@@ -21,6 +21,8 @@ export interface ActivityRingCardProps<Row, Key extends NumericKey<Row>> {
21
21
  maximum?: number;
22
22
  /** How the resting headline sums up the day: `sum` (default), `mean`, or `max`. */
23
23
  aggregate?: ActivityAggregate;
24
+ /** Turns each dot into a small puck with walls receding up and to the right. */
25
+ depth?: boolean;
24
26
  /** Ring height in pixels, at least 180. Defaults to 280. */
25
27
  height?: number;
26
28
  /** Resting headline. Defaults to the `aggregate` of every recorded slot. */
@@ -57,4 +59,4 @@ export declare function clockLabel(hour: number): string;
57
59
  * filled by how much happened then. Hovering or stepping around the ring reads each slot in the
58
60
  * headline; tiles name the busiest and quietest times.
59
61
  */
60
- export declare function ActivityRingCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, hour, value, bucketMinutes, unit, maximum: suppliedMaximum, aggregate, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion, className, style, }: ActivityRingCardProps<Row, Key>): ReactElement;
62
+ export declare function ActivityRingCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, hour, value, bucketMinutes, unit, maximum: suppliedMaximum, aggregate, height, depth, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion, className, style, }: ActivityRingCardProps<Row, Key>): ReactElement;
@@ -22,13 +22,16 @@ export interface BarChartCardProps<Row, Key extends NumericKey<Row>> extends Car
22
22
  barWidth?: number;
23
23
  /**
24
24
  * How bars are drawn: `solid` (default), `segmented` into small cells, `needle` (thin segmented
25
- * lines; the hovered bar expands), `gradient` fading toward the baseline, or `outline`.
25
+ * lines; the hovered bar expands), `gradient` fading toward the baseline, `outline`, or
26
+ * `isometric` with a shaded top and side around the measured front face.
26
27
  */
27
28
  barStyle?: ChartBarAppearance;
29
+ /** Shorthand for depth across every card family: here it makes `barStyle` default to `isometric`. */
30
+ depth?: boolean;
28
31
  }
29
32
  /**
30
33
  * A complete bar chart card: headline, delta, period, plot, and value tiles.
31
34
  * Dashed series draw as reference lines over the bars. Bars stay inside the card padding by
32
35
  * default, so every label centers on its bar.
33
36
  */
34
- export declare function BarChartCard<Row, const Key extends NumericKey<Row>>({ stack, radius, corners, tracks, barWidth, barStyle, ...props }: BarChartCardProps<Row, Key>): ReactElement;
37
+ export declare function BarChartCard<Row, const Key extends NumericKey<Row>>({ stack, radius, corners, tracks, barWidth, depth, barStyle, ...props }: BarChartCardProps<Row, Key>): ReactElement;
@@ -21,10 +21,12 @@ export interface BoxPlotCardProps<Row> extends SharedProps<Row> {
21
21
  color?: string;
22
22
  /** Draw samples beyond the whiskers as dots. Defaults to true. */
23
23
  outliers?: boolean;
24
+ /** Draws each box as a solid block receding up and to the right; the front keeps Q1 and Q3. */
25
+ depth?: boolean;
24
26
  }
25
27
  /**
26
28
  * Distributions side by side: quartile boxes, a median line, Tukey whiskers and outliers,
27
29
  * computed from each row's raw samples. The headline is the median of every sample.
28
30
  */
29
- export declare function BoxPlotCard<Row>({ data, x, samples, label, color, outliers, headline, ...props }: BoxPlotCardProps<Row>): ReactElement;
31
+ export declare function BoxPlotCard<Row>({ data, x, samples, label, color, outliers, depth, headline, ...props }: BoxPlotCardProps<Row>): ReactElement;
30
32
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartController, ChartMargins, ChartTooltipContext, NumericXConfig, TimeXConfig, ChartAxis, ChartBarAppearance, ChartBackground, ChartCurve, ChartMotion, ChartPalette, ChartHoverReadout, ChartHoverStyle, ChartSeries, ChartTooltipIndicator, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartController, ChartMargins, ChartTooltipContext, NumericXConfig, TimeXConfig, ChartAxis, ChartBarAppearance, ChartBackground, ChartCurve, ChartMotion, ChartPalette, ChartHoverReadout, ChartHoverStyle, ChartSeries, ChartTooltipIndicator, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { NumericKey, ResolvedX, XKey, XKind } from './keys';
4
4
  import { CardAggregate } from './format';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -84,8 +84,20 @@ export interface CartesianCardProps<Row, Key extends NumericKey<Row>> {
84
84
  /** Period select. Each range replaces data, delta and headline. */
85
85
  ranges?: readonly CardRange<Row>[];
86
86
  defaultRange?: string;
87
- /** Per-series stat tiles under the plot. Defaults to true. */
87
+ /** Per-series stat tiles under the plot. Defaults to true; false hides the legend. */
88
88
  tiles?: boolean;
89
+ /**
90
+ * How the legend under the plot lays out: value `tiles` (default), compact `inline` labels,
91
+ * `list` rows, tinted `pills`, or `bars` that also draw each value against the largest.
92
+ */
93
+ legend?: CardLegend;
94
+ /** The mark beside each legend label: `square` (default), `dot`, or `line`. */
95
+ legendSwatch?: ChartLegendSwatch;
96
+ /**
97
+ * Gives the plot depth: lines become lit tubes with a soft shadow, and bar cards draw
98
+ * `isometric` blocks. Every point and bar still reads its exact value.
99
+ */
100
+ depth?: boolean;
89
101
  /** Plot height in pixels. Defaults to 240. */
90
102
  height?: number;
91
103
  /** Number format for the headline, tiles, and axis, e.g. `{ style: 'currency', currency: 'USD' }`. */
@@ -266,7 +278,7 @@ export declare const CARD_PADDING = 20;
266
278
  * The shared card body: headline, delta, period, plot, and value tiles, with hover sync and
267
279
  * range comparison. Area, Line, and Bar cards differ only in their `shape`.
268
280
  */
269
- export declare function CartesianCard<Row, Key extends NumericKey<Row>>({ shape, title, data: suppliedData, x, series: seriesInput, headline: suppliedHeadline, aggregate: suppliedAggregate, headlineSeries, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, tiles, height, valueFormat, locale, formatValue: suppliedFormatValue, formatAxisValue: suppliedFormatAxisValue, formatX, xType, compare, target: suppliedTarget, forecast, sync, axis, hover, hoverStyle, background, spotlight, surface, badge, numberStyle, palette, bleed, axisInset, pillSeries, pillValue, pillPosition, tooltipIndicator, loading, motion, className, style, panes, live, heading, restCaption, normal, onNormalChange, }: Omit<CartesianCardProps<Row, Key>, 'series'> & {
281
+ export declare function CartesianCard<Row, Key extends NumericKey<Row>>({ shape, title, 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, surface, badge, numberStyle, palette, bleed, axisInset, pillSeries, pillValue, pillPosition, tooltipIndicator, loading, motion, className, style, panes, live, heading, restCaption, normal, onNormalChange, }: Omit<CartesianCardProps<Row, Key>, 'series'> & {
270
282
  series: readonly CoreSeries<Key>[];
271
283
  shape: CardShape;
272
284
  /** Linked panes under the plot, such as volume or indicators. */
@@ -36,8 +36,10 @@ export interface ComboChartCardProps<Row, Key extends NumericKey<Row>> extends O
36
36
  tracks?: boolean;
37
37
  /** Maximum bar width in pixels; bars never exceed their slot. */
38
38
  barWidth?: number;
39
- /** `solid` (default), `segmented`, `needle`, `gradient`, or `outline`. */
39
+ /** `solid` (default), `segmented`, `needle`, `gradient`, `outline`, or `isometric`. */
40
40
  barStyle?: ChartBarAppearance;
41
+ /** Shorthand for depth across every card family: here it makes `barStyle` default to `isometric`. */
42
+ depth?: boolean;
41
43
  /** `smooth` (default) or `linear` line segments. */
42
44
  curve?: 'smooth' | 'linear';
43
45
  /** Mark every line observation with a small dot. Defaults to true. */
@@ -48,4 +50,4 @@ export interface ComboChartCardProps<Row, Key extends NumericKey<Row>> extends O
48
50
  * The headline totals the bars; every series gets a tile, and the pill reads whichever mark is
49
51
  * nearest the pointer.
50
52
  */
51
- export declare function ComboChartCard<Row, const Key extends NumericKey<Row>>({ bars, lines, lineScale, stack, radius, corners, tracks, barWidth, barStyle, curve, points, aggregate, pillPosition, ...props }: ComboChartCardProps<Row, Key>): ReactElement;
53
+ export declare function ComboChartCard<Row, const Key extends NumericKey<Row>>({ bars, lines, lineScale, stack, radius, corners, tracks, barWidth, depth, barStyle, curve, points, aggregate, pillPosition, ...props }: ComboChartCardProps<Row, Key>): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -17,6 +17,11 @@ export interface FunnelChartCardProps<Row, Key extends NumericKey<Row>> {
17
17
  colors?: 'stages' | 'single';
18
18
  /** A quiet full-height lane behind each stage, marking where 100% sits. Defaults to false. */
19
19
  tracks?: boolean;
20
+ /**
21
+ * Gives the funnel depth: a pipe seen a little from the right, every stage shaded as a cylinder
22
+ * of its own thickness, with curved seams and elliptical ends. Band heights still read true.
23
+ */
24
+ depth?: boolean;
20
25
  /** Plot height in pixels. Defaults to 180. */
21
26
  height?: number;
22
27
  /** Resting headline. Defaults to the first stage. */
@@ -29,6 +34,13 @@ export interface FunnelChartCardProps<Row, Key extends NumericKey<Row>> {
29
34
  /** Period select. Each range replaces data, delta, and headline; bands ease to their new size. */
30
35
  ranges?: readonly CardRange<Row>[];
31
36
  defaultRange?: string;
37
+ /**
38
+ * How the legend lays out: value `tiles` (default), compact `inline` labels, `list` rows, tinted
39
+ * `pills`, or `bars` that also draw each value against the largest.
40
+ */
41
+ legend?: CardLegend;
42
+ /** The mark beside each legend label: `square` (default), `dot`, or `line`. */
43
+ legendSwatch?: ChartLegendSwatch;
32
44
  valueFormat?: Intl.NumberFormatOptions;
33
45
  locale?: string;
34
46
  formatValue?: (value: number) => string;
@@ -54,9 +66,21 @@ export declare function stageShare(share: number | null): string;
54
66
  * stay level.
55
67
  */
56
68
  export declare function stagePath(index: number, height: number, next: number | null, curve: 'smooth' | 'linear'): string;
69
+ /**
70
+ * Upright strips that tile one stage's band from left to right, each as tall as the band where
71
+ * it stands, so a gradient mapped to each strip shades the band like a cylinder of that local
72
+ * thickness. Strips overlap a little; the stage's own outline trims them.
73
+ */
74
+ export declare function pipeStrips(index: number, height: number, next: number | null, curve: 'smooth' | 'linear'): {
75
+ x: number;
76
+ width: number;
77
+ half: number;
78
+ }[];
79
+ /** Half of a pipe's elliptical cross-section at `x`: the side facing `right` or left. */
80
+ export declare function pipeEnd(x: number, half: number, rx: number, side: 'left' | 'right'): string;
57
81
  /**
58
82
  * A funnel card: stages left to right, each band sized by its share of the first stage, with
59
83
  * its percentage on the band and its count in a tile beneath. Hovering a stage reads it in the
60
84
  * headline with the conversion from the step before.
61
85
  */
62
- export declare function FunnelChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, value, curve, colors, tracks, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: FunnelChartCardProps<Row, Key>): ReactElement;
86
+ export declare function FunnelChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, value, curve, colors, tracks, depth, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: FunnelChartCardProps<Row, Key>): ReactElement;
@@ -32,6 +32,11 @@ export interface HeatmapChartCardProps<Row, Key extends NumericKey<Row>> {
32
32
  radius?: number;
33
33
  /** Space between cells in pixels. Defaults to 4. */
34
34
  gap?: number;
35
+ /**
36
+ * Raises every cell as a cushioned tile with a lit top edge and a soft shadow. All tiles share
37
+ * one height: color still carries the value.
38
+ */
39
+ depth?: boolean;
35
40
  /** Resting headline. Defaults to the `aggregate` of every known cell. */
36
41
  headline?: number;
37
42
  /** Fractional change shown as a chip, e.g. 0.052 → +5.2%. */
@@ -104,4 +109,4 @@ export declare function labelTier(index: number, count: number): 'major' | 'mino
104
109
  * labeled. Hovering or focusing a cell reads it in the headline; arrow keys move between cells.
105
110
  * Missing cells are hatched and say "No data", so they never read as zero.
106
111
  */
107
- export declare function HeatmapChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, x, y, value, columns, rows: rowOrder, domain, aggregate, height, radius, gap, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: HeatmapChartCardProps<Row, Key>): ReactElement;
112
+ export declare function HeatmapChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, x, y, value, columns, rows: rowOrder, domain, aggregate, height, radius, gap, depth, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: HeatmapChartCardProps<Row, Key>): ReactElement;
@@ -33,9 +33,13 @@ export interface HorizontalBarChartCardProps<Row, Key extends NumericKey<Row>> {
33
33
  /** Number each row by rank. Defaults to false. */
34
34
  rank?: boolean;
35
35
  /**
36
- * `inline` (default) sets each label on a soft bar; `track` draws a slim bar under the label.
36
+ * `inline` (default) sets each label on a soft bar; `track` draws a slim bar under the label;
37
+ * `isometric` draws a solid block under the label whose front ends at the value, with a lit
38
+ * roof and a shaded end receding behind it.
37
39
  */
38
- barStyle?: 'inline' | 'track';
40
+ barStyle?: 'inline' | 'track' | 'isometric';
41
+ /** Shorthand for depth across every card family: here it makes `barStyle` default to `isometric`. */
42
+ depth?: boolean;
39
43
  valueFormat?: Intl.NumberFormatOptions;
40
44
  locale?: string;
41
45
  formatValue?: (value: number) => string;
@@ -57,4 +61,4 @@ export interface HorizontalBarChartCardProps<Row, Key extends NumericKey<Row>> {
57
61
  * A ranked list card: each row carries a bar, its value, and its share of the total. Hovering a
58
62
  * row reads it in the headline; click pins it and the arrow keys move through the list.
59
63
  */
60
- export declare function HorizontalBarChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, value, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, sort, limit, otherLabel, share, rank, barStyle, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: HorizontalBarChartCardProps<Row, Key>): ReactElement;
64
+ export declare function HorizontalBarChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, value, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, sort, limit, otherLabel, share, rank, depth, barStyle, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: HorizontalBarChartCardProps<Row, Key>): ReactElement;
@@ -22,6 +22,11 @@ export interface ProgressCardProps {
22
22
  * a half ring that opens downward.
23
23
  */
24
24
  variant?: 'ring' | 'thick' | 'gauge';
25
+ /**
26
+ * Gives the ring depth: the fill is lit as a tube and the track becomes a groove. The arc keeps
27
+ * its exact angle.
28
+ */
29
+ depth?: boolean;
25
30
  /** Fractional change shown as a chip, e.g. 0.052 → +5.2%. */
26
31
  delta?: number;
27
32
  deltaTone?: 'default' | 'inverse' | 'neutral';
@@ -52,4 +57,4 @@ export interface ProgressCardProps {
52
57
  * One value against a goal: the value in the header, and a large ring or gauge with the
53
58
  * percentage reached. Past the goal the ring stays full and the percentage keeps counting.
54
59
  */
55
- export declare function ProgressCard({ title, value: suppliedValue, target: suppliedTarget, label, variant, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, footer, valueFormat, locale, formatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: ProgressCardProps): ReactElement;
60
+ export declare function ProgressCard({ title, value: suppliedValue, target: suppliedTarget, label, variant, depth, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, footer, valueFormat, locale, formatValue, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: ProgressCardProps): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange, CardSeries } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -34,6 +34,13 @@ export interface RadarChartCardProps<Row, Key extends NumericKey<Row>> {
34
34
  /** Period select. Each range replaces data, delta, and headline; profiles ease to their shape. */
35
35
  ranges?: readonly CardRange<Row>[];
36
36
  defaultRange?: string;
37
+ /**
38
+ * How the legend lays out: value `tiles` (default), compact `inline` labels, `list` rows, tinted
39
+ * `pills`, or `bars` that also draw each value against the largest.
40
+ */
41
+ legend?: CardLegend;
42
+ /** The mark beside each legend label: `square` (default), `dot`, or `line`. */
43
+ legendSwatch?: ChartLegendSwatch;
37
44
  valueFormat?: Intl.NumberFormatOptions;
38
45
  locale?: string;
39
46
  formatValue?: (value: number) => string;
@@ -89,5 +96,5 @@ export declare function profilePath(fractions: readonly (number | null)[], radiu
89
96
  * shape of strengths and gaps reads at a glance. Hovering or stepping around the spokes reads
90
97
  * every profile at that dimension.
91
98
  */
92
- export declare function RadarChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, series, domain: suppliedDomain, aggregate, grid, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: RadarChartCardProps<Row, Key>): ReactElement;
99
+ export declare function RadarChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, series, domain: suppliedDomain, aggregate, grid, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: RadarChartCardProps<Row, Key>): ReactElement;
93
100
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, RankingOrder } from '../types';
2
+ import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, RankingOrder, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { RankedRow } from './rank';
@@ -19,10 +19,19 @@ export interface RadialChartCardProps<Row, Key extends NumericKey<Row>> {
19
19
  */
20
20
  variant?: RadialChartCardVariant;
21
21
  /**
22
- * `list` rows with value and share, value `tiles`, or an `inline` key. Defaults to tiles for
23
- * rings, inline for semi, and list otherwise.
22
+ * Gives the chart depth: every band is lit as a tube from the upper left, ring tracks become
23
+ * grooves, and a soft shadow lifts the chart off the card. Outlines keep their exact angles,
24
+ * so shares read the same as the flat chart.
24
25
  */
25
- legend?: 'list' | 'tiles' | 'inline';
26
+ depth?: boolean;
27
+ /**
28
+ * `list` rows with value and share, value `tiles`, an `inline` key, tinted `pills`, or `bars`
29
+ * that also draw each value against the largest. Defaults to tiles for rings, inline for semi,
30
+ * and list otherwise.
31
+ */
32
+ legend?: CardLegend;
33
+ /** The mark beside each legend label: `square` (default), `dot`, or `line`. */
34
+ legendSwatch?: ChartLegendSwatch;
26
35
  /** Resting headline. Defaults to the total of every slice. */
27
36
  headline?: number;
28
37
  /** Fractional change shown as a chip, e.g. 0.082 → +8.2%. */
@@ -75,5 +84,5 @@ export declare function ringAngles(rows: readonly RankedRow[]): Slice[];
75
84
  * A donut or pie card: the headline total, slices with a matching legend, and each slice's
76
85
  * share. Hovering a slice or a legend row reads it in the headline.
77
86
  */
78
- export declare function RadialChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, value, variant, legend, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, limit, otherLabel, sort, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: RadialChartCardProps<Row, Key>): ReactElement;
87
+ export declare function RadialChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, value, variant, depth, legend, legendSwatch, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, limit, otherLabel, sort, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: RadialChartCardProps<Row, Key>): ReactElement;
79
88
  export {};
@@ -17,6 +17,8 @@ export interface RangeChartCardProps<Row, Key extends NumericKey<Row>> extends S
17
17
  color?: string;
18
18
  /** `bar` (default) floats a bar from low to high; `error` draws whiskers around the value. */
19
19
  display?: 'bar' | 'error';
20
+ /** Draws each bar as a solid block receding up and to the right. Error bars stay flat. */
21
+ depth?: boolean;
20
22
  /** Per-series stat tile under the plot. Defaults to false. */
21
23
  tiles?: boolean;
22
24
  }
@@ -24,5 +26,5 @@ export interface RangeChartCardProps<Row, Key extends NumericKey<Row>> extends S
24
26
  * Ranges per observation: floating bars from low to high, or error bars around a value. The
25
27
  * headline summarizes the values (the mean by default) and hover reads the range's ends.
26
28
  */
27
- export declare function RangeChartCard<Row, const Key extends NumericKey<Row>>({ low, high, value, label, color, display, aggregate, tiles, ...props }: RangeChartCardProps<Row, Key>): ReactElement;
29
+ export declare function RangeChartCard<Row, const Key extends NumericKey<Row>>({ low, high, value, label, color, display, depth, aggregate, tiles, ...props }: RangeChartCardProps<Row, Key>): ReactElement;
28
30
  export {};
@@ -20,6 +20,11 @@ export interface SankeyChartCardProps<Row, Key extends NumericKey<Row>> {
20
20
  */
21
21
  conservation?: 'loss' | 'strict';
22
22
  /** Plot height in pixels. Defaults to 280. */
23
+ /**
24
+ * Gives the diagram depth: flows become lit pipes and nodes small blocks. Flow widths and node
25
+ * heights stay exact.
26
+ */
27
+ depth?: boolean;
23
28
  height?: number;
24
29
  /** Resting headline. Defaults to everything entering the first steps. */
25
30
  headline?: number;
@@ -65,5 +70,5 @@ export declare function sankeyGraph<Row>({ data, source, target, value, conserva
65
70
  * amount that moved. Hovering or stepping through flows with the arrow keys reads each in the
66
71
  * headline with its share of the step it left.
67
72
  */
68
- export declare function SankeyChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, source, target, value, conservation, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: SankeyChartCardProps<Row, Key>): ReactElement;
73
+ export declare function SankeyChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, source, target, value, conservation, depth, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: SankeyChartCardProps<Row, Key>): ReactElement;
69
74
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -26,6 +26,8 @@ export interface ScatterChartCardProps<Row, Key extends NumericKey<Row>> {
26
26
  yLabel?: string;
27
27
  /** A least-squares line through the points, with its r² in the footer. */
28
28
  trend?: boolean;
29
+ /** Draws each point as a lit sphere with a soft contact shadow; centers and sizes stay exact. */
30
+ depth?: boolean;
29
31
  /** Plot height in pixels, including the axes. Defaults to 260. */
30
32
  height?: number;
31
33
  /** How the resting headline sums up `y`: `sum` (default), `mean`, or `max`. */
@@ -40,6 +42,13 @@ export interface ScatterChartCardProps<Row, Key extends NumericKey<Row>> {
40
42
  /** Period select. Each range replaces data, delta, and headline; points glide to their place. */
41
43
  ranges?: readonly CardRange<Row>[];
42
44
  defaultRange?: string;
45
+ /**
46
+ * How the legend lays out: value `tiles` (default), compact `inline` labels, `list` rows, tinted
47
+ * `pills`, or `bars` that also draw each value against the largest.
48
+ */
49
+ legend?: CardLegend;
50
+ /** The mark beside each legend label: `square` (default), `dot`, or `line`. */
51
+ legendSwatch?: ChartLegendSwatch;
43
52
  /** Number format for `y`: the headline, legend, and y axis. */
44
53
  valueFormat?: Intl.NumberFormatOptions;
45
54
  /** Number format for `x`, e.g. `{ style: 'currency', currency: 'USD' }`. */
@@ -88,4 +97,4 @@ export declare function clipTrend(fit: {
88
97
  * and colored by group. Hovering or stepping through points with the arrow keys reads each one in
89
98
  * the headline, with its position marked on both axes.
90
99
  */
91
- export declare function ScatterChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, x, y, size, sizeLabel, group, label, xLabel, yLabel, trend, height, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, xFormat, locale, formatValue: suppliedFormatValue, formatX: suppliedFormatX, color, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: ScatterChartCardProps<Row, Key>): ReactElement;
100
+ export declare function ScatterChartCard<Row, const Key extends NumericKey<Row>>({ title, 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, motion: motionMode, className, style, }: ScatterChartCardProps<Row, Key>): ReactElement;
@@ -24,6 +24,11 @@ export interface SlopeChartCardProps<Row, Key extends NumericKey<Row>> {
24
24
  * categories as rows with both values on one shared scale.
25
25
  */
26
26
  variant?: 'slope' | 'dumbbell';
27
+ /**
28
+ * Draws each change as a lit tube between two spheres, with a soft shadow. Ends stay exactly on
29
+ * their values.
30
+ */
31
+ depth?: boolean;
27
32
  /** `change` (default) puts the largest gain first, `to` the largest later value, `input` keeps your order. */
28
33
  sort?: SlopeOrder;
29
34
  /**
@@ -70,4 +75,4 @@ export interface SlopeChartCardProps<Row, Key extends NumericKey<Row>> {
70
75
  * category reads its later value and change in the headline; click pins it, and the arrow keys
71
76
  * move through categories.
72
77
  */
73
- export declare function SlopeChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, from, to, fromLabel, toLabel, variant, sort, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, color, height, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: SlopeChartCardProps<Row, Key>): ReactElement;
78
+ export declare function SlopeChartCard<Row, const Key extends NumericKey<Row>>({ title, data: suppliedData, category, from, to, fromLabel, toLabel, variant, depth, sort, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, color, height, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, motion: motionMode, className, style, }: SlopeChartCardProps<Row, Key>): ReactElement;
@@ -32,8 +32,13 @@ export interface StatCardProps<Row, Key extends NumericKey<Row>> {
32
32
  * `ring` beside the value, both filling toward `target`; or `none`.
33
33
  */
34
34
  chart?: StatCardChart;
35
- /** Bar treatment for `chart="bars"`: `solid` (default), `segmented`, `needle`, `gradient`, `outline`. */
35
+ /** Bar treatment for `chart="bars"`: `solid` (default), `segmented`, `needle`, `gradient`, `outline`, or `isometric`. */
36
36
  barStyle?: ChartBarAppearance;
37
+ /**
38
+ * Gives the small chart depth: lines and the ring become lit tubes, the meter a solid bar, and bars default
39
+ * to `isometric`. Values still read from the front faces.
40
+ */
41
+ depth?: boolean;
37
42
  /** Goal for `chart="meter"` or `chart="ring"`, in the same unit as the value. */
38
43
  target?: number;
39
44
  /**
@@ -65,4 +70,4 @@ export interface StatCardProps<Row, Key extends NumericKey<Row>> {
65
70
  }
66
71
  /** Cells of a meter: whole cells up to the value, then one cell trimmed to the exact remainder. */
67
72
  export declare function meterCells(ratio: number, count?: number): number[];
68
- export declare function StatCard<Row, const Key extends NumericKey<Row>>({ title, data, value: valueKey, x, xType, headline: suppliedHeadline, aggregate, delta, deltaTone, caption, chart, barStyle, target, sync, height, color, aside, valueFormat, locale, formatValue: suppliedFormatValue, formatX, surface, badge, numberStyle, palette, loading, motion, className, style, }: StatCardProps<Row, Key>): ReactElement;
73
+ export declare function StatCard<Row, const Key extends NumericKey<Row>>({ title, data, value: valueKey, x, xType, headline: suppliedHeadline, aggregate, delta, deltaTone, caption, chart, depth, barStyle, target, sync, height, color, aside, valueFormat, locale, formatValue: suppliedFormatValue, formatX, surface, badge, numberStyle, palette, loading, motion, className, style, }: StatCardProps<Row, Key>): ReactElement;