6986d502973a4a246506b1b15c515648a2abf483
chmalee
  Mon Jul 21 15:52:33 2025 -0700
Move the hgc init call in the hgTracks popup later so function calls that rely on rendered text will work, refs #36092

diff --git src/hg/js/hgc.js src/hg/js/hgc.js
index 65bf7888cc9..dcb18b56551 100644
--- src/hg/js/hgc.js
+++ src/hg/js/hgc.js
@@ -260,31 +260,31 @@
                 if (input.name.endsWith("SetAllVis") || (input.getAttribute("data-default") === input.checked.toString())) {
                     input.disabled = true;
                 } else {
                     input.value = input.value.toLowerCase();
                 }
             }
         });
     }
 }
 
 
 function initPage() {
     if (typeof doHPRCTable !== "undefined") {
         makeHPRCTable();
     }
-    if ($("#svgTable") !== null) {
+    if (typeof svgTable !== "undefined") {
         // redraw the svg with appropriate widths for all columns
         // swatchWidth and columnSpacer are taken from svgBarChart() in hgc/barChartClick.c
         // they should probably be dynamically determined
         var swatchWidth = 20.0;
         var columnSpacer = 4.0;
         var maxSampleWidth = 0.0;
 
         // determine the size taken up by the sample names
         $(".sampleLabel").each(function(s) {
             if ((sampleLength = this.getComputedTextLength()) >= maxSampleWidth) {
                 maxSampleWidth = sampleLength;
             }
         });
 
         // determine the size taken up by the 'N' counts