@lilt-ui/charts 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +16 -20
- package/dist/cards/range-select.d.ts +2 -6
- package/dist/finance.js +6 -2
- package/dist/index.js +2089 -2025
- package/dist/interaction/axis-cursor.d.ts +5 -0
- package/dist/interaction/inspection-layer.d.ts +5 -1
- package/dist/interaction/use-pin-release.d.ts +9 -0
- package/dist/interaction/use-touch-glide.d.ts +4 -0
- package/dist/marks/contract.d.ts +6 -0
- package/dist/motion/animated-number.d.ts +2 -6
- package/dist/motion/area-flow.d.ts +36 -0
- package/dist/motion/motion-layout-features.d.ts +1 -0
- package/dist/motion/motion-scope.d.ts +12 -0
- package/dist/motion/use-glide.d.ts +1 -1
- package/dist/motion/use-motion-blur.d.ts +6 -0
- package/dist/motion-layout-features-CJq3xh5t.js +2 -0
- package/dist/primitives/hover-band.d.ts +2 -1
- package/dist/{report-context-UrwaoLYZ.js → report-context-DLA3I57K.js} +314 -288
- package/dist/{skeleton-block-CPaKI7op.js → skeleton-block-ClcPgFdK.js} +2642 -2530
- package/dist/styles.css +1 -1
- package/dist/watch/board/chart-board.d.ts +2 -6
- package/dist/watch.js +160 -154
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
Pins let go the way you expect, and the hover band wears the colour of what it lights.
|
|
6
|
+
|
|
7
|
+
- Every card that pins (radial, heatmap, funnel, horizontal bar, radar, sankey, scatter, slope, activity ring, and the treemap, calendar, timeline and strip cards) releases its pin on any press that misses the marks: empty plot, elsewhere in the card, or off it, as area and bar charts already did. Escape releases after a mouse pin too. Presses on controls, such as legend items and the period menu, keep the pin.
|
|
8
|
+
- The band behind an inspected column takes that column's colour: a falling candle lights red, a rising one green, and the volume pane follows its bars. With several series in a column, it takes the colour of the one being read.
|
|
9
|
+
- The docs offer `compare` (off, on, or `'badge'`) in Props on every chart that reads change over time.
|
|
10
|
+
- The README covers loading and empty states, long series, and how pins let go, and drops the pre-1.0 upgrade notes.
|
|
11
|
+
|
|
12
|
+
## 0.12.0
|
|
13
|
+
|
|
14
|
+
Hover lands with the column it reads, and every chart moves a little more like a real object.
|
|
15
|
+
|
|
16
|
+
- The crosshair, band, pills and pins share one quick, critically damped spring, so the readout arrives with the column instead of trailing it. Fast moves blur slightly and clear as they land; reduced motion never blurs.
|
|
17
|
+
- Areas lift in on first load, from just below into place on the bars' spring, softly blurred until they land. A new period on an area chart runs left to right instead of moving every point at once.
|
|
18
|
+
- Horizontal bar rows move in one movement: a leaving row fades where it was while the rest close its gap and re-rank together, and rows that cross pass over and under each other instead of clipping through.
|
|
19
|
+
- Bars coloured per row, such as candlestick volume, keep their own colour while they leave.
|
|
20
|
+
- Charts load only the Motion features they use: a minimal line card drops from about 137 kB to 125 kB of gzipped JavaScript. Layout animation, used only where rows or board cards reorder, arrives in its own chunk after first paint.
|
|
21
|
+
- `llms.txt` groups the cards by job with a one-line hint each, and the READMEs end with a two-line prompt that hands Lilt to a coding agent.
|
|
22
|
+
|
|
3
23
|
## 0.11.0
|
|
4
24
|
|
|
5
25
|
Every chart has a quiet empty state, and it can be yours.
|
package/README.md
CHANGED
|
@@ -39,6 +39,16 @@ Lilt needs React and React DOM 19. Every card, variant, and prop is documented a
|
|
|
39
39
|
import '@lilt-ui/charts/styles.css';
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
### With an agent
|
|
43
|
+
|
|
44
|
+
Working with Claude Code, Cursor, or another coding agent? Paste this, then ask for the chart you want:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Use Lilt Charts (@lilt-ui/charts) for charts. Read https://liltui.vercel.app/llms.txt first and follow its rules.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
[llms.txt](https://liltui.vercel.app/llms.txt) lists every card by job with its rules; [llms-full.txt](https://liltui.vercel.app/llms-full.txt) adds every example, data shape, and prop.
|
|
51
|
+
|
|
42
52
|
## Your first card
|
|
43
53
|
|
|
44
54
|
```tsx
|
|
@@ -87,11 +97,11 @@ That's the whole card: the headline, the change chip, value tiles, and hover all
|
|
|
87
97
|
| **Spread** | Range (floating bars, error bars, timeline intervals) and Box plot |
|
|
88
98
|
| **Markets** | Candlestick, Indicators, Price, Depth, Order book, and Portfolio |
|
|
89
99
|
|
|
90
|
-
###
|
|
100
|
+
### Companion cards
|
|
91
101
|
|
|
92
102
|
`TreemapChartCard` reads `label`, `value`, and an optional `group` for one parent level. `CalendarHeatmapCard` reads `date` and `value`, with optional inclusive UTC `from`/`to` bounds. `TimelineChartCard` reads `label`, `start`, and `end`, and packs overlaps within optional `lane` categories. `StripChartCard` reads `category` and `value`; `display="beeswarm"` separates collisions without moving numeric positions.
|
|
93
103
|
|
|
94
|
-
|
|
104
|
+
They take the same `depth`, loading, empty, and header props as every other card, plus `onSelectionChange` and `renderReadout` for your own presentation. Treemap areas must be nonnegative, calendar dates are UTC, and timeline durations are measured in milliseconds (displayed as hours by default).
|
|
95
105
|
|
|
96
106
|
## Finance charts
|
|
97
107
|
|
|
@@ -196,8 +206,10 @@ Cards that need attention rise, what you've seen calms down, and what clears set
|
|
|
196
206
|
|
|
197
207
|
- **Linked hover.** Give cards the same `sync` name and they read the same moment together.
|
|
198
208
|
- **Targets and forecasts.** `target` draws a goal line and counts the points that reach it. `forecast` marks projected rows and keeps them out of the headline.
|
|
199
|
-
- **Pin and compare.** Click to pin
|
|
209
|
+
- **Pin and compare.** Click any mark to pin it; press anywhere off the marks, or Escape, to let go. Add `compare` and drag across a chart to see what changed, in the headline or, with `compare="badge"`, in the card's tab.
|
|
200
210
|
- **Honest data.** `null` is a gap, never a zero, and missing values say so.
|
|
211
|
+
- **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
|
+
- **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.
|
|
201
213
|
- **Watch.** `normal` flags what's unusual and says why; a `ChartBoard` raises what needs attention.
|
|
202
214
|
- **Calm by default.** Keyboard navigation, screen reader labels, and motion that respects reduced-motion settings.
|
|
203
215
|
|
|
@@ -225,7 +237,7 @@ function PeriodSelect({ value, options, onValueChange, ...rest }: ChartRangeSele
|
|
|
225
237
|
<ChartComponentsProvider rangeSelect={PeriodSelect}>{children}</ChartComponentsProvider>;
|
|
226
238
|
```
|
|
227
239
|
|
|
228
|
-
|
|
240
|
+
Every card that pins works from the keyboard: Tab to the chart, arrows to inspect, Enter or Space to pin, and Escape to clear. Radial, Funnel, and Horizontal bar cards can hand their pin to you with a controlled `selected`; a click, Escape, or a press off the marks then asks `onSelectedChange` instead of changing it.
|
|
229
241
|
|
|
230
242
|
Cards follow shadcn theme variables when your app defines them: `--card`, `--card-foreground`, `--muted-foreground`, `--border`, `--ring`, and `--chart-1` to `--chart-5`. Anything you leave out falls back to Lilt's own palette.
|
|
231
243
|
|
|
@@ -236,22 +248,6 @@ Every Lilt style lives in the `lilt` cascade layer, so your CSS wins without spe
|
|
|
236
248
|
@import 'tailwindcss';
|
|
237
249
|
```
|
|
238
250
|
|
|
239
|
-
## Upgrading from 0.1
|
|
240
|
-
|
|
241
|
-
0.2 replaces a series' `interval` with named `fields`, which carry any companion values: a forecast's low and high, quartiles, or a candle's open, high, and low. `IntervalBand` now names the fields it reads:
|
|
242
|
-
|
|
243
|
-
```tsx
|
|
244
|
-
// 0.1
|
|
245
|
-
{ id: 'revenue', accessor: (row) => row.revenue, interval: { lower: (row) => row.low, upper: (row) => row.high, meaning: 'Forecast' } }
|
|
246
|
-
<IntervalBand series="revenue" />
|
|
247
|
-
|
|
248
|
-
// 0.2
|
|
249
|
-
{ id: 'revenue', accessor: (row) => row.revenue, fields: { low: { label: 'Low', accessor: (row) => row.low }, high: { label: 'High', accessor: (row) => row.high } } }
|
|
250
|
-
<IntervalBand series="revenue" lower="low" upper="high" />
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
Cards are unchanged: `forecast={{ from, lower, upper }}` works as before. Tooltip content reads `series[].fields` instead of `series[].interval`.
|
|
254
|
-
|
|
255
251
|
## License
|
|
256
252
|
|
|
257
253
|
MIT © Lilt UI
|
|
@@ -20,9 +20,5 @@ export declare function ChartComponentsProvider({ rangeSelect, children, }: {
|
|
|
20
20
|
children: ReactNode;
|
|
21
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export declare function useCustomRangeSelect(): ComponentType<ChartRangeSelectProps> | null;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
* pattern, so arrows, Home, End, Enter, Escape and typing a period's first letter all work,
|
|
26
|
-
* and focus returns to the pill when the list closes.
|
|
27
|
-
*/
|
|
28
|
-
export declare function RangeSelect({ value, options, onValueChange, 'aria-label': ariaLabel, }: ChartRangeSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
/** RangeSelect with its own MotionScope, so it animates wherever it is rendered. */
|
|
24
|
+
export declare function RangeSelect(props: ChartRangeSelectProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/finance.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $ as e, A as t, C as n, I as r, J as i, L as a, P as o, Q as s, R as c, S as l, T as u, X as d, Z as f, _ as p, a as m, b as h, bt as g, dt as _, f as v, i as y, n as b, rt as x, st as S, t as C, u as w, v as T, w as E, x as D, y as O, z as k } from "./skeleton-block-
|
|
3
|
-
import { C as A, d as j, g as ee, h as M, p as N, u as P } from "./report-context-
|
|
2
|
+
import { $ as e, A as t, C as n, I as r, J as i, L as a, P as o, Q as s, R as c, S as l, T as u, X as d, Z as f, _ as p, a as m, b as h, bt as g, dt as _, f as v, i as y, n as b, rt as x, st as S, t as C, u as w, v as T, w as E, x as D, y as O, z as k } from "./skeleton-block-ClcPgFdK.js";
|
|
3
|
+
import { C as A, d as j, g as ee, h as M, p as N, u as P } from "./report-context-DLA3I57K.js";
|
|
4
4
|
import { useEffect as F, useMemo as I, useRef as L, useState as R } from "react";
|
|
5
5
|
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
6
6
|
import { min as H } from "d3-array";
|
|
@@ -191,6 +191,10 @@ var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle"
|
|
|
191
191
|
e.high,
|
|
192
192
|
e.low
|
|
193
193
|
],
|
|
194
|
+
color: (e, { row: t, descriptor: n }) => {
|
|
195
|
+
let r = K(t, e.series, e);
|
|
196
|
+
return r ? q(n, t, r) : void 0;
|
|
197
|
+
},
|
|
194
198
|
highlight: (e, { row: t, snapshot: r, descriptor: i }) => {
|
|
195
199
|
let a = K(t, e.series, e);
|
|
196
200
|
if (!a) return null;
|