Skip to content

Phase 3: Data quality + HED visualization (website side) #4

Open

Description

@neuromechanist

Part of #1.

Scope

Frontend rendering of data-quality and HED artifacts on the dataset detail page. The backend half (hallu QA sync + data.nemar.org/<id>/qa/* route) is tracked as a sibling issue on nemarOrg/nemar-cli and must merge first.

Deliverables

  • Dataset-level QA panel on /dataset/<id> consuming data.nemar.org/<id>/qa/dataqual.json:
    • Pipeline success bar chart
    • Frames retained % histogram
    • Channels retained % histogram
    • Line noise distribution
    • Age + gender bar chart (from participants.tsv enrichment in D1)
  • HED wordcloud SVG: render from enrichment_json.hed_summary (D1) or from data.nemar.org/<id>/qa/hed-summary.json; fall back to "no HED" notice when absent
  • Per-file Vis modal triggered by Vis button on a .set file:
    • Loads data.nemar.org/<id>/qa/<bids-path>/<filename>_dataqual.json summary
    • Renders the 5 SVGs (_eegplot_mid-sample, _icaact, _icahist, _icamaps, _spectopo) in a grid
  • Per-tsv View modal triggered by View button: streams the .tsv via data.nemar.org/<id>/<ver>/<path> and renders the first N rows
  • Loading states + graceful degradation when QA artifacts are not yet synced for a dataset

Out of scope

  • Generating new QA artifacts (relies on existing pipeline outputs synced to S3 by the sibling nemar-cli issue)
  • Live EEG viewer at original sampling rate (Phase 5 design doc)

Acceptance

  • Charts render on at least 2 datasets with synced QA
  • Vis modal opens with all 5 SVGs for a known good file
  • Missing-QA fallback works on a dataset without QA data

Activity

  1. neuromechanist commented on Aug 3, 2026

    @neuromechanist
    ContributorAuthor

    Status refresh (2026-08-02), because the blocker moved and the issue no longer describes where the work actually stands.

    The frontend is built, just unwired. All five components exist and are tested: QualityPanel.astro, PipelineSuccessChart.astro, HistogramChart.astro, HedWordcloud.astro, AgeGenderChart.astro, plus src/lib/qa-aggregate.ts, a client-side walker that enumerates the <id>/qa/ listing tree and assembles QaAggregates from the per-file _dataqual.json leaves. It was wired into the detail page in cedf6be, then removed again in 7322f2f because doing the walk during SSR cost 5-28 s on HBN-sized datasets (#81). The Data quality tab has been a "coming soon" placeholder ever since.

    nemar-cli#511 is closed, but it did not deliver the precomputed aggregate this issue assumed. What exists on data.nemar.org/<id>/qa/ today is the raw mirrored tree: per-subject directories, and per-file _dataqual.json + the five SVGs. There is no qa/dataqual.json at the root and no qa/hed-summary.json (both 404 on every dataset I probed, including on005509 and nm000103).

    Coverage is the bigger constraint. Only 31 of 754 managed datasets have any QA tree in S3 — the same 31 synced in May. The sync script cannot run unattended yet: nemar-cli#522 (hallu has no AWS creds, and the pipeline writes ds* dirs while the script looks for nm*/on*) and nemar-cli#526 (the ds→on mapping fix). Until those land, this panel renders for ~4% of the catalog.

    Measured cost of the client-side path: walking on005509 (326 subjects, 326 dataqual files) against production takes ~14 s wall-clock at concurrency 25, of which ~9 s is directory listings. Acceptable on tab click with a progress state; not acceptable in SSR, which is why it was pulled.

    Three ways forward, cheapest first:

    1. Per-file Vis modal only. The five SVGs plus the per-file summary need no aggregation and no new backend — they are one fetch each and already addressable. This is the part of the issue that is shippable today, for those 31 datasets.
    2. Client-side aggregate on tab click, reusing qa-aggregate.ts as-is with a progress indicator and abort-on-tab-change. No backend work; slow tail on the largest datasets.
    3. Ask upstream for a precomputed qa/aggregates.json (the shape QaAggregates already declares, matching test/fixtures/qa-aggregates-ds002718.json) so the panel is one cheap fetch. Correct long-term, and worth filing against nemar-cli once AI Mode toggle and overview in search #522/Changelog: file the 0.2.38 entries #526 unblock the sync.

    Keeping this open. Its real blockers are nemar-cli#522 and #526 (coverage), not #511.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions