scale

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesRateFormatter added in v0.5.0

func BytesRateFormatter(abs bool) func(float64) string

BytesRateFormatter returns a Y-axis label formatter function for bytes per second. If abs is true, negative values are formatted without a minus sign (ideal for TX / Write).

func FormatBytes added in v0.5.0

func FormatBytes(v float64) string

FormatBytes formats a byte count into a human-readable string (e.g. "1 KB", "1.5 MB").

func FormatBytesRate added in v0.5.0

func FormatBytesRate(v float64) string

FormatBytesRate formats a throughput value in bytes per second (e.g. "1 KB/s", "100 MB/s").

func FormatBytesRateAbs added in v0.5.0

func FormatBytesRateAbs(v float64) string

FormatBytesRateAbs formats a throughput value in bytes per second using its absolute value (e.g. "50 MB/s"). Ideal for mirror/symmetric Y-axes (RX/TX, Read/Write).

func FormatTick

func FormatTick(v float64) string

FormatTick formats a tick value concisely: up to 4 significant digits without trailing zeros.

func NiceTicks

func NiceTicks(min, max float64, maxTicks int) []float64

NiceTicks returns pleasant tick values covering [min, max]. Heckbert algorithm: step = 1 / 2 / 2.5 / 5 / 10 * 10^k.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL