693a69d6c9bb0639e3b4e37581ade795b4c2a7c7 braney Wed Feb 1 15:18:33 2023 -0800 add option to show chains as snakes under hg.conf control diff --git src/hg/lib/hui.c src/hg/lib/hui.c index 1f2b962..9c53fe9 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -5853,30 +5853,53 @@ } else if (title) printf("
%s ", title ); else printf("
");
return boxed;
}
void cfgEndBox(boolean boxed)
// Handle end of box and title for individual track type settings
{
if (boxed)
puts("");
}
+void snakeOption(struct cart *cart, char *name, char *title, struct trackDb *tdb)
+/* let the user choose to see the track in snake mode */
+{
+if (!cfgOptionBooleanDefault("canSnake", FALSE))
+ return;
+
+printf("
Display data as a snake graph: ");
+boolean option = cartOrTdbBoolean(cart, tdb, "doSnake", FALSE);
+
+char varName[1024];
+safef(varName, sizeof(varName), "%s.doSnake", name);
+cgiMakeCheckBox(varName, option);
+printf("
\n");
+
+char *style = option ? "display:block" : "display:none";
+printf("
Filter by chromosome (e.g. chr10): "); safef(optString, ArraySize(optString), "%s.%s", prefix, OPT_CHROM_FILTER); cgiMakeTextVar(optString, cartUsualStringClosestToHome(cart, tdb, parentLevel, OPT_CHROM_FILTER, ""), 15); if (normScoreAvailable) scoreCfgUi(db, cart,tdb,prefix,NULL,CHAIN_SCORE_MAXIMUM,FALSE); wigOption(cart, prefix, title, tdb); +snakeOption(cart, prefix, title, tdb); cfgEndBox(boxed); } struct dyString *dyAddFilterAsInt(struct cart *cart, struct trackDb *tdb, struct dyString *extraWhere,char *filter, char *defaultLimits, char*field, boolean *and) // creates the where clause condition to support numeric int filter range. // Filters are expected to follow // {fiterName}: trackDb min or min:max - default value(s); // {filterName}Min or {filterName}: min (user supplied) cart variable; // {filterName}Max: max (user supplied) cart variable; // {filterName}Limits: trackDb allowed range "0:1000" Optional // uses:{filterName}Min: old trackDb value if {filterName}Limits not found // {filterName}Max: old trackDb value if {filterName}Limits not found // defaultLimits: function param if no tdb limits settings found)