Skip to content

@graphty/graphty-element / session / TopRanking

Interface: TopRanking ​

Defined in: graphty-element/src/session/results/types.ts:671

The top of a ranking, cut only between tie groups.

THE TIE POLICY: a group of elements that share a value is taken whole or not at all, and it is taken only when the whole group fits inside the limit. With ranks that share a place (1, 2, 2, 4), a group of size s at rank r is in exactly when r + s - 1 <= n. So the top never holds more than n elements and never splits a tie by an arbitrary order -- and it can hold FEWER than n, or none at all on a graph whose top value is shared by more than n elements. TopRanking.leftOut and TopRanking.reason say when that happened.

Properties ​

entries ​

readonly entries: readonly RankingEntry[]

Defined in: graphty-element/src/session/results/types.ts:673

The elements taken, best first: whole tie groups only, never more than the limit.


leftOut ​

readonly leftOut: { count: number; value: number; } | null

Defined in: graphty-element/src/session/results/types.ts:678

The tie group that stopped the top short: the first group that did not fit, with its value and its size. Null when nothing was left out on account of a tie.


reason ​

readonly reason: string | null

Defined in: graphty-element/src/session/results/types.ts:680

Why fewer elements were taken than the limit allowed, in a sentence; null when none were left out.


threshold ​

readonly threshold: number | null

Defined in: graphty-element/src/session/results/types.ts:688

The value of the highest-ranked element left out, or null when every measured element is in the top. An { above } selection target or a threshold filter at this value selects exactly TopRanking.entries, so it is the lowest threshold whose match count fits the limit: top(field, DEFAULT_LIMITS.renderCeiling).threshold is where a threshold control opens with the result still drawable.