Instruments Flow
// Flow

Flow

A throughput edge whose dash travels at a speed bound to rate — the motion is the flow, not decoration.

<talos-flow> is the link primitive for pipeline diagrams: a dashed stroke travels along a path at a speed bound to rate. The animation is the throughput — zero rate means no motion, so a glance reads whether anything is flowing. Colour rides the warn / crit band, so health is the colour, not a caption.

Default — idle

LIVE
<talos-flow rate="0" width="180" height="36"></talos-flow>

rate="0" (the default) draws only the static base hairline — connected, nothing flowing. No travelling dash at all.

Rate → speed

PREVIEW
<talos-flow rate="20"  max="100" width="180" height="36"></talos-flow>
<talos-flow rate="60"  max="100" width="180" height="36"></talos-flow>
<talos-flow rate="100" max="100" width="180" height="36"></talos-flow>

Dash travel velocity is ∝ rate, saturating at max (so a huge rate stays legible). Higher rate, faster sweep.

Band → colour

PREVIEW
<talos-flow rate="40" max="100" warn="70" crit="90" width="180" height="36"></talos-flow>
<talos-flow rate="78" max="100" warn="70" crit="90" width="180" height="36"></talos-flow>
<talos-flow rate="95" max="100" warn="70" crit="90" width="180" height="36"></talos-flow>

rate crossing warn paints the dash --talos-warning; crossing crit paints --talos-danger. Below both, --talos-success. Colour snaps to the band — state must not lag.

Invert — low = bad

PREVIEW
<talos-flow rate="15" max="100" warn="40" crit="20" invert width="180" height="36"></talos-flow>

With invert, the band trips as rate falls — a starved link (low throughput as the symptom) reads red. Same warn / crit semantics as gauge, meter, and trend, flipped.

Reverse

PREVIEW
<talos-flow rate="60" max="100" width="180" height="36"></talos-flow>
<talos-flow rate="60" max="100" reverse width="180" height="36"></talos-flow>

reverse flips travel direction — the visual direction is the data direction.

Curve

PREVIEW
<talos-flow rate="60" max="100" curve="14" width="180" height="48"></talos-flow>

curve bows the path by that many px (quadratic). 0 (default) is a straight line. Endpoints are set with x1 y1 x2 y2 in viewBox units.

Reduced motion

Under prefers-reduced-motion: reduce the dash does not travel — instead the edge renders static directional chevrons and exposes the rate via aria-label (role="img"). The information — there is flow, this fast, this direction, this health — survives without the animation. No flag to set; it reads the OS preference.

Behaviour

Bands use the same threshold + invert logic as <talos-gauge>, <talos-meter>, and <talos-trend>.

Attributes

Generated from custom-elements.json in the installed package. Shared attributes (state, format, static…) behave as the instrument contract describes.

AttributeTypeDefaultDescription
rate number 0 throughput; 0 = idle (no motion)
max number 100 rate at which speed saturates.
warn number — band thresholds on rate.
crit number — band thresholds on rate.
invert boolean — low = bad (band trips as rate FALLS)
x1 number 4 endpoints in viewBox units.
y1 number — endpoints in viewBox units.
x2 number — endpoints in viewBox units.
y2 number — endpoints in viewBox units.
curve number 0 bow height for a curved path, px.
reverse boolean — reverse travel direction.
width number 200 viewBox px.
height number 40 viewBox px.
format string — number | compact | percent | bytes | duration | currency; the readout's number format
precision string — fraction digits of the formatted value
currency string — ISO 4217 code when format=currency
locale string — BCP 47 locale for formatting; defaults to the page locale
state string — live | loading | stale | offline | unknown; sets data-state on the host
updated-at string — time of the last sample (ISO or epoch ms); drives the age caption
stale-after string — seconds after updated-at at which the element reads stale
static string — boolean; turns motion off for this element only
label string — caption and accessible name

Events

EventTypeDescription
talos:band CustomEvent<BandEventDetail> Fired when the band changes (not on first render): detail { from, to, value }. Bubbles and is composed.

CSS parts

::part(base), ::part(chevrons), ::part(dash), ::part(svg)