Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/DavidBarke/shinyExplorer

R Package providing Explorer and Contextmenu for Shiny apps
https://github.com/DavidBarke/shinyExplorer

Last synced: 9 days ago
JSON representation

R Package providing Explorer and Contextmenu for Shiny apps

Awesome Lists containing this project

README

        

---
output: github_document
---

[![Travis build status](https://travis-ci.org/DavidBarke/shinyExplorer.svg?branch=master)](https://travis-ci.org/DavidBarke/shinyExplorer)
[![Coverage status](https://codecov.io/gh/DavidBarke/shinyExplorer/branch/master/graph/badge.svg)](https://codecov.io/github/DavidBarke/shinyExplorer?branch=master)
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# shinyExplorer

shinyExplorer uses `DT::datatable` for visualizing a tree of nodes, in which each node behaves according to its class and can store arbitrary data.

## Installation

Currently shinyExplorer is only available on Github. You can install the latest version with:

```{r, eval=FALSE}
remotes::install_github("DavidBarke/shinyExplorer")
```

## Explorer

Create an explorer tree:

```{r, eval=FALSE}
library(shinyExplorer)

explorer_tree <- ExplorerTree$new(id = "tree", root_id = "root")
```

Take the root node and add nodes to it:

```{r, eval=FALSE}
explorer_tree$get_root_node()$add_child("child1")$add_child("child2", return = "child")$add_child("grandchild")
```

Call the `explorer` module in your server function and add `explorer_ui` to your UI:

```{r, eval=FALSE}
# Inside the server function
shiny::callModule(
module = explorer, id = "id_explorer",
.root_node_r = shiny::reactive(explorer_tree$get_root_node())
)

# Explorer UI
explorer_ui(id = ns("id_explorer"))
```

## Contextmenu