e9ded1aec0ee20e088527f5260f97ec54a476338 braney Fri Apr 25 13:46:17 2014 -0700 stacked bar fixes, including javascript on the ui page diff --git src/hg/hgTracks/wigTrack.c src/hg/hgTracks/wigTrack.c index 169196b..063da80 100644 --- src/hg/hgTracks/wigTrack.c +++ src/hg/hgTracks/wigTrack.c @@ -1009,33 +1009,37 @@ int scaledMinus = scaleHeightToPixels(doTransform(mean-std, transformFunc)); int boxHeight = max(1,scaledMinus - scaledPlus); vLine(image, x, scaledPlus, boxHeight, mediumColor); } vLine(image, x, scaledMean, 1, drawColor); } else { double y0 = dataValue; if ((yOffsets != NULL) && (numTrack > 0)) y0 += yOffsets[(numTrack-1) * width + x1]; int yPointGraph = scaleHeightToPixels(y0) - 1; vLine(image, x, yPointGraph, 3, drawColor); } } - if (dataValue > graphUpperLimit) + double stackValue = dataValue; + + if ((yOffsets != NULL) && (numTrack > 0)) + stackValue += yOffsets[(numTrack-1) * width + x1]; + if (stackValue > graphUpperLimit) vLine(image, x, yOff, 2, clipColor); - else if (dataValue < graphLowerLimit) + else if (stackValue < graphLowerLimit) vLine(image, x, yOff + h - 1, 2, clipColor); #undef scaleHeightToPixels /* No longer use this symbol */ } /* vis == tvFull || vis == tvPack */ else if (vis == tvDense || vis == tvSquish) { double grayValue; int grayIndex; /* honor the viewLimits, data below is white, data above is black */ grayValue = max(dataValue,graphLowerLimit); grayValue = min(grayValue,graphUpperLimit); grayIndex = ((grayValue-graphLowerLimit)/graphRange)*MAX_WIG_VALUE; drawColor = tg->colorShades[grayInRange(grayIndex, 0, MAX_WIG_VALUE)]; vLine(image, x, yOff, tg->lineHeight, drawColor);