Skip to contents

Draws the target trajectory as a central spine and each feeder as a parallel timeline that grows along its length (see feeder_curve) and merges into the spine at its handoff year. The spine is a cumulative river: it widens smoothly as each drawn feeder joins, so by the final year its width reflects the total papers absorbed. Spine and feeder widths share one strictly proportional scale (width 0 at zero papers), so their thickness is directly comparable. It generalises plot_trajectory_dispersion() (one source into one absorber) to many feeders converging on one trajectory, answering visually "which trajectories formed this one?".

Usage

plot_trajectory_formation(
  formation,
  feeder_curve = c("inflow", "size"),
  max_feeders = 8,
  title = NULL,
  label_size = 4.5,
  year_range = NULL,
  axis_text_size = NULL,
  palette = NULL
)

Arguments

formation

Output of sniff_trajectory_formation().

feeder_curve

What the feeder's growing width traces: "inflow" (default) is the cumulative arrival of just the papers that entered the target, a monotone curve ending at n on the river's scale; "size" is the feeder's measured cluster size per year, ending at cohort_size (its whole community, which can dwarf and shrink the river since the 2D scale is linear). Each feeder rises from zero at its start year to this end value, on the same proportional scale as the spine, so it grows like the target does.

max_feeders

Maximum number of feeders to draw, taken by descending papers (default: 8). Feeders beyond this are summarised in the caption.

title

Plot title. Defaults to the target trajectory key.

label_size

Text size for the feeder and target labels (default: 4.5).

year_range

Optional c(from, to) years fixing the time axis, so a short formation can be shown on the same window as a long one (as in plot_trajectory_lines_2d()). NULL (default) fits the drawn data; a wider range only extends the axis (it never drops data).

axis_text_size

Font size of the x-axis (year) tick labels; NULL (default) keeps the built-in size.

palette

Optional named colour vector overriding the default hues (keyed by feeder source_key), to match colours across plots. NULL (default) uses the package's Set2 (<= 8 feeders) / hue scheme.

Value

A ggplot object.

Examples

if (FALSE) { # \dontrun{
flow <- sniff_trajectory_braid(groups_lineage)
f <- sniff_trajectory_formation(flow, target = "tr::c1g3")
plot_trajectory_formation(f)
} # }