need to allow users to upload a file to define a network being rendered in an app.
I would like to vary the parameters to re-render an interactive shiny graph that is deployed via a special shiny github package- "rcytoscapejs": https://github.com/cytoscape/r-cytoscape.js/tree/master
While the graph deploys fine, my problem is that it can only be deployed from the UI, independently of the server...
g<-createCytoscapeJsNetwork(nodeData = nodes, edgeData = edge)
#ui.R
dashboardBody(
sliderInput(inputId="num", label="Choose coef", value=2, min=1, max=3),
rcytoscapejs(g$nodes, g$edges)
)
As you can see this is completely impartial from the server, when I try to implement the code within the server via something like this:
#ui.R
graphOutput("graph")
#server.R
output$graph<-renderGraph({rcytoscapejs(g$nodes, g$edges)})
I have tried "graphOutput" and "renderGraph" but the functions doesn't seem to exist...
I tried downloading the "renderGraph" from github.
devtools::install_github("mfontcada/renderGraph");
Downloading GitHub repo mfontcada/renderGraph@master
from URL https://api.github.com/repos/mfontcada/renderGraph/zipball/master
Error: Does not appear to be an R package (no DESCRIPTION)
But that package is in version 0.1 and hasn't been updated since 2014...
So ultimately my question is how can I vary the parameters of something that resides in the "ui.R" code???
Something like the following, (file upload code taken from: http://shiny.rstudio.com/gallery/file-upload.html):
server <- function(input, output) {
dataInput <- eventReactive(input$choices, {
inFile <- input$file1
if (is.null(inFile))
return(NULL)
read.csv(inFile$datapath, header = input$header, sep = input$sep, quote = input$quote)
createCytoscapeJsNetwork(nodeData = nodes, edgeData = edge)
})
}
#ui.R
actionButton("choices", "Run analyses"),
fileInput('file1', 'Choose file to upload',
accept = c(
'text/csv',
'text/comma-separated-values',
'text/tab-separated-values',
'text/plain',
'.csv',
'.tsv'
),
rcytoscapejs(dataInput()$nodes, dataInput()$edges),
This of course returns an error as one can not vary parameters within the ui.R script as such ....
Any tips on how to circumvent this?
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/3d375184-ace7-4574-9da3-e491531aa32d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.