a47364d48ccd5b8ee8cdf7b47b7ba9edcfd66f1f
braney
  Wed Apr 16 10:58:32 2014 -0700
fix a crashing bug in hgCustom if the description field is empty on anassembly hub

diff --git src/hg/hgTracks/wigCommon.h src/hg/hgTracks/wigCommon.h
index 2643d37..d74fc7e 100644
--- src/hg/hgTracks/wigCommon.h
+++ src/hg/hgTracks/wigCommon.h
@@ -16,32 +16,31 @@
     enum wiggleWindowingEnum windowingFunction;	/*  max,mean,min */
     enum wiggleSmoothingEnum smoothingWindow;	/*  N: [1:15] */
     enum wiggleYLineMarkEnum yLineOnOff;	/*  OFF/ON	*/
     enum wiggleAlwaysZeroEnum alwaysZero;	/*  OFF/ON	*/
     enum wiggleTransformFuncEnum transformFunc;	/*  NONE/LOG	*/
     double minY;	/*	from trackDb.ra words, the absolute minimum */
     double maxY;	/*	from trackDb.ra words, the absolute maximum */
     int maxHeight;	/*	maximum pixels height from trackDb	*/
     int defaultHeight;	/*	requested height from cart	*/
     int minHeight;	/*	minimum pixels height from trackDb	*/
     double yLineMark;	/*	user requested line at y = */
     char *colorTrack;   /*	Track to use for coloring wiggle track. */
     int graphColumn;	/*	column to be graphing (bedGraph tracks)	*/
     boolean bedGraph;	/*	is this a bedGraph track ?	*/
     boolean isMultiWig;	/*      If true it's a multi-wig. */
-    boolean overlay;	/*      Overlay multiple wigs on top of each other? */
-    boolean transparent;  /* Doing transparency? */
+    enum wiggleAggregateFunctionEnum aggregateFunction;	/*  NONE/TRANSPARENT/STACKED	*/
     };
 
 struct wigCartOptions *wigCartOptionsNew(struct cart *cart, struct trackDb *tdb, int wordCount, char *words[]);
 /* Create a wigCartOptions from cart contents and tdb. */
 
 struct preDrawContainer
 /* A preDraw array with a little bit of extra info */
     {
     struct preDrawContainer *nextPlaceholder;   /* Refactoring code so not in list really. */
     struct preDrawElement *preDraw;     /* Array of values. */
     int preDrawSize;		/* Size of preDraw */
     int preDrawZero;		/* Offset from start of predraw array to data requested.  We
                                  * get more because of smoothing */
     int width;			/* Passed in width, number of pixels to display without smooth */
     };
@@ -65,32 +64,37 @@
     char *name;		/* Common name */
     float dataValue;	/* data value from bed table graphColumn	*/
     double graphUpperLimit;	/* filled in by DrawItems	*/
     double graphLowerLimit;	/* filled in by DrawItems	*/
     };
 
 typedef void (*WigVerticalLineVirtual)(void *image, int x, int y, int height, Color color);
 /* Draw a vertical line somewhere, maybe a regular image, maybe a transparent one. */
 
 struct wigGraphOutput
 /* Info on where to draw a wig - may be pretty indirect in transparent case. */
    {
    WigVerticalLineVirtual vLine;
    void *image;	    /* Some type in reality that goes with vLine. */
    int xOff, yOff;  /* Where to offset output within image. */
+   double *yOffsets; /* if not NULL, points to yOffsets for stacked bars */
+   int numTrack;   /* the index of this track */
    };
 
+struct wigGraphOutput *wigGraphOutputStack(int xOff, int yOff, int width, int numTracks,  struct hvGfx *image);
+/* Get appropriate wigGraphOutput for non-transparent stacked rendering */
+
 struct wigGraphOutput *wigGraphOutputSolid(int xOff, int yOff, struct hvGfx *image);
 /* Get appropriate wigGraphOutput for non-transparent rendering */
 
 /*	source to these routines is in wigTrack.c	*/
 
 struct preDrawContainer *initPreDrawContainer(int width);
 /*	initialize a preDraw array of size width	*/
 
 void preDrawWindowFunction(struct preDrawElement *preDraw, int preDrawSize,
 	enum wiggleWindowingEnum windowingFunction,
 	enum wiggleTransformFuncEnum transformFunc);
 /*	apply windowing function to the values in preDraw array	*/
 
 void preDrawSmoothing(struct preDrawElement *preDraw, int preDrawSize,
     enum wiggleSmoothingEnum smoothingWindow);