Skip to main content

compute_skip_factor

Function compute_skip_factor 

Source
pub fn compute_skip_factor(
    labels: &[String],
    available_width: f64,
    rotation_angle_deg: f64,
    metrics: &TextMetrics,
) -> Option<usize>
Expand description

After rotation, check if labels still overlap and compute skip factor.

Two-pronged approach:

  1. Physical overlap: When rotated labels overlap, the renderer truncates them. Only skip when truncation would make labels too short to read (below min_readable_width).
  2. Readability thinning: When there are many rotated labels (> 14) that fill most of their allotted horizontal space, thin for visual clarity even though there is no physical overlap.