diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2021-04-04 05:38:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-04 05:38:57 -0400 |
commit | eb6a737d3430920061cd5e54bf4dc40da21f1fc5 (patch) | |
tree | b329c4b729f31de80405b3a2d015c1525d80d618 /src/units | |
parent | 40f4c796f8d1832e7ef9db7c87db558a1ce12b62 (diff) |
feature: Rework network y-axis, linear interpolation for off-screen data (#437)
Rewrite of the y-axis labeling and scaling for the network widget, along with more customization. This still has one step to be optimized (cache results so we don't have to recalculate the legend each time), but will be done in another PR for sake of this one being too large already.
Furthermore, this change adds linear interpolation at the 0 point in the case a data point shoots too far back - this seems to have lead to ugly gaps to the left of graphs in some cases, because the left hand limit was not big enough for the data point. We address this by grabbing values just outside the time range and linearly interpolating at the leftmost limit. This affects all graph widgets (CPU, mem, network).
This can be optimized, and will hopefully be prior to release in a separate change.
Diffstat (limited to 'src/units')
-rw-r--r-- | src/units/data_units.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/units/data_units.rs b/src/units/data_units.rs new file mode 100644 index 00000000..d0b7c1e1 --- /dev/null +++ b/src/units/data_units.rs @@ -0,0 +1,5 @@ +#[derive(Debug, Clone)] +pub enum DataUnit { + Byte, + Bit, +} |