mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-30 00:55:00 +02:00
Tweaked network graph generation a bit to match master
This commit is contained in:
parent
840b0cccc8
commit
0fdab76cf5
@ -119,11 +119,14 @@ impl DataState {
|
|||||||
|
|
||||||
let mut new_joining_points = Vec::new();
|
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 {
|
new_joining_points.push(network::NetworkJoinPoint {
|
||||||
rx: prev_data.0.rx as f64 + rx_diff / 100.0 * idx as f64,
|
rx: prev_data.0.rx as f64
|
||||||
tx: prev_data.0.tx as f64 + tx_diff / 100.0 * idx as f64,
|
+ rx_diff / num_points as f64 * (num_points - idx) as f64,
|
||||||
time_offset_milliseconds: time_gap / 100.0 * (100 - 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)
|
Some(new_joining_points)
|
||||||
|
@ -131,11 +131,11 @@ fn gen_n_colours(num_to_gen: i32) -> Vec<Color> {
|
|||||||
|
|
||||||
// Generate colours
|
// Generate colours
|
||||||
let mut colour_vec: Vec<Color> = vec![
|
let mut colour_vec: Vec<Color> = vec![
|
||||||
Color::LightCyan,
|
|
||||||
Color::LightYellow,
|
|
||||||
Color::Red,
|
Color::Red,
|
||||||
Color::Green,
|
Color::LightYellow,
|
||||||
Color::LightMagenta,
|
Color::LightMagenta,
|
||||||
|
Color::LightCyan,
|
||||||
|
Color::Green,
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut h: f32 = 0.4; // We don't need random colours... right?
|
let mut h: f32 = 0.4; // We don't need random colours... right?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user