Open ghost opened 7 years ago
Hmm, that's a tough one. My guess would be that it's a problem in DiagrammeR. I had previously experienced problems with special characters in node names, for instance. If you prepare a reproducible example, I might be able to help, no promises though :-(
The first time I ran this "reproducible" example, the visualization succeeded. Subsequent runs, however, failed. Stopping and restarting R and RStudio did not repair the state. So I post here a small example and model file to learn if others experience the same sort of non-determinism.
library(ahp)
ahpName <- "model.txt" # text suffix for issue posting
if (! file.exists(ahpName)) {
stop(paste("Cannot find AHP file",ahpName))
}
myAhp <- Load(ahpName)
# calculate
Calculate(myAhp)
# visualize -- fails
Visualize(myAhp)
# analyze -- succeeds
Analyze(myAhp)
AnalyzeTable(myAhp)
Running
Visualize(myAhp)
leads to a JavaScript abort as shown in the stack trace below. When running inside RStudio the stack trace appears in the Viewer panel. When running from an R shell the stack trace appears in the browser. Running other AHP commands such asCalculate(myAhp)
,Anaylze(myAhp)
,AnalyzeTable(myAhp)
and tree prints succeed as expected.However, on the same model, running
g <- GetGraph(myAhp)
yields a class from which the DOT notation representation can be copied and pasted to GraphViz for successful drawing. Consequently, the issue may not be associated with AHP itself but rather with the dependent JS libraries.Stack trace:
R session info: