- Timestamp:
- 01/29/09 13:32:32 (14 years ago)
- Location:
- trunk/web2/addons/job_monarch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web2/addons/job_monarch/conf.php
r552 r573 41 41 // (250 pixels is same width as Ganglia's pie chart) 42 42 // 43 $BIG_CLUSTERIMAGE_MAXWIDTH = 500;43 $BIG_CLUSTERIMAGE_MAXWIDTH = 700; 44 44 45 // The size of a single node in the smallclusterimage45 // The size of a single node in the big clusterimage 46 46 // 47 $BIG_CLUSTERIMAGE_NODEWIDTH = 1 1;47 $BIG_CLUSTERIMAGE_NODEWIDTH = 14; 48 48 49 49 // Max size of small host image -
trunk/web2/addons/job_monarch/libtoga.php
r569 r573 1192 1192 $this->size = $BIG_CLUSTERIMAGE_NODEWIDTH; 1193 1193 1194 $this->drawShadow(); 1194 1195 $this->draw(); 1196 } 1197 1198 function drawShadow() 1199 { 1200 // offset of drop shadow from top left 1201 // 1202 $ds_offset = 5; 1203 1204 // number of steps from black to background color 1205 // 1206 $ds_steps = 15; 1207 1208 // distance between steps 1209 // 1210 $ds_spread = 1; 1211 1212 // define the background color 1213 // 1214 $background = array("r" => 255, "g" => 255, "b" => 255); 1215 1216 // create a new canvas. New canvas dimensions should be larger than the original's 1217 // 1218 $width = $this->size + $ds_offset; 1219 $height = $this->size + $ds_offset; 1220 1221 // determine the offset between colors 1222 // 1223 $step_offset = array("r" => ($background["r"] / $ds_steps), "g" => ($background["g"] / $ds_steps), "b" => ($background["b"] / $ds_steps)); 1224 1225 // calculate and allocate the needed colors 1226 // 1227 $current_color = $background; 1228 1229 for ($i = 0; $i <= $ds_steps ; $i++) 1230 { 1231 $colors[$i] = imagecolorallocate($this->image, round($current_color["r"]), round($current_color["g"]), round($current_color["b"])); 1232 1233 $current_color["r"] -= $step_offset["r"]; 1234 $current_color["g"] -= $step_offset["g"]; 1235 $current_color["b"] -= $step_offset["b"]; 1236 } 1237 1238 // draw overlapping rectangles to create a drop shadow effect 1239 // 1240 for ($i = 3; $i < count($colors); $i++) 1241 { 1242 imagefilledrectangle( $this->image, ($this->x + $ds_offset), ($this->y + $ds_offset), ($this->x + $width), ($this->y + $height), $colors[$i] ); 1243 $width -= $ds_spread; 1244 $height -= $ds_spread; 1245 } 1195 1246 } 1196 1247 … … 1202 1253 $size = $this->size; 1203 1254 1204 imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+($size ), $this->y+($size), $black_color );1255 imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+($size-2), $this->y+($size-2), $black_color ); 1205 1256 1206 1257 if( $this->showinfo) … … 1219 1270 $load = $this->determineLoad(); 1220 1271 $usecolor = $this->colorHex( load_color($load) ); 1221 imageFilledRectangle( $this->image, $this->x+1, $this->y+1, $this->x+($size- 1), $this->y+($size-1), $usecolor );1272 imageFilledRectangle( $this->image, $this->x+1, $this->y+1, $this->x+($size-3), $this->y+($size-3), $usecolor ); 1222 1273 if( $this->down ) 1223 1274 { … … 1962 2013 $this->nodes = &$nodes; 1963 2014 2015 imageColorTransparent( $image, $colorwhite ); 2016 1964 2017 if ($this->output) 1965 2018 {
Note: See TracChangeset
for help on using the changeset viewer.