7f165a4c474605452621918390c40378a571eec5
kent
  Sun Jan 31 08:31:08 2021 -0800
Getting the facets properly (not in an iFrame) into hgTrackUi.

diff --git src/hg/hgc/facetedBar.c src/hg/hgc/facetedBar.c
index 2cfc1ff..556b836 100644
--- src/hg/hgc/facetedBar.c
+++ src/hg/hgc/facetedBar.c
@@ -67,34 +67,33 @@
     for (i=0; i<oldFieldCount; ++i)
 	newRow[i] = fr->row[i];
     char buf[16];
     safef(buf, sizeof(buf), "%g", chart->expScores[rowIx]);
     newRow[oldFieldCount] = lmCloneString(newTable->lm, buf);
     fieldedTableAdd(newTable, newRow, newFieldCount, fr->id);
     }
 return newTable;
 }
 
 void facetedBarChart(char *item, struct barChartBed *chart, struct trackDb *tdb, 
     double maxVal, char *statsFile, char *facets, char *metric)
 {
 char *trackName = tdb->track;
 struct sqlConnection *conn = sqlConnect(database);
-struct hash *emptyHash = hashNew(0);
 struct hash *wrapperHash = hashNew(0);
 
-/* Write out html to pull in the other files we use and make white background */
+/* Write html to make white background */
 hInsideStyleToWhite();
 
 /* Set up url that has enough context to get back to us.  */
 struct dyString *returnUrl = dyStringNew(0);
 dyStringPrintf(returnUrl, "../cgi-bin/hgc?g=%s", trackName);
 if (item != NULL)
     dyStringPrintf(returnUrl, "&i=%s", item);
 dyStringPrintf(returnUrl, "&%s", cartSidUrlString(cart));
 
 /* Working within a form we save context.  It'd be nice to work outside of form someday. */
 printf("<form action=\"../cgi-bin/hgc\" name=\"facetForm\" ");
 printf("method=\"GET\">\n");
 printf("<div style=\"background-color:white\">");
 cartSaveSession(cart);
 cgiContinueHiddenVar("g");
@@ -120,20 +119,19 @@
 
 /* Add wrapper function(s) */
 hashAdd(wrapperHash, "val", wrapVal);
 
 /* Pick which fields to display.  We'll take the first field whatever it is
  * named, and also count, and the "val" field we added and wrapped. */
 char displayList[256];
 safef(displayList, sizeof(displayList), "%s,count,val", table->fields[0]);
 
 facetedTableWriteHtml(facTab, cart, selected, displayList,
     returnUrl->string, 32, wrapperHash, &context, 7);
 
 
 /* Clean up and go home. */
 printf("</div></form>\n");
-hashFree(&emptyHash);
 facetedTableFree(&facTab);
 sqlDisconnect(&conn);
 }