CellMap
ConsoleMonster.Widgets
One cell per item of a run, in item order, flowing to the width: each state has its own symbol (✓ ✗ ▴ – ○ in Full and Basic, + x ! - . in ASCII), so outcomes read without colour; running items spin; a legend counts each state. Generic: tests, hosts, files, any list of work. Live operations: set (Key = item index, State = status word), add (State, optional), count (Value = the number of items, new ones pending).
Inheritance
- LiveWidget
- CellMap
Usage
Explore 50 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 26
- Method Ui.CellMap
- Extension method CellMap.Blocks
- Extension method CellMap.Columns
- Extension method CellMap.Gap
- Extension method CellMap.LegendLines
- Extension method CellMap.MaxRows
- Extension method CellMap.RowLabel
- Extension method CellMap.RowLabels
- Extension method CellMap.ShowColumnLabels
- Extension method CellMap.ShowLegend
- Extension method CellMap.SpinRunning
- Extension method CellMap.Window
- Method CellMap.Cell
- Method CellMap.Resize
- Method CellMap.Set
- Method CellMapFluent.Blocks
- Method CellMapFluent.Columns
- Method CellMapFluent.Gap
- Method CellMapFluent.LegendLines
- Method CellMapFluent.MaxRows
- Method CellMapFluent.RowLabel
- Method CellMapFluent.RowLabels
- Method CellMapFluent.ShowColumnLabels
- Method CellMapFluent.ShowLegend
- Method CellMapFluent.SpinRunning
- Method CellMapFluent.Window
Accepted by parameters 24
- Method ContentBuilder.CellMap
- Method ContentBuilder.CellMap
- Extension method CellMap.Blocks
- Extension method CellMap.Columns
- Extension method CellMap.Gap
- Extension method CellMap.LegendLines
- Extension method CellMap.MaxRows
- Extension method CellMap.RowLabel
- Extension method CellMap.RowLabels
- Extension method CellMap.ShowColumnLabels
- Extension method CellMap.ShowLegend
- Extension method CellMap.SpinRunning
- Extension method CellMap.Window
- Method CellMapFluent.Blocks
- Method CellMapFluent.Columns
- Method CellMapFluent.Gap
- Method CellMapFluent.LegendLines
- Method CellMapFluent.MaxRows
- Method CellMapFluent.RowLabel
- Method CellMapFluent.RowLabels
- Method CellMapFluent.ShowColumnLabels
- Method CellMapFluent.ShowLegend
- Method CellMapFluent.SpinRunning
- Method CellMapFluent.Window
Constructors
public CellMap(string widgetId = "cells") #Creates a cell map.
Parameters
- widgetId string = "cells"
- The live name (default cells).
Methods
public int Add(StatusKind state = Pending) #Adds an item.
Parameters
- state ConsoleMonster.Styling.StatusKind = Pending
- Its state (default pending).
Returns
int The new item's index.public override void Apply(LiveEvent liveEvent) #Applies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public CellMap Cell(string row, string column, StatusKind state) #Sets the cell at a named row and column, adding the row (to CellMap.RowLabels) and the column (to CellMap.ColumnLabels) the first time each appears: one row per category with a cell per target, coloured by outcome. A cell no row and column pair has set yet shows StatusKind.None. The grid lays out the map's cells and sets CellMap.Columns, so do not mix it with CellMap.Add on the same map.
Parameters
- row string
- The row name (a category).
- column string
- The column name (a target).
- state ConsoleMonster.Styling.StatusKind
- The cell's state.
public static string CountLabel(StatusKind state, int count, RenderContext context) #A count with the word for its state in the current language: "12 passed", "3 failed", "45 queued".
Parameters
- state ConsoleMonster.Styling.StatusKind
- The state.
- count int
- The count.
- context ConsoleMonster.Canvas.RenderContext
- The render context (labels and culture).
Returns
string The text.public int CountOf(StatusKind state) #How many items are in a state.
Parameters
- state ConsoleMonster.Styling.StatusKind
- The state.
Returns
int The count.public StyledLine Legend(RenderContext context) #The legend: each state present with its symbol and count ("✓ 12 passed ✗ 3 failed ○ 45 queued").
Parameters
- context ConsoleMonster.Canvas.RenderContext
- The render context.
public override 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 override 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.
public CellMap Resize(int count) #Sets the number of items: new ones are pending, extra ones are removed.
Parameters
- count int
- The count.
public CellMap Set(int index, StatusKind state) #Sets an item's state, growing the map when the index is past the end.
Parameters
- index int
- The item index.
- state ConsoleMonster.Styling.StatusKind
- The state.
Inherited Methods
public virtual string? Describe(LiveEvent liveEvent) #Parameters
- liveEvent LiveEvent
Returns
string?Properties
public bool ShowLegend { get; set; } #Whether a legend line with each state's count follows the cells (default true).
public int MaxRows { get; set; } #The most rows of cells (0 = all); a last line then counts the items not shown.
public CellWindow Window { get; set; } #Which rows show when there are more than CellMap.MaxRows (default CellWindow.Head).
public bool SpinRunning { get; set; } #Whether running cells spin (default true); false shows the still running symbol, when another part of the screen already spins.
public int Columns { get; set; } #The cells per row (0 = as many as fit, the default). Set it to draw a grid, such as one row per server and one column per check; cells past the width are cut off rather than moved to the next row.
public IList<string> RowLabels { get; } #Labels drawn muted before the rows, one per row in order (empty = none, the default); the cells start after the widest label. Together with CellMap.Columns they make a labelled grid with one legend below it.
public bool Blocks { get; set; } #Whether each cell is a block in its state's colour rather than its symbol (default false), for a dense strip of many items. It needs colour and the Full or Basic tier and is off for an accessible profile; otherwise the cells keep their symbols, so outcomes still read without telling colours apart. Queued cells are drawn as the empty bar track.
public int LegendLines { get; set; } #The most lines the legend wraps onto when it is wider than the map (default 1: it is cut off instead).
public StatusKind this[int index] { get; } #The state of an item.
Parameters
- index int
- The item index.
public IReadOnlyList<string> ColumnLabels { get; } #The columns of a grid filled with CellMap.Cell, in the order they first appeared (for example the targets of a category × target map); empty for a plain map.
public bool ShowColumnLabels { get; set; } #Whether a grid built with CellMap.Cell shows its CellMap.ColumnLabels in a header row (default false). When the names fit, each column is as wide as its name and the cell sits under it; when they do not, the columns are numbered and a key line below the map names them ("1 DC01 · 2 DC02"). When even numbered columns do not fit, the map shows the columns that do and the key ends with "+N more". A suffix all the names share (.corp.example) and a shared prefix are left out first, so the column shows what tells the names apart.
Inherited Properties
Fields
public const int MaxItems #The most items a map holds (1,000,000): live events past it are ignored, so a mistyped index cannot exhaust memory.
1000000Extension Methods
public static CellMap Blocks(CellMap cellMap, bool value = true) #Sets CellMap.Blocks: Whether each cell is a block in its state's colour rather than its symbol (default false), for a dense strip of many items. It needs colour and the Full or Basic tier and is off for an accessible profile; otherwise the cells keep their symbols, so outcomes still read without telling colours apart. Queued cells are drawn as the empty bar track.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { Blocks = value }; Ui.CellMap().Blocks(value);public static CellMap Columns(CellMap cellMap, int value) #Sets CellMap.Columns: The cells per row (0 = as many as fit, the default). Set it to draw a grid, such as one row per server and one column per check; cells past the width are cut off rather than moved to the next row.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { Columns = value }; Ui.CellMap().Columns(value);public static CellMap Gap(CellMap cellMap, int value) #Sets CellMap.Gap: The cells between symbols (default 1).
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { Gap = value }; Ui.CellMap().Gap(value);public static CellMap LegendLines(CellMap cellMap, int value) #Sets CellMap.LegendLines: The most lines the legend wraps onto when it is wider than the map (default 1: it is cut off instead).
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { LegendLines = value }; Ui.CellMap().LegendLines(value);public static CellMap MaxRows(CellMap cellMap, int value) #Sets CellMap.MaxRows: The most rows of cells (0 = all); a last line then counts the items not shown.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { MaxRows = value }; Ui.CellMap().MaxRows(value);public static CellMap RowLabel(CellMap cellMap, string item) #Adds an item to CellMap.RowLabels: Labels drawn muted before the rows, one per row in order (empty = none, the default); the cells start after the widest label. Together with CellMap.Columns they make a labelled grid with one legend below it.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- item string
- The item.
public static CellMap RowLabels(CellMap cellMap, IEnumerable<string> items) #Adds items to CellMap.RowLabels: Labels drawn muted before the rows, one per row in order (empty = none, the default); the cells start after the widest label. Together with CellMap.Columns they make a labelled grid with one legend below it.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static CellMap ShowColumnLabels(CellMap cellMap, bool value = true) #Sets CellMap.ShowColumnLabels: Whether a grid built with CellMap.Cell shows its CellMap.ColumnLabels in a header row (default false). When the names fit, each column is as wide as its name and the cell sits under it; when they do not, the columns are numbered and a key line below the map names them ("1 DC01 · 2 DC02"). When even numbered columns do not fit, the map shows the columns that do and the key ends with "+N more". A suffix all the names share (.corp.example) and a shared prefix are left out first, so the column shows what tells the names apart.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { ShowColumnLabels = value }; Ui.CellMap().ShowColumnLabels(value);public static CellMap ShowLegend(CellMap cellMap, bool value = true) #Sets CellMap.ShowLegend: Whether a legend line with each state's count follows the cells (default true).
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { ShowLegend = value }; Ui.CellMap().ShowLegend(value);public static CellMap SpinRunning(CellMap cellMap, bool value = true) #Sets CellMap.SpinRunning: Whether running cells spin (default true); false shows the still running symbol, when another part of the screen already spins.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { SpinRunning = value }; Ui.CellMap().SpinRunning(value);public static CellMap Window(CellMap cellMap, CellWindow value) #Sets CellMap.Window: Which rows show when there are more than CellMap.MaxRows (default CellWindow.Head).
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value ConsoleMonster.Widgets.CellMap.CellWindow
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.CellMap { Window = value }; Ui.CellMap().Window(value);