Index: /trunk/web/addons/job_monarch/conf.php
===================================================================
--- /trunk/web/addons/job_monarch/conf.php	(revision 521)
+++ /trunk/web/addons/job_monarch/conf.php	(revision 522)
@@ -2,5 +2,5 @@
 // Show hosts in a jobview by default?
 //
-$default_showhosts = 1;
+$default_showhosts = true;
 
 // Stop displaying archive search results after SEARCH_RESULT_LIMIT
@@ -10,18 +10,18 @@
 // Show the column job attribute 'requested memory'?
 //
-$COLUMN_REQUESTED_MEMORY = 0;
+$COLUMN_REQUESTED_MEMORY = false;
 
 // Show the column job attribute 'queued' (since)?
 //
-$COLUMN_QUEUED = 1;
+$COLUMN_QUEUED = true;
 
 // Show the column job attribute 'nodes' hostnames?
 //
-$COLUMN_NODES = 1;
+$COLUMN_NODES = true;
 
 // Path to Ganglia's web frontend root
 //
-//$GANGLIA_PATH = "/var/www/test-ganglia";
-$GANGLIA_PATH = "../..";
+$GANGLIA_PATH = "/var/www/test-ganglia";
+//$GANGLIA_PATH = "../..";
 
 // Format of how to display a date and time in human readable format
@@ -63,4 +63,12 @@
 $NODE_OFFLINE_MARKING = ".";
 
+// Show empty columns in the ClusterImage?
+//
+$SHOW_EMPTY_COLUMN = false;
+
+// Show empty rows in the ClusterImage?
+//
+$SHOW_EMPTY_ROW = true;
+
 // XML Datasource for Job Monarch
 // by default localhost's gmetad
@@ -71,5 +79,5 @@
 // Is there a jobarchive?
 //
-$JOB_ARCHIVE = 1;
+$JOB_ARCHIVE = true;
 
 // Path to the job archive rrd files
@@ -92,5 +100,5 @@
 //$CLUSTER_CONFS["Example Cluster"]	= "./clusterconf/example.php";
 //
-//$CLUSTER_CONFS["LISA Cluster"]          = "./clusterconf/lisa-example.php";
-//$CLUSTER_CONFS["GINA Cluster"]          = "./clusterconf/gina-example.php";
+$CLUSTER_CONFS["LISA Cluster"]          = "./clusterconf/lisa-example.php";
+$CLUSTER_CONFS["GINA Cluster"]          = "./clusterconf/gina-example.php";
 ?>
Index: /trunk/web/addons/job_monarch/libtoga.php
===================================================================
--- /trunk/web/addons/job_monarch/libtoga.php	(revision 521)
+++ /trunk/web/addons/job_monarch/libtoga.php	(revision 522)
@@ -1097,10 +1097,8 @@
 		$this->tasks = $this->tasks + $cpus;
 	}
-
 	function setDown( $down )
 	{
 		$this->down = $down;
 	}
-
 	function isDown()
 	{
@@ -1111,19 +1109,24 @@
 		$this->offline = $offline;
 	}
-
 	function isOffline()
 	{
 		return $this->offline;
 	}
-
 	function setImage( $image )
 	{
 		$this->image = $image;
 	}
-
 	function setCoords( $x, $y )
 	{
 		$this->x = $x;
 		$this->y = $y;
+	}
+	function getX()
+	{
+		return $this->x;
+	}
+	function getY()
+	{
+		return $this->y;
 	}
 
@@ -1384,5 +1387,5 @@
 		global $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH;
 		global $BIG_CLUSTERIMAGE_MAXWIDTH, $BIG_CLUSTERIMAGE_NODEWIDTH;
-		global $CLUSTER_CONFS, $confcluster;
+		global $CLUSTER_CONFS, $confcluster, $SHOW_EMPTY_COLUMN, $SHOW_EMPTY_ROW;
 
 		global $SORTBY_HOSTNAME, $SORT_ORDER, $skan_str;
@@ -1455,5 +1458,4 @@
 		if( $SORTBY_HOSTNAME != "" )
 		{
-
 		        $sorted 	= array();
 
@@ -1494,5 +1496,4 @@
 			if(( strpos( $SORTBY_HOSTNAME, $x_str ) < strpos( $SORTBY_HOSTNAME, $y_str ) ) && ( $x_present && $y_present ))
 			{
-			
 				$x_first	= 1;
 			}
@@ -1531,4 +1532,7 @@
 			$y_min		= null;
 			$y_max		= null;
+
+			$x_columns	= array();
+			$y_rows		= array();
 
 			// Now let's walk through all our nodes and see which one are valid for our scan pattern
@@ -1631,4 +1635,15 @@
 					$y_max	= $y;
 				}
+
+				// Store which non-empty columns and rows we found
+				//
+				if( !in_array( $x, $x_columns ) )
+				{
+					$x_columns[] = $x;
+				}
+				if( !in_array( $y, $y_rows ) )
+				{
+					$y_rows[] = $y;
+				}
 			}
 
@@ -1637,4 +1652,6 @@
 			//
 			$sorted_nodes	= usort( $nodes, "cmp" );
+
+			//print_r( $x_columns ) ;
 
 			$cur_node	= 0;
@@ -1654,8 +1671,6 @@
 			if( $this->isBig() ) 
 			{
-
 				$y_offset	= ($fontheight * (1 + strlen( $x_max) ) ) + ((2 + strlen( $x_max)) * $fontspaceing);
 				$x_offset	= ($fontwidth * (1 + strlen( $y_max) ) ) + ((2 + strlen( $y_max)) * $fontspaceing);
-
 			}
 
@@ -1711,16 +1726,48 @@
 			}
 
+			$previous_n	= 0;
+			$previous_m	= 0;
+			$x_empty_count	= 0;
+			$y_empty_count	= 0;
+
+			// Let's start assigning x,y coordinates now
+			//
 			for( $n = $x_min; $n <= $x_max; $n++ )
 			{
 				for( $m = $y_min; $m <= $y_max; $m++ )
 				{
-
 					if( $x_min > 0 )
 					{
-						$x	= $x_offset + ( ($n-$x_min) * $node_width );
+						$x	= $x_offset + ( ($n-$x_min) * $node_width ) - ($x_empty_count * $node_width);
 					}
 					if( $y_min > 0 )
 					{
-						$y	= $y_offset + ( ($m-$y_min) * $node_width );
+						$y	= $y_offset + ( ($m-$y_min) * $node_width ) - ($y_empty_count * $node_width);
+					}
+
+					// Don't show empty rows/columns if option enabled
+					//
+					if( !in_array( $n, $x_columns ) && !$SHOW_EMPTY_COLUMN )
+					{
+						// Skip to next iteration: we don't want a empty column
+						//
+						if( $n > $previous_n )
+						{
+							$previous_n = $n;
+							$x_empty_count++;
+						}
+						continue;
+					}
+					if( !in_array( $m, $y_rows ) && !$SHOW_EMPTY_ROW )
+
+					{
+						// Skip to next iteration: we don't want a empty column
+						//
+						if( $m > $previous_m )
+						{
+							$previous_m = $m;
+							$y_empty_count++;
+						}
+						continue;
 					}
 
