Holders over time (dotted lines span periods with no successful scrapes)
fillCard((width, height) => Plot.plot({
style: {background: "transparent"},
width,
height,
marginLeft: 50,
x: {type: "utc", domain: [snapshots[0], latest], label: null, ticks: "year", tickFormat: "%Y"},
y: {label: "Certificates held", grid: true, zero: true},
color: {
domain: certs.filter(c => certFilter.includes(c)),
range: certs.filter(c => certFilter.includes(c)).map(colourOf),
legend: true
},
marks: [
Plot.ruleY([0], {strokeOpacity: 0.3}),
Plot.lineY(gapBridges, {x: "date", y: "holders", z: "bridge", stroke: "certificate", strokeWidth: 1.5, strokeDasharray: "2,4"}),
Plot.lineY(holdersOverTime, {x: "date", y: "holders", stroke: "certificate", strokeWidth: 2}),
Plot.tip(holdersOverTime.filter(d => !isNaN(d.holders)), Plot.pointer({
x: "date", y: "holders", stroke: "certificate",
title: d => `${d.certificate}\n${formatDate(d.date)}\n${d.holders} holders`
}))
]
}), 40)
Recent changes
changesTable = dataTableCard(
dtColumns(
["date", "change", "first_name", "last_name", "certificate", "since", "fellow", "qualification_year"],
{
date: "Seen on", change: "Change", first_name: "First name", last_name: "Surname",
certificate: "Certificate", since: "Previous snapshot", fellow: "Fellowship", qualification_year: "Qualified"
},
// Same widths as the People table; the last column takes any spare width.
{...tableColumnWidths, qualification_year: undefined}
),
{order: [[0, "desc"]]}
)viewof search = Inputs.search(filtered, {placeholder: "Search by name", label: "Search", format: () => ""})
viewof peopleOptions = {
const input = Inputs.checkbox(["Current holders only", "Relinquished only", "Regulatory record only"], {label: "Show"});
// Keep the options on one row (wrapping only on narrow screens) instead of stacking in the default input width.
input.style.maxWidth = "none";
input.querySelector(":scope > div").style.cssText = "display: flex; flex-wrap: wrap; column-gap: 1.5rem; width: auto;";
input.querySelectorAll(":scope > div > label").forEach(label => label.style.whiteSpace = "nowrap");
return input;
}
How the data is collected
Each day, a GitHub Actions workflow searches the IFoA public directory for Fellows holding each type of practising certificate and saves the results. This dashboard combines those snapshots.
- Holding a certificate. A certificate counts as held from the first snapshot it appears in. It counts as relinquished only once it has been missing from at least 3 successful snapshots spanning more than 30 days, so a brief drop-out from the directory isn’t counted as a change.
- Dates of changes are the first snapshot that shows the change. After a gap in the data, the change could have happened at any time during the gap.
- CERA counts anyone shown as CERA in any snapshot. The directory used since 2026 rarely shows CERA, so people who became CERA or first appeared since then are undercounted.
- Qualification year is the year shown with the Fellow’s status in the directory.
- People are matched by name, so two people with the same name and certificate are treated as one.
- The first snapshot was taken on . There are successful snapshots in total.
Periods with no successful scrapes (over 14 days)
{
const gaps = snapshots.slice(1)
.map((end, i) => ({start: snapshots[i], end}))
.filter(d => d.end - d.start > 14 * 86400000);
return html`<table class="table table-sm">
<thead><tr><th>Last snapshot before</th><th>Next snapshot</th><th>Days</th></tr></thead>
<tbody>${gaps.map(d => html`<tr>
<td>${formatDate(d.start)}</td><td>${formatDate(d.end)}</td><td>${Math.round((d.end - d.start) / 86400000)}</td>
</tr>`)}</tbody>
</table>`;
}dark = Generators.observe(notify => {
// Follows the dashboard's light/dark toggle so chart colours use the step validated for that surface.
const check = () => notify(document.body.classList.contains("quarto-dark"));
check();
const observer = new MutationObserver(check);
observer.observe(document.body, {attributes: true, attributeFilter: ["class"]});
return () => observer.disconnect();
})statBox = function(icon, label, value, note) {
// One summary figure per card, laid out the same in every card so labels, icons and values line up across
// the row: a one-line label, then a Bootstrap icon beside the large value, then an optional status line.
return html`<div style="display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 0 4px; min-width: 0;">
<div style="font-size: 0.85rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title=${label}>${label}</div>
<div style="display: flex; align-items: center; gap: 10px;">
<i class="bi bi-${icon}" style="font-size: 1.5rem; line-height: 1; color: var(--slider-accent);" aria-hidden="true"></i>
<span style="font-size: 1.6rem; font-weight: 600; line-height: 1.2; white-space: nowrap;">${value}</span>
</div>
<div style="font-size: 0.85rem; min-height: 1.2em;">${note ?? ""}</div>
</div>`;
}scrapeStatus = {
// Checked when the page is viewed, so an old copy of the site still shows that it's out of date.
const daysOld = Math.floor((Date.now() - latest) / day);
return daysOld > 3
? html`<span style="color: ${dark ? "#fab219" : "#9a6700"};">⚠ ${daysOld} days ago</span>`
: html`<span style="color: ${dark ? "#0ca30c" : "#006300"};">✓ Up to date</span>`;
}// Swaps new rows into the existing tables when the filters change, rather than rebuilding them.
changesTable.setRows(
changeSearch.filter(d => changeTypes.includes(d.change)),
// Count shown here rather than in the search box, so it reflects the Show options too.
rows => `${rows.length.toLocaleString()} changes in the last ${recentDays} days`
)dtColumns = function(fields, header, widths) {
// DataTables column definitions. Dates show formatted but sort by time; true/false shows as Yes/No.
const date = (d, type) => d == null ? "" : type === "display" || type === "filter" ? formatDate(d) : +d;
const yesNo = d => d ? "Yes" : "No";
const render = {
date, since: date, first_date: date, last_date: date,
current: yesNo, cera: yesNo, regulatory_record: yesNo
};
// Widths become shares of the table so it always fits its card; a column without one gets 120px worth.
const total = d3.sum(fields, field => widths[field] ?? 120);
return fields.map(field => ({
data: field,
title: header[field],
width: `${(100 * (widths[field] ?? 120) / total).toFixed(2)}%`,
render: render[field] ?? null
}));
}dataTableCard = function(columns, options = {}) {
// A DataTable that fills its card. It is built once; setRows(rows, note) swaps in new rows and
// updates the note above the table. Scroller draws only the rows in view, and resizing the card
// resizes the scrolling area instead of rebuilding the table.
const outer = document.createElement("div");
outer.className = "dt-card";
outer.style.cssText = "position: relative; width: 100%; height: 260px;";
const inner = document.createElement("div");
inner.style.cssText = "position: absolute; inset: 0;";
const note = document.createElement("div");
note.className = "dt-note";
const table = document.createElement("table");
table.className = "table table-sm table-hover";
table.style.width = "100%";
inner.append(note, table);
outer.append(inner);
let api = null;
let pending = [];
outer.setRows = (rows, describe) => {
note.textContent = describe(rows);
pending = rows;
if (api) api.clear().rows.add(rows).draw();
};
let frame;
const observer = new ResizeObserver(([entry]) => {
cancelAnimationFrame(frame);
frame = requestAnimationFrame(() => {
const height = Math.max(260, Math.floor(entry.contentRect.height) - 4);
outer.style.height = `${height}px`;
const body = inner.querySelector(".dt-scroll-body");
// Skip while the page is hidden; this runs again when it's shown.
if (!api || !body || entry.contentRect.width === 0) return;
const top = body.getBoundingClientRect().top - inner.getBoundingClientRect().top;
body.style.height = body.style.maxHeight = `${Math.max(100, height - top)}px`;
api.columns.adjust();
api.scroller.measure();
});
});
(function attach() {
// DataTables measures the page when it starts, so wait until the table is on the page.
if (!outer.isConnected) return requestAnimationFrame(attach);
api = new DataTable(table, {
columns,
data: pending,
autoWidth: false,
deferRender: true,
scroller: true,
scrollY: 200,
searching: false,
// Filtering and counts are done by the dashboard's own inputs, so hide DataTables' controls.
layout: {topStart: null, topEnd: null, bottomStart: null, bottomEnd: null},
language: {emptyTable: "No matching records"},
...options
});
observer.observe(outer.closest(".cell-output") ?? outer);
})();
return outer;
}fillCard = function(draw, reserve = 0) {
// Redraws a chart to fill its card, leaving `reserve` pixels for legends and notes. It measures the
// card's output area (which Quarto sizes to the card) and positions the chart absolutely, so the chart
// can't change the size being measured.
const container = document.createElement("div");
container.style.cssText = "position: relative; width: 100%; height: 260px;";
const chart = document.createElement("div");
chart.style.cssText = "position: absolute; inset: 0;";
container.append(chart);
let frame;
const observer = new ResizeObserver(([entry]) => {
cancelAnimationFrame(frame);
frame = requestAnimationFrame(() => {
const width = Math.floor(entry.contentRect.width);
const height = Math.max(260, Math.floor(entry.contentRect.height) - 4);
container.style.height = `${height}px`;
if (width > 0) chart.replaceChildren(draw(width, height - reserve));
});
});
(function attach() {
if (!container.isConnected) return requestAnimationFrame(attach);
observer.observe(container.closest(".cell-output") ?? container);
})();
return container;
}// A change is recorded on the first snapshot that shows it, so after a data gap the real date is earlier.
events = [
...filtered.filter(d => d.joined_after).map(d => ({
...d, change: "Gained", date: d.first_date, since: d.joined_after
})),
...filtered.filter(d => d.left_before).map(d => ({
...d, change: "Relinquished", date: d.left_before, since: d.last_date
}))
].map(d => ({...d, after_gap: d.date - d.since > 14 * day}))// Holders of each selected certificate on every snapshot date, with a break in the line across data gaps.
holdersOverTime = certs.filter(c => certFilter.includes(c)).flatMap(certificate => {
const certSpells = filtered.filter(d => d.certificate === certificate);
const rows = [];
snapshots.forEach((date, i) => {
if (i > 0 && date - snapshots[i - 1] > 14 * day) {
// Break the solid line across a data gap; gapBridges draws it dotted instead.
rows.push({certificate, date: new Date((+date + +snapshots[i - 1]) / 2), holders: NaN});
}
const holders = certSpells.filter(d => d.first_date <= date && (d.current || d.last_date >= date)).length;
rows.push({certificate, date, holders});
});
return rows;
})