@@ -516,56 +516,6 @@ def get_legacy_sites_by_build(self, site_type, build):
516516 def get_display_sites (self , site_type ):
517517 return self .display_sites .get (site_type , [])
518518
519- def get_preferred_visualization (self , datatype_extension ):
520- """
521- Get the preferred visualization mapping for a specific datatype extension.
522- Returns a dictionary with 'visualization' and 'default_params' keys, or None if no mapping exists.
523-
524- Preferred visualizations are defined inline within each datatype definition in the
525- datatypes_conf.xml configuration file. These mappings determine which visualization plugin
526- should be used by default when viewing datasets of a specific type.
527-
528- If no direct mapping exists for the extension, this method will walk up the inheritance
529- chain to find a preferred visualization from a parent datatype class.
530-
531- Example configuration:
532- <datatype extension="bam" type="galaxy.datatypes.binary:Bam" mimetype="application/octet-stream" display_in_upload="true">
533- <visualization plugin="igv" />
534- </datatype>
535- """
536- direct_mapping = self .visualization_mappings .get (datatype_extension )
537- if direct_mapping :
538- return direct_mapping
539-
540- current_datatype = self .get_datatype_by_extension (datatype_extension )
541- if not current_datatype :
542- return None
543-
544- # Use the same mapping approach as the datatypes API for consistency
545- from galaxy .managers .datatypes import view_mapping
546-
547- mapping_data = view_mapping (self )
548-
549- current_class_name = mapping_data .ext_to_class_name .get (datatype_extension )
550- if not current_class_name :
551- return None
552-
553- current_class_mappings = mapping_data .class_to_classes .get (current_class_name , {})
554-
555- # Find parent extensions that have preferred visualizations
556- for ext , visualization_mapping in self .visualization_mappings .items ():
557- if ext == datatype_extension :
558- continue
559-
560- parent_class_name = mapping_data .ext_to_class_name .get (ext )
561- if parent_class_name and parent_class_name in current_class_mappings :
562- self .log .debug (
563- f"Found inherited preferred visualization '{ visualization_mapping ['visualization' ]} ' for datatype '{ datatype_extension } ' from parent '{ ext } '"
564- )
565- return visualization_mapping
566-
567- return None
568-
569519 def get_all_visualization_mappings (self ):
570520 """
571521 Get all datatype to visualization mappings.
0 commit comments