Home - matej-hron/decojs GitHub Wiki
DecoJS is a browser-based, zero-build implementation of the Bรผhlmann ZH-L16 decompression algorithm with Erik Baker's gradient factors. It runs live at decotheory.eu; the source is on GitHub at matej-hron/decojs.
Who this wiki is for
Developers reading, modifying, or porting the code. This wiki documents the algorithm as implemented โ equations with file:line citations, data flow between modules, and the numerical conventions used. The in-app HTML pages (pressure.html, tissue-loading.html, m-values.html, gradient-factors.html) cover the physics for divers โ this wiki does not.
For diving-physiology background that this wiki assumes, the most accessible primer is Mark Powell's Deco for Divers โ the project's intellectual inspiration; see References ยง3.
Contents
Getting started
- Project-Info โ install, run, tests, live demo
- Architecture โ module graph and no-build philosophy
Decompression Model (the math as implemented)
- Decompression-Model โ overview and notation
- Model-01-Compartments โ 16 tissue compartments, variants A/B/C
- Model-02-Haldane-Equation โ constant-depth loading
- Model-03-Schreiner-Equation โ linear-rate loading
- Model-04-M-Values โ Bรผhlmann critical supersaturation
- Model-05-Gradient-Factors โ pAnchor-based GF ramp
Algorithms (how DecoJS simulates a dive)
- Algorithms โ overview
- Algo-01-Ascent-Simulation
- Algo-02-NDL-Calculation
- Algo-03-First-Stop-Ramped-GF
- Algo-04-Deco-Stop-Loop
- Algo-05-Multi-Gas-Switching
- Algo-06-Ceiling-Time-Series
Reference
- Module-Reference โ per-file API walkthrough
- Validation-and-Testing โ 208 tests, decotengu cross-check
- Extending-DecoJS โ adding gases, quizzes, variants
- References โ bibliography
How to read
Start with Architecture to orient โ it shows the module graph and the no-build ES-module philosophy. Then read the Decompression Model chapters in order; they build up notation and each equation is cited to source. The Algorithms chapters assume the Model chapters and show how DecoJS stitches the equations into a dive simulation. Module-Reference is lookup-style โ go there when you need the signature or line number for a specific function.