
Animate the stock map: the citation network forming year by year
Source:R/plot_groups_map_animation.R
plot_groups_map_animation.RdOne layout of the final network, with every paper revealed at the year it
first enters the cumulative network and held at its final position, so the
cloud grows without nodes moving. Returns a gganim object; render it to a
GIF/MP4 with gganimate::animate() and gganimate::anim_save(). Reveal and
colour reuse the static plot_groups_map() engine.
Usage
plot_groups_map_animation(
groups_cumulative,
labels_text = NULL,
layout = "drl",
seed = 888L,
show_unassigned = TRUE,
label = TRUE,
label_size = 3.2,
title_size = 14,
point_size = 0.9
)Arguments
- groups_cumulative
A stock object from
sniff_groups_cumulative().- labels_text
Optional
data.framewith columnsidandtext;NULL(default) uses the bare group id. If noidmatches any group, a warning is issued and the group ids are used.- layout
Force-directed layout passed to
ggraph::create_layout()(default"drl").- seed
Integer seed for the stochastic layout (default
888L).- show_unassigned
Reveal nodes with no group (
NA) as grey (defaultTRUE).- label
Draw persistent group labels at the final centroids (default
TRUE).- label_size
Font size of the centroid labels (default
3.2).- title_size
Font size of the per-frame
"Year: ..."title (default14).- point_size
Node point size (default
0.9).
Value
A gganim object (render with gganimate::animate()).
Details
Rendering: the transition is one frame per year. Render with duration (not
fps), which works with either renderer: gganimate::animate(anim, duration = 8)
gives nframes/duration fps (with the magick renderer that ratio must divide
100, e.g. 32 years / 8 = 4). Save the rendered object, not the gganim:
a <- gganimate::animate(anim, duration = 8); gganimate::anim_save("x.gif", a).
Installing gifski removes the fps constraint.
See also
plot_groups_map(), plot_groups_map_interactive()
Other visualization:
plot_groups_influence_matrix(),
plot_groups_influence_network(),
plot_groups_lineage_2d(),
plot_groups_lineage_3d(),
plot_groups_map(),
plot_groups_map_interactive(),
plot_groups_per_year(),
plot_trajectory_confluence(),
plot_trajectory_confluence_interactive(),
plot_trajectory_confluence_matrix(),
plot_trajectory_dag(),
plot_trajectory_dag_interactive(),
plot_trajectory_dispersion(),
plot_trajectory_dynamics(),
plot_trajectory_dynamics_interactive(),
plot_trajectory_formation(),
plot_trajectory_lines_2d(),
plot_trajectory_lines_3d()