NDTV.jl
Turn observed network activity into animations, timelines, and filmstrips. NDTV.jl takes DynamicNetworks.jl data, computes layouts over time, and exports visual artifacts for inspecting and communicating changing relationships.
| First analysis | Learn the model or data | Reference and detail |
|---|---|---|
| Export a first animation | Choose a layout | Compare export formats |
Layouts encode graph structure, not physical positions or an inferred movement process. Interpolation is a visual transition between frames. HTML and SVG exports are self-contained outputs; video and GIF export require the external tools documented in the export guide.
Installation
Use Julia 1.12 or newer and the shared workspace installation guide. These development packages are not yet registered; the guide prepares the required sibling checkouts and a Julia environment for the examples.
Quick Start
Create a small contact sequence and export an HTML animation with a deterministic circular layout:
using DynamicNetworks, NDTV
dnet = DynamicNetwork(4; observation_start=0.0, observation_end=10.0)
activate_vertices!(dnet, collect(1:4), 0.0, 10.0)
activate!(dnet, 0.0, 5.0; edge=(1, 2))
activate!(dnet, 3.0, 9.0; edge=(2, 3))
layout = render_animation(dnet; algorithm=CircleLayout(), n_frames=6)
export_html(layout, "network.html")Open network.html in a browser to inspect the selected frames. Each frame shows everything active during its slice of the window, so short spells are not lost between frames. For quantitative reachability or duration analysis, continue with TSNA.jl.
Visualization Types
| Type | Function | Description |
|---|---|---|
| Animation | render_animation | Smooth layout transitions across time |
| Timeline | timeline_plot | ASCII activity timeline |
| Proximity | ego_timeline | Ego-centric activity view |
| Transmission | transmission_timeline | Diffusion event visualization |
| Filmstrip | filmstrip | Multiple snapshots at specified times |
| Single snapshot | compute_slice_layout | Layout at a single time point |
Documentation
- Getting Started
- Animation Layout
- Layout Algorithms
- Export
- Types API Reference
- Layout API Reference
- Export API Reference
Theoretical Background
Force-Directed Layout
The Fruchterman-Reingold algorithm treats the network as a physical system:
- Repulsive forces push all vertex pairs apart: $f_r(d) = k^2 / d$
- Attractive forces pull connected vertices together: $f_a(d) = d^2 / k$
- Simulated annealing gradually reduces the temperature to settle into a stable layout
Where $k = \sqrt{\text{area} / n}$ is the optimal spacing and $d$ is the distance between vertices.
Dynamic Layout Stability
With FRLayout() and anchoring enabled, a frame starts from the previous frame's coordinates before applying the force-directed updates. This can reduce visual jumps, but does not constrain actors to fixed positions. CircleLayout() and MDSLayout() recompute their deterministic layouts; anchoring does not change those algorithms. New or changing contacts can still lead to substantial movement in the drawing.
Interpolation
Between computed layout frames, positions are interpolated:
- Linear: $p(t) = p_1 + \alpha \cdot (p_2 - p_1)$
- Ease: Smooth acceleration and deceleration using cubic easing
References
Bender-deMoll, S., Morris, M., Moody, J. (2008). Prototype packages for managing and animating longitudinal network data: dynamicnetwork and rSoNIA. Journal of Statistical Software, 24(7), 1-36.
Fruchterman, T.M.J., Reingold, E.M. (1991). Graph drawing by force-directed placement. Software: Practice and Experience, 21(11), 1129-1164.
Torgerson, W.S. (1952). Multidimensional scaling: I. Theory and method. Psychometrika, 17(4), 401-419. — the classical (strain) MDS that
MDSLayoutimplements.Note: Kamada, T., Kawai, S. (1989), "An algorithm for drawing general undirected graphs" (Information Processing Letters, 31(1), 7-15), is cited here only for contrast. Its iterative spring-energy minimization is not implemented in NDTV.jl; the layout formerly named
KKLayoutis classical MDS.Moody, J., McFarland, D., Bender-deMoll, S. (2005). Dynamic network visualization. American Journal of Sociology, 110(4), 1206-1241.
Citation
If you use NDTV.jl in your work, please cite it using the entry in CITATION.bib:
@misc{SNWJNDTVJL,
author = {Santoni, Simone},
title = {NDTV.jl: Network Dynamic Temporal Visualization for Julia},
year = {2026},
url = {https://github.com/statistical-network-analysis-with-Julia/NDTV.jl},
note = {Homepage: https://statistical-network-analysis-with-Julia.github.io/NDTV.jl; GitHub: https://github.com/statistical-network-analysis-with-Julia}
}Module
NDTV — Module
NDTV.jl - Network Dynamic Temporal VisualizationProvides tools for visualizing dynamic networks including animations, timeline plots, filmstrip displays, and layout algorithms.
Vertex identity is stable across time: position dictionaries are keyed by the network's persistent vertex IDs even when vertices activate and deactivate. Structural layouts (FRLayout, MDSLayout) are computed on the vertices active in each slice only; an inactive vertex keeps the position it last had (or will first have), so it never distorts the active picture.
Port of the R ndtv package from the StatNet collection.