Imports name this capability’s declared dependencies, which fune builds next to it in your project; each one links to its page.
use super::funejson::Value; ← the fune runtime: the JSON value the test vectors use; fune build keeps it only where a signature takes one
use super::charts_scale_band_scale::{band_position, band_strings, check_align, check_outer}; ← bandScale, another function of this group · built into the same file, even by a slim install
use super::charts_scale_linear_scale::floats; ← linearScale, another function of this group · built into the same file, even by a slim install
use super::math_round_float::round_float; ← from math.round-float ^1.0.0 · built alongside by fune
/// The position of a category on an axis of evenly spaced points, as
/// d3.scalePoint: a band scale with inner padding 1, so bands have no width.
///
/// # Panics
/// Panics on an empty or repeating domain, a value not in it, a range without
/// two values, or padding or align out of bounds.
pub fn point_scale(domain: &[String], range: &[f64], value: &str, padding: f64, align: f64) -> f64 {
check_outer(padding, "padding");
check_align(align);
round_float(band_position(domain, range, value, 1.0, padding, align).0, 6)
}
pub fn fune_vector(args: &[Value]) -> Value {
Value::Float(point_scale(&band_strings(&args[0]), &floats(&args[1]), args[2].as_str(), args[3].as_f64(), args[4].as_f64()))
}