About This Demo
This is a browser-based demonstration of clj-proj,
a Clojure/ClojureScript library that provides bindings to PROJ
(cartographic projections and coordinate transformations library).
Project Links:
GitHub Repository |
Documentation |
Clojars |
npm
This demo runs PROJ directly in your browser using WebAssembly (WASM). The entire PROJ library, including its
coordinate reference system database, has been compiled to WASM and runs entirely client-side. No server
communication is required for the transformations.
How it's built:
- WebAssembly compilation: PROJ is compiled to WASM using
Emscripten
(see build configuration)
- ClojureScript → JavaScript: The Clojure code is compiled to JavaScript ES6 modules using
Cherry
(see main source)
- Function bindings: PROJ C function names are automatically extracted from
fndefs.cljc
and exported from WASM (no manual maintenance required)
- Module bundling: JavaScript modules are bundled with
esbuild, with dependencies kept external
- Memory management: C-allocated objects are automatically cleaned up using
resource-tracker for lifecycle management
- Embedded resources: The proj.db and proj.ini files are embedded directly in the WASM binary,
eliminating filesystem requirements
See the README for comprehensive documentation,
installation instructions, and usage examples for both Clojure and JavaScript environments.