src/hg/hgTracks/multiWig.c 1.4
1.4 2010/05/14 21:35:37 kent
Making click on multi-wig bring up trackUi page.
Index: src/hg/hgTracks/multiWig.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/multiWig.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -B -U 4 -r1.3 -r1.4
--- src/hg/hgTracks/multiWig.c 13 May 2010 21:42:02 -0000 1.3
+++ src/hg/hgTracks/multiWig.c 14 May 2010 21:35:37 -0000 1.4
@@ -3,8 +3,9 @@
#include "common.h"
#include "hash.h"
#include "linefile.h"
#include "jksql.h"
+#include "dystring.h"
#include "hdb.h"
#include "hgTracks.h"
#include "container.h"
#include "wigCommon.h"
@@ -37,15 +38,15 @@
if (overlay)
subtrack->lineHeight = tg->lineHeight;
subtrack->drawItems(subtrack, seqStart, seqEnd, hvg, xOff, y, width, font, color, vis);
if (!overlay)
- {
- y += height;
- y += 1;
- }
+ y += height + 1;
hvGfxUnclip(hvg);
}
}
+char *url = trackUrl(tg->track, chromName);
+mapBoxHgcOrHgGene(hvg, seqStart, seqEnd, xOff, y, width, tg->height, tg->track, tg->track, NULL,
+ url, TRUE, NULL);
}
static int multiWigTotalHeight(struct track *tg, enum trackVisibility vis)
/* Return total height of container. */
@@ -68,8 +69,9 @@
totalHeight += oneHeight;
}
}
}
+tg->height = totalHeight;
return totalHeight;
}
static boolean graphLimitsAllSame(struct track *trackList, struct track **retFirstTrack)
@@ -121,18 +123,28 @@
int height = subtrack->totalHeight(subtrack, vis);
wigLeftAxisLabels(subtrack, seqStart, seqEnd, hvg, xOff, y, width, height, withCenterLabels,
font, subtrack->ixColor, vis, subtrack->shortLabel, subtrack->graphUpperLimit,
subtrack->graphLowerLimit, TRUE);
- y += height;
- y += 1;
+ y += height+1;
}
}
}
}
+void multiWigLoadItems(struct track *track)
+{
+containerLoadItems(track);
+struct track *subtrack;
+for (subtrack = track->subtracks; subtrack != NULL; subtrack = subtrack->next)
+ {
+ subtrack->mapsSelf = FALSE; /* Round about way to tell wig not to do own mapping. */
+ }
+}
+
void multiWigContainerMethods(struct track *track)
/* Override general container methods for multiWig. */
{
+track->loadItems = multiWigLoadItems;
track->totalHeight = multiWigTotalHeight;
track->drawItems = multiWigDraw;
track->drawLeftLabels = multiWigLeftLabels;
}