concord-demo

Standalone static demo — runs entirely in the browser with no server

Role in the system The demo is a self-contained static site that can be hosted on GitHub Pages (or any static host). It uses pre-baked real SEEG data so the full interactive dashboard works without a Python server. It shares all frontend JavaScript modules with concord-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:

Baked Data Format

demo_data.js exports a DEMO_DATA object containing pre-computed responses for every API endpoint the frontend calls:

KeyContents
loadChannel names, metadata, sampling rate, duration, events
timeseriesBase64-encoded Int16Array (µV) with scale factor for lossless decompression
psdWelch PSD: frequencies and power arrays per channel
spectrogramSTFT spectrogram: times, frequencies, and power (dB)
band_powerPer-channel band power across 6 frequency bands
line_lengthWindowed line length heatmap data
hjorthWindowed Hjorth parameters
electrode_positionsMNI coordinates for 3D brain visualization
brain_timeseriesPer-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.