Skip to contents

The plot card on its own: a shiny::plotOutput() bound to the ptr_plot id the server writes to (see ptr_server()). One of the single-piece UI builders for the L3 "own every UI piece" workflow; place it anywhere in your own layout and wire the server with ptr_server() / ptr_server().

Usage

ptr_ui_plot(id = NULL)

Arguments

id

Optional module id; the namespace prefix for the output. Defaults to NULL (identity namespace) for the single-embedding case. When set, must match the id passed to the other piece functions and to the shiny::moduleServer() wrapping ptr_server() (or to ptr_server()).

Value

A shiny::tag.

Details

The piece is truly bare: just the plot card, with no error slot and no show-code button. Behaviour is added compositionally by the combinators ptr_ui_inline_error() (nests an error slot in the card body) and ptr_ui_toggle_code() (adds the </> toggle + slide-out code window) — not by flags on this function.

Examples

ptr_ui_plot("myplot")
#> <div class="ptr-card ptr-card--plot">
#>   <div class="ptr-card__head">
#>     <h3 class="ptr-card__title">Plot</h3>
#>   </div>
#>   <div class="ptr-card__body">
#>     <div class="shiny-plot-output html-fill-item" id="myplot-ptr_plot" style="width:100%;height:400px;"></div>
#>   </div>
#> </div>