minor cleanup

pull/663/head
Danny Gale 2 years ago
parent a9b0a13043
commit 3cca75b962

@ -11,7 +11,7 @@ use std::{
use tui::{
backend::{Backend, CrosstermBackend},
layout::{Constraint, Direction, Layout},
style::{Color, Modifier, Style},
style::{Color, Style},
widgets::{Block, Borders, Histogram},
Frame, Terminal,
};
@ -35,7 +35,7 @@ impl App {
}
fn on_tick(&mut self) {
for i in (0..self.size) {
for i in 0..self.size {
self.data[i] = self.rng.gen_range(0..100);
}
}

@ -5,7 +5,6 @@ use crate::{
symbols,
widgets::{Block, Widget},
};
use std::cmp::min;
use unicode_width::UnicodeWidthStr;
/// A bar chart specialized for showing histograms
@ -48,10 +47,6 @@ pub struct Histogram<'a> {
/// buckets[1] counts items where bucket_size <= x < 2*bucket_size
/// etc.
buckets: Vec<u64>,
/// the size of each bucket
bucket_size: u64,
/// the number of buckets
n_buckets: u64,
/// Value necessary for a bar to reach the maximum height (if no value is specified,
/// the maximum value in the data is taken as reference)
max: Option<u64>,
@ -69,8 +64,6 @@ impl<'a> Default for Histogram<'a> {
bar_style: Style::default(),
bar_gap: 1,
bar_set: symbols::bar::NINE_LEVELS,
bucket_size: 0,
n_buckets: 0,
buckets: Vec::new(),
value_style: Default::default(),
label_style: Default::default(),

Loading…
Cancel
Save