1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/handler_pbcol.R
\name{handler_pbcol}
\alias{handler_pbcol}
\title{Progression Handler: Progress Reported as an ANSI Background Color in the Terminal}
\usage{
handler_pbcol(
adjust = 0,
pad = 1L,
complete = function(s) cli::bg_blue(cli::col_white(s)),
incomplete = function(s) cli::bg_cyan(cli::col_white(s)),
intrusiveness = getOption("progressr.intrusiveness.terminal", 1),
target = "terminal",
...
)
}
\arguments{
\item{adjust}{(numeric) The adjustment of the progress update,
where \code{adjust = 0} positions the message to the very left, and
\code{adjust = 1} positions the message to the very right.}
\item{pad}{(integer) Amount of padding on each side of the message,
where padding is done by spaces.}
\item{complete, incomplete}{(function) Functions that take "complete" and
"incomplete" strings that comprise the progress bar as input and annotate
them to reflect their two different parts. The default is to annotation
them with two different background colors and the same foreground color
using the \pkg{cli} package.}
\item{intrusiveness}{(numeric) A non-negative scalar on how intrusive
(disruptive) the reporter to the user.}
\item{target}{(character vector) Specifies where progression updates are
rendered.}
\item{\ldots}{Additional arguments passed to \code{\link[=make_progression_handler]{make_progression_handler()}}.}
}
\description{
Progression Handler: Progress Reported as an ANSI Background Color in the Terminal
}
\section{Requirements}{
This progression handler requires the \pkg{cli} package.
}
\section{Appearance}{
Below are a few examples on how to use and customize this progress handler.
In all cases, we use \code{handlers(global = TRUE)}.
\if{html}{\out{<div class="sourceCode r">}}\preformatted{handlers("pbcol")
y <- slow_sum(1:25)
}\if{html}{\out{</div>}}
\if{html}{\figure{handler_pbcol-default.svg}}
\if{html}{\out{<div class="sourceCode r">}}\preformatted{handlers(handler_pbcol(adjust = 0.5))
y <- slow_sum(1:25)
}\if{html}{\out{</div>}}
\if{html}{\figure{handler_pbcol-adjust-mid.svg}}
\if{html}{\out{<div class="sourceCode r">}}\preformatted{handlers(handler_pbcol(
adjust = 1,
complete = function(s) cli::bg_red(cli::col_black(s)),
incomplete = function(s) cli::bg_cyan(cli::col_black(s))
))
y <- slow_sum(1:25)
}\if{html}{\out{</div>}}
\if{html}{\figure{handler_pbcol-adjust-right-complete.svg}}
}
\examples{
handlers(handler_pbcol)
with_progress({ y <- slow_sum(1:10) })
print(y)
}
|