6dcef0d057b21be3cb1cbe699998764883543c84 kate Thu Apr 6 16:46:22 2017 -0700 First cut bigBarChart track type for hubs. Basic function on hgTracks, hgTrackUi, and hgc. Lacks boxplot on details page, custom track support, extra fields diff --git src/hg/hgTracks/hgTracks.h src/hg/hgTracks/hgTracks.h index 85e6e38..7859aa9 100644 --- src/hg/hgTracks/hgTracks.h +++ src/hg/hgTracks/hgTracks.h @@ -769,30 +769,32 @@ /* Draw generic item list. Features must be fixed height * and tg->drawItemAt has to be filled in. */ void bedDrawSimpleAt(struct track *tg, void *item, struct hvGfx *hvg, int xOff, int y, double scale, MgFont *font, Color color, enum trackVisibility vis); /* Draw a single simple bed item at position. */ void bedDrawSimple(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis); /* Draw simple Bed items. */ typedef struct slList *(*ItemLoader)(char **row); +typedef struct bed *(*bedItemLoader)(char **row); + void bedLoadItemByQuery(struct track *tg, char *table, char *query, ItemLoader loader); /* Generic tg->item loader. If query is NULL use generic hRangeQuery(). */ void bedLoadItemWhere(struct track *tg, char *table, char *extraWhere, ItemLoader loader); /* Generic tg->item loader, adding extra clause to hgRangeQuery. */ void bedLoadItem(struct track *tg, char *table, ItemLoader loader); /* Generic tg->item loader. */ boolean simpleBedNextPrevEdge(struct track *tg, struct hvGfx *hvg, void *item, int x, int y, int w, int h, boolean next); /* Like linkedFeaturesNextPrevItem, but for simple bed which has no block structure so * this simply zaps us to the right/left edge of the feature. Arrows have already been * drawn; here we figure out coords and draw a mapBox. */ @@ -851,32 +853,34 @@ * that is different from the gray level implied by scoreMin's place in [0..scoreMax], * then linearly transform bed->score from the range of [scoreMin,scoreMax] to * [(cartMinGrayLevel*scoreMax)/maxShade,scoreMax]. * Note: this assumes that scoreMin and scoreMax are constant for each track. */ struct linkedFeatures *lfFromBedExtra(struct bed *bed, int scoreMin, int scoreMax); /* Return a linked feature from a (full) bed. */ struct linkedFeatures *lfFromBed(struct bed *bed); /* Return a linked feature from a (full) bed. */ void loadSimpleBedAsLinkedFeaturesPerBase(struct track *tg); /* bed list not freed as pointer to it is stored in 'original' field */ void loadSimpleBed(struct track *tg); -/* Load the items in one track - just move beds in - * window... */ +/* Load the items in one track - just move beds in window... */ + +void loadSimpleBedWithLoader(struct track *tg, bedItemLoader loader); +/* Load the items in one track using specified loader - just move beds in window... */ void loadBed8(struct track *tg); /* Convert bed 8 info in window to linked feature. */ void loadBed9(struct track *tg); /* Convert bed 9 info in window to linked feature. (to handle itemRgb)*/ void loadGappedBed(struct track *tg); /* Convert bed info in window to linked feature. */ void linkedFeaturesFreeList(struct linkedFeatures **pList); /* Free up a linked features list. */ void freeLinkedFeaturesSeries(struct linkedFeaturesSeries **pList); /* Free up a linked features series list. */