Skip to content

Commit 9c95786

Browse files
authored
Fix plot legend items disappearing when they have the same name
### Related * requires emilk/egui_plot#231 * Fixes RR-3717 <img width="692" height="709" alt="image" src="https://github.com/user-attachments/assets/421d50db-bc63-4b45-a138-5c4fed713d9d" /> Source-Ref: a6fc782b9b65fa87c5cb832b9a771ccd09a5b941
1 parent 6484e5a commit 9c95786

26 files changed

+52
-49
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,9 +3437,9 @@ dependencies = [
34373437

34383438
[[package]]
34393439
name = "egui_plot"
3440-
version = "0.34.0"
3440+
version = "0.34.1"
34413441
source = "registry+https://github.com/rust-lang/crates.io-index"
3442-
checksum = "33233ffc010fd450381805bbbebecbbb82f077de7712ddc439f0b20effd42db7"
3442+
checksum = "67fc9b427a837264e55381a5cade6e28fe83ac5b165a61b9c888548c732a9c95"
34433443
dependencies = [
34443444
"ahash",
34453445
"egui",

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ emath = "0.33.3"
181181
# other egui crates:
182182
egui_commonmark = { version = "0.22.0", default-features = false }
183183
egui_dnd = { version = "0.14.0" }
184-
egui_plot = "0.34.0" # https://github.com/emilk/egui_plot
184+
egui_plot = "0.34.1" # https://github.com/emilk/egui_plot
185185
egui_table = "0.6.0" # https://github.com/rerun-io/egui_table
186186
egui_tiles = "0.14.1" # https://github.com/rerun-io/egui_tiles
187187
walkers = "0.50.0"
@@ -877,8 +877,8 @@ unnecessary_debug_formatting = "allow"
877877
# emath = { path = "../../egui/crates/emath" }
878878
# wgpu = { path = "../../wgpu/wgpu" }
879879

880-
# egui_plot = { git = "https://github.com/emilk/egui_plot.git", branch = "main" }
881-
# egui_plot = { path = "../../egui_plot/egui_plot" }
880+
#egui_plot = { git = "https://github.com/emilk/egui_plot.git", branch = "legend-id-keying" }
881+
#egui_plot = { path = "../../../egui_plot/egui_plot" }
882882

883883
# egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", branch = "emilk/update-egui" }
884884
# egui_tiles = { path = "../egui_tiles" }

crates/viewer/re_selection_panel/src/visualizer_ui.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,7 @@ fn current_component_source(
711711
}
712712
}
713713
None => {
714-
re_log::debug_assert!(
715-
false,
714+
re_log::debug_panic!(
716715
"Expected component {component:?} to be resolved to a source kind in the query result",
717716
);
718717
VisualizerComponentSource::Default

crates/viewer/re_view_bar_chart/src/view_class.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ impl ViewClass for BarChartView {
207207
plot = plot.legend(
208208
Legend::default()
209209
.position(legend_corner.into())
210+
.follow_insertion_order(true)
211+
.grouping(egui_plot::LegendGrouping::ById)
210212
.color_conflict_handling(ColorConflictHandling::PickFirst),
211213
);
212214
}

crates/viewer/re_view_time_series/src/view_class.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,8 @@ impl ViewClass for TimeSeriesView {
657657
plot = plot.legend(
658658
Legend::default()
659659
.position(legend_corner.into())
660+
.follow_insertion_order(true)
661+
.grouping(egui_plot::LegendGrouping::ById)
660662
.color_conflict_handling(ColorConflictHandling::PickFirst),
661663
);
662664
}
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)