vis_files/generate_plots.js
/// Draws a map onto "resultscan"
Draws a map onto "resultscan"
Draws a map onto " resultscan "
function drawmap(vis)
{
	plottype = "map";
	cv = resultcv; 
	cv.clearRect(0,0,graphdx,graphdy);
	playtimemax = vis.array.length;
	var b = visjson.boundaries;
	for(c = 0; c < b.length; c++){                                  
		for(p = 0; p < b[c].length; p++){
			set_outline(b[c][p]);
			if(vis.type == "OP_LEVEL_EFFECT"){
				cv.fillStyle = collist[vis.array[playtime][c]];
			}
			else{
				var val;
				if(col_map.type == "log") val = Math.log(vis.arraytrans[playtime][c] + col_map.shift);		
				else val = vis.arraytrans[playtime][c];		
				var div = Math.floor(0.999999*col_map.div*(val-col_map.min)/(col_map.max-col_map.min));
				cv.fillStyle = "rgb("+col_map.map[div].R+","+col_map.map[div].G+","+col_map.map[div].B+")";
			}
			cv.fill();
		}
	}
	cv.lineWidth = 0.4;
	for(c = 0; c < b.length; c++){                                  
		for(p = 0; p < b[c].length; p++){
			set_outline(b[c][p]);
			cv.strokeStyle = BLACK;
			cv.stroke();
		}
	}
	if(areaover != -1){
		var val;
		if(vis.type == "OP_LEVEL_EFFECT") val = vis.level_param[vis.array[playtime][areaover]];
		else val = vis.arraytrans[playtime][areaover];
		highlight_area(vis,areaover,val,vis.areas[areaover]);
	}
	if(vis.dates != null) centertext(vis.dates[playtime],mapdx/2,30,MAPDATEFONT,BLACK);
}
function drawmap ( vis ) { plottype = "map" ; cv = resultcv ; cv . clearRect ( 0 , 0 , graphdx , graphdy ) ; playtimemax = vis . array . length ; var b = visjson . boundaries ; for ( c = 0 ; c < b . length ; c ++ ) { for ( p = 0 ; p < b [ c ] . length ; p ++ ) { set_outline ( b [ c ] [ p ] ) ; if ( vis . type == "OP_LEVEL_EFFECT" ) { cv . fillStyle = collist [ vis . array [ playtime ] [ c ] ] ; } else { var val ; if ( col_map . type == "log" ) val = Math . log ( vis . arraytrans [ playtime ] [ c ] + col_map . shift ) ; else val = vis . arraytrans [ playtime ] [ c ] ; var div = Math . floor ( 0.999999 * col_map . div * ( val - col_map . min ) / ( col_map . max - col_map . min ) ) ; cv . fillStyle = "rgb(" + col_map . map [ div ] . R + "," + col_map . map [ div ] . G + "," + col_map . map [ div ] . B + ")" ; } cv . fill ( ) ; } } cv . lineWidth = 0.4 ; for ( c = 0 ; c < b . length ; c ++ ) { for ( p = 0 ; p < b [ c ] . length ; p ++ ) { set_outline ( b [ c ] [ p ] ) ; cv . strokeStyle = BLACK ; cv . stroke ( ) ; } } if ( areaover != - 1 ) { var val ; if ( vis . type == "OP_LEVEL_EFFECT" ) val = vis . level_param [ vis . array [ playtime ] [ areaover ] ] ; else val = vis . arraytrans [ playtime ] [ areaover ] ; highlight_area ( vis , areaover , val , vis . areas [ areaover ] ) ; } if ( vis . dates != null ) centertext ( vis . dates [ playtime ] , mapdx / 2 , 30 , MAPDATEFONT , BLACK ) ; }
Draws a map onto "resultscan"
Draws a map onto " resultscan "
// Fills the areas // Draws the boundaries