Skip to content

Commit

Permalink
docs: add shinylive to the getting started vignette (#1491)
Browse files Browse the repository at this point in the history
Part of #1404
  • Loading branch information
vedhav authored Feb 12, 2025
1 parent 73664cf commit a5d679e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion vignettes/getting-started-with-teal.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ More advanced users of the framework can also create new analysis modules which

This simple `teal` application takes the `iris` and `mtcars` datasets and displays their contents:

```{r message=FALSE, warning=FALSE}
```{r setup, include=FALSE}
library(teal)
```

```{r app}
library(teal)
app <- init(
Expand Down Expand Up @@ -81,6 +85,17 @@ Every `teal` application is composed of the following elements, all of which can
* <span style="color: #3A88FE;">Filter Panel</span> _(panel on the right hand side)_: for filtering the data to be passed into all `teal` modules.
* In the example code: the filter panel is being initialized with a filter for the `Species` variable in the `iris` dataset.

## Try the above app in `shinylive`

```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = requireNamespace("roxy.shinylive", quietly = TRUE) && knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")}
code <- paste0(c(
"interactive <- function() TRUE",
knitr::knit_code$get("app")
), collapse = "\n")
url <- roxy.shinylive::create_shinylive_url(code)
knitr::include_url(url, height = "800px")
```

## Creating your own applications

The key function to use to create your `teal` application is `init`, which requires two mandatory arguments: `data` and `modules`. There are other optional arguments for `init`, which can be used to customize the application. Please refer to the documentation for `init` for further details.
Expand Down

0 comments on commit a5d679e

Please sign in to comment.