Instruments Histogram
// Histogram

Histogram

The distribution of one value across many units: bar height is the count per bucket, bar colour is that bucket's band.

<talos-histogram> shows the shape of a population: how battery charge is spread across a fleet, how latency is distributed across gateways, where the mass sits and where the tail is. Bar height is how many units fall in a bucket; bar colour is the band of that bucket’s centre. A cohort sliding toward trouble reads as a bump migrating toward the red end.

Default — .values

LIVE
<talos-histogram
  bins="24" min="0" max="100" warn="70" crit="88"
  label="cpu across nodes" style="height:150px"
></talos-histogram>
<script type="module">
  const el = document.querySelector("talos-histogram");
  el.values = nodes.map((n) => n.cpu); // the raw population
</script>

The demo feeds 400 samples whose centre drifts each second. The element buckets the raw population itself; give the host a height.

Inverted — low is bad

LIVE
<talos-histogram bins="20" warn="45" crit="25" invert label="battery"></talos-histogram>

invert flips the bands: the low buckets are the red ones.

Behaviour

el.values = ArrayLike<number> sets the population and re-renders. Colour and bar position carry the meaning in a static frame; there is no motion-only information.

Attributes

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

AttributeTypeDefaultDescription
bins number 24, 1..MAX_BINS number of buckets.
min number 0 value range to bucket across.
max number 100 value range to bucket across.
warn number — band thresholds for bar colour.
crit number — band thresholds for bar colour.
invert boolean — low = bad.
label string — accessible label.
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

Properties and methods

MemberTypeDescription
.values ArrayLike<number>

CSS parts

::part(bars), ::part(svg)