Facet Trelliscope

facet_trelliscope(
facets,
nrow = 1,
ncol = 1,
scales = "same",
name = NULL,
group = "common",
desc = ggplot2::waiver(),
md_desc = ggplot2::waiver(),
path = NULL,
height = 500,
width = 500,
state = NULL,
jsonp = TRUE,
as_plotly = FALSE,
plotly_args = NULL,
plotly_cfg = NULL,
split_sig = NULL,
self_contained = FALSE,
thumb = TRUE,
auto_cog = FALSE,
split_layout = FALSE,
data = ggplot2::waiver()
)

## Arguments

facets formula to facet the panels on. Similar to ggplot2::facet_wrap's facets the number of rows of panels to display by default the number of columns of panels to display by default should scales be the same ("same", the default), free ("free"), or sliced ("sliced"). May provide a single string or two strings, one for the X and Y axis respectively. name of the display group that the display belongs to description of the display optional string of markdown that will be shown in the viewer for additional context about the display the base directory of the trelliscope application height in pixels of each panel width in pixels of each panel the initial state the display will open in should json for display object be jsonp (TRUE) or json (FALSE)? should the panels be written as plotly objects? optional named list of arguments to send to ggplotly optional named list of arguments to send to plotly's config method optional string that specifies the "signature" of the data splitting. If not specified, this is calculated as the md5 hash of the sorted unique facet variables. This is used to identify "related displays" - different displays that are based on the same faceting scheme. This parameter should only be specified manually if a display's faceting is mostly similar to another display's. should the Trelliscope display be a self-contained html document? (see note) should a thumbnail be created? should auto cogs be computed (if possible)? boolean that determines if the layout is split into components like a facet_grid vs. individual panels like facet_wrap. Only applies to ggplot2 plot objects. data used for faceting. Defaults to the first layer data

## Note

Note that self_contained is severely limiting and should only be used in cases where you would either like your display to show up in the RStudio viewer pane, in an interactive R Markdown Notebook, or in a self-contained R Markdown html document.

## Examples

if (FALSE) {
library(ggplot2)

# basically swap out facet_wrap for facet_trelliscope
qplot(cty, hwy, data = mpg) +
facet_trelliscope(~ class + manufacturer)

# not required, but if you set labels, these will be added as
# descriptions to the cognostics that are automatically computed
mpg <- set_labels(mpg, mpg_labels)

qplot(cty, hwy, data = mpg) +
theme_bw() +
facet_trelliscope(~ manufacturer + class, nrow = 2, ncol = 4)

# using plotly
library(plotly)
qplot(cty, hwy, data = mpg) +
theme_bw() +
facet_trelliscope(~ manufacturer + class, nrow = 2, ncol = 4, as_plotly = TRUE)

qplot(class, cty, data = mpg, geom = c("boxplot", "jitter"), na.rm = TRUE) +
facet_trelliscope(~ class, ncol = 7, height = 800, width = 200,
state = list(sort = list(sort_spec("cty_mean")))) +
theme_bw()

library(gapminder)
qplot(year, lifeExp, data = gapminder) +
xlim(1948, 2011) + ylim(10, 95) + theme_bw() +
facet_trelliscope(~ country + continent, nrow = 2, ncol = 7,
width = 300, as_plotly = TRUE,
plotly_cfg = list(displayModeBar = FALSE))
}