23bb7c6df21dec94a2a711c14149da901647104a braney Tue May 17 15:02:54 2016 -0700 use autoscale and maximum scaling mode for density graphs. Also, don't show the wiggle options unless folks have selected density graph diff --git src/hg/lib/hui.c src/hg/lib/hui.c index dee6965..0e68346 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -4820,39 +4820,44 @@ void wigOption(struct cart *cart, char *name, char *title, struct trackDb *tdb) /* let the user choose to see the track in wiggle mode */ { char *canDoCoverage = cfgOptionEnvDefault("HGDB_CAN_DO_COVERAGE", CanDoCoverageConfVariable, "off"); if (differentString(canDoCoverage, "on")) return; printf("

Display data as a density graph: "); char varName[1024]; safef(varName, sizeof(varName), "%s.doWiggle", name); boolean parentLevel = isNameAtParentLevel(tdb,varName); boolean option = cartUsualBooleanClosestToHome(cart, tdb, parentLevel,"doWiggle", FALSE); -//char *optVal = "on"; -//if (! option) - //optVal = "off"; -//printf("\n", varName) - cgiMakeCheckBox(varName, option); printf("
\n"); -printf("
\n"); +char *style = option ? "display:block" : "display:none"; +printf("
\n", style); + +// we need to fool the wiggle dialog into defaulting to autoscale and maximum +char *origType = tdb->type; +tdb->type = "bedGraph"; +if (hashFindVal(tdb->settingsHash, AUTOSCALE) == NULL) + hashAdd(tdb->settingsHash, AUTOSCALE, "on"); +if (hashFindVal(tdb->settingsHash, WINDOWINGFUNCTION) == NULL) + hashAdd(tdb->settingsHash, WINDOWINGFUNCTION, wiggleWindowingEnumToString( wiggleWindowingMax)); wigCfgUi(cart,tdb,name,title,TRUE); +tdb->type = origType; printf("
\n\n"); printf("\n\n"); } void wiggleScaleDropDownJavascript(char *name) /* print some js that deactivates the min/max range if autoscaling is activated */ { printf("