| name | ndtv |
| description | R ndtv package for network animation. Use for visualizing and animating dynamic networks. |
ndtv
Network dynamic temporal visualization.
Compute Animation
library(ndtv)
compute.animation(dnet,
animation.mode = "kamadakawai",
slice.par = list(
start = 0,
end = 10,
interval = 1,
aggregate.dur = 1
))
Render Animation
render.d3movie(dnet, filename = "network.html")
render.animation(dnet, filename = "network.gif")
render.animation(dnet, filename = "network.mp4",
ani.options = list(interval = 0.1))
Customization
render.d3movie(dnet,
vertex.col = "blue",
vertex.cex = 1.5,
vertex.sides = 50,
edge.col = "gray",
edge.lwd = 1,
displaylabels = TRUE,
label.cex = 0.8,
label.col = "black",
filename = "network.html",
output.mode = "htmlWidget"
)
Dynamic Attributes
render.d3movie(dnet,
vertex.col = function(slice) {
get.vertex.attribute(slice, "group")
})
render.d3movie(dnet,
vertex.cex = function(slice) {
degree(slice) / 5
})
Timeline
timeline(dnet,
slice.par = list(start = 0, end = 10, interval = 1))
filmstrip(dnet, displaylabels = TRUE)
Layout Modes
compute.animation(dnet, animation.mode = "kamadakawai")
compute.animation(dnet, animation.mode = "MDSJ")
compute.animation(dnet, animation.mode = "Graphviz")
compute.animation(dnet, animation.mode = "useAttribute")
Proximity Timeline
proximity.timeline(dnet,
default.dist = 10,
mode = "sammon")
Export Frames
for (t in 0:10) {
net_t <- network.extract(dnet, at = t)
png(paste0("frame_", t, ".png"))
plot(net_t)
dev.off()
}