853a2deb64b72bb0ad5b85128f598925e815ee5b braney Tue Apr 30 15:33:37 2019 -0700 don't put out more than 5,000 map boxes because more than that freaks out Chrome diff --git src/hg/hgTracks/lollyTrack.c src/hg/hgTracks/lollyTrack.c index d76e324..0127ed4 100644 --- src/hg/hgTracks/lollyTrack.c +++ src/hg/hgTracks/lollyTrack.c @@ -45,42 +45,53 @@ int trackHeight = tg->lollyCart->height; if (popList == NULL) // nothing to draw return; if ( tg->visibility == tvDense) // in dense mode we just track lines { for (pop = popList; pop; pop = pop->next) { int sx = ((pop->start - seqStart) + .5) * scale + xOff; // x coord of center (lower region) hvGfxLine(hvg, sx, yOff, sx , yOff+ tl.fontHeight, pop->color); } return; } +boolean noMapBoxes = FALSE; +int numItems = slCount(popList); +if ( numItems > 5000) + { + char buffer[4096]; + safef(buffer, sizeof buffer, "Too many (%d) items in window. Zoom in or set viewing range to be more restrictive.", numItems); + noMapBoxes = TRUE; + mapBoxHgcOrHgGene(hvg, winStart, winEnd, xOff, yOff, width, trackHeight, + tg->track, "", buffer, "hgTracks", FALSE, NULL); + } // first draw the lines so they won't overlap any lollies for (pop = popList; pop; pop = pop->next) { int sx = ((pop->start - seqStart) + .5) * scale + xOff; // x coord of center (lower region) hvGfxLine(hvg, sx, yOff + trackHeight, sx , yOff+(trackHeight - pop->height), MG_GRAY); } // now draw the sucker part! for (pop = popList; pop; pop = pop->next) { int sx = ((pop->start - seqStart) + .5) * scale + xOff; // x coord of center (lower region) hvGfxCircle(hvg, sx, yOff + trackHeight - pop->radius - pop->height, pop->radius, pop->color, TRUE); + if (!noMapBoxes) mapBoxHgcOrHgGene(hvg, pop->start, pop->end, sx - pop->radius, yOff + trackHeight - pop->radius - pop->height - pop->radius, 2 * pop->radius,2 * pop->radius, tg->track, pop->name, pop->name, NULL, TRUE, NULL); } } void lollyLeftLabels(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, int height, boolean withCenterLabels, MgFont *font, Color color, enum trackVisibility vis) // draw the labels on the left margin { int fontHeight = tl.fontHeight+1; int centerLabel = (height/2)-(fontHeight/2); if ( tg->visibility == tvDense) {