Skip to contents

Assembles a trelliscopejs display from the panel tibble returned by precise_viz (or any tibble with one list-column of panels plus scalar columns): the panel column becomes the display panels, and every remaining scalar (non-list) column becomes a cognostic for filtering and sorting. Trelliscope browsing of many metrics/views is a first-class PreciseViz capability, but the trelliscopejs dependency is optional (Suggests): calls error actionably when it is not installed.

Usage

precise_trellis(
  data,
  path = NULL,
  panel_col = "panel",
  key_col = NULL,
  name = "PreciseViz panels",
  group = "common",
  desc = "",
  height = 500,
  width = 500
)

Arguments

data

A tibble with a list-column of panels – typically precise_viz output (panel column, panel_id key).

path

The base directory of the trelliscope application.

panel_col

The panel list-column name. Default "panel"; a column named "panel" is also detected for hand-built tibbles.

key_col

The key/label column. Default NULL chooses "input" when available, then "panel_id", then "descriptor".

name

Display name.

group

Display group.

desc

Display description.

height, width

Panel dimensions in pixels.

Value

The trelliscope display object (opens in the viewer when printed).

Author

Brian Muchmore

Examples

if (interactive() && requireNamespace("trelliscopejs", quietly = TRUE)) {
  m <- matrix(c(0, 1, 1, 0), nrow = 2)
  dimnames(m) <- list(c("a", "b"), c("a", "b"))
  panels <- precise_viz(m, type = "distance", views = "heatmap",
                        verbose = FALSE)

  precise_trellis(panels, path = tempfile("precise_trellis_"))
}