mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-25 14:44:39 +02:00
revert the smaller values thing
This commit is contained in:
parent
55b5eebc2a
commit
79615aed2f
@ -104,7 +104,7 @@ impl TimeGraph<'_> {
|
|||||||
if self.hide_x_labels {
|
if self.hide_x_labels {
|
||||||
Axis::default().bounds(adjusted_x_bounds)
|
Axis::default().bounds(adjusted_x_bounds)
|
||||||
} else {
|
} else {
|
||||||
let x_bound_left = ((-self.x_min) as u64).to_string();
|
let x_bound_left = ((-self.x_min) as u64 / 1000).to_string();
|
||||||
let x_bound_right = "0s";
|
let x_bound_right = "0s";
|
||||||
|
|
||||||
let x_labels = vec![
|
let x_labels = vec![
|
||||||
@ -230,7 +230,7 @@ mod test {
|
|||||||
fn create_time_graph() -> TimeGraph<'static> {
|
fn create_time_graph() -> TimeGraph<'static> {
|
||||||
TimeGraph {
|
TimeGraph {
|
||||||
title: " Network ".into(),
|
title: " Network ".into(),
|
||||||
x_min: -15.0,
|
x_min: -15000.0,
|
||||||
hide_x_labels: false,
|
hide_x_labels: false,
|
||||||
y_bounds: AxisBound::Max(100.5),
|
y_bounds: AxisBound::Max(100.5),
|
||||||
y_labels: &Y_LABELS,
|
y_labels: &Y_LABELS,
|
||||||
@ -254,7 +254,7 @@ mod test {
|
|||||||
let x_axis = tg.generate_x_axis();
|
let x_axis = tg.generate_x_axis();
|
||||||
|
|
||||||
let actual = Axis::default()
|
let actual = Axis::default()
|
||||||
.bounds(AxisBound::Min(-15.0))
|
.bounds(AxisBound::Min(-15000.0))
|
||||||
.labels(vec![Span::styled("15s", style), Span::styled("0s", style)])
|
.labels(vec![Span::styled("15s", style), Span::styled("0s", style)])
|
||||||
.style(style);
|
.style(style);
|
||||||
assert_eq!(x_axis.bounds, actual.bounds);
|
assert_eq!(x_axis.bounds, actual.bounds);
|
||||||
|
@ -46,7 +46,7 @@ impl TimeChart<'_> {
|
|||||||
.iter_along_base(times)
|
.iter_along_base(times)
|
||||||
.rev()
|
.rev()
|
||||||
.map(|(&time, &val)| {
|
.map(|(&time, &val)| {
|
||||||
let from_start = current_time.duration_since(time).as_secs_f64() * -1.0;
|
let from_start = current_time.duration_since(time).as_millis() as f64 * -1.0;
|
||||||
|
|
||||||
// XXX: Should this be generic over dataset.graph_type instead? That would allow us to move
|
// XXX: Should this be generic over dataset.graph_type instead? That would allow us to move
|
||||||
// transformations behind a type - however, that also means that there's some complexity added.
|
// transformations behind a type - however, that also means that there's some complexity added.
|
||||||
|
@ -180,7 +180,7 @@ impl Painter {
|
|||||||
let data = app_state.data_store.get_data();
|
let data = app_state.data_store.get_data();
|
||||||
|
|
||||||
let border_style = self.get_border_style(widget_id, app_state.current_widget.widget_id);
|
let border_style = self.get_border_style(widget_id, app_state.current_widget.widget_id);
|
||||||
let x_min = -(cpu_widget_state.current_display_time as f64) / 1000.0;
|
let x_min = -(cpu_widget_state.current_display_time as f64);
|
||||||
let hide_x_labels = should_hide_x_label(
|
let hide_x_labels = should_hide_x_label(
|
||||||
app_state.app_config_fields.hide_time,
|
app_state.app_config_fields.hide_time,
|
||||||
app_state.app_config_fields.autohide_time,
|
app_state.app_config_fields.autohide_time,
|
||||||
|
@ -62,7 +62,7 @@ impl Painter {
|
|||||||
|
|
||||||
if let Some(mem_state) = app_state.states.mem_state.widget_states.get_mut(&widget_id) {
|
if let Some(mem_state) = app_state.states.mem_state.widget_states.get_mut(&widget_id) {
|
||||||
let border_style = self.get_border_style(widget_id, app_state.current_widget.widget_id);
|
let border_style = self.get_border_style(widget_id, app_state.current_widget.widget_id);
|
||||||
let x_min = -(mem_state.current_display_time as f64) / 1000.0;
|
let x_min = -(mem_state.current_display_time as f64);
|
||||||
let hide_x_labels = should_hide_x_label(
|
let hide_x_labels = should_hide_x_label(
|
||||||
app_state.app_config_fields.hide_time,
|
app_state.app_config_fields.hide_time,
|
||||||
app_state.app_config_fields.autohide_time,
|
app_state.app_config_fields.autohide_time,
|
||||||
|
@ -67,7 +67,7 @@ impl Painter {
|
|||||||
let rx_points = &(shared_data.timeseries_data.rx);
|
let rx_points = &(shared_data.timeseries_data.rx);
|
||||||
let tx_points = &(shared_data.timeseries_data.tx);
|
let tx_points = &(shared_data.timeseries_data.tx);
|
||||||
let time = &(shared_data.timeseries_data.time);
|
let time = &(shared_data.timeseries_data.time);
|
||||||
let time_start = -(network_widget_state.current_display_time as f64) / 1000.0;
|
let time_start = -(network_widget_state.current_display_time as f64);
|
||||||
|
|
||||||
let border_style = self.get_border_style(widget_id, app_state.current_widget.widget_id);
|
let border_style = self.get_border_style(widget_id, app_state.current_widget.widget_id);
|
||||||
let hide_x_labels = should_hide_x_label(
|
let hide_x_labels = should_hide_x_label(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user