Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhk0530/shinyCyJS
cytoscape.js R binding library for shiny
https://github.com/jhk0530/shinyCyJS
cytoscape cytoscapejs r shiny
Last synced: 2 months ago
JSON representation
cytoscape.js R binding library for shiny
- Host: GitHub
- URL: https://github.com/jhk0530/shinyCyJS
- Owner: jhk0530
- License: other
- Created: 2019-03-04T10:44:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T10:00:15.000Z (over 1 year ago)
- Last Synced: 2024-05-14T11:32:14.316Z (9 months ago)
- Topics: cytoscape, cytoscapejs, r, shiny
- Language: JavaScript
- Homepage: https://jhk0530.github.io/shinyCyJS/
- Size: 1.17 MB
- Stars: 8
- Watchers: 4
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - shinyCyJS - Cytoscape.js R binding for Shiny. (Visualization / Network and Graph Data)
README
# shinyCyJS
[![CRAN status badge](https://www.r-pkg.org/badges/version/shinyCyJS)](https://cran.r-project.org/web/packages/shinyCyJS/index.html)
[![shinyCyJS status badge](https://jhk0530.r-universe.dev/badges/shinyCyJS)](https://jhk0530.r-universe.dev/shinyCyJS)
[![Codecov test coverage](https://codecov.io/gh/jhk0530/shinyCyJS/graph/badge.svg)](https://app.codecov.io/gh/jhk0530/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 :
From CRAN (1.0.0)
``` r
install.packages('shinyCyJS')
```From r-universe (1.2.0)
```r
install.packages(
"shinyCyJS",
repos = c("https://jhk0530.r-universe.dev", "https://cloud.r-project.org")
)
```## 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)
```## Versions of Javascripts
see `inst/htmlwidgets/shinyCyJS.yaml`## Used in
## Suggest or comment
Make issue on [here](https://github.com/jhk0530/shinyCyJS/issues)