+ What was recorded, season by season
+
+ The share of records with a value for each measurement, which shows what each comparison on this
+ site can draw on. It is not a check that the values are right, and it says nothing about the
+ lab's work. A zero counts as recorded. A blank can't tell a skipped measurement from one the
+ protocol didn't call for that season. A dashed cell has no records to count. Each table gives
+ the counts.
+
+
+ Lavage results count only captures marked as lavaged or with a result. Of the rest, {plural(
+ data.unknownLavage,
+ 'capture doesn’t',
+ 'captures don’t'
+ )} say whether the shark was lavaged and {plural(data.notLavaged, 'was', 'were')} marked as not lavaged.
+
+ {#each panels as p (p.title)}
+
+
+
+ {/each}
+
diff --git a/src/lib/components/ModelSelection.svelte b/src/lib/components/ModelSelection.svelte
new file mode 100644
index 0000000..095aadc
--- /dev/null
+++ b/src/lib/components/ModelSelection.svelte
@@ -0,0 +1,74 @@
+
+
+
+ Which sets does the model use?
+
+ Each bar is the number of sets left after a filter, counted by the same code the model uses. The
+ first three filters run in order and leave the sample for all sharks. Each species model then
+ starts again from that sample and drops the nurseries where that species was rarely caught.
+
+ {#if incomplete}
+
+ Of the {plural(incomplete, 'set')} missing a model variable, {missingText.length > 1
+ ? `${missingText.slice(0, -1).join(', ')} and ${missingText.at(-1)}`
+ : missingText[0]}{flow.missing.length > 1 ? `; a set can lack more than one` : ''}.
+
+ {/if}
+
+ Being in the sample doesn't guarantee a fit: the model also needs at least {num(
+ flow.minModelSets
+ )} sets, two nurseries and two seasons. The sample for all sharks has {plural(
+ flow.modelSets,
+ 'set'
+ )} from {plural(flow.nurseries, 'nursery', 'nurseries')} over {plural(flow.seasons, 'season')}.
+
+
+ r.stage)}
+ series={[
+ { name: 'Sets', color: 'var(--series-1)', values: flow.rows.map((r) => r.remaining) }
+ ]}
+ valueFormat={(v) => num(v)}
+ />
+
+
+
+
diff --git a/src/lib/components/charts/Heatmap.svelte b/src/lib/components/charts/Heatmap.svelte
index c790a63..40ea86d 100644
--- a/src/lib/components/charts/Heatmap.svelte
+++ b/src/lib/components/charts/Heatmap.svelte
@@ -49,22 +49,27 @@
const hi = $derived(domain?.[1] ?? (flat.length ? Math.max(...flat) : 1));
const absMax = $derived(Math.max(Math.abs(lo), Math.abs(hi)) || 1);
- function fill(v: number | null): { color: string; opacity: number; dark: boolean } {
+ function fill(v: number | null): { color: string; opacity: number; ink: string } {
// No data: an empty dashed cell, never a colour from the scale (the lightest steps are
// close to --surface-2, in dark mode especially).
- if (v == null || !Number.isFinite(v)) return { color: 'none', opacity: 1, dark: false };
+ if (v == null || !Number.isFinite(v)) return { color: 'none', opacity: 1, ink: 'var(--ink)' };
if (mode === 'div') {
const t = Math.max(-1, Math.min(1, v / absMax));
- if (Math.abs(t) < 0.06) return { color: 'var(--div-mid)', opacity: 1, dark: false };
+ if (Math.abs(t) < 0.06) return { color: 'var(--div-mid)', opacity: 1, ink: 'var(--ink)' };
return {
color: t < 0 ? 'var(--div-neg)' : 'var(--div-pos)',
opacity: 0.18 + 0.82 * Math.abs(t),
- dark: Math.abs(t) > 0.6
+ ink: Math.abs(t) > 0.6 ? '#ffffff' : 'var(--ink)'
};
}
const t = hi === lo ? 1 : (v - lo) / (hi - lo);
const k = Math.min(7, 1 + Math.floor(t * 6.999));
- return { color: `var(--seq-${k})`, opacity: 1, dark: k >= 5 };
+ // The strong end is dark in light mode and pale in dark mode, so its text flips with it.
+ return {
+ color: `var(--seq-${k})`,
+ opacity: 1,
+ ink: k >= 5 ? 'var(--seq-strong-ink)' : 'var(--ink)'
+ };
}
let tip = $state