Tweaked network graph generation a bit to match master

This commit is contained in:
ClementTsang 2020-01-21 22:59:42 -05:00
parent 840b0cccc8
commit 0fdab76cf5
2 changed files with 10 additions and 7 deletions

View file

@ -119,11 +119,14 @@ impl DataState {
let mut new_joining_points = Vec::new();
for idx in 0..100 {
let num_points = 50;
for idx in (0..num_points).rev() {
new_joining_points.push(network::NetworkJoinPoint {
rx: prev_data.0.rx as f64 + rx_diff / 100.0 * idx as f64,
tx: prev_data.0.tx as f64 + tx_diff / 100.0 * idx as f64,
time_offset_milliseconds: time_gap / 100.0 * (100 - idx) as f64,
rx: prev_data.0.rx as f64
+ rx_diff / num_points as f64 * (num_points - idx) as f64,
tx: prev_data.0.tx as f64
+ tx_diff / num_points as f64 * (num_points - idx) as f64,
time_offset_milliseconds: time_gap / num_points as f64 * idx as f64,
});
}
Some(new_joining_points)

View file

@ -131,11 +131,11 @@ fn gen_n_colours(num_to_gen: i32) -> Vec<Color> {
// Generate colours
let mut colour_vec: Vec<Color> = vec![
Color::LightCyan,
Color::LightYellow,
Color::Red,
Color::Green,
Color::LightYellow,
Color::LightMagenta,
Color::LightCyan,
Color::Green,
];
let mut h: f32 = 0.4; // We don't need random colours... right?