
Draw a colony's maternal lines and the links between them
Source:R/drawColonyOverview.R
drawColonyOverview.RdReturns a picture of a whole colony, as a visNetwork widget, for an
overview made by makeColonyOverview: one circle per drawn
maternal line, set around a ring in the overview's order (the first at the
top, then clockwise), and one link between two lines when a sire in one
fathered young in the other.
Arguments
- overview
the list returned by
makeColonyOverview, with at least one drawn line.- onClick
NULL(the default), or a JavaScript function, as a character string, that runs when the overview is clicked. Only then does the text shown when pointing at a circle end with “Click to draw this line”, since a click does nothing without it.
Details
A circle's size grows with its line's number of animals. A line with a living animal is blue and one with none is gray. Each circle is labeled with its founding dam's id, its number of animals and its number of living animals. A link is wider for more young. Pointing at a circle or a link shows its figures, and pointing at a circle fades every circle and link it does not touch. The Export Overview (PNG) button saves the picture.
The widget shows wherever an htmlwidget does: in the RStudio viewer,
in an R Markdown or Quarto document, or in a web page saved with
htmlwidgets::saveWidget().
Examples
library(nprcgenekeepr)
overview <- makeColonyOverview(nprcgenekeepr::examplePedigree)
picture <- drawColonyOverview(overview)
## Print `picture` in an interactive session to see it, or save it as a
## web page with htmlwidgets::saveWidget(picture, "colony.html").