Skip to content

#291: facet hierarchy tree for Sampled Feature + Specimen Type#294

Merged
rdhyee merged 1 commit into
isamplesorg:mainfrom
rdhyee:feat/291-context-objecttype-trees
Jun 18, 2026
Merged

#291: facet hierarchy tree for Sampled Feature + Specimen Type#294
rdhyee merged 1 commit into
isamplesorg:mainfrom
rdhyee:feat/291-context-objecttype-trees

Conversation

@rdhyee

@rdhyee rdhyee commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

#291 — extend the facet hierarchy tree to Sampled Feature + Specimen Type

Follow-up to the shipped Material tree (#281/#282 + live counts #290). Now all three hierarchical facets render as expandable trees: Material, Sampled Feature (context), Specimen Type (object_type). source stays flat. Caveat #1 from the Slack note (material-only) → closed.

What

Generalizes the previously material-specific machinery to a dim-parameterized model:

  • TREE_DIM_BODY / TREE_DIM_KEYS config; treeActive(key) / treeSelection(key) / syncTreeVisual(bodyId) replace the material* helpers; renderTreeFacet(facetType, bodyId, …).
  • facetFilterSQL, writeQueryState, applyQueryToFacetFilters, describeCrossFilters, buildCrossFilterWhere, updateCrossFilteredCounts all loop/key by dim — tree dim → membership (facet_type='<key>'), flat → facets_v3. Per-dim live-count gate (zoomed → membership, global → baseline) and per-dim flat fallback.

Verified (202608)

  • All three trees render — material 18 / context 21 / object_type 14 nodes, correct roots + counts ("All sampled features", "All specimen types").
  • Each tree filters the table/map via membership; tri-state/inherit + URL round-trip per dim; material legend == table coherence holds; multi-dim selections register + round-trip.
  • 10 facet-tree specs + smoke green; quarto render clean (OJS parse OK).
  • Codex: no blocking findings — it validated 3 simultaneous tree filters as coherent (1047) natively.

Known follow-up (filed #293)

Multi-tree filtering issues one membership scan per selected tree dim (AND-ed) — fast natively (~0.1s) but slow in WASM at scale; single-dim (the common case) is fast. Collapse into one scan / cube. (The #290 global-view live-count baseline gate also applies per-dim — counts at global view aren't cross-filtered; #290's cube follow-up covers it.)

Heavy live-count integration specs retry under accumulated WASM load (gated/local, not CI).

🤖 Generated with Claude Code

… Specimen Type

Generalizes the material-specific tree machinery to a dim-parameterized model over
all three hierarchical dims (material, context=Sampled Feature, object_type=Specimen
Type). source stays flat. The data pipeline already builds tree_summaries +
membership for all three.

- TREE_DIM_BODY / TREE_DIM_KEYS config (OJS cells).
- treeActive(key) / treeSelection(key) / syncTreeVisual(bodyId) replace the
  material-specific helpers; renderTreeFacet(facetType, bodyId, flatItems, allLabel).
- facetFilterSQL, writeQueryState, applyQueryToFacetFilters, describeCrossFilters,
  buildCrossFilterWhere, updateCrossFilteredCounts all loop/key by dim: tree dim →
  membership (facet_type='<key>'); flat → facets_v3. Per-dim live-count gate
  (zoomed→membership, global→baseline) and per-dim flat fallback.

Verified (202608): all three trees render (material 18 / context 21 / object_type 14
nodes, correct roots + counts), each filters via membership, material coherence
legend==table holds, multi-dim selections register + round-trip to the URL. 10
facet-tree specs + smoke green; render clean (OJS parse OK). Codex: no blocking
findings (validated 3 simultaneous tree filters coherent natively).

Known follow-up (isamplesorg#293): multi-tree filtering does N membership scans (one per
selected tree dim) — fast natively but slow in WASM at scale; single-dim (the common
case) is fast. Combine into one scan / add a cube. (The global-view live-count
baseline gate from isamplesorg#290 also applies per-dim.)

Heavy live-count integration specs retry under accumulated WASM load (gated/local,
not CI).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rdhyee rdhyee merged commit 5b6e5ea into isamplesorg:main Jun 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant