9636c10bf15ced6d4ef56a4aad3510975eb88b99 kate Tue Apr 11 09:27:05 2017 -0700 Use of labelFields requires different itemName handlers for labeling and identification for click-thru. refs #18736 diff --git src/hg/hgTracks/barChartTrack.c src/hg/hgTracks/barChartTrack.c index 4d06e29..c87861c 100644 --- src/hg/hgTracks/barChartTrack.c +++ src/hg/hgTracks/barChartTrack.c @@ -785,46 +785,54 @@ } static void barChartPreDrawItems(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis) { if (vis == tvSquish || vis == tvDense) { // NonProp routines not relevant to these modes, and they interfere // NOTE: they must be installed by barChartMethods() for pack mode tg->nonPropDrawItemAt = NULL; tg->nonPropPixelWidth = NULL; } } +static char *barChartMapItemName(struct track *tg, void *item) +/* Return item name for click handler */ +{ +struct barChartItem *chartItem = (struct barChartItem *)item; +struct bed *bed = (struct bed *)chartItem->bed; +return bed->name; +} + static char *barChartItemName(struct track *tg, void *item) -/* Return item name */ +/* Return item name for labeling */ { struct barChartItem *chartItem = (struct barChartItem *)item; struct bed *bed = (struct bed *)chartItem->bed; if (tg->isBigBed) return bigBedItemName(tg, bed); return bed->name; } void barChartMethods(struct track *tg) /* Bar Chart track type: draw fixed width chart of colored bars over a BED item */ { // TODO: derive this from AS or trackDb ? tg->bedSize = 8; bedMethods(tg); tg->canPack = TRUE; tg->drawItemAt = barChartDrawAt; tg->preDrawItems = barChartPreDrawItems; tg->loadItems = barChartLoadItems; tg->mapItem = barChartMapItem; tg->itemName = barChartItemName; -tg->mapItemName = barChartItemName; +tg->mapItemName = barChartMapItemName; tg->itemHeight = barChartItemHeight; tg->itemStart = barChartItemStart; tg->itemEnd = barChartItemEnd; tg->totalHeight = barChartTotalHeight; tg->nonPropDrawItemAt = barChartNonPropDrawAt; tg->nonPropPixelWidth = barChartNonPropPixelWidth; }