Changeset 2054

Show
Ignore:
Timestamp:
10-10-11 12:01:51 (3 years ago)
Author:
taco@…
Message:

visualization/VisualizeController.groovy, getFields request now checks whether the GSCF-related fields it would return, refer to any data other than null, and no longer returns those fields that do refer only to null

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/visualization/VisualizeController.groovy

    r2047 r2054  
    230230                if( type == "domainfields" )  
    231231                        collection = domainObjectCallback( category )?.giveDomainFields(); 
    232                 else  
     232                else 
    233233                        collection = templateObjectCallback( category, study )?.template?.fields 
    234234 
     
    237237        // Formatting the data 
    238238        fields += formatGSCFFields(type, collection, source, category) 
     239 
     240        // Here we will remove those fields, whose set of datapoints only contain null 
     241        def fieldsToBeRemoved = [] 
     242        fields.each{ field -> 
     243            def fieldData = getFieldData( study, study.samples, field.id ) 
     244            fieldData.removeAll([null]) 
     245            if(fieldData==[]){ 
     246                // Field only contained nulls, so don't show it as a visualization option 
     247                fieldsToBeRemoved << field 
     248            } 
     249        } 
     250        fields.removeAll(fieldsToBeRemoved) 
    239251 
    240252        return fields