ggnetwork is a very good project, but I tested the conversion that doesn't seem to support plotly, I don't know what caused it, and I'm looking forward to your reply。
library(ggnetwork)
a=rgraph(10, tprob = 0.2)
# colnames(a)=LETTERS[1:ncol(a)]
# rownames(a)=letters[1:nrow(a)]
n <- network(a, directed = FALSE)
n %v% "family" <- sample(letters[1:3], 10, replace = TRUE)
n %v% "importance" <- sample(1:3, 10, replace = TRUE)
e <- network.edgecount(n)
set.edge.attribute(n, "type", sample(letters[24:26], e, replace = TRUE))
set.edge.attribute(n, "day", sample(1:3, e, replace = TRUE))
n=ggnetwork(n, layout = "fruchtermanreingold", cell.jitter = 0.75)
# n=ggnetwork(n, layout = "target", niter = 100)
ggplot(n, aes(x = x, y = y, xend = xend, yend = yend)) +
geom_edges(aes(linetype = type), color = "grey50") +
theme_blank()
gg=ggplot(n, aes(x = x, y = y, xend = xend, yend = yend)) +
geom_edges(color = "black") +
geom_nodes(color = "black", size = 8) +
geom_nodetext(aes(color = family, label = LETTERS[ vertex.names ]),
fontface = "bold") +
theme_blank();gg
ggplotly(gg)
###################################################################
Error in match.fun(FUN) :
'ggfun("scales_transform_df")' is not a function, character or symbol
ggnetwork is a very good project, but I tested the conversion that doesn't seem to support plotly, I don't know what caused it, and I'm looking forward to your reply。
Here's my operating environment