Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove egui_plot as dependency from re_sdk #5099

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo 😭

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have fixed this quickly, but someone has force-pushed to my branch :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 🚢 🚢

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,
}
}
Loading