Motivation
SISMID workshop materials cover network visualization with ndtv (networkDynamic Temporal Visualization), but the gallery has no example demonstrating it. Animated visualizations of disease spreading over a network are among the most powerful pedagogical tools for understanding network epidemics — they make abstract concepts like concurrency, bridging, and super-spreading visually intuitive. The ObservedNetworkData example already stores time-varying status attributes (the `testatus` TEA), making it a natural foundation.
Suggested Design
Disease Model: SIR on a Small Network
Use a small network (n = 50–100) so the visualization is legible, and SIR so the epidemic has a clear beginning, middle, and end (unlike endemic SIS which looks chaotic in animation).
| Compartment |
Color in Visualization |
| S |
Blue |
| I |
Red |
| R |
Green |
Custom Modules
| Module |
Purpose |
infection.FUN |
Standard S → I transmission; stores time-varying status on network via `activate.vertex.attribute()` for ndtv |
recovery.FUN |
I → R recovery; updates time-varying status |
The modules are deliberately minimal — the focus is on the visualization workflow, not complex disease dynamics.
Parameters
| Parameter |
Description |
Suggested Value |
inf.prob |
Per-act transmission probability |
0.3 (high, for visible spread) |
act.rate |
Acts per partnership per week |
1 |
rec.rate |
Weekly recovery rate |
0.05 |
i.num |
Initial infected |
1–2 (seed epidemic from identifiable nodes) |
ERGM Parameterization
The network must be small enough to visualize and structured enough to be interesting:
~edges: Mean degree ~2.0 (enough edges to see transmission paths)
~triangles or ~gwesp(0.5, fixed = TRUE): Clustering creates visible community structure in the layout — the disease spreads within clusters before jumping between them
~isolates or ~degree(0): Minimize isolates so most nodes participate in the epidemic
- Network size: n = 50–75 (large enough for interesting dynamics, small enough for legible plots)
- Dissolution ~offset(edges): Long duration (~100 weeks) so the network is relatively stable during the animation
The small, clustered network makes the visualization compelling — you can see the epidemic move through one cluster, jump to another via a bridging edge, and then sweep through the second cluster.
Visualization Outputs
- Static network snapshots: Network at timesteps 1, 10, 25, 50 with nodes colored by disease status — shows epidemic progression as a series of frames
- Animated HTML visualization: Using `ndtv::render.d3movie()` to produce an interactive animation that can be viewed in a browser
- Transmission tree overlay: Highlight the edges along which transmission actually occurred (using EpiModel's transmission data frame)
- Static filmstrip: Side-by-side snapshots at key timepoints using `ndtv::filmstrip()`
Analyses
This is primarily a visualization example, but include:
- Network plot at key epidemic phases (early spread, peak, post-peak)
- Identification of the index case(s) and early transmission chain
- Highlight super-spreader events (high-degree nodes that infect multiple partners)
- Show how clustering creates heterogeneous epidemic timing across communities
- Compare two runs: one where the epidemic dies out stochastically and one where it takes off — visualize why
Implementation Notes
The key technical requirement is storing time-varying disease status on the `networkDynamic` object using `activate.vertex.attribute()`, which the ObservedNetworkData example already demonstrates. This example would:
- Show the complete workflow from simulation to visualization
- Demonstrate `ndtv::compute.animation()` for computing network layouts
- Show `ndtv::render.d3movie()` for interactive HTML output
- Show `ndtv::filmstrip()` for static publication-quality figures
Dependencies: `ndtv` package (available on CRAN).
Relationship to Existing Examples
- Builds on ObservedNetworkData's `activate.vertex.attribute()` pattern for time-varying attributes
- Complements every other example — the visualization techniques shown here can be applied to any gallery model
- Smallest network in the gallery (50–75 nodes vs. 500+ in other examples)
- Most visual/pedagogical example — designed for presentations and teaching
Motivation
SISMID workshop materials cover network visualization with ndtv (networkDynamic Temporal Visualization), but the gallery has no example demonstrating it. Animated visualizations of disease spreading over a network are among the most powerful pedagogical tools for understanding network epidemics — they make abstract concepts like concurrency, bridging, and super-spreading visually intuitive. The ObservedNetworkData example already stores time-varying status attributes (the `testatus` TEA), making it a natural foundation.
Suggested Design
Disease Model: SIR on a Small Network
Use a small network (n = 50–100) so the visualization is legible, and SIR so the epidemic has a clear beginning, middle, and end (unlike endemic SIS which looks chaotic in animation).
Custom Modules
infection.FUNrecovery.FUNThe modules are deliberately minimal — the focus is on the visualization workflow, not complex disease dynamics.
Parameters
inf.probact.raterec.ratei.numERGM Parameterization
The network must be small enough to visualize and structured enough to be interesting:
~edges: Mean degree ~2.0 (enough edges to see transmission paths)~trianglesor~gwesp(0.5, fixed = TRUE): Clustering creates visible community structure in the layout — the disease spreads within clusters before jumping between them~isolatesor~degree(0): Minimize isolates so most nodes participate in the epidemicThe small, clustered network makes the visualization compelling — you can see the epidemic move through one cluster, jump to another via a bridging edge, and then sweep through the second cluster.
Visualization Outputs
Analyses
This is primarily a visualization example, but include:
Implementation Notes
The key technical requirement is storing time-varying disease status on the `networkDynamic` object using `activate.vertex.attribute()`, which the ObservedNetworkData example already demonstrates. This example would:
Dependencies: `ndtv` package (available on CRAN).
Relationship to Existing Examples