lineage/export/svg/genes

Compact genotype drawings for the CompactGenes display mode in export/svg.

Unlike export/svg/pea, these drawings are species-agnostic: rather than illustrating a trait’s expressed phenotype, each gene is rendered as a small badge showing its raw allele letters, grouped by the physical chromosome they sit on (mirroring the List(List(String)) shape expected by export/svg.CompactGenes).

Values

pub const gene_size: Float

Local coordinate box every gene badge is drawn within, starting at (0, 0). Matches export/svg/pea.icon_size so both modes size their drawings the same way.

pub fn render_genes(
  traits: List(String),
) -> fn(individual.Individual, individual.SpeciesRules) -> List(
  List(String),
)

Returns a compact genotype visualizer for the given gene names, suitable for export/svg.CompactGenes.

An empty traits list means “show all genes”, mirroring the convention used by export/svg/pea.render_phenotypes. Genes are grouped into rows by the chromosome they belong to, preserving the order they appear in rules.genes.

Examples

let visualize = render_genes([])
visualize(individual, pea.rules())
// -> one row per chromosome, one badge per gene on it
Search Document