Module Line.Bar_style

type t

The type of progress bar style specifications.

val ascii : t

The style used by bar ~style:`ASCII (which is the default). Generates bars of the form [######---].

val utf8 : t

utf8 is the style used by bar ~style:`UTF8. Uses the UTF-8 block element characters (U+2588U+258F) for progress stages, and a box-drawing character (U+2502) for delimiters.

Custom styles

val v : ?delims:(string * string) -> ?color:Color.t -> ?color_empty:Color.t -> string list -> t

v stages is a bar that uses the given string stages to render progress. The first stage is interpreted as a "full" segment, with subsequent stages denoting progressively less-full segments until a final "empty" stage (which is implicitly a space if only one stage is provided).

The optional parameters are as follows:

Examples

Specifics

Each segment of a rendering progress bar is in one of three states: full, empty or in-progress. At any given time, either the bar is entirely full or or there is exactly one in-progress segment. Given the style v [s1; s2; ... sN], these states are rendered as follows:

For the progress bar to render within a fixed size, the user must ensure that each of the stages must have the same rendered width.

Setters

val with_color : Color.t -> t -> t
val with_empty_color : Color.t -> t -> t
val with_delims : (string * string) option -> t -> t
val with_stages : string list -> t -> t