Repository navigation
feat: interactive Zarr signal viewer (website#99) - #101
Merged
Merged
Conversation
… grouped toolbar, dark mode, 75uV default
… + bounding-box-fit height
…B->134KB, no 502); batch view-level probes
Deploying nemar-website with
|
| Latest commit: |
6df2abb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c00e41c3.nemar-website.pages.dev |
| Branch Preview URL: | https://feat-issue-99-zarr-viewer.nemar-website.pages.dev |
- readEvents: empty catch -> warn log - discoverViewLevels: log non-404 probe failures; dtype guard before cast - retryingFetch: throw on transient exhausted instead of returning bad response - openGroup: warn on n_channels mismatch; annotate errors with group name; dtype guard on level0 - parseChannels: export for unit testing
- ChannelWindow: { kind: "line"; line } | { kind: "band"; min; max } (remove isBand from WindowData)
- FrameChannel: same discriminated shape with label + color
- readLevel0/readViewLevel: return kind-tagged objects
- render.ts: dispatch on ch.kind === "band"
- viewer.ts: dispatch on cw.kind, return kind-tagged FrameChannel
- dsp.ts: add exported removeBandDc (midpoint-mean DC removal for band channels) - viewer.ts: import from dsp, remove local duplicate
- mountEegViewer: call prior _eegvCleanup before rebuild; collect RO/MO into cleanups[]; set _eegvCleanup on slot - render() catch: set firstPaint=false, paint error message on canvas, update status text - channel cap: min(visible, win.channels) to prevent out-of-bounds indexing - render.ts: guard gain > 0 (use 1 on bad input); move clipPx inside per-channel loop (per slot) - escapeAttr: also escape ' -> ' and > -> > - [id].astro: bind + log err in EEG mount catch
- render-dir-listing: add tree__tag--signal modifier class to EEG file badges (SET/EDF/BDF/VHDR/FIF) - BidsTree.astro: .tree__tag--signal style uses --color-link tint so signal files stand out from muted JSON/TSV badges
…lebar position, formatSi/pickViewLevel/zarr-base/label_map)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the in-browser EEG/MEG/iEEG/EMG signal viewer (Stream D of the NEMAR Zarr serving-copy epic, nemar-cli#684). Clicking a
.set/.edf/.bdf/.vhdr/.fiffile in the BIDS tree opens an inline viewer that streams the recording's per-recording Zarr v3 store fromzarr.nemar.orgwith zarrita (ranged GETs, no decode backend), exactly like the existing TSV/JSON inline previews.What it does
label_map, a type legend.Architecture
src/lib/zarr-base.ts- base URL (PUBLIC_ZARR_BASE_URL) + BIDS-path -> store-URL mapping.src/lib/eeg-viewer/-store.ts(zarrita reader: view pyramid + events, parallel open, retry),dsp.ts,render.ts(Canvas 2D),events.ts,viewer.ts(orchestration). Pure helpers unit-tested (no mocks).eegbranch ofsrc/pages/dataset/[id].astrodynamic-imports the viewer (code-split; zarrita only loads when a signal file is opened).Why the view pyramid (not level-0)
Level-0 is a single whole-array shard; zarrita reads the entire shard (multi-MB) for any access, which is far too heavy and tripped the gateway. The view pyramid is the interactive hot path (134 KB vs 9 MB, ~0.9 s vs ~13 s, zero 502s). Sample-level zoom from level-0 needs per-segment sharding in the producer; deferred.
Validated
zarr.nemar.orgCORS verified (allows ww2/localhost origins, denies third-party, Range + expose-headers work).Closes #99 (P0). Follow-ups: per-segment level-0 sharding for sample-level zoom; P1 client HP/LP/notch filters, butterfly, bad-channel marking, overview minimap.