8935bd46a374201b88bc38ed35994f2a306827d7 braney Thu Apr 24 17:38:41 2014 -0700 make stacked wiggles grok the smoothing parameter, Fix autoscale to usethe windowingFunction to drive the autoScale. diff --git src/hg/hgTracks/wigCommon.h src/hg/hgTracks/wigCommon.h index d74fc7e..ebe42f0 100644 --- src/hg/hgTracks/wigCommon.h +++ src/hg/hgTracks/wigCommon.h @@ -31,30 +31,32 @@ 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 */ + double graphUpperLimit, graphLowerLimit; /* limits to the smoothed value */ + boolean smoothingDone; /* did we already do the smoothing? */ }; struct preDrawElement { double max; /* maximum value seen for this point */ double min; /* minimum value seen for this point */ unsigned long long count; /* number of datum at this point */ double sumData; /* sum of all values at this point */ double sumSquares; /* sum of (values squared) at this point */ double plotValue; /* raw data to plot */ double smooth; /* smooth data values */ }; struct bedGraphItem /* A bedGraph track item. */ @@ -94,33 +96,33 @@ 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); /* apply smoothing function to preDraw array */ double preDrawLimits(struct preDrawElement *preDraw, int preDrawZero, int width, double *overallUpperLimit, double *overallLowerLimit); /* scan preDraw array and determine graph limits */ double preDrawAutoScale(struct preDrawElement *preDraw, int preDrawZero, int width, enum wiggleScaleOptEnum autoScale, - double *overallUpperLimit, double *overallLowerLimit, + enum wiggleWindowingEnum windowingFunction, double *graphUpperLimit, double *graphLowerLimit, - double *overallRange, double *epsilon, int lineHeight, + double *epsilon, int lineHeight, double maxY, double minY, enum wiggleAlwaysZeroEnum alwaysZero); /* if autoScaling, scan preDraw array and determine limits */ void drawZeroLine(enum trackVisibility vis, enum wiggleGridOptEnum horizontalGrid, double graphUpperLimit, double graphLowerLimit, struct hvGfx *hvg, int xOff, int yOff, int width, int lineHeight); /* draw a line at y=0 on the graph */ void drawArbitraryYLine(enum trackVisibility vis, enum wiggleGridOptEnum horizontalGrid, double graphUpperLimit, double graphLowerLimit, struct hvGfx *hvg, int xOff, int yOff, int width, int lineHeight, double yLineMark, double graphRange, enum wiggleYLineMarkEnum yLineOnOff); /* draw a line at y=yLineMark on the graph */