diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..807ea25 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.Rproj.user +.Rhistory +.RData diff --git a/cytoscapeJsR_example.html b/cytoscapeJsR_example.html index 7525192..87c5745 100644 --- a/cytoscapeJsR_example.html +++ b/cytoscapeJsR_example.html @@ -3,10 +3,15 @@ + - + + + + + - Cytoscape.js initialisation
diff --git a/cytoscapeJsSimpleNetwork.R b/cytoscapeJsSimpleNetwork.R index d19450d..6e47e1b 100644 --- a/cytoscapeJsSimpleNetwork.R +++ b/cytoscapeJsSimpleNetwork.R @@ -138,12 +138,12 @@ createCytoscapeNetwork <- function(nodeData, edgeData, #' #' network <- createCytoscapeNetwork(nodeData, edgeData) #' -#' output <- cytoscapeJsSimpleNetwork(network$nodes, network$edges) +#' output <- cytoscapeJsSimpleNetwork(network$nodes, network$edges, standAlone=TRUE) #' fileConn <- file("cytoscapeJsR_example.html") #' writeLines(output, fileConn) #' close(fileConn) cytoscapeJsSimpleNetwork <- function(nodeEntries, edgeEntries, - standAlone=FALSE, layout="cose", + standAlone=FALSE, layout="cola", height=600, width=600, injectCode="") { # Create webpage PageHeader <- " @@ -155,6 +155,9 @@ cytoscapeJsSimpleNetwork <- function(nodeEntries, edgeEntries, + + + Cytoscape.js in R Example" @@ -185,72 +188,72 @@ cytoscapeJsSimpleNetwork <- function(nodeEntries, edgeEntries, # Main script for creating the graph MainScript <- paste0(" ") PageBody <- "
" diff --git a/ui.R b/ui.R index bb0af4a..101c6ab 100644 --- a/ui.R +++ b/ui.R @@ -2,7 +2,10 @@ library(shiny) shinyUI(fluidPage( tags$head( - tags$script(src = 'http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/cytoscape.min.js') + tags$script(src = 'http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/cytoscape.min.js'), + tags$script(src = 'http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/cola.v3.min.js'), + tags$script(src = 'http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/springy.js'), + tags$script(src = 'http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/dagre.js') ), # Application title @@ -12,7 +15,7 @@ shinyUI(fluidPage( sidebarPanel(width=3, sliderInput("maxInteractions", "Maximum Interactions:", min=1, max=75, value=10), selectInput("layout", "Layout:", - choices=c("grid", "random", "circle", "breadthfirst", "cose"), + choices=c("grid", "random", "circle", "breadthfirst", "cose", "springy", "cola", "dagre"), selected="grid", multiple=FALSE), checkboxInput("addLinks", "Add Links on Nodes?", TRUE)