axis-ticks

Crates.ioaxis-ticks
lib.rsaxis-ticks
version0.1.0
sourcesrc
created_at2020-09-24 21:12:40.191538
updated_at2020-09-24 21:12:40.191538
descriptionGenerates an array of nicely rounded values between two numbers for which are ideal for positioning axis labels and grid-lines
homepage
repositoryhttps://github.com/timfish/axis-ticks
max_upload_size
id292663
size9,613
Tim Fish (timfish)

documentation

README

axis-ticks

A port of d3-ticks, part of the JavaScript D3 plotting library.

Generates an array of nicely rounded values between two numbers for which are ideal for positioning axis labels and grid-lines.

let ticks = axis_ticks::ticks(-0.125, 0.25, 10);

assert_eq!(
    ticks,
    [-0.15, -0.1, -0.05, 0.0, 0.05, 0.1, 0.15, 0.2, 0.25]
);
Commit count: 5

cargo fmt