Graph outputs - not appearing
Posted: Wed Mar 13, 2024 5:36 pm
Hello
I have a module under development that runs a set of simulations and produces a graph as output. So long as the number of simulations allows the process to finish in maybe 15sec, then all is well. If the number of simulations is too big, then the graph never appears, and Jamovi just gets stuck with the circling icon indicating it is waiting for output.
The structure of the graph itself is unaffected by the number of simulations: the points may be in slightly different places but the number of points, lines, polygons is not affected.
I've tried various things and can't be sure what's happening. For example, I placed a deliberate error after the simulations have finished but before the graph is sent to Jamovi:
This triggers an error (there is no variable y1) and so I know the simulations have ended. If I place the same line here:
then the error is not triggered, suggesting that the code is stuck at that point.
The code that generates the graph works fine as stand alone. Actually if I replace the
setState line with this (but leave the simulations happening) then I still get the problem:
this suggests that the graph is not the problem.
So I'm wondering about two possibilities.
1. the amount of data generated is increased by increasing the number of simulations - so is there a storage issue of some sort? The bytes required are not great, however.
2. is there a time-out for the .plotGraph function.
Any thoughts/suggestions would be very welcome.
Roger
I have a module under development that runs a set of simulations and produces a graph as output. So long as the number of simulations allows the process to finish in maybe 15sec, then all is well. If the number of simulations is too big, then the graph never appears, and Jamovi just gets stuck with the circling icon indicating it is waiting for output.
The structure of the graph itself is unaffected by the number of simulations: the points may be in slightly different places but the number of points, lines, polygons is not affected.
I've tried various things and can't be sure what's happening. For example, I placed a deliberate error after the simulations have finished but before the graph is sent to Jamovi:
Code: Select all
y2<-y1
self$results$graphPlot$setState(outputGraph)
Code: Select all
.plotGraph=function(image, ...) {
outputGraph <- image$state
if (!is.null(outputGraph)) {
y2<-y1
print(outputGraph)
TRUE
} else {
FALSE
}
},
The code that generates the graph works fine as stand alone. Actually if I replace the
setState line with this (but leave the simulations happening) then I still get the problem:
Code: Select all
self$results$graphPlot$setState(ggplot())
So I'm wondering about two possibilities.
1. the amount of data generated is increased by increasing the number of simulations - so is there a storage issue of some sort? The bytes required are not great, however.
2. is there a time-out for the .plotGraph function.
Any thoughts/suggestions would be very welcome.
Roger