Flow
Sankey from Chat, Code and API to three models, with particles streaming in proportion to traffic; hovering a band isolates it.
Demo data
The sources, models and 100k request split are invented; only label can be set. It cannot show your own data yet, so use it as a template: replace the invented data in its source before it shows anything real. See Your data.
Playground
Change a prop and the component updates. Props marked live animate to the new value; the others rebuild the element.
<HfFlow label="Where requests go" />
Installation
pnpm dlx shadcn@latest add @lumesec/hf-flowFirst timeRegister the @lumesec registry once, or install by URL
Adds @lumesec to your components.json:
pnpm dlx shadcn@latest registry add @lumesec=https://elements.lumesec.ai/r/{name}.jsonOr skip the setup and install by URL:
npx shadcn@latest add https://elements.lumesec.ai/r/hf-flow.jsonUsage
import { HfFlow } from "@/components/lumesec/hf-flow";
export function Example() {
return (
<HfFlow />
);
}Behaviour
A sankey from surfaces to models, with particles streaming along each band in proportion to its traffic. Hover a band to isolate it.
API reference
Attributes
labelReact proplabelTypestringDefaultWhere requests goHeading text. Observed.
Accessibility
- The canvas has
role="img"with anaria-labelthat lists every flow, for exampleChat: 12k to Large, 26k to Medium, 8k to Small. - Node names and totals are text beside the chart.
- The band tooltip appears on hover only.
- Reduced motion: bands appear at once without growing in, no particles stream and drawing stops.
Theming
The element reads your shadcn theme tokens through its shadow root, so light and dark follow your theme. The accent comes from --lumesec. See Theming.
This component reads --border, --foreground, --lumesec, --muted and --muted-foreground.
To restyle only LumeSec elements, set the matching --ui-* overrides: --ui-accent, --ui-border, --ui-fg, --ui-muted and --ui-raised.
Notes
- Data is built in: three sources, three models and 100k requests in total. It cannot be configured.
- The chart is 220px tall and fills the width between the two label columns.
Related
Was this page helpful?