06d7be056190c14b85e71bc12523f18ea6815b5e markd Mon Dec 7 00:50:29 2020 -0800 BLAT mmap index support merge with master diff --git src/hg/hgTracks/lollyTrack.c src/hg/hgTracks/lollyTrack.c index 232f2f1..f0471da 100644 --- src/hg/hgTracks/lollyTrack.c +++ src/hg/hgTracks/lollyTrack.c @@ -1,381 +1,434 @@ /* lollyTrack -- load and draw lollys */ /* Copyright (C) 2019 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "obscure.h" #include "hgTracks.h" #include "bedCart.h" #include "bigWarn.h" #include "lolly.h" #include "limits.h" #include "float.h" #include "bigBedFilter.h" +#include "asParse.h" #define LOLLY_DIAMETER 2 * (lollyCart->radius + 2) struct lolly { struct lolly *next; char *name; /* the mouseover name */ double val; /* value in the data file */ unsigned start; /* genomic start address */ unsigned end; /* genomic end address */ unsigned radius; /* radius of the top of the lolly */ unsigned height; /* height of the lolly */ Color color; /* color of the lolly */ char *mouseOver; }; static unsigned getLollyColor( struct hvGfx *hvg, unsigned color) /* Get the device color from our internal definition. */ { struct rgbColor itemRgb; itemRgb.r = (color & 0xff0000) >> 16; itemRgb.g = (color & 0xff00) >> 8; itemRgb.b = color & 0xff; return hvGfxFindColorIx(hvg, itemRgb.r, itemRgb.g, itemRgb.b); } void doYLabels(struct track *tg, struct hvGfx *hvg, int width, int height, struct lollyCartOptions *lollyCart, int xOff, int yOff, Color color, MgFont *font, boolean doLabels ) /* Draw labels or lines for labels. */ { -double range = lollyCart->upperLimit - lollyCart->lowerLimit; +double range = tg->graphUpperLimit - tg->graphLowerLimit; int fontHeight = tl.fontHeight+1; // we need a margin on top and bottom for half a lolly, and some space at the bottom // for the lolly stems double minimumStemHeight = fontHeight; double topAndBottomMargins = LOLLY_DIAMETER / 2 + LOLLY_DIAMETER / 2; double usableHeight = height - topAndBottomMargins - minimumStemHeight; yOff += LOLLY_DIAMETER / 2; struct hashEl *hel = trackDbSettingsLike(tg->tdb, "yAxisLabel*"); // parse lines like yAxisLabel