So I have tried everything I could think of, and after a few days of searching, I resort to asking here.
I wrote a maze solver in c++, it takes a png image, reads it as binary data, and then solves it. the final output of this solving stage is a matrix with all values set to 0 (walls and unexplored vertices of the maze), except the relevant path. R reads this matrix through Rcpp.
My algorithm itself is quite fast, solving a 10K X 10K maze I found online (weighs 127 megabytes of 16 bit integers) in 0.7 seconds, it also solved a 30k x 30k maze which is the largest I managed to load into memory without Rstudio crashing. (By saying solved, I mean that the output is an ordered sequence of all (x,y) coordinates on the path from the start to the exit).
Now the thing is that I want to look at this plot, preferably through something like a 2d heatmap plot, something which i have done on smaller mazes, but with this size of maze - every library I tried to plot with, just crashed my client. So the question is, is there any way for me to plot a 10K x 10K 2d heatmap in R? (don't mind having it cropped when I zoom out.)
Example code:
library(plotly)
mat = matrix(sample(0:1,100000000,replace = T),10000,10000)
plot_ly(z =~ mat, type = "heatmap")