@lilt-ui/charts 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +36 -10
- package/dist/cards/calendar-heatmap-card.d.ts +18 -0
- package/dist/cards/chart-card.d.ts +4 -1
- package/dist/cards/keys.d.ts +2 -0
- package/dist/cards/observations-card.d.ts +82 -0
- package/dist/cards/range-select.d.ts +28 -0
- package/dist/cards/strip-chart-card.d.ts +15 -0
- package/dist/cards/timeline-chart-card.d.ts +18 -0
- package/dist/cards/treemap-chart-card.d.ts +24 -0
- package/dist/engine/keyed.d.ts +19 -0
- package/dist/engine/lifecycle.d.ts +1 -1
- package/dist/engine/sankey.d.ts +16 -0
- package/dist/finance.js +2 -2
- package/dist/index.d.ts +11 -1
- package/dist/index.js +3426 -2362
- package/dist/marks/contract.d.ts +0 -2
- package/dist/motion/use-chart-motion.d.ts +5 -0
- package/dist/motion/use-departing.d.ts +7 -0
- package/dist/motion/use-snap-bars.d.ts +27 -0
- package/dist/{report-context-CVNzZBRd.js → report-context-UrwaoLYZ.js} +408 -231
- package/dist/{skeleton-block-Ha7mwDOY.js → skeleton-block-C8gOUsxn.js} +1848 -1598
- package/dist/styles.css +1 -1
- package/dist/watch/board/board-state.d.ts +0 -2
- package/dist/watch.js +129 -127
- package/package.json +11 -10
package/dist/marks/contract.d.ts
CHANGED
|
@@ -60,5 +60,3 @@ export declare function markSeries<T>(mark: string, descriptors: readonly ChartS
|
|
|
60
60
|
export declare function rowFields(row: NormalizedRow<unknown>, series: string, fields: readonly string[]): number[] | null;
|
|
61
61
|
/** An observation's own color, falling back to the series color. */
|
|
62
62
|
export declare function observationColor<T>(descriptor: ChartSeries<T>, row: NormalizedRow<T>, fallback: string): string;
|
|
63
|
-
/** Rows whose x lies in the visible domain. */
|
|
64
|
-
export declare function rowsInView<T>(snapshot: ChartSnapshot<T>): readonly NormalizedRow<T>[];
|
|
@@ -5,6 +5,11 @@ export interface TimelineSpec {
|
|
|
5
5
|
key: string | number;
|
|
6
6
|
duration: number;
|
|
7
7
|
active: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Run on Lilt's spring instead of the reveal ease, keeping its slight overshoot: progress may
|
|
10
|
+
* pass 1 briefly before it settles there. For marks that should land like physical objects.
|
|
11
|
+
*/
|
|
12
|
+
spring?: boolean;
|
|
8
13
|
}
|
|
9
14
|
export declare function useChartTimeline(spec: TimelineSpec, reducedMotion: boolean): number;
|
|
10
15
|
export { REVEAL_EASE };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Items that just left the data, kept for `duration` milliseconds so they can animate out
|
|
3
|
+
* instead of vanishing. Changes are detected by key, so a list rebuilt every render is fine, and
|
|
4
|
+
* each departing item keeps the last place it was drawn. Derived while rendering, so it is never
|
|
5
|
+
* missing for a frame before its exit starts; an item that comes back stops departing at once.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useDeparting<T>(items: readonly T[], keyOf: (item: T) => string, duration: number): readonly T[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BarGeometry } from '../engine/bars';
|
|
2
|
+
/** One bar as drawn on a frame of a snap: its geometry and how far it has risen. */
|
|
3
|
+
export interface SnapBar {
|
|
4
|
+
key: string;
|
|
5
|
+
bar: BarGeometry;
|
|
6
|
+
/** Share of the bar's height above its floor: 0 drained, 1 full; a spring may overshoot. */
|
|
7
|
+
rise: number;
|
|
8
|
+
opacity: number;
|
|
9
|
+
/** Gaussian blur in pixels while the bar arrives or leaves. */
|
|
10
|
+
blur: number;
|
|
11
|
+
leaving: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Closed-form damped spring from 0 to 1 that lands with a slight overshoot in about 0.55s. */
|
|
14
|
+
export declare function snapSpring(seconds: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* Bars that behave like real objects when the set of bars changes, such as a new period: new
|
|
17
|
+
* bars rise out of the floor with a soft blur, leaving bars drain back into it and narrow toward
|
|
18
|
+
* where their gap closes, and the rest spring to their new places, widths and heights. Returns
|
|
19
|
+
* the frame to draw while that runs, and `null` when at rest, so ordinary updates and the first
|
|
20
|
+
* entrance are untouched. `pulse` counts snaps, to restart the plot's light motion blur.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSnapBars(bars: readonly BarGeometry[] | undefined, keyOf: (bar: BarGeometry) => string, enabled: boolean,
|
|
23
|
+
/** The chart is revealing its first data: every bar arrives the way new bars do. */
|
|
24
|
+
entrance?: boolean): {
|
|
25
|
+
frame: SnapBar[] | null;
|
|
26
|
+
pulse: number;
|
|
27
|
+
};
|