warplab 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Canton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,163 @@
1
+ # WarpLab
2
+
3
+ **Feel spacetime bend.**
4
+
5
+ An interactive gravitational wave visualizer built with Three.js and WebGL. Every event shown is real — detected by [LIGO](https://www.ligo.caltech.edu/), [Virgo](https://www.virgo-gw.eu/), and [KAGRA](https://gwcenter.icrr.u-tokyo.ac.jp/en/).
6
+
7
+ **[Try it live at warplab.app](https://warplab.app)**
8
+
9
+ ## What is this?
10
+
11
+ WarpLab lets you explore gravitational wave events — the ripples in spacetime produced when black holes and neutron stars collide. Four interactive scenes cover different aspects of gravitational physics:
12
+
13
+ - **Merger** — watch real binary mergers on a deforming spacetime grid with audio sonification
14
+ - **Sandbox** — build your own binary system, tweak masses and spins, and trigger a custom merger
15
+ - **Black Hole** — orbit a ray-traced Schwarzschild black hole with accretion disk and AR mode
16
+ - **N-Body** — gravitational simulator with presets, collision detection, and orbit trails
17
+
18
+ ## Features
19
+
20
+ ### Merger scene
21
+ - 90+ real events from GWTC-1, GWTC-2, GWTC-2.1, and GWTC-3 catalogs
22
+ - Real-time spacetime deformation with custom GLSL vertex shaders
23
+ - Audio sonification mapping gravitational wave frequency to sound
24
+ - 3D universe map showing all events at cosmological distances
25
+ - Guided tours ("Greatest Hits", "Record Breakers", "Neutron Stars")
26
+ - Event filtering (BBH / BNS / NSBH), sorting, and search
27
+ - URL deep links (`?event=GW150914&mode=researcher`)
28
+
29
+ ### Black hole scene
30
+ - Full-screen ray-marched Schwarzschild black hole
31
+ - Togglable accretion disk and AR camera mode
32
+ - Independent orbit camera with smooth interpolation
33
+ - **VR passthrough (Quest 3)** — black hole floats in your real room via mixed reality
34
+ - Two-tier architecture: Tier 1 (dark void + Einstein ring glow over passthrough), Tier 2 (gravitational lensing of camera feed — activates automatically when WebXR camera-access ships)
35
+ - Grab & drag to reposition the black hole with controllers or hand tracking
36
+ - Localized 2m sphere with early ray termination for Quest 3 performance
37
+
38
+ ### Sandbox & N-Body
39
+ - Custom binary parameters with live waveform preview
40
+ - N-body gravitational simulator with presets and placement tools
41
+ - Orbit trails, reference grid, and collision physics
42
+
43
+ ### Three view modes
44
+ - **Explorer** — clean, minimal interface for casual browsing
45
+ - **Student** — parameter labels, KaTeX-rendered physics equations, and pedagogical detail
46
+ - **Researcher** — full data with 90% confidence intervals, computed equation values, and data export
47
+
48
+ ### Export (researcher mode)
49
+ Downloads a ZIP bundle containing:
50
+ - `parameters.json` / `parameters.csv` — full event data with uncertainties
51
+ - `waveform_template.csv` — synthetic IMRPhenom waveform arrays
52
+ - `notebook.ipynb` — Jupyter notebook that fetches real strain from GWOSC
53
+ - `CITATION.bib` — BibTeX for GWOSC, catalog paper, and WarpLab
54
+
55
+ ### Platform support
56
+ - WebXR / VR ready (Merger, Sandbox, Black Hole, N-Body scenes)
57
+ - Quest 3 mixed reality passthrough (Black Hole scene)
58
+ - Embeddable via iframe (`?embed=true`)
59
+ - Responsive mobile layout
60
+ - First-visit onboarding hints
61
+ - PWA with offline support
62
+
63
+ ## Keyboard shortcuts
64
+
65
+ | Key | Action |
66
+ |-----|--------|
67
+ | `Space` | Play / Pause |
68
+ | `S` | Cycle playback speed |
69
+ | `M` | Toggle universe map |
70
+ | `H` | Toggle help overlay |
71
+ | `P` | Take screenshot |
72
+ | `/` | Focus search input |
73
+ | `Esc` | Close overlay |
74
+
75
+ ## Tech stack
76
+
77
+ - **Three.js** — 3D rendering, orbit controls, universe map
78
+ - **Custom GLSL** — spacetime grid deformation, black hole ray marching
79
+ - **Web Audio API** — real-time chirp synthesis
80
+ - **KaTeX** — LaTeX equation rendering (lazy-loaded)
81
+ - **postprocessing** — bloom and ACES tone mapping
82
+ - **React** — landing page only (Vite multi-page app)
83
+ - **Tailwind CSS v4** — landing page styling
84
+ - **TypeScript** — end to end
85
+ - **Vite** — build tooling, code splitting, PWA plugin
86
+
87
+ ## Project structure
88
+
89
+ ```
90
+ src/
91
+ ├── main.ts # App entry — renderer, controls, UI, render loop
92
+ ├── landing.tsx # React landing page
93
+ ├── lib/
94
+ │ ├── waveform.ts # GWOSC API client, waveform generation
95
+ │ ├── waveform-generator.ts # IMRPhenom waveform synthesis
96
+ │ ├── binary.ts # Binary orbit system (inspiral + merger)
97
+ │ ├── audio.ts # Gravitational wave sonification
98
+ │ ├── universe-map.ts # 3D event scatter plot
99
+ │ ├── view-mode.ts # Explorer / Student / Researcher system
100
+ │ ├── equations.ts # Lazy KaTeX loader + equation DOM builder
101
+ │ ├── equation-data.ts # Physics equation definitions per scene
102
+ │ ├── export.ts # ZIP export (JSON, CSV, notebook, BibTeX)
103
+ │ ├── SceneManager.ts # Scene lifecycle + tab switching
104
+ │ └── tours.ts # Guided tour sequences
105
+ ├── scenes/
106
+ │ ├── merger/MergerScene.ts # Binary merger visualization
107
+ │ ├── sandbox/SandboxPanel.ts # Custom binary parameter panel
108
+ │ ├── blackhole/BlackHoleScene.ts # Ray-traced black hole
109
+ │ └── nbody/NBodyScene.ts # N-body gravitational simulator
110
+ ├── shaders/
111
+ │ ├── spacetime.vert.glsl # Grid deformation from binary masses
112
+ │ ├── spacetime.frag.glsl # Grid lines, glow, distance fade
113
+ │ ├── blackhole.vert.glsl # Fullscreen quad vertex shader
114
+ │ ├── blackhole.frag.glsl # Schwarzschild ray marching
115
+ │ ├── blackhole-vr.vert.glsl # VR stereo vertex shader (per-eye parallax)
116
+ │ └── blackhole-vr.frag.glsl # VR ray marching + passthrough lensing
117
+ └── components/ # React components (landing page)
118
+ ├── SplashCursor.tsx
119
+ ├── DecryptedText.tsx
120
+ └── GlassCTA.tsx
121
+ ```
122
+
123
+ ## Getting started
124
+
125
+ ```bash
126
+ git clone https://github.com/danielcanton/warplab.git
127
+ cd warplab
128
+ npm install
129
+ npm run dev # Dev server at localhost:5173
130
+ npm run build # Production build to dist/
131
+ ```
132
+
133
+ ## URL parameters
134
+
135
+ | Parameter | Values | Default |
136
+ |-----------|--------|---------|
137
+ | `scene` | `merger`, `sandbox`, `blackhole`, `nbody` | `merger` |
138
+ | `mode` | `explorer`, `student`, `researcher` | `explorer` |
139
+ | `embed` | `true` | `false` |
140
+ | `event` | any event name (e.g. `GW150914`) | first by SNR |
141
+
142
+ ## Data source
143
+
144
+ All event data is fetched live from the [Gravitational Wave Open Science Center (GWOSC)](https://gwosc.org/) API. The waveforms are synthetic IMRPhenom approximations based on detected parameters — not raw detector strain.
145
+
146
+ ## Contributing
147
+
148
+ Contributions welcome! Some areas that could use help:
149
+
150
+ - **Tidal deformation** — neutron star matter effects during BNS mergers
151
+ - **Accessibility** — screen reader support, keyboard navigation improvements
152
+ - **Mobile UX** — touch gesture refinements, responsive panel layouts
153
+ - **New scenes** — pulsar timing arrays, cosmic web structure
154
+
155
+ Open an issue or submit a PR.
156
+
157
+ ## License
158
+
159
+ MIT
160
+
161
+ ## Author
162
+
163
+ **Daniel Canton** — [dancanton.com](https://dancanton.com) · [X](https://x.com/coco_canton) · [LinkedIn](https://www.linkedin.com/in/danielcantonarg/)