lineage/export/svg/pea

Phenotype icons for the garden pea species, for embedding into the SVG family-tree nodes produced by export/svg.

Each icon is a self-contained SVG fragment drawn within a local icon_size x icon_size box anchored at (0, 0). Placement (translation, spacing, node sizing) is the caller’s responsibility — see export/svg.render_node.

Values

pub const icon_size: Float

Local coordinate box every icon fragment is drawn within, starting at (0, 0).

pub fn render_phenotypes(
  traits: List(String),
) -> fn(individual.Individual, individual.SpeciesRules) -> dict.Dict(
  String,
  String,
)

Returns a phenotype visualizer for the given trait names, suitable for export/svg.Phenotype.

An empty traits list means “show all known traits”, mirroring the convention used by the phenotype selection controls elsewhere in the UI (see ui/view/controls.render).

The returned dict is keyed by stringified position ("0", "1", …) reflecting the order traits appear in rules.genes, since dict.Dict itself carries no ordering guarantee.

Examples

let visualize = render_phenotypes(["Seed shape", "Pod color"])
visualize(individual, pea.rules()) |> dict.size
// -> 2
Search Document