65cc3900649623b8366ab05d9b285e528f8f2959 hiram Tue Mar 8 11:58:53 2022 -0800 now using a new initial column for the view/request function and correctly counting hasIucn columns refs #28930 diff --git src/hg/js/gar.js src/hg/js/gar.js index 42f7f00..0adcffa 100644 --- src/hg/js/gar.js +++ src/hg/js/gar.js @@ -152,55 +152,55 @@ countVisHidden: function(category, counts, gca, gcf, canBeReq, ucscDb, hasIucn) { gar.incrementCount(category, counts); if (gca) { gar.incrementCount('gca', counts); } if (gcf) { gar.incrementCount('gcf', counts); } if (hasIucn) { gar.incrementCount('iucn', counts); } if (canBeReq) { gar.incrementCount('gar', counts); } else { gar.incrementCount('gak', counts); } }, // foreach table, for each row in the table, count visible rows countVisibleRows: function(et) { // var t0 = gar.millis(); - var comNameRow = gar.columnNames.get('comName'); + var viewReqRow = gar.columnNames.get('viewReq'); var asmIdRow = gar.columnNames.get('asmId'); var iucnRow = gar.columnNames.get('IUCN'); var cladeRow = gar.columnNames.get('clade'); var visRows = 0; var totalRows = 0; // key is category name, value is count visible var categoryVisible = new Map(); // key is category name, value is count hidden var categoryHidden = new Map(); var i = 0; for (i = 0; i < gar.cladeTableList.length; i++) { for (var j = 0; j < gar.cladeTableList[i].rows.length; j++) { var rowId = gar.cladeTableList[i].rows[j]; var tagN = rowId.parentNode.tagName.toLowerCase(); // ignore thead and tfoot rows if (tagN === "thead" || tagN === "tfoot") { continue; } ++totalRows; var thisClade = rowId.cells[cladeRow].innerHTML; var asmId = rowId.cells[asmIdRow].innerHTML; var isGCA = asmId.includes("GCA"); var isGCF = asmId.includes("GCF"); - var comName = rowId.cells[comNameRow].innerHTML; - var canBeRequested = comName.includes("button"); - var ucscDb = comName.includes("cgi-bin/hgTracks"); + var viewReq = rowId.cells[viewReqRow].innerHTML; + var canBeRequested = viewReq.includes("button"); + var ucscDb = viewReq.includes("cgi-bin/hgTracks"); var iucnStatus = rowId.cells[iucnRow].innerHTML; var hasIucn = false; if (iucnStatus) { hasIucn = ! iucnStatus.includes(" "); } if ( rowId.style.display !== "none") { gar.countVisHidden(thisClade, categoryVisible, isGCA, isGCF, canBeRequested, ucscDb, hasIucn); ++visRows; } else { gar.countVisHidden(thisClade, categoryHidden, isGCA, isGCF, canBeRequested, ucscDb, hasIucn); } } } var notVis = totalRows - visRows; /* fixup the showAll checkbox status, fully on == checked box @@ -218,32 +218,32 @@ } var hiddenCount = 0; if ( categoryHidden.get(name) ) { hiddenCount = categoryHidden.get(name); } if (hiddenCount > 0 && visibleCount > 0) { checkBox.indeterminate = true; } else { checkBox.indeterminate = false; } var labelId = name + "Label"; var labelEl = document.getElementById(labelId); var labelText = gar.checkBoxLabels.get(name); if (labelEl) { labelEl.innerText = labelText + " (" + visibleCount.toLocaleString() + "/" + hiddenCount.toLocaleString() + ")"; - } else { -alert("no element for label '" + labelId + "'"); +// } else { +// alert("no element for label '" + labelId + "'"); } }); var showAllList = document.getElementsByClassName('showAll'); // var thisEt = gar.millis() - t0; var thisEt = et; if (visRows > 0) { // var pageEt = gar.garEndTime.getTime() - window.garStartTime.getTime(); // perfDisplay.innerHTML = "countRows " + gar.garEndTime.getTime() + " - " + window.garStartTime.getTime() + " = page load time " + pageEt + " millis : DOMContentLoaded: " + gar.onLoadTime.getTime(); if (gar.measureTiming) { counterDisplay.innerHTML = "showing " + visRows.toLocaleString() + " assemblies, " + notVis.toLocaleString() + " hidden : process time: " + thisEt + " millis"; } else { counterDisplay.innerHTML = "showing " + visRows.toLocaleString() + " assemblies, " + notVis.toLocaleString() + " hidden"; } for (i = 0; i < showAllList.length; i++) { if (notVis > 0) {