MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / default_formatter

Function default_formatter

src/ticks.rs:46–54  ·  view source on GitHub ↗

A default formatter that displays values with reasonable precision.

(mark: Tick)

Source from the content-addressed store, hash-verified

44///
45/// ## Arguments
46/// - `min`: The minimum value of the axis in world coordinates.
47/// - `max`: The maximum value of the axis in world coordinates.
48/// - `width_pixels`: The width of the plot along this axis in pixels.
49///
50/// ## Returns
51/// A vector of `Tick` structs representing the positions and weights of ticks along the axis.
52pub type TickProducer = Arc<dyn Fn(f64, f64, f64) -> Vec<Tick> + Send + Sync>;
53
54/// A default formatter that displays values with reasonable precision.
55pub fn default_formatter(mark: Tick) -> String {
56 let log_step = mark.step_size.log10();
57 if log_step >= 0.0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected