stanhue v1.1.0 — overlap-aware coloring
What's new
Overlap-aware coloring
Categories that overlap in the 2D embedding no longer receive light/dark shades of the same hue.
- New parameters
overlap_aware=Trueandoverlap_threshold=0.1in both Python and R. - Overlap is measured as grid-based neighbor-label mixing, symmetrized with
max, so a rare population sitting inside a big one is detected. - ≤ palette size: colors are handed out in CIELAB farthest-point order (anchored on white), then overlapping pairs are pushed apart by ΔE. Two categories now get e.g. dark red + dark green instead of light blue + dark blue.
- > palette size: two-level greedy. Group dominants pick offsets, other members pick slots within their group's palette segment, maximizing overlap-weighted CIELAB ΔE. Non-overlapping categories keep their previous slot, so there is no cascade of color changes.
overlap_aware=Falsereproduces the v1.0.0 algorithm exactly.- The R implementation produces identical output to Python on all test fixtures.
Packaging
pip install stanhuenow installs a properstanhuepackage:from stanhue import assign_celltype_colors. The standalone script lives atstanhue/scatter_colormap.py.- Added MIT
LICENSE; sdist no longer bundles gallery images.