feat: show ARR disclosure coverage by business category

This commit is contained in:
2026-10-31 21:18:11 +08:00
parent 72f0928efa
commit 4330817138
3 changed files with 56 additions and 2 deletions
+16
View File
@@ -15,6 +15,22 @@ export function arrDisclosures(snapshot: ResearchSnapshot, options: { category?:
return [{ company, observation }];
});
}
/** Count companies once; missing ARR is a coverage gap, never zero revenue. */
export function arrDisclosureCoverage(snapshot: ResearchSnapshot, foundedYear?: number) {
const rows = arrDisclosures(snapshot, { foundedYear });
return snapshot.categories.map((category) => {
const companies = snapshot.companies.filter((company) => company.cat === category.id &&
[2025, 2026].includes(company.year ?? 0) && (!foundedYear || company.year === foundedYear));
const claims = rows.filter((row) => row.company.cat === category.id);
const disclosed = new Set(claims.map((row) => row.company.id));
const reported = new Set(claims.filter((row) =>
["signal", "historical"].includes(row.observation.selection)).map((row) => row.company.id));
return { id: category.id, name: category.name, companies: companies.length,
disclosed: disclosed.size, reported: reported.size, estimatedOnly: disclosed.size - reported.size,
missing: companies.length - disclosed.size, records: claims.length };
});
}
export type IncomeStats = {
n: number; mean: number; median: number; min: number; max: number;
sampleDeviation: number | null; cv: number | null; meanMedianRatio: number | null;