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/hgc/barChartClick.c src/hg/hgc/barChartClick.c index 162766a9fc4..eb27e10ce94 100644 --- src/hg/hgc/barChartClick.c +++ src/hg/hgc/barChartClick.c @@ -464,30 +464,31 @@ double borderSize = 1.0; double headerHeight = heightPer + 2*borderSize; double innerHeight=heightPer-borderSize; double labelWidth = longestLabelSize(categs) + 9; // Add some because size is just estimate if (labelWidth > totalWidth/2) labelWidth = totalWidth/2; // Don't let labels take up more than half double patchWidth = heightPer; double labelOffset = patchWidth + 2*borderSize; double statsOffset = labelOffset + labelWidth; double barOffset = statsOffset + statsSize; double statsRightOffset = barOffset - 9; double barNumLabelWidth = estimateStringWidth(" 1234.000"); double barMaxWidth = totalWidth-barOffset -barNumLabelWidth ; double totalHeight = headerHeight + heightPer * categCount + borderSize; +jsInline("var svgTable = true;\n"); printf("<svg id='svgBarChart' width=\"%g\" height=\"%g\">\n", totalWidth, totalHeight); /* Draw header */ printf("<rect width=\"%g\" height=\"%g\" style=\"fill:#%s\"/>\n", totalWidth, headerHeight, HG_COL_HEADER); char *sampleLabel = trackDbSettingOrDefault(tdb, "barChartLabel", "Sample"); printf("<text class=\"sampleLabel\" x=\"%g\" y=\"%g\" font-size=\"%g\">%s</text>\n", labelOffset, innerHeight-1, innerHeight-1, sampleLabel); if (statsSize > 0.0) printf("<text class=\"statsLabel\" x=\"%g\" y=\"%g\" font-size=\"%g\" text-anchor=\"end\">%s</text>\n", statsRightOffset, innerHeight-1, innerHeight-1, "N"); printf("<text class=\"valueLabel\" x=\"%g\" y=\"%g\" font-size=\"%g\">%s %s</text>\n", barOffset, innerHeight-1, innerHeight-1, metric, "Value"); /* Set up clipping path for the pesky labels, which may be too long */ printf("<clipPath id=\"labelClip\"><rect x=\"%g\" y=\"0\" width=\"%g\" height=\"%g\"/></clipPath>\n",