GroupedRows<T>
ConsoleMonster.Frames
A detail table grouped by a key. Every group shares one column layout; group headings carry their own rollup. Long single-column tables repeat their header; wide terminals flow groups into columns without splitting a group. Healthy rows collapse into the group heading in large sections, and rows stop at the length's cap with +N more.
Inheritance
- object
- GroupedRows<T>
Type Parameters
- T
- The row type.
Constructors
public GroupedRows<T>(IEnumerable<T?> items, Func<T?, string> group, FrameScale scale) #Creates grouped rows.
Parameters
- items System.Collections.Generic.IEnumerable<T?>
- The rows, already in display order within each group.
- group System.Func<T?, string>
- The group key; groups appear in first-seen order.
- scale ConsoleMonster.Frames.FrameScale
- The frame's scale, from the section context.
Methods
public Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
Properties
public Func<string, IReadOnlyList<T?>, GroupHeading>? Heading { get; set; } #Builds a group's heading; null shows the key only.
public Func<T?, bool>? IsHealthy { get; set; } #Whether a row is healthy, for collapsing large sections; null never collapses.
public string Noun { get; set; } #The singular noun for rows, for +N more and collapsed counts.
public string HealthyWord { get; set; } #The word for collapsed healthy rows (default healthy).