Matrix
ConsoleMonster.Widgets
A labelled status grid with contiguous axis bands, a counted legend and explicit narrow fallbacks.
Inheritance
- object
- Matrix
Usage
Explore 83 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 41
- Extension method Matrix.AddAdditionalLegendEntries
- Extension method Matrix.AddAdditionalLegendEntry
- Extension method Matrix.AsciiListDirection
- Extension method Matrix.CellNote
- Extension method Matrix.ColumnAxisCaption
- Extension method Matrix.Configure
- Extension method Matrix.InlineAxes
- Extension method Matrix.ListDirection
- Extension method Matrix.MaxGridSize
- Extension method Matrix.MaxListRows
- Extension method Matrix.MinCellWidth
- Extension method Matrix.MissingLegendLabel
- Extension method Matrix.NonHealthyOnly
- Extension method Matrix.RowAxisCaption
- Extension method Matrix.SelfLegendLabel
- Extension method Matrix.ShortColumnAxisCaption
- Extension method Matrix.ShortRowAxisCaption
- Extension method Matrix.ShowLegend
- Extension method Matrix.ShowLegendCounts
- Extension method Matrix.Title
- Method Matrix.SetCell
- Method MatrixFluent.AddAdditionalLegendEntries
- Method MatrixFluent.AddAdditionalLegendEntry
- Method MatrixFluent.AsciiListDirection
- Method MatrixFluent.CellNote
- Method MatrixFluent.ColumnAxisCaption
- Method MatrixFluent.Configure
- Method MatrixFluent.InlineAxes
- Method MatrixFluent.ListDirection
- Method MatrixFluent.MaxGridSize
- Method MatrixFluent.MaxListRows
- Method MatrixFluent.MinCellWidth
- Method MatrixFluent.MissingLegendLabel
- Method MatrixFluent.NonHealthyOnly
- Method MatrixFluent.RowAxisCaption
- Method MatrixFluent.SelfLegendLabel
- Method MatrixFluent.ShortColumnAxisCaption
- Method MatrixFluent.ShortRowAxisCaption
- Method MatrixFluent.ShowLegend
- Method MatrixFluent.ShowLegendCounts
- Method MatrixFluent.Title
Accepted by parameters 42
- Extension method Matrix.AddAdditionalLegendEntries
- Extension method Matrix.AddAdditionalLegendEntry
- Extension method Matrix.AsciiListDirection
- Extension method Matrix.CellNote
- Extension method Matrix.ColumnAxisCaption
- Extension method Matrix.Configure
- Extension method Matrix.Configure
- Extension method Matrix.InlineAxes
- Extension method Matrix.ListDirection
- Extension method Matrix.MaxGridSize
- Extension method Matrix.MaxListRows
- Extension method Matrix.MinCellWidth
- Extension method Matrix.MissingLegendLabel
- Extension method Matrix.NonHealthyOnly
- Extension method Matrix.RowAxisCaption
- Extension method Matrix.SelfLegendLabel
- Extension method Matrix.ShortColumnAxisCaption
- Extension method Matrix.ShortRowAxisCaption
- Extension method Matrix.ShowLegend
- Extension method Matrix.ShowLegendCounts
- Extension method Matrix.Title
- Method MatrixFluent.AddAdditionalLegendEntries
- Method MatrixFluent.AddAdditionalLegendEntry
- Method MatrixFluent.AsciiListDirection
- Method MatrixFluent.CellNote
- Method MatrixFluent.ColumnAxisCaption
- Method MatrixFluent.Configure
- Method MatrixFluent.Configure
- Method MatrixFluent.InlineAxes
- Method MatrixFluent.ListDirection
- Method MatrixFluent.MaxGridSize
- Method MatrixFluent.MaxListRows
- Method MatrixFluent.MinCellWidth
- Method MatrixFluent.MissingLegendLabel
- Method MatrixFluent.NonHealthyOnly
- Method MatrixFluent.RowAxisCaption
- Method MatrixFluent.SelfLegendLabel
- Method MatrixFluent.ShortColumnAxisCaption
- Method MatrixFluent.ShortRowAxisCaption
- Method MatrixFluent.ShowLegend
- Method MatrixFluent.ShowLegendCounts
- Method MatrixFluent.Title
Constructors
public Matrix(IEnumerable<MatrixLabel> rows, IEnumerable<MatrixLabel> columns) #Creates a matrix with fixed axes; labels and cells contain plain text.
Parameters
- rows System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.MatrixLabel>
- The row labels.
- columns System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.MatrixLabel>
- The column labels.
Methods
public MatrixCell? GetCell(int row, int column) #Gets an observation, or null when none has been supplied.
Parameters
- row int
- Zero-based row index.
- column int
- Zero-based column index.
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.
public Matrix SetCell(int row, int column, StatusKind? status, string? text = null, bool diagonal = false) #Sets an observation without deriving health or assuming the axes describe the same entities.
Parameters
- row int
- Zero-based row index.
- column int
- Zero-based column index.
- status ConsoleMonster.Styling.StatusKind?
- The supplied status, or null.
- text string? = null
- Optional short plain text.
- diagonal bool = false
- True for an explicit self marker.
public Matrix SetCell(int row, int column, StatusKind? status, string? text, string? marker, bool diagonal = false) #Sets an observation with a literal marker independent of its supplied status and tone.
Parameters
- row int
- Zero-based row index.
- column int
- Zero-based column index.
- status ConsoleMonster.Styling.StatusKind?
- The supplied status, or null.
- text string?
- Optional short plain text.
- marker string?
- A literal marker; null retains the built-in glyph. Explicit self cells retain their self marker.
- diagonal bool = false
- True for an explicit self marker.
Inherited Methods
Properties
public string? RowAxisCaption { get; set; } #An optional plain text caption for the row axis, shown in grids and attention lists.
public string? ColumnAxisCaption { get; set; } #An optional plain text caption for the column axis, shown in grids and attention lists.
public string? ListDirection { get; set; } #An optional literal connector between row and column identities in lists; null retains a slash.
public string? AsciiListDirection { get; set; } #The ASCII connector for Matrix.ListDirection; null uses that connector unchanged.
public IDictionary<StatusKind, string> LegendLabels { get; } #Optional plain text legend words keyed by supplied status; absent entries retain the built-in words.
public IDictionary<StatusKind, string> LegendMarkers { get; } #Optional literal legend glyphs keyed by status; absent entries retain the built-in glyphs. These do not change cell glyphs or counts. Use ASCII-safe glyphs for all-tier output.
public IDictionary<StatusKind, ThemeToken> LegendRoles { get; } #Optional semantic roles for caller-labelled matrix states.
public IList<string> AdditionalLegendEntries { get; } #Additional markup legend entries for evidence not assignable to a cell.
public string? SelfLegendLabel { get; set; } #The plain text self-cell legend word, or null for the built-in word.
public string? MissingLegendLabel { get; set; } #The plain text absent-observation legend word, or null for the built-in word.
public bool ShowLegend { get; set; } #Show counts of supplied statuses, self cells and absent observations (default true).
public bool ShowLegendCounts { get; set; } #Include observed cell counts after state labels in an inline legend (default true).
public bool InlineAxes { get; set; } #Use inline axis captions, a left band column and the full/short/numbered fit chain.
public int MinCellWidth { get; set; } #Minimum cell width for an inline grid (default one).
public string? ShortRowAxisCaption { get; set; } #Abbreviated row caption for numbered grids.
public string? ShortColumnAxisCaption { get; set; } #Abbreviated column caption for numbered grids.
public string? CellNote { get; set; } #An optional literal explanation of what each cell contains.
public bool NonHealthyOnly { get; set; } #Always render the non-healthy list instead of the grid.
public int MaxGridSize { get; set; } #The largest axis allowed in grid mode (default 16). Larger axes use the attention list.
public int MaxListRows { get; set; } #The most attention entries shown (default 10; zero shows all), followed by an omission count.
public Func<StatusKind?, bool>? IsHealthy { get; set; } #Classifies supplied statuses for the attention list; null uses Pass, Skip and absent as healthy.
Extension Methods
public static Matrix AddAdditionalLegendEntries(Matrix matrix, params string[] items) #Adds items to Matrix.AdditionalLegendEntries: Additional markup legend entries for evidence not assignable to a cell.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- items string[]
- The items, in order.
public static Matrix AddAdditionalLegendEntries(Matrix matrix, IEnumerable<string> items) #Adds items to Matrix.AdditionalLegendEntries: Additional markup legend entries for evidence not assignable to a cell.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static Matrix AddAdditionalLegendEntry(Matrix matrix, string item) #Adds an item to Matrix.AdditionalLegendEntries: Additional markup legend entries for evidence not assignable to a cell.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- item string
- The item.
public static Matrix AsciiListDirection(Matrix matrix, string? value) #Sets Matrix.AsciiListDirection: The ASCII connector for Matrix.ListDirection; null uses that connector unchanged.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.AsciiListDirection = value; matrix.AsciiListDirection(value);public static Matrix CellNote(Matrix matrix, string? value) #Sets Matrix.CellNote: An optional literal explanation of what each cell contains.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.CellNote = value; matrix.CellNote(value);public static Matrix ColumnAxisCaption(Matrix matrix, string? value) #Sets Matrix.ColumnAxisCaption: An optional plain text caption for the column axis, shown in grids and attention lists.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.ColumnAxisCaption = value; matrix.ColumnAxisCaption(value);public static Matrix Configure(Matrix matrix, Action<Matrix> configure) #Assigns callbacks and related configuration without invoking delegate-valued properties.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- configure System.Action<ConsoleMonster.Widgets.Matrix>
- Assignments applied in order.
Examples
// C# initializer or property // C# fluent
matrix.IsHealthy = value; matrix.Configure(configured => configured.IsHealthy = value);public static Matrix InlineAxes(Matrix matrix, bool value) #Sets Matrix.InlineAxes: Use inline axis captions, a left band column and the full/short/numbered fit chain.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
matrix.InlineAxes = value; matrix.InlineAxes(value);public static Matrix InlineAxes(Matrix matrix) #Sets Matrix.InlineAxes to true.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance to configure.
public static Matrix ListDirection(Matrix matrix, string? value) #Sets Matrix.ListDirection: An optional literal connector between row and column identities in lists; null retains a slash.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.ListDirection = value; matrix.ListDirection(value);public static Matrix MaxGridSize(Matrix matrix, int value) #Sets Matrix.MaxGridSize: The largest axis allowed in grid mode (default 16). Larger axes use the attention list.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
matrix.MaxGridSize = value; matrix.MaxGridSize(value);public static Matrix MaxListRows(Matrix matrix, int value) #Sets Matrix.MaxListRows: The most attention entries shown (default 10; zero shows all), followed by an omission count.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
matrix.MaxListRows = value; matrix.MaxListRows(value);public static Matrix MinCellWidth(Matrix matrix, int value) #Sets Matrix.MinCellWidth: Minimum cell width for an inline grid (default one).
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
matrix.MinCellWidth = value; matrix.MinCellWidth(value);public static Matrix MissingLegendLabel(Matrix matrix, string? value) #Sets Matrix.MissingLegendLabel: The plain text absent-observation legend word, or null for the built-in word.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.MissingLegendLabel = value; matrix.MissingLegendLabel(value);public static Matrix NonHealthyOnly(Matrix matrix, bool value) #Sets Matrix.NonHealthyOnly: Always render the non-healthy list instead of the grid.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
matrix.NonHealthyOnly = value; matrix.NonHealthyOnly(value);public static Matrix NonHealthyOnly(Matrix matrix) #Sets Matrix.NonHealthyOnly to true.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance to configure.
public static Matrix RowAxisCaption(Matrix matrix, string? value) #Sets Matrix.RowAxisCaption: An optional plain text caption for the row axis, shown in grids and attention lists.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.RowAxisCaption = value; matrix.RowAxisCaption(value);public static Matrix SelfLegendLabel(Matrix matrix, string? value) #Sets Matrix.SelfLegendLabel: The plain text self-cell legend word, or null for the built-in word.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.SelfLegendLabel = value; matrix.SelfLegendLabel(value);public static Matrix ShortColumnAxisCaption(Matrix matrix, string? value) #Sets Matrix.ShortColumnAxisCaption: Abbreviated column caption for numbered grids.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.ShortColumnAxisCaption = value; matrix.ShortColumnAxisCaption(value);public static Matrix ShortRowAxisCaption(Matrix matrix, string? value) #Sets Matrix.ShortRowAxisCaption: Abbreviated row caption for numbered grids.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.ShortRowAxisCaption = value; matrix.ShortRowAxisCaption(value);public static Matrix ShowLegend(Matrix matrix, bool value) #Sets Matrix.ShowLegend: Show counts of supplied statuses, self cells and absent observations (default true).
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
matrix.ShowLegend = value; matrix.ShowLegend(value);public static Matrix ShowLegend(Matrix matrix) #Sets Matrix.ShowLegend to true.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance to configure.
public static Matrix ShowLegendCounts(Matrix matrix, bool value) #Sets Matrix.ShowLegendCounts: Include observed cell counts after state labels in an inline legend (default true).
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
matrix.ShowLegendCounts = value; matrix.ShowLegendCounts(value);public static Matrix ShowLegendCounts(Matrix matrix) #Sets Matrix.ShowLegendCounts to true.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance to configure.
public static Matrix Title(Matrix matrix, string? value) #Sets Matrix.Title: An optional markup title.
Parameters
- matrix ConsoleMonster.Widgets.Matrix
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
matrix.Title = value; matrix.Title(value);