@@ -10,6 +10,7 @@ use re_types_blueprint::blueprint::components::VisualizerOverrides;
10
10
use re_ui:: { list_item, UiExt as _} ;
11
11
use re_viewer_context:: {
12
12
DataResult , QueryContext , SpaceViewClassExt as _, UiLayout , ViewContext , ViewSystemIdentifier ,
13
+ VisualizerSystem ,
13
14
} ;
14
15
use re_viewport_blueprint:: SpaceViewBlueprint ;
15
16
@@ -111,18 +112,30 @@ pub fn visualizer_ui_impl(
111
112
112
113
for & visualizer_id in active_visualizers {
113
114
let default_open = true ;
114
- ui. list_item ( )
115
- . interactive ( false )
116
- . show_hierarchical_with_children (
117
- ui,
118
- ui. make_persistent_id ( visualizer_id) ,
119
- default_open,
120
- list_item:: LabelContent :: new ( visualizer_id. as_str ( ) )
115
+
116
+ // List all components that the visualizer may consume.
117
+ if let Ok ( visualizer) = ctx. visualizer_collection . get_by_identifier ( visualizer_id) {
118
+ ui. list_item ( )
119
+ . interactive ( false )
120
+ . show_hierarchical_with_children (
121
+ ui,
122
+ ui. make_persistent_id ( visualizer_id) ,
123
+ default_open,
124
+ list_item:: LabelContent :: new ( visualizer_id. as_str ( ) )
125
+ . min_desired_width ( 150.0 )
126
+ . with_buttons ( |ui| remove_visualizer_button ( ui, visualizer_id) )
127
+ . always_show_buttons ( true ) ,
128
+ |ui| visualizer_components ( ctx, ui, data_result, visualizer) ,
129
+ ) ;
130
+ } else {
131
+ ui. list_item_flat_noninteractive (
132
+ list_item:: LabelContent :: new ( format ! ( "{visualizer_id} (unknown visualizer)" ) )
133
+ . weak ( true )
121
134
. min_desired_width ( 150.0 )
122
135
. with_buttons ( |ui| remove_visualizer_button ( ui, visualizer_id) )
123
136
. always_show_buttons ( true ) ,
124
- |ui| visualizer_components ( ctx, ui, data_result, visualizer_id) ,
125
137
) ;
138
+ }
126
139
}
127
140
} ) ;
128
141
}
@@ -141,7 +154,7 @@ fn visualizer_components(
141
154
ctx : & ViewContext < ' _ > ,
142
155
ui : & mut egui:: Ui ,
143
156
data_result : & DataResult ,
144
- visualizer_id : ViewSystemIdentifier ,
157
+ visualizer : & dyn VisualizerSystem ,
145
158
) {
146
159
// Helper for code below
147
160
fn non_empty_component_batch_raw (
@@ -157,14 +170,6 @@ fn visualizer_components(
157
170
}
158
171
}
159
172
160
- // List all components that the visualizer may consume.
161
- let Ok ( visualizer) = ctx. visualizer_collection . get_by_identifier ( visualizer_id) else {
162
- re_log:: warn!(
163
- "Failed to resolve visualizer identifier {visualizer_id}, to a visualizer implementation"
164
- ) ;
165
- return ;
166
- } ;
167
-
168
173
let query_info = visualizer. visualizer_query_info ( ) ;
169
174
170
175
let store_query = ctx. current_query ( ) ;
0 commit comments