Skip to content

Commit

Permalink
Remove egui_plot as dependency from rerun-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored and teh-cmc committed Feb 7, 2024
1 parent 67e05c9 commit a519074
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/re_entity_db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ re_types_core.workspace = true

ahash.workspace = true
document-features.workspace = true
egui_plot.workspace = true
emath.workspace = true
getrandom.workspace = true
itertools.workspace = true
Expand Down
11 changes: 0 additions & 11 deletions crates/re_entity_db/src/entity_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,6 @@ impl std::fmt::Display for LegendCorner {
}
}

impl From<LegendCorner> for egui_plot::Corner {
fn from(value: LegendCorner) -> Self {
match value {
LegendCorner::LeftTop => egui_plot::Corner::LeftTop,
LegendCorner::RightTop => egui_plot::Corner::RightTop,
LegendCorner::LeftBottom => egui_plot::Corner::LeftBottom,
LegendCorner::RightBottom => egui_plot::Corner::RightBottom,
}
}
}

// ----------------------------------------------------------------------------

/// What kind of aggregation should be performed when the zoom-level on the X axis goes below 1.0?
Expand Down
16 changes: 12 additions & 4 deletions crates/re_space_view_bar_chart/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,11 @@ impl SpaceViewClass for BarChartSpaceView {

if *root_entity_properties.show_legend {
plot = plot.legend(
Legend::default().position(
Legend::default().position(to_egui_lot_corner(
root_entity_properties
.legend_location
.unwrap_or(LegendCorner::RightTop)
.into(),
),
.unwrap_or(LegendCorner::RightTop),
)),
);
}

Expand Down Expand Up @@ -282,3 +281,12 @@ impl SpaceViewClass for BarChartSpaceView {
Ok(())
}
}

fn to_egui_lot_corner(value: LegendCorner) -> egui_plot::Corner {
match value {
LegendCorner::LeftTop => egui_plot::Corner::LeftTop,
LegendCorner::RightTop => egui_plot::Corner::RightTop,
LegendCorner::LeftBottom => egui_plot::Corner::LeftBottom,
LegendCorner::RightBottom => egui_plot::Corner::RightBottom,
}
}

0 comments on commit a519074

Please sign in to comment.