Skip to main content

Type Alias: BarProducer

BarProducer = (entry, variant, childrenAsSegments?) => readonly Bar[]

Defined in: layout/bars/bar.ts:71

What shape one variant draws. EntryVariant.bars takes one. Omit it and the variant draws wholeSpanUnlessSegments, the registry's own default (ADR 0023, ADR 0026) — one Bar over the entry's whole span. A former Segment is an ordinary child Entry now, so it draws its own Bar through its own row, never through this Entry's producer.

Takes the variant's own name. A variant states its name once (ADR 0018), so the registry passes its own registration's name here instead of a producer inventing or hardcoding one — the Bar then carries that name straight to data-variant. A one-argument producer an author already wrote keeps compiling: TypeScript accepts a function that takes fewer parameters than its declared type.

Takes whether childrenAsSegments matches this Entry as a row's subject (true for a segmented parent's own bar, false otherwise; EntriesRowSource.childrenAsSegments, #421 C2). Core's own wholeSpanUnlessSegments returns no Bar for it, so summary() paints no rail over the bars its children already draw. A producer that ignores this parameter still draws — nothing skips it.

Parameters​

entry​

Entry

variant​

string

childrenAsSegments?​

boolean

Returns​

readonly Bar[]