I have an application where user chooses some of ~10000 entries (genes), and displays xy marker+line scatterplot (time/expression), grouped by experiments & replicates.
This boils down to having identical number of traces (~50), identical x-coordinates, with only y-coordinates varying (and hovertext, which states trace-info and precise x, y coordinate).
Consequently, some 400 points per plot.
I save plots to >generatedScatterPlots[[geneID]] = renderPlotly(…)< and complete the plotting through renderUI. Which at least achieves that previously generated plots are plotted in an instant.
What I’d like to solve:
- Plotting 10 genes takes 11-13 seconds. I’d like to achieve 3-4 sec.
- I am unable to plot a larger number of genes (~50), as I get segfault/cstack overflow in the R server.
Granted, I’m just testing this on my laptop, so server times would be better. But conceptually one should be able to improve upon this…
Creating a single plot takes ~2.5sec.
Cloning the plotly svg’s 10 times takes ~1sec.
Using Plotly.restyle to change 10 plots to different y-values takes <3 sec.
Asking again for already generated 10 plots takes ~4sec.
I tried both approaches, none of them seems feasible. I know I cannot reuse an output binding. It would seem I cannot reuse renderFunction. [as in: template<-renderPlotly(…); output[[geneID1]]=template(); output[geneID2]]=template() ]
Solving 1) seems to also solve 2), as there doesn’t seem to be an issue handling the duplicated DOM elements…
Any ideas? Am I missing out on something that could be used for this?