pub fn compute_ticks(ideal_num_steps: u32, good_ticks: &[u32], range: [f64; 2]) -> TickInfo<f64> {
    let (step, good_normalized_step) = find_good_step(good_ticks, ideal_num_steps, range);
    let (start_step, step_num) = get_range_info(step, range);

    let display_relative = tick_fmt::should_fmt_offset(
        start_step,
        start_step + ((step_num - 1) as f64) * step,
        step,
    );

    let first_tick = if display_relative { 0.0 } else { start_step };

    let mut ticks = Vec::with_capacity(usize::try_from(step_num).unwrap());
    for a in 0..step_num {
        let position = start_step + step * (a as f64);
        let value = first_tick + step * (a as f64);

        ticks.push(Tick { position, value });
    }

    let dash_multiple = good_normalized_step;

    TickInfo {
        ticks,
        dash_multiple,
        step,
        start_step,
        display_relative: display_relative.then(|| start_step),
    }
}
/// Generate out good tick interval defaults for `f64`.
Generate out good tick interval defaults for `f64`.
Generate out good tick interval defaults for ` f64 ` .
pub fn compute_ticks(ideal_num_steps: u32, good_ticks: &[u32], range: [f64; 2]) -> TickInfo<f64> {
    let (step, good_normalized_step) = find_good_step(good_ticks, ideal_num_steps, range);
    let (start_step, step_num) = get_range_info(step, range);
    let display_relative = tick_fmt::should_fmt_offset(
        start_step,
        start_step + ((step_num - 1) as f64) * step,
        step,
    );
    let first_tick = if display_relative { 0.0 } else { start_step };
    let mut ticks = Vec::with_capacity(usize::try_from(step_num).unwrap());
    for a in 0..step_num {
        let position = start_step + step * (a as f64);
        let value = first_tick + step * (a as f64);
        ticks.push(Tick { position, value });
    }
    let dash_multiple = good_normalized_step;
    TickInfo {
        ticks,
        dash_multiple,
        step,
        start_step,
        display_relative: display_relative.then(|| start_step),
    }
}
pub fn compute_ticks ( ideal_num_steps : u32 , good_ticks : & [ u32 ] , range : [ f64 ; 2 ] ) -> TickInfo < f64 > { let ( step , good_normalized_step ) = find_good_step ( good_ticks , ideal_num_steps , range ) ; let ( start_step , step_num ) = get_range_info ( step , range ) ; let display_relative = tick_fmt :: should_fmt_offset ( start_step , start_step + ( ( step_num - 1 ) as f64 ) * step , step , ) ; let first_tick = if display_relative { 0.0 } else { start_step } ; let mut ticks = Vec :: with_capacity ( usize :: try_from ( step_num ) . unwrap ( ) ) ; for a in 0 .. step_num { let position = start_step + step * ( a as f64 ) ; let value = first_tick + step * ( a as f64 ) ; ticks . push ( Tick { position , value } ) ; } let dash_multiple = good_normalized_step ; TickInfo { ticks , dash_multiple , step , start_step , display_relative : display_relative . then ( | | start_step ) , } }
Generate out good tick interval defaults for `f64`.
Generate out good tick interval defaults for ` f64 ` .
ideal_num_steps
u32
good_ticks
&[u32]
range
[f64; 2]