| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/ctl_pillar_component.R |
| 3 |
\name{new_pillar_component} |
| 4 |
\alias{new_pillar_component} |
| 5 |
\alias{pillar_component} |
| 6 |
\title{Components of a pillar} |
| 7 |
\usage{ |
| 8 |
new_pillar_component(x, ..., width, min_width = NULL) |
| 9 |
|
| 10 |
pillar_component(x) |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{x}{A bare list of length one (for \code{new_pillar_component()}), |
| 14 |
or an object with \code{"width"} and \code{"min_width"} attributes |
| 15 |
(for \code{pillar_component()}).} |
| 16 |
|
| 17 |
\item{...}{These dots are for future extensions and must be empty.} |
| 18 |
|
| 19 |
\item{width, min_width}{Width and minimum width for the new component. |
| 20 |
If \code{min_width} is \code{NULL}, it is assumed to match \code{width}.} |
| 21 |
} |
| 22 |
\description{ |
| 23 |
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} |
| 24 |
|
| 25 |
\code{new_pillar_component()} constructs an object of class \code{"pillar_component"}. |
| 26 |
It is used by custom \code{\link[=ctl_new_pillar]{ctl_new_pillar()}} methods to create pillars with |
| 27 |
nonstandard components. |
| 28 |
|
| 29 |
\code{pillar_component()} is a convenience helper that wraps the input in a list |
| 30 |
and extracts width and minimum width. |
| 31 |
} |
| 32 |
\details{ |
| 33 |
Objects of class \code{"pillar"} are internally a named lists of their components. |
| 34 |
The default components for pillars created by \code{\link[=pillar]{pillar()}} are: |
| 35 |
\code{title} (may be missing), \code{type}, and \code{data}. |
| 36 |
Each component is a \code{"pillar_component"} object. |
| 37 |
|
| 38 |
This class captures contents that can be fitted in a simple column. |
| 39 |
Compound columns are represented by multiple pillar objects, each with their |
| 40 |
own components. |
| 41 |
} |
| 42 |
\examples{ |
| 43 |
new_pillar_component(list(letters[1:3]), width = 1) |
| 44 |
pillar_component(new_pillar_title("letters")) |
| 45 |
pillar_component(new_pillar_type(letters)) |
| 46 |
pillar_component(pillar_shaft(letters[1:3])) |
| 47 |
} |