be4311c07e14feb728abc6425ee606ffaa611a58
markd
  Fri Jan 22 06:46:58 2021 -0800
merge with master

diff --git src/hg/inc/barChartUi.h src/hg/inc/barChartUi.h
index 6723b3e..d1d9b04 100644
--- src/hg/inc/barChartUi.h
+++ src/hg/inc/barChartUi.h
@@ -13,30 +13,32 @@
 #define BAR_CHART_COLORS_USER                "user"
 #define BAR_CHART_COLORS_DEFAULT             BAR_CHART_COLORS_USER
 
 /* Data transform */
     // WARNING: this also appears in JS
 #define BAR_CHART_LOG_TRANSFORM              "logTransform"
 #define BAR_CHART_LOG_TRANSFORM_DEFAULT      TRUE
 
 /* Data range and viewing limits */
 #define BAR_CHART_MAX_LIMIT                  "maxLimit"
 #define BAR_CHART_MAX_LIMIT_DEFAULT          10000
     // WARNING: this also appears in JS
 #define BAR_CHART_MAX_VIEW_LIMIT             "maxViewLimit"
 #define BAR_CHART_MAX_VIEW_LIMIT_DEFAULT     50
 
+#define BAR_CHART_LIMIT	"barChartLimit"
+
 /* Category (bar) info */
 #define BAR_CHART_MAX_CATEGORIES        1000
 
 /* Category filter */
 #define BAR_CHART_CATEGORY_SELECT      "categories"
 
 /* Labels for categories */
 #define BAR_CHART_CATEGORY_LABELS        "barChartBars"
 #define BAR_CHART_CATEGORY_LABEL         "barChartLabel"
 #define BAR_CHART_CATEGORY_LABEL_DEFAULT "Categories"
 
 /* Colors for categories */
 #define BAR_CHART_CATEGORY_COLORS        "barChartColors"
 
 /* Labels and colors */
@@ -66,30 +68,36 @@
 
 #define barChartAutoSqlString \
 "table barChartBed\n" \
 "\"BED6+ with additional fields for category count and values\"\n" \
     "(\n" \
     "string chrom;       \"Reference sequence chromosome or scaffold\"\n" \
     "uint   chromStart;  \"Start position in chromosome\"\n" \
     "uint   chromEnd;    \"End position in chromosome\"\n" \
     "string name;        \"Item identifier\"\n" \
     "uint   score;       \"Score from 0-1000; derived from total median all categories (log-transformed and scaled)\"\n" \
     "char[1] strand;     \"+ or - for strand\"\n" \
     "uint expCount;      \"Number of categories\"\n" \
     "float[expCount] expScores; \"Comma separated list of category values\"\n" \
     ")\n"
 
+double barChartCurViewMax(struct cart *cart, char *trackName, struct trackDb *tdb);
+/* Look up max value to scale for this bar chart - consults both cart and trackDb defaults. */
+
+boolean barChartIsLogTransformed(struct cart *cart, char *trackName, struct trackDb *tdb);
+/* Return TRUE if bar chart needs to be log transformed */
+
 double barChartUiMaxMedianScore();
 /* Max median score, for scaling */
 
 struct barChartCategory *barChartUiGetCategories(char *database, struct trackDb *tdb);
 /* Get category colors and descriptions.  
  * If barChartLabel setting contains label list, assign rainbow colors.
  * O/w look for a table naed track+Category, and use labels and colors there */
 
 struct barChartCategory *barChartUiGetCategoryById(int id, char *database, 
                                                         struct trackDb *tdb);
 /* Get category info by id */
 
 char *barChartUiGetCategoryLabelById(int id, char *database, struct trackDb *tdb);
 /* Get label for a category id */