67cb546ae004d876b50e6959aef4d6dcf1e3bff0 max Fri May 16 10:01:03 2025 -0700 fixing width of buttons diff --git src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js index fbea65c..9761f16 100644 --- src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js +++ src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js @@ -8067,66 +8067,72 @@ function legendSetCheckboxes(status) { /* set the legend checkboxes, status can be "none", "invert" or "all". Update the selection and redraw. */ let els = document.getElementsByClassName("tpLegendCheckbox"); let rows = gLegend.rows; for (let i=0; i<els.length; i++) { let el = els[i]; var valIdx = parseInt(el.getAttribute("data-value-index")); let row = rows[valIdx]; var valStr = null; if (gLegend.type==="meta") valStr = gLegend.rows[valIdx].label; if (status==="none") { - if (el.checked) - renderer.unselectByColor(valIdx); + //if (el.checked) + //renderer.unselectByColor(valIdx); el.checked = false; row.isChecked = false; } else if (status==="all") { - if (!el.checked) - renderer.selectByColor(valIdx); + //if (!el.checked) + //renderer.selectByColor(valIdx); el.checked = true; row.isChecked = true; } else if (status==="invert") { if (!el.checked) { el.checked = true; renderer.selectByColor(valIdx); row.isChecked = true; } else { el.checked = false; row.isChecked = false; renderer.unselectByColor(valIdx); } } else if (status==="notNull") { if ((i===0 && valStr===null) || (valStr!==null && likeEmptyString(valStr))) { el.checked = false; row.isChecked = false; renderer.unselectByColor(valIdx); } else { el.checked = true; row.isChecked = true; renderer.selectByColor(valIdx); } } } + // MUCH faster this way: do not operate on clusters, operate on all cells + if (status==="all") + renderer.selectVisible(); + if (status==="none") + renderer.selectClear(); + renderer.drawDots(); } function legendColorOnlyChecked(ev) { /* re-assign colors from palette, for only checked rows. Or reset all colors. */ if (gLegend.isColorOnlyChecked===undefined || gLegend.isColorOnlyChecked===false) { // make a new palette and assign to checked legend rows, otherwise grey let rows = gLegend.rows; let checkedCount = 0; for (let rowIdx=0; rowIdx<rows.length; rowIdx++) { let row = rows[rowIdx]; if (row.isChecked) checkedCount++; } @@ -8292,34 +8298,34 @@ $('#tpLegendContent').empty(); var htmls = []; var colors = []; var rows = gLegend.rows; var legTitle = gLegend.title; var subTitle = gLegend.subTitle; htmls.push('<span id="tpLegendTitle" title="' +gLegend.titleHover+'">'+legTitle+"</span>"); if (subTitle) htmls.push('<div id="tpLegendSubTitle" >'+subTitle+"</div>"); htmls.push('<div class="tpHint">Click buttons to select '+gSampleDesc+'s</small></div>'); - htmls.push("<small><button id='tpLegendAll'>All</button>"); - htmls.push("<button id='tpLegendNone'>None</button>"); - htmls.push("<button id='tpLegendInvert'>Invert</button></small>"); - htmls.push("<button id='tpLegendNotNull'>> 0</button></small>"); + htmls.push("<small><button id='tpLegendAll' class='legendButton'>All</button>"); + htmls.push("<button id='tpLegendNone' class='legendButton'>None</button>"); + htmls.push("<button id='tpLegendInvert' class='legendButton'>Invert</button>"); + htmls.push("<button id='tpLegendNotNull' class='legendButton'>> 0</button></small>"); let buttonText = "Recolor only checked"; if (gLegend.isColorOnlyChecked===true) { buttonText = "Reset colors"; } htmls.push("<button id='tpLegendColorChecked'>"+buttonText+"</button></small>"); htmls.push("</div>"); // title htmls.push('<div id="tpLegendHeader"><span id="tpLegendCol1"></span><span id="tpLegendCol2"></span></div>'); htmls.push('<div id="tpLegendRows">'); // get the sum of all, to calculate frequency var sum = 0; for (var i = 0; i < rows.length; i++) {