concord-demo
Standalone static demo — runs entirely in the browser with no server
How It Works
The demo intercepts window.fetch() calls to /api/* endpoints
and returns pre-computed data from a baked JavaScript file instead of making real HTTP requests.
From the frontend's perspective, it behaves identically to the server — the same
app.js, panels.js, timeseries.js, etc. modules
render data the same way.
File Structure
concord-demo/
index.html HTML shell (similar to server's index.html)
demo.js Patches window.fetch to intercept API calls
demo_data.js Pre-baked data (~10 MB): Base64-encoded Int16Array + JSON
bake_demo_data.py Script to regenerate demo_data.js from live data
record_demo.py Full pipeline: loads EDF, computes all metrics, writes demo_data.js
CNAME GitHub Pages custom domain config
app.js Copy of shared frontend controller
panels.js, timeseries.js, spectral.js, metrics.js, brain.js
Copies of shared frontend render modules
style.css Copy of shared styles
docs/ Documentation site (this site) for GitHub Pages
Source Data
The demo uses a 120-second window (t=90–210 s) from the sub-HUP117 ictal EDF recording:
- Dataset: HUP iEEG (OpenNeuro ds004100)
- Subject: sub-HUP117 — SEEG, temporal lobe
- Window: 120 seconds capturing a seizure onset at ~30 s into the window
- Montage: Bipolar
Baked Data Format
demo_data.js exports a DEMO_DATA object containing pre-computed
responses for every API endpoint the frontend calls:
| Key | Contents |
|---|---|
| load | Channel names, metadata, sampling rate, duration, events |
| timeseries | Base64-encoded Int16Array (µV) with scale factor for lossless decompression |
| psd | Welch PSD: frequencies and power arrays per channel |
| spectrogram | STFT spectrogram: times, frequencies, and power (dB) |
| band_power | Per-channel band power across 6 frequency bands |
| line_length | Windowed line length heatmap data |
| hjorth | Windowed Hjorth parameters |
| electrode_positions | MNI coordinates for 3D brain visualization |
| brain_timeseries | Per-channel metric values over time for brain animation |
Regenerating the Demo
# From the project root, with the concord environment active:
python concord-demo/record_demo.py
# This reads the EDF, computes all metrics, and writes:
# concord-demo/demo_data.js (~10 MB)
The script uses the same Python functions as the server (concord-io, concord-viz, concord-metrics-*), so the demo always reflects the current state of the pipeline.
Deployment
The demo directory is deployed as a static site. All files are served directly — no build step.
The CNAME file configures the custom domain for GitHub Pages.
The docs/ subdirectory within concord-demo contains this documentation site.