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.
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,
...
)
A plotly htmlwidget (or plotly object if `return_widget = FALSE`).
A data frame containing the pedigree data. Needs personID, momID, and dadID columns
Character string specifying the column name for family IDs. Defaults to "famID".
Character string specifying the column name for individual IDs. Defaults to "personID".
Character string specifying the column name for mother IDs. Defaults to "momID".
Character string specifying the column name for father IDs. Defaults to "dadID".
Character string specifying the column name for paternal lines Defaults to "patID".
Character string specifying the column name for maternal lines Defaults to "matID".
Character string specifying the column name for twin IDs. Defaults to "twinID".
Character string specifying the column name for affected status. Defaults to NULL.
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.
Character string specifying the column name for focal fill color.
Character string specifying the column name for overlay alpha values.
A list of configuration options for customizing the plot. See getDefaultPlotConfig for details. The list can include:
Integer or string. Value identifying males in the sex column. (typically 0 or 1) Default: 1.
Character. Line colors for respective connection types.
Character. Line colors for respective connection types.
Numeric. Controls text size, point size, and line thickness.
Numeric. Vertical spacing multiplier between generations. Default: 1.
Integers. Shape codes for plotting each group.
Character vector of labels for the sex variable. (default: c("Female", "Male", "Unknown"))
Values indicating unaffected/affected status.
Logical. If TRUE, uses color to differentiate sex.
Maximum number of overlaps allowed in repelled labels.
Color used for label connector lines.
Logical. If TRUE, prints debugging information. Default: FALSE.
Logical; if TRUE (default) returns a plotly htmlwidget. If FALSE, returns the underlying plotly object (useful for further customization before printing).
Logical. If TRUE, adds phantom parents for individuals without parents.
Additional arguments passed to `ggplot2` functions.
library(BGmisc)
data("potter")
ggPedigreeInteractive(potter, famID = "famID", personID = "personID")
Run the code above in your browser using DataLab