Skip to content

psrenergy/IncrementalProgressBar.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IncrementalProgressBar.jl

Getting Started

Installation

julia> ]add https://github.com/psrenergy/IncrementalProgressBar.jl

Ways of displaying a progress bar

Currently, there are two types of progress bars available:

Iterative

The iterative progress bar keeps overwriting the same line in the terminal, updating as it progresses.

Incremental

The incremental progress bar does not overwrite the whole terminal line. It adds new ticks to the end of the line as it progresses.

Note It is advised to use the incremental progress bar when your terminal cannot overwrite the terminal line.

Costumizing the progress bar

The progress bar can be costumized by passing the following arguments to the ProgressBar constructor:

  • display: The type of progress bar to be displayed (IncrementalProgressBar.Incremental or IncrementalProgressBar.Iterative).

  • maximum_steps(Int): The maximum number of steps the progress bar will take.

  • tick(Char): The character that will be used to represent the progress bar (".", "*", "+", etc.).

  • first_tick(Char): The leading tick of the progress bar (">", etc.)

  • left_bar(Char): The character that will be used to represent the left bar of the progress bar ("|", "[", etc.).

  • right_bar(Char): The character that will be used to represent the right bar of the progress bar ("|", "]", etc.).

  • maximum_length(Int): The width of the progress bar in characters.

  • color(Symbol): The color of the progress bar (e.g. :red, :green, :blue , etc.).

  • has_percentage(Bool): Whether to show the percentage of the progress bar or not.

  • has_frame(Bool): Whether to show a top and bottom frame of the progress bar or not.

  • has_eta(Bool): Whether to show the estimated time of arrival or not.

  • has_elapsed_time(Bool): Whether to show the elapsed time or not.

Examples

using IncrementalProgressBar

p = IncrementalProgressBar.ProgressBar(maximum_steps = 100, tick = "+", left_bar = "|", right_bar="|")

for i in 1:100
    IncrementalProgressBar.next!(p)
    sleep(0.1)
end
IncrementalProgressBar.done!(p)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages