c5a827f8f0c4094c20ff333acb191ded2bf86744
braney
  Wed Dec 20 11:36:10 2017 -0800
ongoing work on hgCollection

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 31d87c4..449af58 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -14179,84 +14179,86 @@
     }
 track->height = height;
 return track->height;
 }
 
 int trackPriCmp(const void *va, const void *vb)
 /* Compare for sort based on priority */
 {
 const struct track *a = *((struct track **)va);
 const struct track *b = *((struct track **)vb);
 
 return (a->priority - b->priority);
 }
 
 void buildMathWig(struct trackDb *tdb)
-/* Turn a mathWig view into a mathWig track. */
+/* Turn a mathWig composite into a mathWig track. */
 {
 char *viewFunc =  trackDbSetting(tdb, "viewFunc");
 
 if ((viewFunc == NULL) || sameString("show all", viewFunc))
     return;
 
 struct trackDb *subTracks = tdb->subtracks;
 
 tdb->subtracks = NULL;
 tdb->type = "mathWig";
 
 struct dyString *dy = newDyString(1024);
 
 if (sameString("add all", viewFunc))
     dyStringPrintf(dy, "+ ");
 else
     dyStringPrintf(dy, "- ");
 struct trackDb *subTdb;
 for (subTdb=subTracks; subTdb; subTdb = subTdb->next)
     {
     char *bigDataUrl = trackDbSetting(subTdb, "bigDataUrl");
     if (bigDataUrl != NULL)
         dyStringPrintf(dy, "%s ",bigDataUrl);
     else // native tracks are prepended with '$'
         dyStringPrintf(dy, "$%s ",subTdb->track);
     }
 
 hashAdd(tdb->settingsHash, "mathDataUrl", dy->string);
 }
 
+#ifdef NOTNOW   /// for the moment, mathWigs are made at the composite level.  Since we may go back to having them at the view level I'm leaving this in
 void fixupMathWigs(struct trackDb *tdb)
 /* Look through a container to see if it has a mathWig view and convert it. */
 {
 struct trackDb *subTdb;
 
 for(subTdb = tdb->subtracks; subTdb; subTdb = subTdb->next)
     {
     char *type;
     if ((type = trackDbSetting(subTdb, "container")) != NULL)
         {
         if (sameString(type, "mathWig"))
             {
             buildMathWig(subTdb);
             }
         }
     }
 }
+#endif
 
 void makeCompositeTrack(struct track *track, struct trackDb *tdb)
 /* Construct track subtrack list from trackDb entry.
  * Sets up color gradient in subtracks if requested */
 {
-fixupMathWigs(tdb);
+buildMathWig(tdb);
 unsigned char finalR = track->color.r, finalG = track->color.g,
                             finalB = track->color.b;
 unsigned char altR = track->altColor.r, altG = track->altColor.g,
                             altB = track->altColor.b;
 unsigned char deltaR = 0, deltaG = 0, deltaB = 0;
 
 struct slRef *tdbRef, *tdbRefList = trackDbListGetRefsToDescendantLeaves(tdb->subtracks);
 
 struct trackDb *subTdb;
 int subCount = slCount(tdbRefList);
 int altColors = subCount - 1;
 struct track *subtrack = NULL;
 TrackHandler handler;
 boolean smart = FALSE;