85bd10da37f403d155c4434d90edcd146e682948
braney
  Mon May 15 13:03:32 2017 -0700
add sorting to composite wiggles.

diff --git src/hg/hgTracks/wigCommon.h src/hg/hgTracks/wigCommon.h
index 296da4f..d6b3b2c 100644
--- src/hg/hgTracks/wigCommon.h
+++ src/hg/hgTracks/wigCommon.h
@@ -64,38 +64,47 @@
 
 struct bedGraphItem
 /* A bedGraph track item. */
     {
     struct bedGraphItem *next;
     int start, end;	/* Start/end in chrom coordinates. */
     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 pixelCountBin
+/* A structure used to keep track of how many pixels are drawn in a set of bins. */
+    {
+    unsigned binCount;
+    unsigned binSize;
+    unsigned long *bins;
+    };
+
 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 pixelCountBin *pixelBins;
    };
 
 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,