Skip to content

struct

Band

pub struct Band {
    pub start: f32,
    pub step: f32,
    pub width: f32,
}

Evenly sized positions along a length, for categories.

Fields

start

pub start: f32

Where the first step starts.

step

pub step: f32

The distance between steps.

width

pub width: f32

The mark's width within a step.

Methods

new

pub fn new(count: usize, range: (f32, f32), gap: f32) -> Band

Bands for count categories across range, with gap (a fraction of a band) between them.

left

pub fn left(&self, i: usize) -> f32

The left edge of band i.

center

pub fn center(&self, i: usize) -> f32

The centre of band i.

Trait implementations