MCPcopy Index your code
hub / github.com/askanium/rustplotlib / Scale

Interface Scale

src/scales/mod.rs:12–35  ·  view source on GitHub ↗

The Scale trait defines common operations on all scales.

Source from the content-addressed store, hash-verified

10
11/// The Scale trait defines common operations on all scales.
12pub trait Scale<T> {
13 /// Get the type of the scale.
14 fn get_type(&self) -> ScaleType;
15
16 /// Get the range value for the given domain entry.
17 fn scale(&self, domain: &T) -> f32;
18
19 /// Get the bandwidth (if present).
20 fn bandwidth(&self) -> Option<f32>;
21
22 /// Get the start range value.
23 fn range_start(&self) -> f32;
24
25 /// Get the end range value.
26 fn range_end(&self) -> f32;
27
28 /// Check whether the range is in reversed order, meaning the start is greater than the end.
29 fn is_range_reversed(&self) -> bool {
30 self.range_start() > self.range_end()
31 }
32
33 /// Get the list of ticks that represent the scale on a chart axis.
34 fn get_ticks(&self) -> Vec<T>;
35}

Callers 3

load_dataMethod · 0.80
load_dataMethod · 0.80
load_dataMethod · 0.80

Implementers 2

linear.rssrc/scales/linear.rs
band.rssrc/scales/band.rs

Calls

no outgoing calls

Tested by

no test coverage detected