#!/usr/bin/env python3 """Scatter of external citations vs in-graph influence for the top influencers. x = real-world citation count (log scale); y = in-graph influence (how many corpus papers `builds-on` it). Median lines split the plane into quadrants: canonical (high/high), sleeping beauties (high influence / low citation), broadly-cited-but-less-built-on (high citation / low influence), and niche. Reads a JSON produced by the citation fetch (default /tmp/cif.json), of the form {slug: {"influence": int, "year": int, "title": str, "cites": int|null}} and writes one self-contained HTML page (D3 from CDN). Citation counts come from Semantic Scholar's batch endpoint (slightly below Google Scholar but close); the fetch recipe (batch by arXiv id in one request, title-search fallback, <=1 req/s) is in skills/visualize-graph/SKILL.md. This script only draws the scatter. python3 _scripts/make_cite_influence.py --data /tmp/cif.json --out reports/cite-vs-influence.html """ import argparse import json import os import re VAULT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def short(slug): m = re.match(r"[a-z]+\d{4}-(.+)", slug) return (m.group(1) if m else slug).replace("-", " ") def main(): ap = argparse.ArgumentParser() ap.add_argument("--data", default="/tmp/cif.json") ap.add_argument("--out", default="reports/cite-vs-influence.html") ap.add_argument("--title", default="Citations vs in-graph influence") a = ap.parse_args() raw = json.load(open(a.data, encoding="utf-8")) pts = [{"slug": s, "label": short(s), "cites": v["cites"], "infl": v["influence"], "year": v.get("year") or 0} for s, v in raw.items() if v.get("cites") is not None] pts.sort(key=lambda p: -p["infl"]) data = json.dumps(pts) html = TEMPLATE.replace("__DATA__", data).replace("__TITLE__", a.title) out = a.out if os.path.isabs(a.out) else os.path.join(VAULT, a.out) os.makedirs(os.path.dirname(out), exist_ok=True) open(out, "w", encoding="utf-8").write(html) print(f"wrote {out}: {len(pts)} points") TEMPLATE = r'''
The 50 papers most built-on within the corpus. x = external citations (Semantic Scholar, log scale — conservative vs Google Scholar); y = in-graph influence (how many corpus papers build on it). Color = year. Dashed lines are medians. Hover a point for details.