@@ -172,25 +172,24 @@ def set_tree(self, model=None):
172172
173173 self ._update_main_area ()
174174
175- # The target class can also be passed from the meta properties
176- # This must be set after `_update_target_class_combo`
177- if hasattr (model , 'meta_target_class_index' ):
178- self .target_class_index = model .meta_target_class_index
179- self .update_colors ()
180-
181- # Get meta variables describing what the settings should look like
182- # if the tree is passed from the Pythagorean forest widget.
183- if hasattr (model , 'meta_size_calc_idx' ):
184- self .size_calc_idx = model .meta_size_calc_idx
185- self .update_size_calc ()
186-
187- # TODO There is still something wrong with this
188- # if hasattr(model, 'meta_depth_limit'):
189- # self.depth_limit = model.meta_depth_limit
190- # self.update_depth()
191-
192175 self .openContext (self .model )
193176
177+ self .update_depth ()
178+
179+ # The forest widget sets the following attributes on the tree,
180+ # describing the settings on the forest widget. To keep the tree
181+ # looking the same as on the forest widget, we prefer these settings to
182+ # context settings, if set.
183+ if hasattr (model , "meta_target_class_index" ):
184+ self .target_class_index = model .meta_target_class_index
185+ self .update_colors ()
186+ if hasattr (model , "meta_size_calc_idx" ):
187+ self .size_calc_idx = model .meta_size_calc_idx
188+ self .update_size_calc ()
189+ if hasattr (model , "meta_depth_limit" ):
190+ self .depth_limit = model .meta_depth_limit
191+ self .update_depth ()
192+
194193 self .Outputs .annotated_data .send (create_annotated_table (self .data , None ))
195194
196195 def clear (self ):
0 commit comments