@@ -15,6 +15,7 @@ pub use proportion_bar::{ProportionBar, ProportionBarBlock};
1515pub use tree:: { TreeHorizontalSlice , TreeSkeletalComponent } ;
1616
1717use super :: { data_tree:: DataTree , size} ;
18+ use bon:: Builder ;
1819use std:: fmt:: Display ;
1920
2021/// Visualize a [`DataTree`].
@@ -32,17 +33,17 @@ use std::fmt::Display;
3233/// # use parallel_disk_usage::visualizer::{Visualizer, Direction, BarAlignment, ColumnWidthDistribution};
3334/// # fn _wrapper(create_data_tree: fn() -> DataTree<OsStringDisplay, Bytes>) {
3435/// let data_tree: DataTree<OsStringDisplay, Bytes> = create_data_tree();
35- /// let visualizer = Visualizer {
36- /// data_tree: &data_tree,
37- /// bytes_format: BytesFormat::MetricUnits,
38- /// direction: Direction::BottomUp,
39- /// bar_alignment: BarAlignment::Right,
40- /// column_width_distribution: ColumnWidthDistribution::total(100),
41- /// } ;
36+ /// let visualizer = Visualizer::builder()
37+ /// . data_tree( &data_tree)
38+ /// . bytes_format( BytesFormat::MetricUnits)
39+ /// . direction( Direction::BottomUp)
40+ /// . bar_alignment( BarAlignment::Right)
41+ /// . column_width_distribution( ColumnWidthDistribution::total(100))
42+ /// .build() ;
4243/// println!("{visualizer}");
4344/// # }
4445/// ```
45- #[ derive( Debug ) ]
46+ #[ derive( Debug , Builder ) ]
4647pub struct Visualizer < ' a , Name , Size >
4748where
4849 Name : Display ,
0 commit comments