-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
69 lines (49 loc) · 1.82 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
[![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
<!-- You can install the released version of shinyExplorer from [CRAN](https://CRAN.R-project.org) with: -->
Currently shinyExplorer is only available on Github. You can install the latest version with:
<!--
``` r
install.packages("shinyExplorer")
```
-->
```{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