Changeset 20579
- Timestamp:
- 04/28/16 22:58:29 (9 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/plot/applyoptions.js ¶
r20541 r20579 1 function applyoptions(md,data, options,canvas,gl,node){1 function applyoptions(md,data,datatype,options,canvas,gl,node){ 2 2 //APPLYOPTIONS - apply the options to current plot 3 3 // … … 11 11 if (options.getfieldvalue('colorbar')==1) { 12 12 //Handle movie data {{{ 13 if (typeof data == 'string') {14 //throw Error('plot error message: data of type string');15 return;16 }17 var dataresults = processdata(md,data,options);18 var data2 = dataresults[0];19 var datatype = dataresults[1];20 13 if (datatype == 5) { 21 //Transpose data to obtain column addressable data matrix 22 data = data[0].map(function(col, i) { 23 return data.map(function(row) { 24 return row[i] 25 }) 26 }); 27 data = data[0].slice(0,-1); 14 data = data[0]; 28 15 } //}}} 29 //Variable options initialization {{{ 30 16 //Variable options initialization {{{ 31 17 var caxis = options.getfieldvalue('caxis',[ArrayMin(data),ArrayMax(data)]); 32 18 var canvassize = options.getfieldvalue('canvassize',480); -
TabularUnified issm/trunk-jpl/src/m/plot/plot_manager.js ¶
r20401 r20579 224 224 } 225 225 226 if (typeof data !== 'string'){ 227 //plot unit 228 plot_unit(md,data,options,canvas,gl,canvas.nodes["data"+String(canvas.datalength)]); 229 } 230 231 applyoptions(md,data,options,canvas,gl,canvas.nodes["data"+String(canvas.datalength)]); 226 var dataresults = processdata(md,data,options); 227 var data2 = dataresults[0]; 228 var datatype = dataresults[1]; 229 230 //plot unit 231 plot_unit(md,data2,datatype,options,canvas,gl,canvas.nodes["data"+String(canvas.datalength)]); 232 233 applyoptions(md,data2,datatype,options,canvas,gl,canvas.nodes["data"+String(canvas.datalength)]); 232 234 } -
TabularUnified issm/trunk-jpl/src/m/plot/plot_mesh.js ¶
r20565 r20579 94 94 vertices[vertices.length] = vertex[1]; 95 95 vertices[vertices.length] = vertex[2]; 96 97 colors[colors.length] = color[0]; 98 colors[colors.length] = color[1]; 99 colors[colors.length] = color[2]; 100 colors[colors.length] = color[3]; 96 101 continue; 97 102 } -
TabularUnified issm/trunk-jpl/src/m/plot/plot_overlay.js ¶
r20565 r20579 117 117 vertices[vertices.length] = vertex[1]; 118 118 vertices[vertices.length] = vertex[2]; 119 120 texcoords[texcoords.length] = 0.0; 121 texcoords[texcoords.length] = 0.0; 119 122 continue; 120 123 } -
TabularUnified issm/trunk-jpl/src/m/plot/plot_unit.js ¶
r20565 r20579 1 function plot_unit(md,data, options,canvas,gl,node) {1 function plot_unit(md,data,datatype,options,canvas,gl,node) { 2 2 //PLOT_UNIT - unit plot, display data 3 3 // … … 26 26 var is2d = meshresults[4]; 27 27 var isplanet = meshresults[5]; 28 29 var dataresults = processdata(md,data,options);30 var data2 = dataresults[0];31 var datatype = dataresults[1];32 28 33 29 //Compue scaling through matrices for 2d meshes and vertices for 3d meshes … … 112 108 for(var i = 0; i < x.length; i++){ 113 109 //Check for NaN values and remove from indices array as necessary, but preserve vertex array spacing 114 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) ) {110 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) || isNaN(data[i])) { 115 111 nanindices[i] = i; 116 112 vertices[vertices.length] = vertex[0]; 117 113 vertices[vertices.length] = vertex[1]; 118 114 vertices[vertices.length] = vertex[2]; 115 116 texcoords[texcoords.length] = 0.0; 117 texcoords[texcoords.length] = 0.0; 119 118 continue; 120 119 } … … 144 143 145 144 } 145 146 146 //Initalize buffers 147 147 node["arrays"] = [vertices, texcoords, indices]; … … 175 175 for(var i = 0; i < x.length; i++){ 176 176 //Check for NaN values and remove from indices array as necessary, but preserve vertex array spacing 177 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) ) {177 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) || isNaN(data[i])) { 178 178 nanindices[i] = i; 179 179 vertices[vertices.length] = vertex[0]; 180 180 vertices[vertices.length] = vertex[1]; 181 181 vertices[vertices.length] = vertex[2]; 182 183 texcoords[texcoords.length] = 0.0; 184 texcoords[texcoords.length] = 0.0; 182 185 continue; 183 186 } … … 191 194 vertices[vertices.length] = vertex[2]; 192 195 } 193 194 196 //Transpose data to obtain column addressable data matrix 195 197 data = data[0].map(function(col, i) { … … 271 273 throw Error(sprintf("%s%i%s\n",'case ',datatype,' not supported')); 272 274 } 275 273 276 if (canvas.requestDrawing) draw(gl,options,canvas); 274 277 }
Note:
See TracChangeset
for help on using the changeset viewer.