Skip to main content

Module scale

Module scale 

Source
Expand description

Scales and axis ticks: linear value scales, “nice” numeric ticks and calendar-aware time ticks.

Structs§

LinearScale
Maps a value domain linearly onto an output range (pixels, dots or cells).
TimeTick
A labelled tick on a time axis.

Functions§

format_value
Formats v with just enough decimals to tell ticks step apart. Values of a million or more use a compact k, M, B or T suffix.
nice_step
A step of 1, 2 or 5 times a power of ten that splits span into about target intervals.
nice_ticks
Tick values at multiples of nice_step inside [min, max], with the step used.
time_ticks
About target ticks between start and end, on whole local seconds, minutes, hours, days, months or years in tz, labelled for that step.