Decide the coverage-band cross-fade for a scalar metric — whatever the
group's selector names, i.e. the viewport AREA fraction under
'screen-area' (what derived ladders stamp) or the normalised diagonal
(projected bbox diagonal ÷ FILL_FACTOR·fittedAxisPx, where fittedAxisPx
is min(viewport.width, viewport.height)) under the legacy 'coverage' —
against a level's ascending per-child coverage_fraction thresholds
(coarsest 0 → finest 0.5 whole-object / 1.0 partition-bound under
'screen-area'; finest 1 for a legacy whole-object ladder, up to
SCREEN_FILL_DIAGONAL_RATIO / FILL_FACTOR for an explicitly authored or
partition-bound one). Everything here is proportional to the inter-threshold
gaps, so the band scales with the ladder either way.
Each inter-level boundary is the activation threshold of the finer level
(thresholds[i+1]). The band half-width is PROPORTIONAL to the local
inter-level spacing — Δ_i = fraction · min(gapBelow, gapAbove) — because the
coverage_fraction thresholds are geometrically spaced either way (a derived
'screen-area' ladder halves EXACTLY per coarser level, whatever the
compression factor K; a derived legacy 'coverage' one steps by √K, from
the retired sqrt(N_i/N_finest) derivation), so a constant band would be a
clean dissolve at the finest step yet many times wider than the whole step at
the coarse end (perpetually-blended coarse levels, overlapping bands).
Scaling to the smaller adjacent gap makes the dissolve feel the same fraction
of a step at every level and guarantees no two bands overlap (for
fraction ≤ 0.5).
When the metric is within ±Δ_i of the NEAREST such boundary, the two levels
straddling it cross-fade: the finer level's weight is
smoothstep(boundary − Δ_i, boundary + Δ_i, metric), so it rises 0→1 across
the band and is 0.5 at the boundary. The blend is continuous through the hard
selection flip (which happens at the boundary): the same (lo, hi) pair and a
continuous hiWeight govern both sides.
Returns null when no boundary's band contains the metric (a single level
suffices), when fraction <= 0 (cross-fade disabled → hard step), or when
there are fewer than two levels. Direction-agnostic — zoom-in and zoom-out
cross the same band symmetrically.
Decide the coverage-band cross-fade for a scalar
metric— whatever the group'sselectornames, i.e. the viewport AREA fraction under'screen-area'(what derived ladders stamp) or the normalised diagonal (projected bbox diagonal ÷FILL_FACTOR·fittedAxisPx, wherefittedAxisPxismin(viewport.width, viewport.height)) under the legacy'coverage'— against a level's ascending per-childcoverage_fractionthresholds (coarsest 0 → finest 0.5 whole-object / 1.0 partition-bound under'screen-area'; finest 1 for a legacy whole-object ladder, up toSCREEN_FILL_DIAGONAL_RATIO / FILL_FACTORfor an explicitly authored or partition-bound one). Everything here is proportional to the inter-threshold gaps, so the band scales with the ladder either way.Each inter-level boundary is the activation threshold of the finer level (
thresholds[i+1]). The band half-width is PROPORTIONAL to the local inter-level spacing —Δ_i = fraction · min(gapBelow, gapAbove)— because thecoverage_fractionthresholds are geometrically spaced either way (a derived'screen-area'ladder halves EXACTLY per coarser level, whatever the compression factor K; a derived legacy'coverage'one steps by√K, from the retiredsqrt(N_i/N_finest)derivation), so a constant band would be a clean dissolve at the finest step yet many times wider than the whole step at the coarse end (perpetually-blended coarse levels, overlapping bands). Scaling to the smaller adjacent gap makes the dissolve feel the same fraction of a step at every level and guarantees no two bands overlap (forfraction ≤ 0.5).When the metric is within
±Δ_iof the NEAREST such boundary, the two levels straddling it cross-fade: the finer level's weight issmoothstep(boundary − Δ_i, boundary + Δ_i, metric), so it rises 0→1 across the band and is 0.5 at the boundary. The blend is continuous through the hard selection flip (which happens at the boundary): the same(lo, hi)pair and a continuoushiWeightgovern both sides.Returns
nullwhen no boundary's band contains the metric (a single level suffices), whenfraction <= 0(cross-fade disabled → hard step), or when there are fewer than two levels. Direction-agnostic — zoom-in and zoom-out cross the same band symmetrically.