Changeset 2091


Ignore:
Timestamp:
Nov 7, 2011, 4:28:37 PM (11 years ago)
Author:
tjeerd@…
Message:

VIS-36 fixed, added field.unit to the fields and show them in the graphs

File:
1 edited

Legend:

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

    r2090 r2091  
    194194        def urlVars = "assayToken="+assay.assayUUID
    195195        try {
    196             callUrl = ""+assay.module.url + "/rest/getMeasurements/query?"+urlVars
     196            callUrl = ""+assay.module.url + "/rest/getMeasurementMetaData/query?"+urlVars
    197197            def json = moduleCommunicationService.callModuleRestMethodJSON( assay.module.url /* consumer */, callUrl );
    198 
     198            println(callUrl)
    199199            def collection = []
    200200            json.each{ jason ->
     
    204204            collection.each { field ->
    205205                // For getting this field from this assay
    206                 fields << [ "id": createFieldId( id: field, name: field, source: assay.id, type: ""+assay.name), "source": source, "category": ""+assay.name, "name": field ]
     206                fields << [ "id": createFieldId( id: field.name, name: field.name, source: ""+assay.id, type: ""+assay.name, unit: (field.unit?:"")), "source": source, "category": ""+assay.name, "name": field.name + (field.unit?" ("+field.unit+")":"") ]
    207207            }
    208208        } catch(Exception e){
     
    283283            // This is a single field. Format it and return the result.
    284284            if(type=="domainfields"){
    285                 fields << [ "id": createFieldId( id: collectionOfFields.name, name: collectionOfFields.name, source: source, type: category ), "source": source, "category": category, "name": collectionOfFields.name ]
     285                fields << [ "id": createFieldId( id: collectionOfFields.name, name: collectionOfFields.name, source: source, type: category, unit: (collectionOfFields.unit?:"") ), "source": source, "category": category, "name": collectionOfFields.name + (collectionOfFields.unit?" ("+collectionOfFields.unit+")":"") ]
    286286            }
    287287            if(type=="templatefields"){
    288                 fields << [ "id": createFieldId( id: collectionOfFields.id.toString(), name: collectionOfFields.name, source: source, type: category ), "source": source, "category": category, "name": collectionOfFields.name ]
     288                fields << [ "id": createFieldId( id: collectionOfFields.id.toString(), name: collectionOfFields.name, source: source, type: category, unit: (collectionOfFields.unit?:"") ), "source": source, "category": category, "name": collectionOfFields.name + (collectionOfFields.unit?" ("+collectionOfFields.unit+")":"")]
    289289            }
    290290            return fields
     
    703703            def return_data = [:]
    704704            return_data[ "type" ] = type
    705             return_data.put("yaxis", ["title" : parseFieldId( fields[ valueAxis ] ).name, "unit" : "", "type":valueAxisTypeString ])
    706             return_data.put("xaxis", ["title" : parseFieldId( fields[ groupAxis ] ).name, "unit": "", "type":groupAxisTypeString ])
     705            return_data.put("yaxis", ["title" : parseFieldId( fields[ valueAxis ] ).name, "unit" : parseFieldId( fields[ valueAxis ] ).unit, "type":valueAxisTypeString ])
     706            return_data.put("xaxis", ["title" : parseFieldId( fields[ groupAxis ] ).name, "unit": parseFieldId( fields[ groupAxis ] ).unit, "type":groupAxisTypeString ])
    707707            return_data.put("series", [[
    708708                    "x": groupedData[ groupAxis ].collect { it.toString() },
     
    717717            def return_data = [:]
    718718            return_data[ "type" ] = type
    719             return_data.put("yaxis", ["title" : yName, "unit" : "", "type":valueAxisTypeString ])
    720             return_data.put("xaxis", ["title" : parseFieldId( fields[ groupAxis ] ).name, "unit": "", "type":groupAxisTypeString  ])
     719            return_data.put("yaxis", ["title" : yName, "unit" : parseFieldId( fields[ valueAxis ] ).unit, "type":valueAxisTypeString ])
     720            return_data.put("xaxis", ["title" : parseFieldId( fields[ groupAxis ] ).name, "unit": parseFieldId( fields[ groupAxis ] ).unit, "type":groupAxisTypeString  ])
    721721            return_data.put("series", [[
    722722                "name": yName,
Note: See TracChangeset for help on using the changeset viewer.