@lilt-ui/charts 0.5.0 → 0.7.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 (36) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/activity-ring.d.ts +3 -2
  3. package/dist/cards/activity-ring-card.d.ts +3 -2
  4. package/dist/cards/cartesian-card.d.ts +15 -2
  5. package/dist/cards/funnel-chart-card.d.ts +3 -2
  6. package/dist/cards/heatmap-chart-card.d.ts +3 -2
  7. package/dist/cards/horizontal-bar-chart-card.d.ts +3 -2
  8. package/dist/cards/progress-card.d.ts +3 -2
  9. package/dist/cards/radar-chart-card.d.ts +3 -2
  10. package/dist/cards/radial-chart-card.d.ts +4 -2
  11. package/dist/cards/sankey-chart-card.d.ts +3 -2
  12. package/dist/cards/scatter-chart-card.d.ts +3 -2
  13. package/dist/cards/slope-chart-card.d.ts +3 -2
  14. package/dist/cards/stat-card.d.ts +3 -2
  15. package/dist/chart-context.d.ts +8 -1
  16. package/dist/chart.d.ts +1 -1
  17. package/dist/engine/decimate.d.ts +25 -0
  18. package/dist/finance/cards/depth-chart-card.d.ts +3 -2
  19. package/dist/finance/order-book.d.ts +4 -2
  20. package/dist/finance.js +467 -404
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +2488 -2080
  23. package/dist/lifecycle/loading-layer.d.ts +14 -3
  24. package/dist/lifecycle/skeleton-block.d.ts +6 -0
  25. package/dist/lifecycle/skeleton-sheen.d.ts +15 -2
  26. package/dist/lifecycle/use-skeleton-clock.d.ts +5 -0
  27. package/dist/marks/contract.d.ts +15 -0
  28. package/dist/marks/range-loading-mark.d.ts +3 -0
  29. package/dist/primitives/depth-paint.d.ts +5 -1
  30. package/dist/primitives/runoff.d.ts +6 -7
  31. package/dist/{report-context-Cz0AYdV2.js → report-context-CkzH-r8B.js} +130 -129
  32. package/dist/{cartesian-card-7DAiMU3w.js → skeleton-block-C110l-2a.js} +2223 -1856
  33. package/dist/styles.css +1 -1
  34. package/dist/types.d.ts +14 -0
  35. package/dist/watch.js +1 -1
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ Long lines and areas stay smooth to hover from a hundred points to a hundred thousand.
6
+
7
+ ### Drawing
8
+
9
+ - Line and area marks with more observations than the plot has pixels draw each pixel column's first, last, lowest and highest observation. The ink is the same and every drawn point is a real reading; gaps and provisional or forecast runs keep their edges, and stacked layers still meet.
10
+ - The headline, tiles, hover, comparison, Watch and exports still read every row.
11
+ - `decimate` on `ChartPlot` and Cartesian cards turns this off. It is on by default.
12
+
13
+ ### Fixes
14
+
15
+ - Hover no longer rebuilds the plot and reformats every value on each move when a chart is given inline `margins`, as cards do. A 1,000-point, three-layer stacked area hovers at full frame rate instead of about 12 fps.
16
+ - Charts with more than about 125,000 values in total draw instead of showing an empty plot. Domains, summaries, box plots, scatter, slope, portfolio and Watch no longer spread every value into a single call.
17
+ - Line and area runoff paths are reused between renders instead of being rebuilt on every hover.
18
+
19
+ ## 0.6.0
20
+
21
+ Charts have three loading styles, with skeletons shaped for each family and refreshed palettes.
22
+
23
+ ### Loading
24
+
25
+ - `loadingStyle` accepts `shimmer` (the default), `draw`, or `breathe` on charts and cards, including finance charts. `ChartLoadingStyle` is exported for typed consumers.
26
+ - Loading skeletons follow each chart's geometry, including candles, range marks, rings, funnels, and flows. Moving skeletons share a clock so cards on a page move together.
27
+ - Loading motion respects reduced-motion preferences and `motion="none"`; placeholders do not present invented readings as data.
28
+
29
+ ### Palettes
30
+
31
+ - Iris uses violet, rose, and amber; Cobalt uses blue, cyan, and indigo; Emerald uses green, lime, and teal. Default series colors follow Iris, with matching light and dark palettes.
32
+
3
33
  ## 0.5.0
4
34
 
5
35
  Every chart that can carry it gets depth with one prop, and legends come in five layouts.
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ChartMotion } from './types';
2
+ import { ChartLoadingStyle, ChartMotion } from './types';
3
3
  export interface ActivitySelection<Row> {
4
4
  hour: number;
5
5
  row: Row | null;
@@ -23,6 +23,7 @@ export interface ActivityRingProps<Row> {
23
23
  onSelectionChange?: (selection: ActivitySelection<Row> | null) => void;
24
24
  /** `loading` keeps showing the last accepted day until new data is ready. */
25
25
  status?: 'ready' | 'loading';
26
+ loadingStyle?: ChartLoadingStyle;
26
27
  /** A new key drops the accepted day and any selection. */
27
28
  resetKey?: string | number;
28
29
  motion?: ChartMotion;
@@ -42,5 +43,5 @@ export declare function activitySlots<Row>(data: readonly Row[], hour: (row: Row
42
43
  * The 24-hour dot ring inside `ActivityRingCard`: one column of dots per time slot, filled by
43
44
  * how much happened then. One tab stop; arrow keys step around the day and Enter pins a slot.
44
45
  */
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;
46
+ export declare function ActivityRing<Row>({ data, hour, value, maximum, bucketMinutes, dotDensity, unit, formatValue, center, onSelectionChange, status, loadingStyle, resetKey, motion, height, depth, className, 'aria-label': ariaLabel, }: ActivityRingProps<Row>): import("react/jsx-runtime").JSX.Element;
46
47
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -47,6 +47,7 @@ export interface ActivityRingCardProps<Row, Key extends NumericKey<Row>> {
47
47
  numberStyle?: AnimatedNumberVariant;
48
48
  palette?: ChartPalette;
49
49
  loading?: boolean;
50
+ loadingStyle?: ChartLoadingStyle;
50
51
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
51
52
  motion?: ChartMotion;
52
53
  className?: string;
@@ -59,4 +60,4 @@ export declare function clockLabel(hour: number): string;
59
60
  * filled by how much happened then. Hovering or stepping around the ring reads each slot in the
60
61
  * headline; tiles name the busiest and quietest times.
61
62
  */
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;
63
+ 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, loadingStyle, motion, className, style, }: ActivityRingCardProps<Row, Key>): ReactElement;
@@ -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, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartController, ChartMargins, ChartTooltipContext, NumericXConfig, TimeXConfig, ChartAxis, ChartBarAppearance, ChartBackground, ChartCurve, ChartMotion, ChartPalette, ChartHoverReadout, ChartHoverStyle, ChartSeries, ChartTooltipIndicator, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch, ChartLoadingStyle } 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';
@@ -118,6 +118,12 @@ export interface CartesianCardProps<Row, Key extends NumericKey<Row>> {
118
118
  background?: ChartBackground;
119
119
  /** Brighten the background around the hovered point. Defaults to true. */
120
120
  spotlight?: boolean;
121
+ /**
122
+ * Draw a long line or area from each pixel column's first, last, lowest and highest
123
+ * observation, so tens of thousands of points stay fast to hover. The ink is the same, and the
124
+ * headline, tiles, hover, Watch and exports still read every row. Defaults to true.
125
+ */
126
+ decimate?: boolean;
121
127
  /** Card treatment: `elevated` (default), `outline`, or `ghost` inside your own card. */
122
128
  surface?: ChartSurface;
123
129
  /** A glass tab tucked behind the card's top edge, e.g. a caption, a command, or actions. */
@@ -184,6 +190,12 @@ export interface CartesianCardProps<Row, Key extends NumericKey<Row>> {
184
190
  */
185
191
  sync?: string;
186
192
  loading?: boolean;
193
+ /**
194
+ * How the skeleton moves while `loading`: `shimmer` (default) sweeps a highlight over still
195
+ * shapes, `draw` reveals bars or contours in order, `breathe` lets them rise and settle.
196
+ * Moving skeletons on a page share a clock.
197
+ */
198
+ loadingStyle?: ChartLoadingStyle;
187
199
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
188
200
  motion?: ChartMotion;
189
201
  className?: string;
@@ -258,6 +270,7 @@ export interface CardMarks {
258
270
  }
259
271
  /** Panes drawn under the main plot, linked to it: same data, x, margins and crosshair. */
260
272
  export interface CardPaneContext<Row> {
273
+ loadingStyle?: ChartLoadingStyle;
261
274
  data: readonly Row[];
262
275
  x: TimeXConfig<Row> | NumericXConfig<Row>;
263
276
  controller: ChartController;
@@ -278,7 +291,7 @@ export declare const CARD_PADDING = 20;
278
291
  * The shared card body: headline, delta, period, plot, and value tiles, with hover sync and
279
292
  * range comparison. Area, Line, and Bar cards differ only in their `shape`.
280
293
  */
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'> & {
294
+ 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, decimate, surface, badge, numberStyle, palette, bleed, axisInset, pillSeries, pillValue, pillPosition, tooltipIndicator, loading, loadingStyle, motion, className, style, panes, live, heading, restCaption, normal, onNormalChange, }: Omit<CartesianCardProps<Row, Key>, 'series'> & {
282
295
  series: readonly CoreSeries<Key>[];
283
296
  shape: CardShape;
284
297
  /** Linked panes under the plot, such as volume or indicators. */
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartLoadingStyle, 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';
@@ -53,6 +53,7 @@ export interface FunnelChartCardProps<Row, Key extends NumericKey<Row>> {
53
53
  numberStyle?: AnimatedNumberVariant;
54
54
  palette?: ChartPalette;
55
55
  loading?: boolean;
56
+ loadingStyle?: ChartLoadingStyle;
56
57
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
57
58
  motion?: ChartMotion;
58
59
  className?: string;
@@ -83,4 +84,4 @@ export declare function pipeEnd(x: number, half: number, rx: number, side: 'left
83
84
  * its percentage on the band and its count in a tile beneath. Hovering a stage reads it in the
84
85
  * headline with the conversion from the step before.
85
86
  */
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;
87
+ 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, loadingStyle, motion: motionMode, className, style, }: FunnelChartCardProps<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 { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -59,6 +59,7 @@ export interface HeatmapChartCardProps<Row, Key extends NumericKey<Row>> {
59
59
  numberStyle?: AnimatedNumberVariant;
60
60
  palette?: ChartPalette;
61
61
  loading?: boolean;
62
+ loadingStyle?: ChartLoadingStyle;
62
63
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
63
64
  motion?: ChartMotion;
64
65
  className?: string;
@@ -109,4 +110,4 @@ export declare function labelTier(index: number, count: number): 'major' | 'mino
109
110
  * labeled. Hovering or focusing a cell reads it in the headline; arrow keys move between cells.
110
111
  * Missing cells are hatched and say "No data", so they never read as zero.
111
112
  */
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;
113
+ 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, loadingStyle, motion: motionMode, className, style, }: HeatmapChartCardProps<Row, Key>): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, RankingOrder } from '../types';
2
+ import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface, RankingOrder } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -52,6 +52,7 @@ export interface HorizontalBarChartCardProps<Row, Key extends NumericKey<Row>> {
52
52
  numberStyle?: AnimatedNumberVariant;
53
53
  palette?: ChartPalette;
54
54
  loading?: boolean;
55
+ loadingStyle?: ChartLoadingStyle;
55
56
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
56
57
  motion?: ChartMotion;
57
58
  className?: string;
@@ -61,4 +62,4 @@ export interface HorizontalBarChartCardProps<Row, Key extends NumericKey<Row>> {
61
62
  * A ranked list card: each row carries a bar, its value, and its share of the total. Hovering a
62
63
  * row reads it in the headline; click pins it and the arrow keys move through the list.
63
64
  */
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;
65
+ 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, loadingStyle, motion: motionMode, className, style, }: HorizontalBarChartCardProps<Row, Key>): ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  import { AnimatedNumberVariant } from '../motion/animated-number';
3
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
+ import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
4
4
  export interface ProgressRange {
5
5
  id: string;
6
6
  label: string;
@@ -49,6 +49,7 @@ export interface ProgressCardProps {
49
49
  numberStyle?: AnimatedNumberVariant;
50
50
  palette?: ChartPalette;
51
51
  loading?: boolean;
52
+ loadingStyle?: ChartLoadingStyle;
52
53
  motion?: ChartMotion;
53
54
  className?: string;
54
55
  style?: CSSProperties | ChartStyle;
@@ -57,4 +58,4 @@ export interface ProgressCardProps {
57
58
  * One value against a goal: the value in the header, and a large ring or gauge with the
58
59
  * percentage reached. Past the goal the ring stays full and the percentage keeps counting.
59
60
  */
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;
61
+ 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, loadingStyle, motion: motionMode, className, style, }: ProgressCardProps): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartLoadingStyle, 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';
@@ -51,6 +51,7 @@ export interface RadarChartCardProps<Row, Key extends NumericKey<Row>> {
51
51
  numberStyle?: AnimatedNumberVariant;
52
52
  palette?: ChartPalette;
53
53
  loading?: boolean;
54
+ loadingStyle?: ChartLoadingStyle;
54
55
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
55
56
  motion?: ChartMotion;
56
57
  className?: string;
@@ -96,5 +97,5 @@ export declare function profilePath(fractions: readonly (number | null)[], radiu
96
97
  * shape of strengths and gaps reads at a glance. Hovering or stepping around the spokes reads
97
98
  * every profile at that dimension.
98
99
  */
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;
100
+ 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, loadingStyle, motion: motionMode, className, style, }: RadarChartCardProps<Row, Key>): ReactElement;
100
101
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, RankingOrder, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartMotion, ChartLoadingStyle, 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';
@@ -61,6 +61,8 @@ export interface RadialChartCardProps<Row, Key extends NumericKey<Row>> {
61
61
  numberStyle?: AnimatedNumberVariant;
62
62
  palette?: ChartPalette;
63
63
  loading?: boolean;
64
+ /** Shimmer (default), a clockwise draw, or a gentle pulse. Honors reduced motion. */
65
+ loadingStyle?: ChartLoadingStyle;
64
66
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
65
67
  motion?: ChartMotion;
66
68
  className?: string;
@@ -84,5 +86,5 @@ export declare function ringAngles(rows: readonly RankedRow[]): Slice[];
84
86
  * A donut or pie card: the headline total, slices with a matching legend, and each slice's
85
87
  * share. Hovering a slice or a legend row reads it in the headline.
86
88
  */
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;
89
+ 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, loadingStyle, motion: motionMode, className, style, }: RadialChartCardProps<Row, Key>): ReactElement;
88
90
  export {};
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  import { SankeyGraph, SankeyLink, SankeyNode } from '../engine/sankey';
3
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
+ import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
4
4
  import { CardRange } from './cartesian-card';
5
5
  import { NumericKey, TextKey } from './keys';
6
6
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -46,6 +46,7 @@ export interface SankeyChartCardProps<Row, Key extends NumericKey<Row>> {
46
46
  numberStyle?: AnimatedNumberVariant;
47
47
  palette?: ChartPalette;
48
48
  loading?: boolean;
49
+ loadingStyle?: ChartLoadingStyle;
49
50
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
50
51
  motion?: ChartMotion;
51
52
  className?: string;
@@ -70,5 +71,5 @@ export declare function sankeyGraph<Row>({ data, source, target, value, conserva
70
71
  * amount that moved. Hovering or stepping through flows with the arrow keys reads each in the
71
72
  * headline with its share of the step it left.
72
73
  */
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;
74
+ 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, loadingStyle, motion: motionMode, className, style, }: SankeyChartCardProps<Row, Key>): ReactElement;
74
75
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartLoadingStyle, 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';
@@ -65,6 +65,7 @@ export interface ScatterChartCardProps<Row, Key extends NumericKey<Row>> {
65
65
  numberStyle?: AnimatedNumberVariant;
66
66
  palette?: ChartPalette;
67
67
  loading?: boolean;
68
+ loadingStyle?: ChartLoadingStyle;
68
69
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
69
70
  motion?: ChartMotion;
70
71
  className?: string;
@@ -97,4 +98,4 @@ export declare function clipTrend(fit: {
97
98
  * and colored by group. Hovering or stepping through points with the arrow keys reads each one in
98
99
  * the headline, with its position marked on both axes.
99
100
  */
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;
101
+ 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, loadingStyle, motion: motionMode, className, style, }: ScatterChartCardProps<Row, Key>): ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  import { SlopeOrder } from '../engine/slope';
3
- import { ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
+ import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
4
4
  import { CardRange } from './cartesian-card';
5
5
  import { NumericKey, TextKey } from './keys';
6
6
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -64,6 +64,7 @@ export interface SlopeChartCardProps<Row, Key extends NumericKey<Row>> {
64
64
  numberStyle?: AnimatedNumberVariant;
65
65
  palette?: ChartPalette;
66
66
  loading?: boolean;
67
+ loadingStyle?: ChartLoadingStyle;
67
68
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
68
69
  motion?: ChartMotion;
69
70
  className?: string;
@@ -75,4 +76,4 @@ export interface SlopeChartCardProps<Row, Key extends NumericKey<Row>> {
75
76
  * category reads its later value and change in the headline; click pins it, and the arrow keys
76
77
  * move through categories.
77
78
  */
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;
79
+ 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, loadingStyle, motion: motionMode, className, style, }: SlopeChartCardProps<Row, Key>): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartBarAppearance, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartBarAppearance, ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
3
  import { NumericKey, XKey, XKind } from './keys';
4
4
  import { CardAggregate } from './format';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -64,10 +64,11 @@ export interface StatCardProps<Row, Key extends NumericKey<Row>> {
64
64
  numberStyle?: AnimatedNumberVariant;
65
65
  palette?: ChartPalette;
66
66
  loading?: boolean;
67
+ loadingStyle?: ChartLoadingStyle;
67
68
  motion?: ChartMotion;
68
69
  className?: string;
69
70
  style?: CSSProperties | ChartStyle;
70
71
  }
71
72
  /** Cells of a meter: whole cells up to the value, then one cell trimmed to the exact remainder. */
72
73
  export declare function meterCells(ratio: number, count?: number): number[];
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;
74
+ 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, loadingStyle, className, style, }: StatCardProps<Row, Key>): ReactElement;
@@ -53,6 +53,11 @@ export interface ChartSnapshot<T> {
53
53
  /** Series drawn by column marks. */
54
54
  columns: readonly string[];
55
55
  geometry: PlotGeometry | null;
56
+ /**
57
+ * Lines and areas with more rows than pixels draw from this thinner geometry, which traces the
58
+ * same ink; null when every row is drawn. Inspection and everything else read `geometry`.
59
+ */
60
+ drawGeometry: PlotGeometry | null;
56
61
  plot: PlotBox;
57
62
  formatX: (value: number) => string;
58
63
  formatY: (value: number) => string;
@@ -116,5 +121,7 @@ export declare function makeAxisTicks(snapshot: ChartSnapshot<unknown>, previous
116
121
  export declare function logTicks(domain: readonly [number, number], count: number): number[];
117
122
  export declare function buildSnapshot<T>(data: NormalizedData<T>, series: readonly ChartSeries<T>[], xConfig: ChartXConfig<T>, yConfig: ChartYConfig, margins: ChartMargins, width: number, height: number, yDomainOverride?: readonly [number, number] | null, xDomainOverride?: readonly [number, number] | null, geometrySeries?: readonly ChartSeries<T>[], arrangement?: PlotArrangement, stackWeights?: Readonly<Record<string, number>>, barLayout?: ChartBarLayout,
118
123
  /** Keeps line and area observations off the plot edges so labels can center on them. */
119
- edgeInset?: number): ChartSnapshot<T>;
124
+ edgeInset?: number,
125
+ /** Draw long lines and areas from at most four rows per pixel column. */
126
+ decimate?: boolean): ChartSnapshot<T>;
120
127
  export { ChartContext };
package/dist/chart.d.ts CHANGED
@@ -15,5 +15,5 @@ type ChartPlotRendererProps<T> = Omit<ChartProps<T>, 'className' | 'style'> & Om
15
15
  controllerLinked?: boolean;
16
16
  tooltipNode?: ReactNode;
17
17
  };
18
- export declare function ChartPlotRenderer<T>({ data, x, y, series, height, compactHeight, margins: marginProps, arrangement, marks, barLayout: barsProps, compact, tooltipNode, inspectionSeries: plotInspectionSeries, className, style, 'aria-label': ariaLabel, children, status, interactive, error, renderRetry, motion: motionPreference, animateIn, resetKey, onSelectionChange, controller, linkedSelection, selectedCategoryId, onSelectedCategoryIdChange, compare, focus, live, brush, visibleSeries, onVisibleSeriesChange, toolkit, model, controllerLinked, axis: axisProp, pill, pillSeries, pillValue, pillPosition, axisInset, runoff, labelOverhang, }: ChartPlotRendererProps<T>): ReactElement;
18
+ export declare function ChartPlotRenderer<T>({ data, x, y, series, height, compactHeight, margins: marginProps, arrangement, marks, barLayout: barsProps, compact, tooltipNode, inspectionSeries: plotInspectionSeries, className, style, 'aria-label': ariaLabel, children, status, loadingStyle, interactive, error, renderRetry, motion: motionPreference, animateIn, resetKey, onSelectionChange, controller, linkedSelection, selectedCategoryId, onSelectedCategoryIdChange, compare, focus, live, brush, visibleSeries, onVisibleSeriesChange, toolkit, model, controllerLinked, axis: axisProp, pill, pillSeries, pillValue, pillPosition, axisInset, decimate, runoff, labelOverhang, }: ChartPlotRendererProps<T>): ReactElement;
19
19
  export {};
@@ -0,0 +1,25 @@
1
+ import { NormalizedData } from './normalize';
2
+ import { StackMode } from './stack';
3
+ export interface DecimateOptions {
4
+ /** Series drawn as lines or areas, in chart order. Bars are drawn per row and left out. */
5
+ lines: readonly string[];
6
+ /** Stacked layers, in drawing order, whose cumulative boundaries are what the plot draws. */
7
+ stack?: {
8
+ series: readonly string[];
9
+ mode: StackMode;
10
+ weights?: Readonly<Record<string, number>>;
11
+ };
12
+ xDomain: readonly [number, number];
13
+ /** Maps a row's x to its screen pixel. */
14
+ xToPixel: (x: number) => number;
15
+ }
16
+ /**
17
+ * The rows worth drawing when a series has more rows than the plot has pixels (M4): in each pixel
18
+ * column, every drawn line's first, last, lowest and highest row. That traces the same ink as
19
+ * every row would, and every kept row is a real observation. Rows at the edge of a gap or a
20
+ * change of status are always kept, so gaps and provisional runs never close up.
21
+ *
22
+ * Returns null when thinning would not save much; the caller then draws every row. Only drawing
23
+ * uses the result: inspection, values and exports keep reading every row.
24
+ */
25
+ export declare function decimateRows<T>(data: NormalizedData<T>, options: DecimateOptions): NormalizedData<T> | null;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
- import { ChartAxis, ChartBackground, ChartHoverStyle, ChartMotion, ChartStyle, ChartSurface } from '../../types';
2
+ import { ChartAxis, ChartBackground, ChartHoverStyle, ChartLoadingStyle, ChartMotion, ChartStyle, ChartSurface } from '../../types';
3
3
  import { AnimatedNumberVariant } from '../../motion/animated-number';
4
4
  import { BookLevel } from '../indicators';
5
5
  export interface DepthChartCardProps {
@@ -23,6 +23,7 @@ export interface DepthChartCardProps {
23
23
  surface?: ChartSurface;
24
24
  numberStyle?: AnimatedNumberVariant;
25
25
  loading?: boolean;
26
+ loadingStyle?: ChartLoadingStyle;
26
27
  motion?: ChartMotion;
27
28
  className?: string;
28
29
  style?: CSSProperties | ChartStyle;
@@ -31,4 +32,4 @@ export interface DepthChartCardProps {
31
32
  * Order book depth: how much could trade at each price, buying and selling, as stepped areas, with
32
33
  * the mid, spread and total depth in the header. Hover reads the size resting at each price.
33
34
  */
34
- export declare function DepthChartCard({ title, bids, asks, valueFormat, sizeFormat, locale, height, axis, background, hoverStyle, surface, numberStyle, loading, motion, className, style, depth, }: DepthChartCardProps): ReactElement;
35
+ export declare function DepthChartCard({ title, bids, asks, valueFormat, sizeFormat, locale, height, axis, background, hoverStyle, surface, numberStyle, loading, loadingStyle, motion, className, style, depth, }: DepthChartCardProps): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
- import { ChartMotion, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartLoadingStyle, ChartMotion, ChartStyle, ChartSurface } from '../types';
3
3
  import { BookLevel } from './indicators';
4
4
  export interface OrderBookProps {
5
5
  title: string;
@@ -17,6 +17,8 @@ export interface OrderBookProps {
17
17
  /** Briefly highlight levels whose size changed. Defaults to true; reduced motion turns it off. */
18
18
  flash?: boolean;
19
19
  surface?: ChartSurface;
20
+ loading?: boolean;
21
+ loadingStyle?: ChartLoadingStyle;
20
22
  motion?: ChartMotion;
21
23
  className?: string;
22
24
  style?: CSSProperties | ChartStyle;
@@ -25,4 +27,4 @@ export interface OrderBookProps {
25
27
  * A price ladder: asks above, bids below, a spread row between, and a depth bar behind each
26
28
  * level sized by its running total. It is a real table, so screen readers read it row by row.
27
29
  */
28
- export declare function OrderBook({ title, bids, asks, levels, depth, valueFormat, sizeFormat, locale, flash, surface, motion, className, style, }: OrderBookProps): ReactElement;
30
+ export declare function OrderBook({ title, bids, asks, levels, depth, valueFormat, sizeFormat, locale, flash, surface, loading, loadingStyle, motion, className, style, }: OrderBookProps): ReactElement;