38fe0330488867c168c817169bbf1c49806c5cfb kate Fri Oct 7 15:32:40 2016 -0700 Move tissue table to code for flexibility/maintenance. refs #17369 diff --git src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c index 10ae215..3b072a8 100644 --- src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c +++ src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c @@ -12,76 +12,129 @@ #include "hCommon.h" #include "hgConfig.h" #include "hdb.h" #include "htmshell.h" #include "hubConnect.h" #include "hui.h" #include "jsHelper.h" #include "jsonParse.h" #include "obscure.h" // for readInGulp #include "regexHelper.h" #include "suggest.h" #include "trackHub.h" #include "trix.h" #include "web.h" +#include "gtexInfo.h" +#include "gtexTissue.h" + /* Global Variables */ struct cart *cart = NULL; /* CGI and other variables */ struct hash *oldVars = NULL; /* Old contents of cart before it was updated by CGI */ static void doCartJson() /* Perform UI commands to update the cart and/or retrieve cart vars & metadata. */ { struct cartJson *cj = cartJsonNew(cart); //e.g. cartJsonRegisterHandler(cj, "setTaxId", setTaxId); cartJsonExecute(cj); } static void doJsIncludes() /* Include JS libraries. From hgGateway (think about libifying) */ { //puts(""); //puts(""); //puts(""); puts(""); webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("jquery.watermarkinput.js", NULL); jsIncludeFile("utils.js",NULL); } +static void printTissueTable(char *version) +/* Output HTML with tissue labels and colors, in 2 columns, to fit next to body map */ +{ +struct gtexTissue *tis, *tissues = gtexGetTissues(version); +struct gtexTissue **tisTable = NULL; +int count = slCount(tissues); +AllocArray(tisTable, count); +int i=0, col=0; +int cols = 2; +int last = count/2 + 1; + +puts("
%s | ", + tis->color, tis->name, tis->description); + col++; + if (col > cols-1) + { + puts("