Skip to contents

Genetic-Health Trends Module - Server Function

Usage

modSnapshotTrendsServer(id, snapshotSource)

Arguments

id

character vector of length 1. Module namespace identifier.

snapshotSource

reactive returning list(ped, geneticValue, guIter, guThresh) from the most recent Genetic Value Analysis run (see modGeneticValueServer's snapshotSource return element), or erroring (shiny req() semantics) before any run has happened.

Value

A list with reactive components:

  • history - the current validated snapshot history (or NULL before any upload or generation).

  • deltas - the current delta comparison (see calcSnapshotDeltas), keyed off the sidebar's rule/from/ to selectors.

  • isReady - logical: is a non-empty history loaded.

The generated snapshot's membershipRule is auto-derived from snapshotSource()$ped$population (issue #167 Slice 4, S760 owner decision): "focalPopulation" when the analyzed pedigree's population column excludes any animal, "wholePedigree" otherwise – truthful by construction from what reportGV() actually analyzed, never a user-set dropdown that could contradict the data and hit createColonySnapshot's stop(). The delta comparison keeps a user-facing rule selector, populated from the uploaded/generated history's own membershipRule values.

A checkSnapshotHistory violation on a malformed history upload surfaces as a notification (module-contract rule 5: this is not the same seam as inter-module malleability – the specific violation is shown, not disguised as "no data yet") and leaves the current history unchanged.