from typing import Dict


def compactness(r: Dict[str, float]) -> float:
    """Check how compact a component is. Higher = less compact."""
    aa = 10.0
    bb = 1.3
    s = r['Component S (Franzen)'] if r['Component S (Franzen)'] != 0.0 else r['Component Sp (Franzen)']
    ssp = s / r['Component Sp (Franzen)']
    aasnrbb = aa / (r['Component SNR (Franzen)'] ** bb)
    return ssp / aasnrbb