Interactive pedigree plot (Plotly wrapper around ggPedigree)
Source:R/ggPedigreeInteractive.R
ggPedigreeInteractive.Rd
Generates an interactive HTML widget built on top of the static ggPedigree output. All layout, styling, and connection logic are inherited from ggPedigree(); this function simply augments the plot with Plotly hover, zoom, and pan functionality.
Usage
ggPedigreeInteractive(
ped,
famID = "famID",
personID = "personID",
momID = "momID",
dadID = "dadID",
patID = "patID",
matID = "matID",
twinID = "twinID",
status_column = NULL,
tooltip_columns = NULL,
focal_fill_column = NULL,
overlay_column = NULL,
config = list(),
debug = FALSE,
return_widget = TRUE,
phantoms = FALSE,
...
)
ggpedigreeInteractive(
ped,
famID = "famID",
personID = "personID",
momID = "momID",
dadID = "dadID",
patID = "patID",
matID = "matID",
twinID = "twinID",
status_column = NULL,
tooltip_columns = NULL,
focal_fill_column = NULL,
overlay_column = NULL,
config = list(),
debug = FALSE,
return_widget = TRUE,
phantoms = FALSE,
...
)
ggpedigreeinteractive(
ped,
famID = "famID",
personID = "personID",
momID = "momID",
dadID = "dadID",
patID = "patID",
matID = "matID",
twinID = "twinID",
status_column = NULL,
tooltip_columns = NULL,
focal_fill_column = NULL,
overlay_column = NULL,
config = list(),
debug = FALSE,
return_widget = TRUE,
phantoms = FALSE,
...
)
Arguments
- ped
A data frame containing the pedigree data. Needs personID, momID, and dadID columns
- famID
Character string specifying the column name for family IDs. Defaults to "famID".
- personID
Character string specifying the column name for individual IDs. Defaults to "personID".
- momID
Character string specifying the column name for mother IDs. Defaults to "momID".
- dadID
Character string specifying the column name for father IDs. Defaults to "dadID".
- patID
Character string specifying the column name for paternal lines Defaults to "patID".
- matID
Character string specifying the column name for maternal lines Defaults to "matID".
- twinID
Character string specifying the column name for twin IDs. Defaults to "twinID".
- status_column
Character string specifying the column name for affected status. Defaults to NULL.
- tooltip_columns
Character vector of column names to show when hovering. Defaults to c("personID", "sex"). Additional columns present in `ped` can be supplied – they will be added to the Plotly tooltip text. Defaults to NULL, which uses the default tooltip columns.
- focal_fill_column
Character string specifying the column name for focal fill color.
- overlay_column
Character string specifying the column name for overlay alpha values.
- config
A list of configuration options for customizing the plot. See getDefaultPlotConfig for details. The list can include:
- code_male
Integer or string. Value identifying males in the sex column. (typically 0 or 1) Default: 1.
- segment_spouse_color, segment_self_color
Character. Line colors for respective connection types.
- segment_sibling_color, segment_parent_color, segment_offspring_color
Character. Line colors for respective connection types.
- label_text_size, point_size, segment_linewidth
Numeric. Controls text size, point size, and line thickness.
- generation_height
Numeric. Vertical spacing multiplier between generations. Default: 1.
- shape_unknown, shape_female, shape_male, status_shape_affected
Integers. Shape codes for plotting each group.
- sex_shape_labels
Character vector of labels for the sex variable. (default: c("Female", "Male", "Unknown"))
- unaffected, affected
Values indicating unaffected/affected status.
- sex_color_include
Logical. If TRUE, uses color to differentiate sex.
- label_max_overlaps
Maximum number of overlaps allowed in repelled labels.
- label_segment_color
Color used for label connector lines.
- debug
Logical. If TRUE, prints debugging information. Default: FALSE.
- return_widget
Logical; if TRUE (default) returns a plotly htmlwidget. If FALSE, returns the underlying plotly object (useful for further customization before printing).
- phantoms
Logical. If TRUE, adds phantom parents for individuals without parents.
- ...
Additional arguments passed to `ggplot2` functions.