Skip to content

Commit 8559b56

Browse files
committed
Fix explorer facet dimming
1 parent 7d2af9e commit 8559b56

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

explorer.qmd

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,23 +1493,17 @@ zoomWatcher = {
14931493
// Counts answer: for each value in facet D, how many samples would match
14941494
// this value plus the active filters in all OTHER facets. This keeps
14951495
// selected facets useful as drill-out controls instead of just echoing the
1496-
// selected values. Search text is treated as an additional sample predicate.
1496+
// selected values.
14971497
let facetCountsReqId = 0;
14981498
let facetCountsDebounce = null;
14991499
1500-
function getSearchTerm() {
1501-
const input = document.getElementById('sampleSearch');
1502-
return input ? input.value.trim() : '';
1503-
}
1504-
15051500
function describeCrossFilters() {
15061501
const sourceChecks = document.querySelectorAll('#sourceFilter input[type="checkbox"]');
15071502
const sourceTotal = sourceChecks.length;
15081503
const sources = getActiveSources();
15091504
const mat = getCheckedValues('materialFilterBody');
15101505
const ctx = getCheckedValues('contextFilterBody');
15111506
const ot = getCheckedValues('objectTypeFilterBody');
1512-
const search = getSearchTerm();
15131507
const dims = [
15141508
{ key: 'source', col: 'source', values: sources.length < sourceTotal ? sources : [] },
15151509
{ key: 'material', col: 'material', values: mat },
@@ -1523,13 +1517,11 @@ zoomWatcher = {
15231517
activeDims,
15241518
totalActiveValues,
15251519
sourceImpossible: sourceTotal > 0 && sources.length === 0,
1526-
searchActive: search.length >= 2,
1527-
search,
15281520
};
15291521
}
15301522
15311523
function buildCrossFilterWhere(excludeFacet) {
1532-
const { activeDims, sourceImpossible, searchActive, search } = describeCrossFilters();
1524+
const { activeDims, sourceImpossible } = describeCrossFilters();
15331525
if (sourceImpossible && excludeFacet !== 'source') return '1=0';
15341526
15351527
const conds = activeDims
@@ -1539,31 +1531,21 @@ zoomWatcher = {
15391531
return `${d.col} IN (${list})`;
15401532
});
15411533
1542-
if (searchActive) {
1543-
const terms = searchTerms(search);
1544-
const searchWhere = textSearchWhere(terms, ['label', 'CAST(place_name AS VARCHAR)']);
1545-
conds.push(`pid IN (
1546-
SELECT pid
1547-
FROM read_parquet('${lite_url}')
1548-
WHERE ${searchWhere}
1549-
)`);
1550-
}
1551-
15521534
return conds.length > 0 ? conds.join(' AND ') : '1=1';
15531535
}
15541536
15551537
async function updateCrossFilteredCounts(myReq) {
15561538
if (myReq !== facetCountsReqId) return;
1557-
const { dims, activeDims, totalActiveValues, sourceImpossible, searchActive } = describeCrossFilters();
1539+
const { dims, activeDims, totalActiveValues, sourceImpossible } = describeCrossFilters();
15581540
1559-
if (!sourceImpossible && activeDims.length === 0 && !searchActive) {
1541+
if (!sourceImpossible && activeDims.length === 0) {
15601542
for (const d of dims) applyFacetCounts(d.key, null);
15611543
return;
15621544
}
15631545
15641546
markFacetCountsRecomputing();
15651547
1566-
const singleActiveDim = !sourceImpossible && !searchActive
1548+
const singleActiveDim = !sourceImpossible
15671549
&& activeDims.length === 1 && activeDims[0].values.length === 1
15681550
? activeDims[0] : null;
15691551
if (singleActiveDim && totalActiveValues === 1) {

0 commit comments

Comments
 (0)