272888a64de727315e0328a74b727d695fcb8db7 kent Mon Jan 18 20:26:56 2021 -0800 Some fine adjustments to the scale of bars - honestly could make them wider but not wanting to make GTEX behave differently just yet. diff --git src/hg/hgTracks/barChartTrack.c src/hg/hgTracks/barChartTrack.c index 79e3fe0..e185d8c 100644 --- src/hg/hgTracks/barChartTrack.c +++ src/hg/hgTracks/barChartTrack.c @@ -366,40 +366,42 @@ extras->winMaxGraph = WIN_MAX_GRAPH_DEFAULT; extras->winMedGraph = WIN_MED_GRAPH_DEFAULT; char *setting = trackDbSetting(tdb, BAR_CHART_SIZE_WINDOWS); if (isNotEmpty(setting)) { char *words[2]; int ct = chopLine(setting, words); if (ct == 2) { extras->winMaxGraph = atoi(words[0]); extras->winMedGraph = atoi(words[1]); } } int barCount = getCategoryCount(tg); double scale = 1.0; -if (barCount < 20) +if (barCount <= 20) scale = 2.0; -else if (barCount < 40) +else if (barCount <= 50) scale = 1.5; -else if (barCount < 80) +else if (barCount <= 100) scale = 1.0; -else if (barCount < 120) +else if (barCount <= 150) scale = 0.75; -else +else if (barCount <= 200) scale = 0.5; +else + scale = 0.25; long winSize = virtWinBaseCount; if (winSize < extras->winMaxGraph && sameString(extras->maxGraphSize, BAR_CHART_MAX_GRAPH_SIZE_LARGE)) { extras->boxModelHeight = MAX_BAR_CHART_MODEL_HEIGHT; extras->barWidth = MAX_BAR_WIDTH * scale; extras->padding = MAX_GRAPH_PADDING; extras->maxHeight = MAX_GRAPH_HEIGHT; } else if (winSize < extras->winMedGraph && differentString(extras->maxGraphSize, BAR_CHART_MAX_GRAPH_SIZE_SMALL)) { extras->boxModelHeight = MED_BAR_CHART_MODEL_HEIGHT; extras->barWidth = MED_BAR_WIDTH * scale;