Optimizing add_trace() in a for loop?
问题 I'm using the add_trace() function in a for loop to create lines for a 3d network graph in plotly's scatter3d mode. Each add_trace draws an individual line between two nodes in the network. The method is working, but with large number of loops, the speed of the individual loops seems to be slowing down very quickly. Example data can be downloaded here: https://gist.github.com/pravj/9168fe52823c1702a07b library(igraph) library(plotly) G <- read.graph("karate.gml", format = c("gml")) L <-