cyjShiny
cyjShiny copied to clipboard
htmlwidgets work in shinyApp, not yet in RStudio
Reference to this issue: https://github.com/ramnathv/htmlwidgets/issues/321
One part in the debugging is clicking the open icon marked with the red box:

after running this:
library(cyjShiny)
tbl.nodes <- data.frame(id=c("A", "B", "C"),
type=c("kinase", "TF", "glycoprotein"),
lfc=c(-3, 1, 1),
count=c(0, 0, 0),
stringsAsFactors=FALSE)
tbl.edges <- data.frame(source=c("A", "B", "C"),
target=c("B", "C", "A"),
interaction=c("phosphorylates", "synthetic lethal", "unknown"),
stringsAsFactors=FALSE)
graph.json <- dataFramesToJSON(tbl.edges, tbl.nodes)
cyjShiny(graph=graph.json, layoutName="cola", style_file=system.file("examples/tinyApp/basicStyle.js", package="cyjShiny"))
In the browser window, you'll have access to the browser Javascript developer tools. The first problem you'll encounter is:
bundle.js:94044 Uncaught ReferenceError: $ is not defined
at Object.<anonymous> (bundle.js:94044)
at __webpack_require__ (bundle.js:20)
at bundle.js:66
at bundle.js:69
This should be simple to fix by not using $ and instead import as jQuery:
jQuery = require('jquery'); // Instead of $ = require('jquery');
Then things will get complicated. I think I tracked the problem to cytoscape, but with no idea how to fix:

ctr might be a jQuery object here, I'm not sure what it should be normally. The error is related to ctr.className being undefined and indexOf() not existing.
@cannin Is this still a problem? Dharna and I do not run into at present.