Creates HTML widgets from sorting grids.
Wraps pensieve's inanimatus.js.
End users should use the convenient print method wrappers.
inanimatus(
grid = as_psGrid(obj = c(1, 2, 3, 5, 3, 2, 1)),
sort = matrix(data = c(NA, NA, NA, "foo", NA, NA, NA, NA, NA, NA, "bar", NA, NA, NA,
NA, NA, "zap", "zop", "zong", NA, NA, NA, "wap", "gum", "pap", "wep", "pel", NA,
"rom", "com", "jul", "rob", "di", "nir", "omg"), byrow = TRUE, nrow = 5),
header = TRUE,
footer = TRUE,
aspect_ratio_cards = 16/9,
scale_2_height = NULL,
width = NULL,
height = NULL
)
Arguments
grid |
[matrix()]
giving the availability of cells for sorting as logical(1) values.
The (horizontal) x-axis is assumed to be the sorting direction, the (vertical) y-axis for recording ties.
Dimensions can be named (recommended), giving a short description of the sorting dimension (only applicable to the x-axis).
Row and column indeces can also be named, but names are purely cosmetic.
|
sort |
[matrix()]
giving the occupying item of cells for sorting as character(1) strings of item handles.
NA is used for empty and disallowed cells (see psGrid).
The (horizontal) x-axis is assumed to be the sorting direction, the (vertical) y-axis for recording ties.
Dimensions can be named (recommended), giving a short description of the sorting dimension (only applicable to the x-axis).
Row and column indeces can also be named, but names are purely cosmetic.
|
header |
A logical flag, defaults to TRUE , in which case column or row names from grid are included as headers or footers, respectively.
Missing row or column names are replaced with sensible defaults. |
footer |
A logical flag, defaults to TRUE , in which case column or row names from grid are included as headers or footers, respectively.
Missing row or column names are replaced with sensible defaults. |
aspect_ratio_cards |
A numeric scalar, giving width divided by height of individual cards (such as 16/9 for screen dimensions).
Aspect ratio of cards is required to appropriately set the resulting dimensions of the grid.
Defaults to standard business cards. |
scale_2_height |
[logical()]
giving whether widget should, in addition to width, also be scaled to an ancestor height.
Only set TRUE if you are sure that the surrounding markup passes down a valid css height property, otherwise you will get bad css for the widget.
Defaults to NULL ; FALSE when rendering via knitr, otherwise TRUE .
|
width |
Fixed width for widget (in css units). The default is
NULL , which results in intelligent automatic sizing based on the
widget's container. |
height |
Fixed height for widget (in css units). The default is
NULL , which results in intelligent automatic sizing based on the
widget's container. |
Value
An htmlwidget.