Skip to content

module

scale

Scales: from data values to positions.

Structs

  • Band

    Evenly sized positions along a length, for categories.

  • Linear

    A continuous scale.

Functions

label_stride

pub fn label_stride(n: usize, width: f32, label_w: f32) -> usize

Which of n evenly placed labels to show, so label_w wide labels don't touch in width.

nice_ticks

pub fn nice_ticks(min: f64, max: f64, count: usize) -> Vec<f64>

About count round tick values covering min..=max.

time_ticks

pub fn time_ticks(min: f64, max: f64, count: usize) -> Vec<(f64, String)>

Round-number ticks on a time axis (decimal years), each labelled.

times

pub fn times(xs: &[String]) -> Option<Vec<f64>>

A column of date text as decimal years.