Skip to main contentModule labels
Source - LabelStrategyConfig
- Configuration for label strategy determination.
- TextMetrics
- Text-shaping parameters that influence the rendered width of a label.
- LabelStrategy
- The strategy selected for rendering labels.
- approximate_text_width
- Approximate text width in pixels using a character-width table.
Calibrated for ~12px font. For other sizes, use
approximate_text_width_at. - approximate_text_width_at
- Approximate text width scaled for a specific font size.
- compute_skip_factor
- After rotation, check if labels still overlap and compute skip factor.
- format_tick_value_si
- Format a numeric tick value with SI suffixes for large magnitudes.
Returns compact labels like “1.5M”, “200K”, “3B” based on the tick step.
- measure_text
- Measure the rendered width of a text string under the given metrics.
- strategic_indices
- Select strategic indices for sampled label display.
Always includes first and last; evenly distributes the rest.
- truncate_label
- Truncate a label to fit within max_width, adding ellipsis.
- truncate_label_with_metrics
- Truncate a label to fit within
max_width, adding ellipsis, measuring
glyphs under the provided metrics.