Changeset 2061
- Timestamp:
- Oct 17, 2011, 12:10:04 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/visualization/VisualizeController.groovy
r2059 r2061 187 187 * - a key 'name' with a value equal to the name of the field in question, as determined by the source value 188 188 */ 189 def getFields(source, assay) {189 def getFields(source, assay) { 190 190 def fields = [] 191 191 def callUrl = "" … … 419 419 // Retrieve the value for the selected field for this sample 420 420 def value = closure( sample, parsedField.name ); 421 422 if( value != null ) { 423 data << value; 424 } else { 425 // Return null if the value is not found 426 data << null 427 } 421 422 data << value; 428 423 } 429 424 } else { -
trunk/grails-app/views/visualize/index.gsp
r2057 r2061 86 86 <table> 87 87 <tr> 88 <td> Visualize the data as soon as enough parameters are known.</td>88 <td><label for="autovis">Visualize the data as soon as enough parameters are known.</label></td> 89 89 <td><input type="checkbox" name="autovis" id="autovis" CHECKED/></td> 90 90 </tr> 91 91 <tr> 92 <td>Always show values in the graph.<br />(if this box is unchecked, value's are only shown when you hover over a datapoint)</td> 92 <td><label for="errorbars">Show errorbars in graph.<br />(only available with aggregation set to average)</label></td> 93 <td><input type="checkbox" name="errorbars" id="errorbars" CHECKED/></td> 94 </tr> 95 <tr> 96 <td><label for="showvalues">Always show values in the graph.<br />(if this box is unchecked, value's are only shown when you hover over a datapoint)</label></td> 93 97 <td><input type="checkbox" name="showvalues" id="showvalues" onClick="changeVis();"/></td> 94 98 </tr> -
trunk/web-app/css/visualization.css
r2057 r2061 79 79 background: #87cefa; 80 80 cursor:pointer; 81 }82 83 div#message_counter_container.message_warningnew {84 width: 50px;85 height: 50px;86 background-color: #eee;87 }88 89 div#message_counter_container.message_errornew {90 width: 150px;91 height: 150px;92 background-color: #ffe0e0;93 81 } 94 82 -
trunk/web-app/js/visualization.js
r2055 r2061 53 53 visualization.destroy(); 54 54 55 if($( '#study 55 if($( '#study' ).find( 'option:selected' ).length>0) { 56 56 $( "#menu_row, #menu_column" ).find("img.spinner").show(); 57 $( "#menu_study" ).find(" div.topmenu_item_info").html($( '#studyoption:selected' ).text());57 $( "#menu_study" ).find(".topmenu_item_info").html($( '#study').find( 'option:selected' ).text()); 58 58 59 59 executeAjaxCall( "getFields", { … … 80 80 strOptions += "<option value='"+field.id+"'>"+field.name+"</option>"; 81 81 }); 82 strOptions += "</optgroup>"; 83 $( "#rows, #columns" ).html(strOptions); 82 if(strOptions.length>0) { 83 strOptions += "</optgroup>"; 84 $( "#rows, #columns" ).html(strOptions); 85 } else { 86 $("#visualization").html('<div style="padding: 30px">No fields could be found. This visualization prototype requires studies with samples.</div>'); 87 } 84 88 85 $( "#menu_study" ).find(" div.topmenu_item_info").html($( '#studyoption:selected' ).text());86 $( "#menu_row, #menu_column" ).find(" img.spinner").hide();89 $( "#menu_study" ).find(".topmenu_item_info").html($( '#study').find( 'option:selected' ).text()); 90 $( "#menu_row, #menu_column" ).find(".spinner").hide(); 87 91 $( "#menu_row, #menu_column" ).addClass("menu_item_fill"); 88 92 } … … 100 104 $( "#"+divid ).addClass("menu_item_done"); 101 105 102 if($( '#rows option:selected' ).length>0 && $( '#columnsoption:selected' ).length>0) {103 104 $( "#menu_vis" ).find(" img.spinner").show();106 if($( '#rows' ).find( 'option:selected' ).length>0 && $( '#columns' ).find( 'option:selected' ).length>0) { 107 108 $( "#menu_vis" ).find(".spinner").show(); 105 109 106 110 executeAjaxCall( "getVisualizationTypes", { … … 120 124 $.each( returnData, function( idx, field ) { 121 125 $( '#types' ).append( $( "<option>" ).val( field.id ).text( field.name ) ); 122 if( field.name==visType ) { $( '#types 126 if( field.name==visType ) { $( '#types').find( 'option:last' ).attr("selected","selected"); }; 123 127 }); 124 128 } … … 130 134 visualization.destroy(); 131 135 132 if($( '#types 136 if($( '#types' ).find( 'option' ).length==1) { 133 137 $( '#types :first-child' ).attr("selected","selected"); 134 138 } 135 if($( '#types 139 if($( '#types').find( 'option:selected' ).length>0) { 136 140 changeVis(); 137 141 } 138 142 } 139 143 140 $( "#menu_vis" ).find(" img.spinner").hide();144 $( "#menu_vis" ).find(".spinner").hide(); 141 145 142 146 } … … 150 154 function changeVis() { 151 155 152 if($( '#types 156 if($( '#types' ).find( 'option:selected' ).length>0) { 153 157 $( "#menu_vis" ).removeClass().addClass("menu_item menu_item_done"); 154 158 visType = $( '#types option:selected' ).text(); … … 190 194 if( !checkCorrectData( data.returnData ) ) { 191 195 showError( ["Unfortunately the server returned data in a format that we did not expect."], "message_error" ); 192 $( "#menu_go" ).find(" img.spinner").hide();196 $( "#menu_go" ).find(".spinner").hide(); 193 197 return; 194 198 } … … 209 213 if( dataPoints.length == 0 ) { 210 214 showError( ["Unfortunately the server returned data without any measurements"], "message_error" ); 211 $( "#menu_go" ).find(" img.spinner").hide();215 $( "#menu_go" ).find(".spinner").hide(); 212 216 return; 213 217 } … … 412 416 } 413 417 414 $( "#menu_go" ).find(" img.spinner").hide();418 $( "#menu_go" ).find(".spinner").hide(); 415 419 } 416 420 }, "menu_go"); … … 497 501 // For simplicity, we send the whole form to the server. In the 498 502 // future this might be enhanced, based on the given type 499 return $( ' form#visualizationForm' ).serialize();503 return $( '#visualizationForm' ).serialize(); 500 504 } 501 505 … … 525 529 // An error occurred while retrieving fields from the server 526 530 showError( ["An error occurred while retrieving variables from the server. Please try again or contact a system administrator.<br />"+textStatus], "message_error" ); 527 $( "#"+divid ).removeClass().addClass('menu_item menu_item_error');528 $( "#"+divid ).find(" img.spinner").hide();531 $( "#"+divid ).removeClass().addClass('menu_item_error'); 532 $( "#"+divid ).find(".spinner").hide(); 529 533 } 530 534
Note: See TracChangeset
for help on using the changeset viewer.