epanet.js - EPANET in JavaScript
The epanet.js app is a JavaScript version of EPANET that requires no installation. The app runs in the browser, making it available on personal computers as well as tablets and mobile phones. There's no model data send to the server, the simulation takes place in the browser.
Demo
A live demo is available: epanet.de/js/
Please be patient while the app is loading - it's a full-fledged hydraulic analysis engine and takes longer to load than the average website.
What's missing
The epanet.js app is not finished, its future development also depends on your feedback. One of the envisaged features is a GIS editor interface.
Feedback
Use the epanet.js issue tracker or send an email to sdteffen@gmail.com.
Developer information
Please use and extend epanet.js - it's open source.
The app compiles the original EPANET C sources into Javascript and adds a simple interface using several HTML 5 technologies.
Download
Download the current epanet.js release as a tarball: epanet.js-2.0.12.3.tar.xz
Development Requirements
Emscripten's emcc c-to-js compiler is required to compile the C sources into the Javascript epanet.js app.
Note that simple adjustments, like an exchange of the default INP file data just require a text editor and only minimum HTML editing skills.
Compilation with Bash shell
A shell like Bash can be used to build epanet.js. Starting from the tarball, use the following commands to build js.html (configure is created using Autotools):
./configure make
Manual compilation
You can use this approach on platforms like Windows, if you don't have a shell like Bash available. Make sure that the emcc compiler is in your path. In the src folder, run the following command:
emcc -O1 epanet.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c -o js.html --pre-js js/pre.js --shell-file shell.html --js-library js/library.js -s EXPORTED_FUNCTIONS="['_main', '_hour']"
This approach works from tarball and cloned git repository.
Libraries
Several libraries are used in epanet.js:
- Emscripten
- D3.js
- jQuery
- Bootstrap
- FileSaver.js
Source Code
The epanet.js source code is available on Github: github.com/sdteffen/epanet.js