
Interactive stock map: the citation network as a plotly HTML widget
Source:R/plot_groups_map_interactive.R
plot_groups_map_interactive.RdThe interactive twin of plot_groups_map(). Every paper is a scattergl
point laid out by a force-directed layout of the citation network and coloured
by its final group; hovering a node shows its title, year, authors, keywords,
and final group. Returns a plotly htmlwidget – it renders in the RStudio
Viewer, embeds in Quarto/Shiny, or saves to a standalone file with
htmlwidgets::saveWidget().
Usage
plot_groups_map_interactive(
groups_cumulative,
labels_text = NULL,
network_until = NULL,
layout = "drl",
seed = 888L,
show_unassigned = TRUE,
label = TRUE,
label_size = 12,
title = "Group map",
title_size = 16,
normalize = FALSE,
normalize_q = 0.99,
marker_size = 5
)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.- network_until
Snapshot year.
NULL(default) uses the last element.- layout
Force-directed layout passed to
ggraph::create_layout()(default"drl").- seed
Integer seed for the stochastic layout (default
888L).- show_unassigned
Draw nodes with no group (
NA) as grey background (defaultTRUE).- label
Draw group labels at centroids as annotations (default
TRUE).- label_size
Font size (px) of the centroid label annotations (default
12).- title
Plot title: the default
"Group map", any string, orNULLfor no title.- title_size
Title font size in px (default
16).- normalize
Rescale to a fixed unit window for cross-year comparison (default
FALSE); seeplot_groups_map().- normalize_q
Quantile of the radial distance kept inside the normalised window (default
0.99).- marker_size
Node marker size (default
5).
See also
plot_groups_map(), sniff_groups_cumulative()
Other visualization:
plot_groups_influence_matrix(),
plot_groups_influence_network(),
plot_groups_lineage_2d(),
plot_groups_lineage_3d(),
plot_groups_map(),
plot_groups_map_animation(),
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()