c2c780666cf30f764fe4eb81b7fad350b0a7391a kate Thu Mar 8 15:56:39 2018 -0800 Add trackDb setting to indicate if there is a direction to the interaction (interactDirectional). refs #17512 diff --git src/hg/lib/interactUi.c src/hg/lib/interactUi.c index 1a0d231..faf1217 100644 --- src/hg/lib/interactUi.c +++ src/hg/lib/interactUi.c @@ -32,32 +32,47 @@ /* Input box to change track height */ { // track height control char buffer[1024]; int min, max, deflt, current; cartTdbFetchMinMaxPixels(cart, tdb, INTERACT_MINHEIGHT, INTERACT_MAXHEIGHT, atoi(INTERACT_DEFHEIGHT), &min, &max, &deflt, ¤t); safef(buffer, sizeof buffer, "%s.%s", track, INTERACT_HEIGHT); printf("<br><b>Track height: </b>"); cgiMakeIntVar(buffer, current, 3); printf(" <span>pixels (range: %d to %d, default: %d)<span>", min, max, deflt); } +boolean interactUiDirectional(struct trackDb *tdb) +/* Determine if interactions are directional */ +{ +boolean isDirectional = FALSE; +char *setting = trackDbSettingClosestToHome(tdb, INTERACT_DIRECTIONAL); +if (setting == NULL) + errAbort("interact track %s missing required %s setting\n", tdb->track, INTERACT_DIRECTIONAL); +if (sameString(setting, "true")) + isDirectional = TRUE; +else if (differentString(setting, "false")) + errAbort("interact track %s setting %s must be set true or false\n", + tdb->track, INTERACT_DIRECTIONAL); +return isDirectional; +} + void interactCfgUi(char *database, struct cart *cart, struct trackDb *tdb, char *track, char *title, boolean boxed) -/* Bar chart track type */ +/* Configure interact track type */ { if (cartVarExists(cart, "ajax")) isPopup = TRUE; boxed = cfgBeginBoxAndTitle(tdb, boxed, title); if (startsWith("big", tdb->type)) labelCfgUi(database, cart, tdb); //printf("\n<table id=interactControls style='font-size:%d%%' %s>\n<tr><td>", //isPopup ? 75 : 100, boxed ?" width='100%'":""); interactUiTrackHeight(cart, track, tdb); puts("<div>"); interactUiDrawMode(cart, track, tdb); //puts("\n</table>\n"); cfgEndBox(boxed); }