Mosaic_ui.Progress_barProgress bar with sub-cell precision via Unicode half-blocks.
Progress bar with sub-cell precision fill rendering.
A progress bar maps a numeric value within a min, max range to a visual fill level along a horizontal or vertical track. The filled portion represents the current value relative to the range.
Rendering uses a double-resolution virtual coordinate system with Unicode half-block characters for sub-cell fill precision. Values are clamped to [min;max] before rendering. When min = max, the bar renders as fully filled.
The type for progress bar widgets backed by a Renderable.t.
val create :
parent:Renderable.t ->
?index:int ->
?id:string ->
?style:Toffee.Style.t ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?value:float ->
?min:float ->
?max:float ->
?orientation:orientation ->
?filled_color:Ansi.Color.t ->
?empty_color:Ansi.Color.t ->
unit ->
tcreate ~parent () is a progress bar attached to parent with:
value is the initial fill value. Defaults to 0.0.min is the lower bound of the range. Defaults to 0.0.max is the upper bound of the range. Defaults to 1.0.orientation is the track direction. Defaults to `Horizontal.filled_color is the color of the filled portion. Defaults to medium gray.empty_color is the color of the unfilled portion. Defaults to dark gray.val node : t -> Renderable.tnode t is the underlying Renderable.t for t.
module Props : sig ... endapply_props t props replaces all properties of t with props. Always triggers a re-render.
val value : t -> floatvalue t is the current fill value of t.
val set_value : t -> float -> unitset_value t v sets the fill value of t to v. The value is stored as-is; clamping to [min t;max t] occurs at render time. Triggers a re-render if the value changed.
val min : t -> floatmin t is the lower bound of the range of t.
val set_min : t -> float -> unitset_min t v sets the lower bound of the range of t to v. Triggers a re-render if the bound changed.
val max : t -> floatmax t is the upper bound of the range of t.
val set_max : t -> float -> unitset_max t v sets the upper bound of the range of t to v. Triggers a re-render if the bound changed.
val set_orientation : t -> orientation -> unitset_orientation t o sets the track direction of t to o. Triggers a re-render if the orientation changed.
val set_filled_color : t -> Ansi.Color.t -> unitset_filled_color t c sets the filled portion color of t to c. Triggers a re-render if the color changed.
val set_empty_color : t -> Ansi.Color.t -> unitset_empty_color t c sets the unfilled portion color of t to c. Triggers a re-render if the color changed.
val pp : Format.formatter -> t -> unitpp formats a progress bar for debugging.