diff --git a/core/src/modules/block_dag.rs b/core/src/modules/block_dag.rs index 6fbadef..0dbc594 100644 --- a/core/src/modules/block_dag.rs +++ b/core/src/modules/block_dag.rs @@ -202,7 +202,8 @@ impl ModuleT for BlockDag { let mut lines_parent = Vec::new(); let mut lines_vspc = Vec::new(); - let daa_margin = 10; + let daa_range = (self.plot_bounds.max()[0] - self.plot_bounds.min()[0]) * 0.4; + let daa_margin = daa_range as u64; let daa_min = self.plot_bounds.min()[0] as u64 - daa_margin; let daa_max = self.plot_bounds.max()[0] as u64 + daa_margin; diff --git a/core/src/primitives/block.rs b/core/src/primitives/block.rs index 4bd8728..58d8257 100644 --- a/core/src/primitives/block.rs +++ b/core/src/primitives/block.rs @@ -92,8 +92,8 @@ impl DaaBucket { pub fn update(&mut self, settings: &BlockDagGraphSettings) { self.blocks - .sort_by(|a, b| a.src_y.partial_cmp(&b.src_y).unwrap()); - // .sort_by(|a, b| a.dst_y.partial_cmp(&b.dst_y).unwrap()); + // .sort_by(|a, b| a.src_y.partial_cmp(&b.src_y).unwrap()); + .sort_by(|a, b| a.dst_y.partial_cmp(&b.dst_y).unwrap()); let y_distance = settings.y_dist; let len = self.blocks.len(); if let Some(mut vspc_idx) = self.blocks.iter().position(|block| block.vspc) { @@ -130,10 +130,10 @@ impl DaaBucket { block.dst_y = y; }); } else { - let mut y = len as f64 * y_distance / 2.0; + let mut y = -(len as f64 * y_distance / 2.0); (0..len).for_each(|idx| { let block = &mut self.blocks[idx]; - y -= y_distance; + y += y_distance; block.dst_y = y; }); }