6dfb86f7f9c25c2fd3b332695b9e79dc0c5184ee chmalee Fri Feb 25 16:06:50 2022 -0800 Fix 3 barChart issues: One allow users to define a bar width and padding, two fix bar drawing bug where dynamically sizing the bars based on zoom level was causing some bars to be drawn at inconsistent widths in the same chart, three fix barChartStretchToItem bug when zoomed in to the base level such that your window size is less than the item size, refs #28977 diff --git src/hg/inc/barChartUi.h src/hg/inc/barChartUi.h index 8789be3..c54f1ab 100644 --- src/hg/inc/barChartUi.h +++ src/hg/inc/barChartUi.h @@ -54,30 +54,34 @@ /* Measurement type -- e.g. 'median'. Shown as part of label on details page. Default is "" */ #define BAR_CHART_METRIC "barChartMetric" /* Suppress whiteout behind graph (to show highlight and blue lines) */ #define BAR_CHART_NO_WHITEOUT "noWhiteout" #define BAR_CHART_NO_WHITEOUT_DEFAULT FALSE /* Support limiting graphs to small or medium hights (bypass semantic zoom) */ #define BAR_CHART_MAX_GRAPH_SIZE "barChartMaxSize" #define BAR_CHART_MAX_GRAPH_SIZE_SMALL "small" #define BAR_CHART_MAX_GRAPH_SIZE_MEDIUM "medium" #define BAR_CHART_MAX_GRAPH_SIZE_LARGE "large" #define BAR_CHART_MAX_GRAPH_SIZE_DEFAULT BAR_CHART_MAX_GRAPH_SIZE_LARGE #define BAR_CHART_SIZE_WINDOWS "barChartSizeWindows" +/* Let users configure bar width and padding if semantic zoom doesn't work */ +#define BAR_CHART_USER_BAR_WIDTH "barChartBarWidth" +#define BAR_CHART_USER_BAR_PADDING "barChartBarPadding" + void barChartCfgUi(char *database, struct cart *cart, struct trackDb *tdb, char *track, char *title, boolean boxed); /* Bar chart track type */ #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" \