Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jhk0530/shinyCyJS

cytoscape.js R binding library for shiny
https://github.com/jhk0530/shinyCyJS

cytoscape cytoscapejs r shiny

Last synced: 3 months ago
JSON representation

cytoscape.js R binding library for shiny

Awesome Lists containing this project

README

        

# shinyCyJS

shinyCyJS is R/Shiny Package to use cytoscape.js in R environment.

cytoscape.js is a great javascript library for visualize/analysis Graph theory ( network )
if you interested, please refer to this [Link](https://js.cytoscape.org/).

shinyCyJS is built with cytoscape.js version 3.12.0. (2019/11)

# How to install :

``` r

# CRAN Ver, 0.0.11
install.packages('shinyCyJS')

# Development Ver, 0.0.12
library(devtools)
devtools::install_github('jhk0530/shinyCyJS')
library(shinyCyJS)

```

# Example :

bulid Graph with node 4 = A, B, C, D and edge = A-B, B-C, C-D, B-D

Code

``` r
library(shiny)
library(shinyCyJS)

ui = function(){
fluidPage(
ShinyCyJSOutput(outputId = 'cy')
)
}

server = function(input, output, session){

nodes = data.frame(
id = c('A','B','C','D'),
width = c(10,20,30,40),
height = c(10,20,30,40)
)

edges = data.frame(
source = c('A','B','C','D'),
target = c('B','C','D','B')
)

nodes = buildElems(nodes, type = 'Node')
edges = buildElems(edges, type = 'Edge')

obj = shinyCyJS(c(nodes, edges))
output$cy = renderShinyCyJS(obj)
}

shinyApp(ui,server, options = list(launch.browser = TRUE, display.mode ='normal'))
```

# Versions of Javascripts

see `inst/htmlwidgets/shinyCyJS.yaml`

# Used in

netGO
GScluster

# Suggest or comment

Make issue on [here](https://github.com/jhk0530/shinyCyJS/issues)