Skip to content

v5.12.8 — modern chart decluttering fix

Latest

Choose a tag to compare

@g-battaglia g-battaglia released this 22 Apr 13:07
· 5 commits to main since this release
c804a31

Bugfix release — modern chart decluttering

Fixes planet glyph ordering on style="modern" charts in tight clusters.

The bug

In a dense stellium (≥3 planets within ~8°) the old decluttering loop could push a planet past its neighbours, violating the true zodiacal order. Reported symptom: Neptune at 5° Aquarius rendered after Uranus at 17° Aquarius on the 2000-02-26 chart.

The fix

Rewrote _resolve_planet_collisions (kerykeion/charts/draw_modern.py) from a 5-pass iterative push (vulnerable to wraparound overshoots) to a single-pass largest-gap linearization:

  1. Sort once by true zodiacal angle.
  2. Cut the circle at the largest gap in those true angles.
  3. Walk forward once, placing each planet at max(desired_linear, prev_linear + sep).

Monotonic by construction → order preserved, min_separation respected, no iterative refinement.

Compatibility

  • No public API touched.
  • _resolve_planet_collisions is private; no get_type_hints() impact.
  • Classic style unaffected.

Regression tests

tests/core/test_modern_decluttering.py — 13 tests including:

  • unit invariants on empty/single/sparse/dense inputs
  • the 2000-02-26 cluster (synthetic fixture + end-to-end SVG parse)
  • property-based: 200 random dense clusters + 500 random full-circle distributions
  • pathological cases: all-equal angles, long push chain crossing 0°/360°

Full changelog: https://github.com/g-battaglia/kerykeion/blob/v5.12.8/CHANGELOG.md