The aliquot chain
The chain describes what happened to the material: a sample becomes a digest, which yields a fraction, which yields a measurement. Nodes are material and results, not files; files attach to nodes and to operations. This page describes the model, the templates that avoid entering everything by hand, and the grid view.
Why nodes are not files
A graph of files cannot say that an Sb(III) fraction comes from a given digest, because that fraction has no file of its own: it is one line in a workbook that holds forty. By taking material as the unit, the chain describes what happened at the bench, and files attach wherever they document something.
| Element | What it is |
|---|---|
| Node | An aliquot, a result or an output. |
| Edge | An operation: digestion, purification, dilution, spiking, measurement... |
| Attached file | To a node, or to an edge. A digestion protocol documents the operation. |
| Split | Two edges leaving the same node. No dedicated type. |
| Mix | Two edges arriving at the same node. |
The operations
Fifteen operations ship, covering preparation and measurement, including dopage for isotope dilution. The vocabulary is bilingual and lives in a label table, like the inventory reasons: the chain stores the code, the display produces the sentence.
| Guard | Behaviour |
|---|---|
| Cycle | Refused on write, and the message names the cycle rather than announcing a general refusal. |
| Expected target | A measurement targets a result; a citation and a publication target an output. |
| Output | Is cited from results, and is not manufactured from material. |
| Traversal | Iterative, checked on three thousand nodes. A recursive traversal would fail on a deep chain. |
Templates
The main risk in this model is not technical. An editor where three hundred nodes must be placed by hand produces a graph nobody fills in, which is the usual failure mode of laboratory information systems. Templates exist for that reason.
| Point | Behaviour |
|---|---|
| Shipped | Ten templates across seven domains: isotopes, elemental, waters, solids, organic, mineral, environment. |
| Form | A list of steps, each naming the step it starts from. Describing a graph would have required an editor just to write the template. |
| Domain | It groups, it does not restrict: a template from another domain still applies. |
| Shipped templates | Not copied into the user file, so that a correction reaches existing installations. A user template with the same key replaces it; deleting it restores the shipped one. |
| Reapplying | Ignores names already present, so applying twice adds no duplicate. |
Template editor
The editor opens from the template picker, at the top to create and at the bottom to modify. Work is done on a copy, so that cancelling gives everything back; a copy starts from an empty key, otherwise duplicating a template would silently replace the original.
The preview goes through the same layout function as the chain view. A second representation, written for the occasion, would diverge from the first at the first correction.
The grid view
The chain is not drawn as a free graph. A force-based layout would produce an unreadable cloud where the real structure is a grid: a campaign is most often N repetitions of the same shape. Steps are therefore the columns and samples the rows.
| Layout rule | Reason |
|---|---|
| A node's rank is the longest path from a root. | With the shortest, a node reachable by a shortcut would move up one column and an edge would point backwards. |
| The first branch continues the row, the following ones open a new one. | A split reads as a doubling, while staying aligned with the other samples. |
| A node already placed keeps its place. | A mix occupies a single row, and reads as a diamond. |
| A column carries the majority step, on a strict majority. | On a tie, all leading steps are named: settling it by coin toss would announce one step while hiding another. |
| A node unreachable from any root is shown at the end of the grid, marked orphan. | Hiding it would remove real data from the screen. |
Edges are drawn in a single SVG layer, as curves: two identical right angles overlap on a split. The layout is computed by a pure function, tested without a DOM on bench cases, including forty parallel chains, a mix, a shortcut skipping a step, and a chain of three thousand nodes.
Opening the view on an already open campaign
A panel asks for the current state when it mounts rather than waiting for an event. That is the common case: the chain view is opened precisely because a campaign is already open, therefore after the load event has fired. Events only serve for later changes.