Manage multiple progress bars simultaneously, useful for tracking parallel operations or multiple stages of a process. Each bar can have its own style and format.
Methods
Method add_bar()
Add a new progress bar to the display
Examples
if (FALSE) { # \dontrun{
# Track multiple operations
mb <- MultiProgressBar$new()
# Add bars for different tasks
pb1 <- mb$add_bar(
id = "download",
total = 100,
format = "{spin} Download {bar} {percent}",
style = "modern"
)
pb2 <- mb$add_bar(
id = "process",
total = 50,
format = "{spin} Process {bar} {percent}",
style = "elegant"
)
pb3 <- mb$add_bar(
id = "upload",
total = 80,
format = "{spin} Upload {bar} {percent}",
style = "blocks"
)
# Simulate work
for (i in 1:100) {
if (i <= 100) pb1$tick()
if (i <= 50) pb2$tick()
if (i <= 80) pb3$tick()
Sys.sleep(0.02)
}
mb$terminate_all()
} # }