---
title: "Plot and tables in OmopViewer"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{supported_result_type}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

The **OmopViewer** package will display by default the 'tidy' tab that will allow the user to explore the data. With the tidy tab there will be displayed different output tabs. By default a table created with `OmopViewer::omopViewerTable()` will be displayed, but some packages have some extra output tabs configured. In the following table you can see the `result_type` that are configured and which are the visualisations.

```{r, echo = FALSE}
OmopViewer:::omopViewerOutput |>
  dplyr::inner_join(
    OmopViewer:::omopViewerTabs, by = "result_tab_id"
  ) |>
  tidyr::separate_wider_delim(
    cols = "output_function", 
    delim = "::", 
    names = c("package", "output_function")
  ) |>
  dplyr::select(
    "package", "Result type" = "result_type", "Function" = "output_function", 
    "Output type" = "output_type") |>
  visOmopResults::formatTable(
    groupColumn = "package", merge = "Result type")
```

## Note for developers

If you wish to configure a new `result_type` this can be done editing the internal data: *omopViewerTabs*, *omopViewerOutput* and *omopViewerOutputArguments* in file [internalData.R](https://github.com/OHDSI/omopViewer/blob/main/data-raw/internalData.R). Please feel free to submit your PR.

<!-- :::{callout} -->
<!-- ::: -->
