---
title: "cyjShiny Demo"
output: html_document
---

# Load Library

```{r include = FALSE}
library(cyjShiny)
```

# Show Toy Network
```{r}
# NETWORK DATA ----
tbl_nodes <- data.frame(id=c("A", "B", "C"), 
                        size=c(10, 20, 30),
                        stringsAsFactors=FALSE)

# Must have the interaction column 
tbl_edges <- data.frame(source=c("A", "B", "C"),
                        target=c("B", "C", "A"),
                        interaction=c("inhibit", "stimulate", "inhibit"),
                        stringsAsFactors=FALSE)

graph_json <- toJSON(dataFramesToJSON(tbl_edges, tbl_nodes), auto_unbox=TRUE)

print(graph_json)
print(class(graph_json))

cyjShiny(graph=graph_json, layoutName="cola")
```

