Skip to content
ConsoleMonster
Class

Distribution

ConsoleMonster.Frames

Namespace
ConsoleMonster.Frames
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

Counts in labelled buckets with line bars on one shared scale; a bucket gets a role only when its owner marks it.

Inheritance

  • object
  • Distribution

Usage

Explore 6 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 4

Accepted by parameters 2

Constructors

public Distribution() #

Methods

public Distribution Add(string label, long count, HealthState? state = null) #

Adds a bucket.

Parameters

label string required
The literal label.
count long required
The count.
state ConsoleMonster.Frames.HealthState? = null optional
Optional state for buckets past a threshold the data owner supplied.

Returns

Distribution This instance.
public Distribution AddNote(string label, long count, HealthState state, string note) #

Adds a row without a bar, such as items that were not read.

Parameters

label string required
The literal label.
count long required
The count.
state ConsoleMonster.Frames.HealthState required
The note's state.
note string required
A literal note in place of the bar.

Returns

Distribution This instance.
public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
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 required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public int BarWidth { get; set; } #

The bar width the distribution would like (default 25).

Extension Methods

public static Distribution BarWidth(Distribution distribution, int value) #

Sets Distribution.BarWidth: The bar width the distribution would like (default 25).

Parameters

distribution ConsoleMonster.Frames.Distribution required
The instance.
value int required
The value.

Returns

Distribution The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Frames.Distribution { BarWidth = value };    distribution.BarWidth(value);