Rank
Ranked rows: each item gets a label, a glyph bar whose length follows its value against the max, and the formatted value on the right.
Install
pnpm add @fractaldesign/machines-ui import '@fractaldesign/machines-ui/style.css';
import { GraphRank } from '@fractaldesign/machines-ui';Preview
- /docs 12,400
- /install 4,100
- /plot 860
- /rank 420
<GraphRank
title="ROUTES"
items={[
{ label: '/docs', value: 12400 },
{ label: '/install', value: 4100 },
{ label: '/plot', value: 860 },
{ label: '/rank', value: 420 }
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Caption drawn on the top edge as `[ TITLE ]`. Uppercase, 1–2 words. |
| items* | RankItem[] | — | The entries to rank, one row each, drawn in list order. |
| max | number | — | The value that fills a whole bar; defaults to the largest item value. |
| ticks | number | 20 | Bar length in glyph cells. Default 20. |
| glyphs | Glyphs | — | Characters that draw the graph: a preset name (`shade`, `ascii`, `hash`, `bar`) or your own array, lightest to heaviest. |
| palette | GraphPalette 'mono''duo''multi' | — | How many accent colours the graph uses: `mono` one, `duo` two, `multi` three. |
| corner | string | — | Character drawn at each corner of the frame. |
| class | string | '' |
API
- class forwarded to the outer element
- motion reveals on scroll into view
Types
| Name | Kind | Description |
|---|---|---|
| RankItem | interface | One ranked row: label, a full-width glyph bar, and the value. |
Theming
CSS custom properties this component reads.
- --border
- --graph-accent
- --text-secondary
Related
Built from
src/lib/components/graphs/GraphRank.svelte