plotly / plotly.R

An interactive graphing library for R
https://plotly-r.com
Other
2.57k stars 627 forks source link

support for ggraph #1052

Closed JannikVindeloev closed 7 years ago

JannikVindeloev commented 7 years ago

Could you provide plotly support for the ggraph package, an extension of the grammer of graphics for networks: https://github.com/thomasp85/ggraph

library(tidyverse)
library(igraph)
library(ggraph)
library(plotly)

nodes <- LETTERS[1:10] %>%
   tibble(name = ., x = seq(1:10), y = seq(1:10))

edges <- tribble(
  ~from, ~to,
  "A", "B",
  "C", "E",
  "C", "F",
  "F", "G",
  "J", "I"
)

g <- graph_from_data_frame(edges, vertices = nodes)

p <- g %>% ggraph(layout = "manual", node.positions = nodes)+
  geom_edge_link()+
  geom_node_label(aes(label = name))

ggplotly(p) # does not work! 
cpsievert commented 7 years ago

Duplicate of #566