4d36c5c0a9c01a918b9f54ee7e46d6373bfe89f3 braney Wed Sep 16 11:39:00 2026 -0700 hgTracks: a dense row can have one clickable map box per item, refs #38364 In dense the whole row is covered by a single map box that switches the track to pack, so nothing inside a dense track points at a details page. To look at an item you have to expand the track, which reloads the page and changes the layout you just set up. With denseClick on, genericDrawItemsFullDense puts down one map box per item as it draws the row. It does this in the draw pass, where the scale and x offset for the window are already in hand, so multi-region windows come out right. The whole draw loop runs before the loop that calls doTrackMap, and map items print in creation order, so the per-item boxes come first in the image map and the existing whole-row box still catches the gaps between items. Clicking empty space in the row, the center label, or the right-click menu all still change the visibility. Nothing had to be removed and the drawn image does not change. A dense row can hold tens of thousands of items, so denseMapItem keeps one flag per pixel of the row and skips an item whose pixels are all claimed by an earlier one. Such a box sits under the earlier one and could never be clicked. That bounds the row at one box per pixel: hg38 simpleRepeat in dense across chr1 at pix=1200 goes from 74,515 map boxes and an 18.5 MB page to 969 boxes and 525 KB. It also decides what happens when several items share a pixel, which is that the first one in the list wins. Three copies of the same early return, all commented "Don't bother if we are imageV2 and a dense child", kept composite subtracks out of this. They now test denseClickEnabled too, which is what lets the hg38 hprcPclai haplotypes work. The fourth copy in wigTrack.c puts down a whole-track box rather than a per-item one and is left alone. Off by default. Set denseClick in hg.conf for every dense track, or a denseClick trackDb setting for one track, which inherits to a container's subtracks. The trackDb setting is not documented yet. diff --git src/hg/hgTracks/hgTracks.h src/hg/hgTracks/hgTracks.h index d9c7bc71c3e..3abfceb7921 100644 --- src/hg/hgTracks/hgTracks.h +++ src/hg/hgTracks/hgTracks.h @@ -733,30 +733,34 @@ void genericItemMapAndArrows(struct track *tg, struct spaceNode *sn, struct hvGfx *hvg, int xOff, int y, int width, MgFont *font, Color color, Color labelColor, enum trackVisibility vis, double scale, boolean withLeftLabels); /* Generic function for putting down a mapbox with a label and drawing exon arrows */ void genericMapItem(struct track *tg, struct hvGfx *hvg, void *item, char *itemName, char *mapItemName, int start, int end, int x, int y, int width, int height); /* This is meant to be used by genericDrawItems to set to tg->mapItem in */ /* case tg->mapItem isn't set to anything already. */ +boolean denseClickEnabled(struct track *tg); +/* Should a dense row of this track get one clickable map box per item, instead */ +/* of a single box that expands the track? */ + void mapStatusMessage(char *format, ...) /* Write out stuff that will cause a status message to * appear when the mouse is over this box. */ #if defined(__GNUC__) __attribute__((format(printf, 1, 2))) #endif ; double scaleForWindow(double width, int seqStart, int seqEnd); /* Return the scale for the window. */ double scaleForPixels(double pixelWidth); /* Return what you need to multiply bases by to * get to scale of pixel coordinates. */