src/hg/lib/hui.c 1.235
1.235 2009/09/04 23:42:37 braney
always include 0 option
Index: src/hg/lib/hui.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hui.c,v
retrieving revision 1.234
retrieving revision 1.235
diff -b -B -U 4 -r1.234 -r1.235
--- src/hg/lib/hui.c 4 Sep 2009 18:05:31 -0000 1.234
+++ src/hg/lib/hui.c 4 Sep 2009 23:42:37 -0000 1.235
@@ -1393,8 +1393,22 @@
cgiMakeDropList(var, wiggleGraphOptions, ArraySize(wiggleGraphOptions),
curVal);
}
+static char *wiggleAlwaysZeroOptions[] = {
+ "ON",
+ "OFF"
+ };
+
+enum wiggleAlwaysZeroEnum wiggleAlwaysZeroToEnum(char *string)
+/* Convert from string to enum representation. */
+{
+int x = stringIx(string, wiggleAlwaysZeroOptions);
+if (x < 0)
+ errAbort("hui::wiggleAlwaysZeroToEnum() - Unknown option %s", string);
+return x;
+}
+
/****** Options for the wiggle track horizontal grid lines *******/
static char *wiggleGridOptions[] = {
"ON",
@@ -3306,8 +3320,9 @@
double tDbMinY; /* data range limits from trackDb type line */
double tDbMaxY; /* data range limits from trackDb type line */
int defaultHeight; /* pixels per item */
char *horizontalGrid = NULL; /* Grid lines, off by default */
+char *alwaysZero = NULL; /* Always include 0 in range */
char *lineBar; /* Line or Bar graph */
char *autoScale; /* Auto scaling on or off */
char *windowingFunction; /* Maximum, Mean, or Minimum */
char *smoothingWindow; /* OFF or [2:16] */
@@ -3324,8 +3339,9 @@
wigFetchMinMaxYWithCart(cart,tdb,name, &minY, &maxY, &tDbMinY, &tDbMaxY, wordCount, words);
freeMem(typeLine);
+(void) wigFetchAlwaysZeroWithCart(cart,tdb,name, &alwaysZero);
(void) wigFetchHorizontalGridWithCart(cart,tdb,name, &horizontalGrid);
(void) wigFetchAutoScaleWithCart(cart,tdb,name, &autoScale);
(void) wigFetchGraphTypeWithCart(cart,tdb,name, &lineBar);
(void) wigFetchWindowingFunctionWithCart(cart,tdb,name, &windowingFunction);
@@ -3364,8 +3380,11 @@
printf("<TR valign=center><th align=right>Data view scaling:</th><td align=left colspan=3>");
snprintf(option, sizeof(option), "%s.%s", name, AUTOSCALE );
wiggleScaleDropDown(option, autoScale);
+snprintf(option, sizeof(option), "%s.%s", name, ALWAYSZERO);
+printf("Always include zero: ");
+wiggleGridDropDown(option, alwaysZero);
puts("</TD></TR>");
printf("<TR valign=center><th align=right>Windowing function:</th><td align=left>");
snprintf(option, sizeof(option), "%s.%s", name, WINDOWINGFUNCTION );