Declare the ranking metric, tie policy and eligible entities for each period before connecting positions.
Bump charts: show rank movement without losing ties or entrants
Rank is an ordering, not a magnitude
A bump chart connects an entity's ranks across periods. A move from third to first may reflect a tiny absolute difference or a major change; the line does not tell you which. Name the ranked measure and link to values behind each position. Paired-change charts work better when the actual size of change matters. If a new entity enters the cohort, existing ranks can fall without their own measurements changing. Display entrants and exits as membership events rather than implying deterioration.
Ties need a written rule
Equal measurements can share a rank, be assigned adjacent ranks by a secondary key, or be shown in a tied band. These choices produce different line paths. Competition ranking gives equal values the same rank and skips the next position; dense ranking does not skip. Neither should be selected by accident inside a plotting library. Preserve raw values and the chosen tie rule in the export. Reproducible chart exports also need source period and eligibility criteria. Test ties at both top and bottom before publishing.
Hold the cohort question steady
A panel can rank the same fixed set of entities every period or rank whoever was eligible at the time. The first view tracks a stable cohort; the second reflects changing membership. State which one readers see. If a missing measurement removes an entity from one period, show a line break or missing marker rather than assigning last place. Provisional periods and data gaps are especially easy to hide in a rank-only display. Mark a period as provisional when its numerator or denominator can still change.
Limit crossings and preserve access
Many crossing lines defeat tracing. Highlight a small set chosen by a documented rule, fade the remainder and let the reader search by entity ID. A table with period, rank, value and membership status is essential, because color-only line identity and hover-only labels fail on touch and assistive technology. Text alternatives should call out the biggest rank rise, biggest fall, ties and entrants. Do not claim a trend from two ranks alone; a third period or actual values may tell a different story.
Worked contract
from math import isfinite
def competition_ranks(scores: dict[str, float]) -> dict[str, int]:
if any(not entity for entity in scores):
raise ValueError("entity IDs must be nonempty")
if any(not isfinite(value) for value in scores.values()):
raise ValueError("scores must be finite")
ordered = sorted(scores.items(), key=lambda item: (-item[1], item[0]))
ranks = {}
prior_score = None
current_rank = 0
for position, (entity, score) in enumerate(ordered, start=1):
if prior_score is None or score != prior_score:
current_rank = position
ranks[entity] = current_rank
prior_score = score
return ranks
week_47 = competition_ranks({"north": 81, "south": 81,
"west": 59, "east": 47})
assert week_47 == {"north": 1, "south": 1, "west": 3, "east": 4}Performance and operating cost
Ranking N entities costs O(N log N) time and O(N) output space per period; connecting P periods takes O(PN) output storage for a fixed cohort. The code uses higher-score-first competition ranks and stable ID ordering only for reproducible output. It does not fill absent entities. Before rendering, validate that every period uses the same score definition and disclose whether the eligible set is fixed or variable.
Common Mistakes
- Reading a one-place rise as a fixed-size improvement.
- Allowing a chart library to break ties arbitrarily.
- Assigning missing entities last place.
- Comparing periods with changing eligibility without labeling entrants and exits.
Validation drill
Rank 47 service depots over six weeks with two ties and one new entrant. Reconcile every rank to its score and show how the entrant changes the apparent position of unchanged depots.
Read next
- Paired-change charts: match entities before drawing a slope
- Time-series charts: distinguish missing days, zeros and provisional periods
- Accessible charts: encode meaning without relying on color alone
- Chart exports: carry the data, filters and render contract together
