Skip to contents

Specify options for lazily-rendered panels in a Trelliscope display

Usage

panel_options(
  width = NULL,
  height = NULL,
  format = NULL,
  force = FALSE,
  prerender = TRUE
)

Arguments

width

Width in pixels of each panel.

height

Height in pixels of each panel.

format

The format of the panels the server will provide. Can be one of "png" , "svg", or "html". Ignored if panel is not lazy.

force

Should server force panels to be written? If FALSE, if the panel has already been generated, that is what will be made available. Ignored if panel is not lazy.

prerender

If "TRUE", lazy panels will be rendered prior to viewing the display. If "FALSE", a local R websockets server will be created and plots will be rendered on the fly when requested by the app. The latter is only available when using Trelliscope locally. Ignored if panel is not lazy.

Examples

mars_rover |>
  as_trelliscope_df(name = "mars rover") |>
  set_panel_options(img_src = panel_options(width = 2, height = 1))
#>  Using the variable "id" to uniquely identify each row of the data.
#>  Trelliscope data frame: "mars rover" located at
#>   "/tmp/RtmpVXgKLj/file17172973e1f7" with 1 panel:
#>"img_src": <panel_url>   [aspect=2]
#> # A tibble: 1,245 × 11
#>       id camera   sol earth_date class width height filesize hex     hue img_src
#>    <int> <chr>  <int> <date>     <chr> <int>  <int>    <int> <chr> <dbl> <url_p>
#>  1  3560 Mars …   565 2014-03-09 hori…   192    144     5656 #7C6…  31.4 <img>  
#>  2 74689 Mars …   565 2014-03-09 hori…  1632   1200   592880 #7B6…  32.9 <img>  
#>  3  3558 Mars …   568 2014-03-12 wheel   192    144     9123 #3C3…  33.9 <img>  
#>  4 74630 Mars …   568 2014-03-12 wheel  1632   1200   567528 #4F4…  31.1 <img>  
#>  5 74631 Mars …   568 2014-03-12 wheel  1632   1200   556007 #4B4…  32.5 <img>  
#>  6 74632 Mars …   568 2014-03-12 wheel  1632   1200   721995 #564…  33.1 <img>  
#>  7 74633 Mars …   568 2014-03-12 wheel  1632   1200   511984 #433…  32.3 <img>  
#>  8 74634 Mars …   568 2014-03-12 wheel  1632   1200   523267 #3C3…  32.3 <img>  
#>  9 74635 Mars …   568 2014-03-12 wheel  1632   1200   580228 #3D3…  32.5 <img>  
#> 10 74637 Mars …   568 2014-03-12 wheel   192    144    10522 #4E4…  32.3 <img>  
#> # ℹ 1,235 more rows
# TODO