Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Render AE drill-down listings lazily to shrink the ae_forestly() widget

Open
#158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, r

Research direction

The work is in the ae_forestly() function, which builds a widget. The drill-down listings are currently built as nested reactable tables. The first step is to understand the existing details function and the inst/js/search-filter.js file. The change depends on an external lt.js extension from the lt repo. Once that is available, embed AE listing data as JSON and replace the R-side details renderer with a client-side JS callback. Verify features by testing sorting, search, and filtering in the drill-down.

Written by the indexing model from the issue text.

Description

Background

Follow-up to #147 (running-time / output-size optimization). #157 removed the duplicated per-nested-table search/filter JS (widget ~1.4 GB → ~350 MB at 1,000 subjects). Profiling the remainder shows the drill-down listing tables are now ~70%+ of the widget: ae_forestly() builds one nested reactable per main-table row (44,865 rows in the profiled case), and each carries ~3 KB of scaffolding regardless of content. All of them are serialized eagerly into the self-contained HTML even though a user only ever expands a few.

Measured at 300 subjects: 13,673 rows, 59.9 MB total; per-row drill-down ≈ 3,135 B.

Proposal

Render the drill-down lazily on the client, and embed the listing data once:

  1. Embed the AE listing data a single time as compact, column-oriented JSON (a page global keyed by parameter + AE term), instead of one pre-built table per row.
  2. Replace the R-side details = function(index) { reactable(...) } with a client-side details = JS("function(rowInfo){ … }") (reactable supports a JS() details renderer). On expand, the callback slices the embedded data for that term and renders an interactive table into the expanded container.
  3. Render that table with a lightweight interactive lt table (sort + search/filter + paging), via the planned lt.js interactive extension.
Expected impact
  • Drill-down scaffolding (~141 MB at 1,000 subj) collapses to one shared renderer + the listing data embedded once → projected total ~340 MB → ~60–100 MB.
  • The per-row R-side reactable construction disappears, so most of the ~605s ae_build stage (this box; single-core) goes away too.
Behavior to preserve
  • Drill-down keeps column sorting, table-wide search, per-column filters, and paging (current reactable features).
  • Search semantics unchanged: substring, ! negation, and x-expression (currently in inst/js/search-filter.js).
  • Main table and crosstalk (param selector + incidence slider) are unchanged — crosstalk wraps only the main table; the drill-down uses none.

Dependency / blocker

Requires the interactive lt.js extension (sort/search/filter/paging as an opt-in add-on). Implementation plan lives in the lt repo (TODO.md). This forestly change is blocked until that extension is published.

Tasks

  • Interactive lt extension available (see lt repo).
  • Emit the AE listing once as a compact JSON global in ae_forestly().
  • Switch details to a client-side JS() renderer calling the lt extension.
  • Attach the lt (+ interactive extension) JS/CSS dependencies.
  • Verify drill-down features (sort/search/filter/paging) and search semantics.
  • Re-measure widget size and build time; update #147.

Refs #147, #157.

Dominant language
R
Stars
22
Forks
6
Avg merge
1d 13h
Merged PRs (30d)
10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Merck/forestly

All issues in Merck/forestly

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.