Skip to content

Commit

Permalink
feat: live scale of histogram axes
Browse files Browse the repository at this point in the history
  • Loading branch information
carrascomj committed Oct 19, 2023
1 parent 12147fb commit e386105
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/aesthetics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ fn plot_side_hist(
HistTag {
side: geom.side.clone(),
node_id: axis.node_id,
follow_scale: true,
},
(*is_met).clone(),
));
Expand Down Expand Up @@ -606,6 +607,7 @@ fn plot_side_box(
HistTag {
side: geom.side.clone(),
node_id: axis.node_id,
follow_scale: false,
},
ColorListener {
value: colors.0[index],
Expand Down Expand Up @@ -673,6 +675,7 @@ fn plot_hover_hist(
HistTag {
side: geom.side.clone(),
node_id: hover.node_id,
follow_scale: false,
},
VisCondition {
condition: aes.condition.clone(),
Expand Down Expand Up @@ -834,6 +837,9 @@ fn follow_the_axes(
if (axis.node_id == hist.node_id) & (hist.side == axis.side) {
trans.translation = axis_trans.translation;
trans.rotation = axis_trans.rotation;
if hist.follow_scale {
trans.scale.x = axis_trans.scale.x;
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/geom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub struct GeomMetabolite {
pub struct HistTag {
pub side: Side,
pub node_id: u64,
pub follow_scale: bool,
}

#[derive(Component)]
Expand Down

0 comments on commit e386105

Please sign in to comment.