Skip to contents

The 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.frame with columns id and text; NULL (default) uses the bare group id. If no id matches 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 (default TRUE).

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, or NULL for no title.

title_size

Title font size in px (default 16).

normalize

Rescale to a fixed unit window for cross-year comparison (default FALSE); see plot_groups_map().

normalize_q

Quantile of the radial distance kept inside the normalised window (default 0.99).

marker_size

Node marker size (default 5).

Value

A plotly htmlwidget.