# Plot the flare import graph as a hive plot
library(igraph)
flareGr <- graph_from_data_frame(flare$imports)
# Add some metadata to divide nodes by
V(flareGr)$type <- 'Both'
V(flareGr)$type[degree(flareGr, mode = 'in') == 0] <- 'Source'
V(flareGr)$type[degree(flareGr, mode = 'out') == 0] <- 'Sink'
analyticsNodes <- grep('flare.analytics', V(flareGr)$name)
E(flareGr)$type <- 'Other'
E(flareGr)[inc(analyticsNodes)]$type <- 'Analytics'
ggraph(flareGr, 'hive', axis = 'type') +
geom_edge_hive(aes(colour = type), edge_alpha = 0.1) +
geom_axis_hive(aes(colour = type)) +
coord_fixed()
Run the code above in your browser using DataLab