Interactive EEG/ERP simulation dashboard built in Julia on top of UnfoldSim.jl, with a reactive web UI powered by Bonito.jl and WGLMakie.jl.
This project was developed in the context of the University of Stuttgart Fachpraktikum to make simulation-driven EEG experimentation easier for Researchers and First-time users
UnfoldSimDashboard is a browser-based GUI that lets you configure and run EEG simulations without writing scripts.
It covers the full simulation pipeline:
- Event definition (categorical + continuous variables)
- Design selection (single-subject, repeat, multi-subject)
- Component modeling (Linear, Mixed, Multi-channel)
- Onset distribution (No Onset, Uniform, Log Normal)
- Noise injection (No Noise, White, Pink, Red)
- Interactive visualization (main waveform, onset density, ERP/topoplot panel)
- Data export/import (JSON/CSV/JLD2)
- UI changes trigger simulation updates through Observables.
- Debounce/throttle is built in to keep interactions smooth during slider moves.
- Linear Model
- Mixed Model (requires multi-subject design)
- Multi-channel Model (includes channel-level and topoplot exploration)
- Add categorical templates (e.g., condition, task, emotion)
- Add continuous templates (e.g., intensity, duration)
- Define custom variables directly from the sidebar
- Add/remove preset components:
N170,N400,P100,P300,Custom - Each tab has its own model controls and contributes to cumulative plotting
- Uses HArtMuT electrode geometry
- Includes channel scatter view + amplitude heatmap
- Supports channel click selection and hover labels
- Download configuration JSON from the GUI
- Export simulation CSV files
- Save full simulation objects as
.jld2 - Upload saved CSV to restore GUI parameters (metadata-based)
Core dependencies from Project.toml:
Bonito,WGLMakie,UnfoldSimDataFrames,StatsModels,Distributions,ObservablesTopoPlots,UnfoldMakie,ColorSchemes,ColorsCSV,JSON3,JLD2
Compatibility:
- Julia
1.10
Before running this repo for the first time, make sure:
- Julia 1.10 is installed and available in terminal.
- You run commands from the project root (where
Project.tomlis located). - You have internet access for first-time package installation.
git clone https://github.com/s-ccs/2025_FaPra_UnfoldSim_GUI.git
cd 2025_FaPra_UnfoldSim_GUIjulia --project=. -e "using Pkg; Pkg.instantiate()"If packages are already present, this is fast and safe to rerun.
julia --project=. run.jlrun.jl includes src/app.jl, which builds the full Bonito app and serves the GUI.
- In most setups, a local browser session opens automatically.
- If not, open the local URL printed in the Julia terminal output.
Depending on the action in section 5 of the sidebar:
- Configuration download: browser download of JSON settings
- Simulation export:
simulation_data.csvsimulation_events.csv(contains metadata for restoring sliders/settings)
- JLD2 save:
unfoldsim_YYYY-MM-DD_HH-MM-SS.jld2
Files are saved relative to the current working directory (usually project root if launched there).
run.jl→ includessrc/app.jlsrc/app.jl:- loads all modules/files,
- creates UI widgets +
AppState, - initializes plots/components,
- wires reactivity and handlers,
- returns the final Bonito app layout.
AppState (in src/types.jl) is the central state container. It holds:
- controls and synced text fields,
- active model/tab values,
- throttled observables and simulation trigger,
- simulation results and status,
- plot handles/observables,
- data-management controls,
- theme state.
Core simulation logic is in src/components/simulation_engine.jl:
- wait on
sim_trigger(debounced) - validate model/design compatibility
- map GUI slider values to model parameters
- build design + component(s)
- run
simulate(...)for noisy and clean signals - update current tab result and cumulative store
- refresh tables/plots/status and cache simulation object
UnfoldSimDashboard/
├── run.jl # Entry point; includes src/app.jl
├── Project.toml # Package dependencies and Julia compat
├── README.md # Documentation
├── report.txt # Project report and background details
└── src/
├── app.jl # Main app assembly and initialization order
├── constants.jl # Throttle/debounce constants, templates, defaults
├── types.jl # AppState and ComponentTab data structures
├── hartmut.jl # HArtMuT caching + electrode position projection
├── erp_analysis.jl # ERPExplorer module (RMS/peak/mean utilities)
├── utils.jl # Slider mappings, formula term counting, design builder
├── viz_utils.jl # Head outline + topoplot helper logic
├── ui_components.jl # Synced text fields, slider rows, event table DOM builder
├── io_system.jl # CSV/JSON save helpers for simulation export
└── components/
├── app_session.jl # Creates Bonito.App session and global state
├── event_manager.jl # Event variable controls and handlers
├── tab_manager.jl # Component tabs, formulas, Hanning overlay controls
├── simulation_engine.jl # Core simulation trigger, execution, IO handlers
├── main_plot.jl # Cumulative plot, tab overlays, channel lines, legend
├── onset_plot.jl # Onset distribution plot + histogram/PDF rendering
├── topoplot.jl # ERP explorer panel, electrode interaction, heatmap
└── sidebar.jl # Sidebar sections, theme toggle, global CSS
Run:
julia --project=. -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"- Check terminal output for the local URL and open it manually.
- Ensure no firewall/network rule blocks local loopback browser access.
- Verify model/design combination is valid.
- Start with default settings, then change one section at a time.
- Watch status text in the app (
Running,Done, or error messages).
- Use a
simulation_events.csvexported from this dashboard. - Confirm the file contains metadata column with serialized config.
- This repository is focused on GUI-driven EEG simulation and exploration.
- The implementation is modular: component files in
src/components/are actively used bysrc/app.jl. - For feature-level background and project rationale, see
report.txt.