new_pillar_component()
constructs an object of class "pillar_component"
.
pillar_component()
is a convenience helper that wraps the input in a list
and extracts width and minimum width.
new_pillar_component(x, ..., width, min_width = NULL) pillar_component(x)
x | A bare list (for |
---|---|
... | These dots are for future extensions and must be empty. |
width, min_width | Width and minimum width for the new component.
If |
Objects of class "pillar"
are internally a named lists of their components.
The default components are title
(may be missing), type
, and data
.
Each component is a "pillar_component"
.
This class captures contents that can be fitted in a rectangle. Each component consists of one or multiple cells that are aligned horizontally (with one space in between) when printed. Each cell has a maximum (i.e., desired) width and may have a minimum width if the contents are compressible. The component object stores the width of the cells as an attribute.
#> [[1]] #> [1] "a" "b" "c" #> #> attr(,"width") #> [1] 1 #> attr(,"class") #> [1] "pillar_component"#> [[1]] #> [[1]] #> [1] "letters" #> #> attr(,"class") #> [1] "pillar_title" #> attr(,"width") #> [1] 7 #> attr(,"min_width") #> [1] 7 #> #> attr(,"width") #> [1] 7 #> attr(,"min_width") #> [1] 7 #> attr(,"class") #> [1] "pillar_component"#> [[1]] #> [[1]] #> [1] "chr" #> #> attr(,"class") #> [1] "pillar_type" #> attr(,"width") #> [1] 5 #> attr(,"min_width") #> [1] 5 #> #> attr(,"width") #> [1] 5 #> attr(,"min_width") #> [1] 5 #> attr(,"class") #> [1] "pillar_component"#> [[1]] #> <pillar_ornament> #> a #> b #> c #> #> attr(,"width") #> [1] 1 #> attr(,"min_width") #> [1] 1 #> attr(,"class") #> [1] "pillar_component"