364d1d51ed66e45f7db0cca796863bbdf438b6ce
kate
  Tue Nov 28 13:05:53 2017 -0800
Add maxHeightPixels setting support to longTabix track type. refs #17512

diff --git src/hg/lib/longRange.c src/hg/lib/longRange.c
index 419fc92..8fc3ac4 100644
--- src/hg/lib/longRange.c
+++ src/hg/lib/longRange.c
@@ -1,33 +1,38 @@
 /*    longRange --- functions to provide UI for long range interaction
  *         graph.   Functions to retrieve long range information from
  *         bedTabix format.
  */
 
 /* Copyright (C) 2016 The Regents of the University of California 
  *  * See README in this or parent directory for licensing information. */
 
 #include "longRange.h"
 
 void longRangeCfgUi(struct cart *cart, struct trackDb *tdb, char *name, char *title, boolean boxed)
 /* Complete track controls for long range interaction. */
 {
 char buffer[1024];
+int min, max, deflt, current;
+cartTdbFetchMinMaxPixels(cart, tdb, LONG_MINHEIGHT, LONG_MAXHEIGHT, atoi(LONG_DEFHEIGHT),
+                                &min, &max, &deflt, &current);
 safef(buffer, sizeof buffer, "%s.%s", tdb->track, LONG_HEIGHT);
-unsigned height = sqlUnsigned(cartUsualString(cart, buffer, LONG_DEFHEIGHT));
-printf("<BR><b>Track height:&nbsp;</b>");
-cgiMakeIntVar(buffer, height, 3);
+printf("<br><b>Track height:&nbsp;</b>");
+cgiMakeIntVar(buffer, current, 3);
+printf("&nbsp;<span>pixels&nbsp;(range: %d to %d, default: %d)<span>", 
+        min, max, deflt);
+
 safef(buffer, sizeof buffer, "%s.%s", tdb->track, LONG_MINSCORE);
 double minScore = sqlDouble(cartUsualString(cart, buffer, LONG_DEFMINSCORE));
 printf("<BR><BR><b>Minimum score:&nbsp;</b>");
 cgiMakeDoubleVar(buffer, minScore, 0);
 }
 
 static char *getOther(struct bed *bed, unsigned *s, unsigned *e, double *score)
 /* parse the name field of longTabix to get the other location */
 {
 char *otherChrom = cloneString(bed->name);
 char *ptr = strchr(otherChrom, ':');
 if (ptr == NULL)
     errAbort("bad longTabix bed name %s\n", bed->name);
 *ptr++ = 0;
 *s = atoi(ptr);