53237d35a239609d588340929dec558b0bcca1c7
braney
  Mon Mar 20 12:15:32 2023 -0700
let users specify the squishyPackPoint

diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 18e4bd9..5c2c4f2 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -5871,30 +5871,48 @@
 
 char varName[1024];
 safef(varName, sizeof(varName), "%s.doSnake", name);
 cgiMakeCheckBox(varName, option);
 printf("<BR>\n");
 
 char *style = option ? "display:block" : "display:none";
 printf("<DIV ID=\"snakeGraphOptions\" STYLE=\"%s\">\n", style);
 printf("SNAKE OPTIONS!!\n");
 printf("</DIV>\n\n");
 
 jsInlineF("$(\"input[name='%s']\").click( function() { $('#snakeGraphOptions').toggle();} );\n"
     , varName); // XSS FILTER?
 }
 
+void squishyPackOption(struct cart *cart, char *name, char *title, struct trackDb *tdb)
+/* let the user choose to see the track in wiggle mode */
+{
+char option[256];
+char *field = trackDbSetting(tdb, "squishyPackField");
+if (field == NULL)
+    return;
+
+char *squishyPackPointStr = trackDbSetting(tdb, "squishyPackPoint");
+double squishyPackPoint = 999;
+if (squishyPackPointStr != NULL)
+    squishyPackPoint = atof(squishyPackPointStr);
+printf("<BR><B>Squish items that have a %s value that is greater or equal to </B> ", field);
+
+safef(option, sizeof(option), "%s.%s", name, "squishyPackPoint" );
+cgiMakeDoubleVarWithLimits(option, squishyPackPoint, "Range min", 0, NO_VALUE, NO_VALUE);
+}
+
 void wigOption(struct cart *cart, char *name, char *title, struct trackDb *tdb)
 /* let the user choose to see the track in wiggle mode */
 {
 printf("<BR><BR><B>Display data as a density graph:</B> ");
 boolean option = cartOrTdbBoolean(cart, tdb, "doWiggle", FALSE);
 
 char varName[1024];
 safef(varName, sizeof(varName), "%s.doWiggle", name);
 cgiMakeCheckBox(varName, option);
 printf("<BR>\n");
 char *style = option ? "display:block" : "display:none";
 printf("<DIV ID=\"densGraphOptions\" STYLE=\"%s\">\n", style);
 
 // we need to fool the wiggle dialog into defaulting to autoscale and maximum
 char *origType = tdb->type;
@@ -7583,30 +7601,31 @@
 filterBy_t *filterBySet = filterBySetGet(tdb,cart,name);
 if (filterBySet != NULL)
     {
     printf("<BR>");
     filterBySetCfgUi(cart,tdb,filterBySet,FALSE, name);
     filterBySetFree(&filterBySet);
     }
 filterBy_t *highlightBySet = highlightBySetGet(tdb,cart,name);
 if (highlightBySet != NULL)
     {
     printf("<BR>");
     highlightBySetCfgUi(cart,tdb,highlightBySet,FALSE, name);
     filterBySetFree(&highlightBySet);
     }
 
+squishyPackOption(cart, name, title, tdb);
 wigOption(cart, name, title, tdb);
 cfgEndBox(boxed);
 }
 
 static boolean isSpeciesOn(struct cart *cart, struct trackDb *tdb, char *species, char *option, int optionSize, boolean defaultState)
 /* check the cart to see if species is turned off or on (default is defaultState) */
 {
 boolean parentLevel = isNameAtParentLevel(tdb,option);
 if (*option == '\0')
     safef(option, optionSize, "%s.%s", tdb->track, species);
 else
     {
     char *suffix = option + strlen(option);
     int suffixSize = optionSize - strlen(option);
     safef(suffix,suffixSize,".%s",species);