Skip to content

Commit

Permalink
visualizer updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jan 8, 2024
1 parent 3da1971 commit 958c07a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion core/src/modules/block_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions core/src/primitives/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
});
}
Expand Down

0 comments on commit 958c07a

Please sign in to comment.