@@ -16,6 +16,30 @@ use super::{data_tree::DataTree, size::Size};
1616use std:: { fmt:: Display , num:: NonZeroUsize } ;
1717
1818/// 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+ /// ```
1943#[ derive( Debug ) ]
2044pub struct Visualizer < ' a , Name , Data >
2145where
0 commit comments