Skip to contents
0.16.6 documentation

Complete canonical API text; task articles explain the workflows. Tutorials

Site guide · find your task

Builds a ggchord plot and returns selected computed geometry in a stable, layer-aware structure. Every exported row records its source layer and, where applicable, its source input row. Original mapped columns already attached to the geometry are preserved. This is the recommended interface for consuming layout tables; get_chord_layout() remains available for the complete layout list. Both retain their documented fields. See ggchord_layout_contract for units, provenance and stability boundaries.

Usage

Code
export_ggchord_layout(
  plot,
  include = c("seq", "ribbon", "gene", "feature", "labels", "axis", "track"),
  original_data = FALSE
)

Arguments

plot

A ggchord plot.

include

Character vector selecting any of "seq", "ribbon", "gene", "feature", "labels", "link", "restriction", "track", and "axis". Point links and restriction sites require explicit selection.

original_data

Logical. Include the resolved per-layer input tables under original_data, default FALSE.

Value

An object of class ggchord_layout_export. Selected component names contain data frames. Circular layouts additionally contain an annotation_registry data frame. Its inner rows expose the physical track, radial width and boundaries; outer rows expose region, sector, annotation class, dominant and actual band, spill reason, leader-crossing count, slot, bounding box and leader corridor. Explicitly inside primer and restriction callouts register measured inner boxes rather than exterior bands or slots. The metadata member records rotation, aspect ratio, limits, coordinate units and transformation state. Collinear layouts instead include sequence_layout, containing each sequence's horizontal range, backbone y, orientation, units per bp, reversible x offset, anchor and source origin. orientation_diagnostics records directional support, confidence and unresolved cases. Position lanes remain local offsets and are not circular physical tracks. Their label_diagnostics records placed or hidden labels after shared linear collision handling, including source layer, row, reason and leader collisions. connection_report records retained and omitted ribbon input rows with a selection reason. When converted inputs are present, conversion_reports retains their conversion attributes, including source class, column renaming, sequence information and object metadata. Sequence break marks are included under seq. Segmented linear displays retain one sequence_layout row per window, including row_id, segment order, break flags and display gap_bp. Source accession, origin/end/full length, local orientation, x offset and units per bp describe each reversible piece; gaps have no source mapping. Automatic segment break paths have .decoration = "segment_break" in the sequence geometry. gap_bp is display spacing, not omitted length. Quantitative geometry is selected with track; track_registry records each ID/sequence band, source layers, numerical limits, unit and physical measurement status. track_diagnostics records retained/missing/clipped source rows. Numerical track axes and explicit bp reference bars are included under axis; axis_selection records selected sequence axes. Explicit label shrinking adds label_fit_diagnostics, preserving original text, requested/minimum/final sizes and fallback or hiding reasons. render_context distinguishes layout-only estimates from actual panel measurements. For a target-size measured report use diagnose_ggchord().

Examples

Code
library(dplyr)
library(ggchord)
data(seq_data_example)
data(ribbon_data_example)
p <- ggchord(seq_data_example, ribbon_data_example) +
  geom_seq() +
  geom_link_ribbon()
exported <- export_ggchord_layout(p, include = c("seq", "ribbon"))
names(exported)