diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2020-08-28 16:30:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 16:30:24 -0400 |
commit | 9a11e77aa057bb4b9d3d31d3c70ceab7136eedaf (patch) | |
tree | 64d32c8bd0e4ed43c9af3f34137d905e5fe0f99f /src/canvas.rs | |
parent | 81ec7c311b5cf915032c473b411c8a1d0bb13228 (diff) |
feature: Adaptive network widget (#206)
Allows the network widget graph to grow/shrink with current data, rather than using a static size.
Diffstat (limited to 'src/canvas.rs')
-rw-r--r-- | src/canvas.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/canvas.rs b/src/canvas.rs index c0c65cf2..e6538001 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -28,14 +28,17 @@ mod dialogs; mod drawing_utils; mod widgets; +/// Point is of time, data +type Point = (f64, f64); + #[derive(Default)] pub struct DisplayableData { pub rx_display: String, pub tx_display: String, pub total_rx_display: String, pub total_tx_display: String, - pub network_data_rx: Vec<(f64, f64)>, - pub network_data_tx: Vec<(f64, f64)>, + pub network_data_rx: Vec<Point>, + pub network_data_tx: Vec<Point>, pub disk_data: Vec<Vec<String>>, pub temp_sensor_data: Vec<Vec<String>>, pub single_process_data: Vec<ConvertedProcessData>, // Contains single process data @@ -45,8 +48,8 @@ pub struct DisplayableData { pub swap_label_percent: String, pub mem_label_frac: String, pub swap_label_frac: String, - pub mem_data: Vec<(f64, f64)>, - pub swap_data: Vec<(f64, f64)>, + pub mem_data: Vec<Point>, + pub swap_data: Vec<Point>, pub cpu_data: Vec<ConvertedCpuData>, pub battery_data: Vec<ConvertedBatteryData>, } |