todo and sensible default setting of min/max for histograms and line graphs to include 0
authorjprocter <Jim Procter>
Mon, 22 Mar 2010 17:14:51 +0000 (17:14 +0000)
committerjprocter <Jim Procter>
Mon, 22 Mar 2010 17:14:51 +0000 (17:14 +0000)
src/jalview/datamodel/AlignmentAnnotation.java

index d8ad4fc..a3328b3 100755 (executable)
@@ -203,7 +203,7 @@ public class AlignmentAnnotation
                 && firstChar != '-'
                 && firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
         {
-          if (jalview.schemes.ResidueProperties.aaIndex[firstChar] < 23)
+          if (jalview.schemes.ResidueProperties.aaIndex[firstChar] < 23) // TODO: parameterise to gap symbol number
           {
             nonSSLabel = true;
           }
@@ -310,6 +310,15 @@ public class AlignmentAnnotation
           min = annotations[i].value;
         }
       }
+      // ensure zero is origin for min/max ranges on only one side of zero
+      if (min>0) {
+        min = 0;
+      } else {
+        if (max<0)
+        {
+          max = 0;
+        }
+        }
     }
 
     graphMin = min;