@@ -16,6 +16,30 @@ use super::{data_tree::DataTree, size::Size};
16
16
use std:: { fmt:: Display , num:: NonZeroUsize } ;
17
17
18
18
/// Visualize a [`DataTree`].
19
+ ///
20
+ /// The fields of the struct are the construction parameters of the ASCII chart.
21
+ /// The [`Display`] trait can be used to create the ASCII chart.
22
+ ///
23
+ /// **Example:**
24
+ ///
25
+ /// ```no_run
26
+ /// # use parallel_disk_usage::data_tree::DataTree;
27
+ /// # use parallel_disk_usage::os_string_display::OsStringDisplay;
28
+ /// # use parallel_disk_usage::size::Bytes;
29
+ /// # use parallel_disk_usage::bytes_format::BytesFormat;
30
+ /// # use parallel_disk_usage::visualizer::{Visualizer, Direction, ColumnWidthDistribution};
31
+ /// # fn _wrapper(create_data_tree: fn() -> DataTree<OsStringDisplay, Bytes>) {
32
+ /// let data_tree: DataTree<OsStringDisplay, Bytes> = create_data_tree();
33
+ /// let visualizer = Visualizer {
34
+ /// data_tree: &data_tree,
35
+ /// bytes_format: BytesFormat::MetricUnits,
36
+ /// direction: Direction::BottomUp,
37
+ /// column_width_distribution: ColumnWidthDistribution::total(100),
38
+ /// max_depth: std::num::NonZeroUsize::new(10).unwrap(),
39
+ /// };
40
+ /// println!("{}", visualizer);
41
+ /// # }
42
+ /// ```
19
43
#[ derive( Debug ) ]
20
44
pub struct Visualizer < ' a , Name , Data >
21
45
where
0 commit comments