diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-11-10 09:26:34 +0100 |
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-11-10 09:26:34 +0100 |
| commit | c3a6dbca3e93a593702b7f2b5ed593b7225d4edf (patch) | |
| tree | d5664927161cd9f0a80a959d8886d3ac6c1cee54 | |
| parent | 2cae90d7f8482535f7e4d8a1b44ca2ec5970dc49 (diff) | |
gipfel: README content (previous commit caught the file mid-write, empty)
| -rw-r--r-- | crates/gipfel/README.md | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/crates/gipfel/README.md b/crates/gipfel/README.md index e69de29..44fb3b9 100644 --- a/crates/gipfel/README.md +++ b/crates/gipfel/README.md @@ -0,0 +1,58 @@ +# gipfel — web front end + +Browser front end for gipfel (WASM, Yew + canvas 2D). This is the main +front end: peak identification, view fitting, saving annotated JPEGs, +distortion profiles, rectilinear and cylindrical projection. + +## Development + +Prerequisites: rustup with the `wasm32-unknown-unknown` target and +`wasm-bindgen` (`cargo install --locked wasm-bindgen-cli`). + +Dev build + hot reload (trunk) and quick local serve: + +```sh +./serve-here.sh # builds wasm, serves ./dist on :8090 +``` + +Release build (static site in the repo-root `dist/gipfel/`, serveable +by any static web server): + +```sh +./build-release.sh +``` + +## URL parameters + +The loader page (`www/loader.js`) accepts query parameters, handy for +testing and for embedding: + +| param | meaning | +|---|---| +| `?file=<url>` | load an image at startup (same-origin path or CORS-enabled URL) | +| `?az= --pitch= --roll= --focal=` | override the view parameters after EXIF | +| `?vis=<ratio>` | visibility height/distance ratio | +| `?debug=1` | log projection diagnostics to the console | + +## Layout + +| File | Purpose | +|---|---| +| `src/main.rs` | entry point | +| `src/app.rs` | root component: sidebar, file loading, state | +| `src/canvas_view.rs` | viewport canvas: bitmap blit, pan/zoom, markers | +| `src/markers.rs` | peak marker placement and label layout | +| `src/compass.rs` | compass/sun helpers | +| `src/widgets.rs` | sliders, dropdowns | +| `src/bridge.rs` | JS glue: image decode, blob read, canvas ctx | +| `www/loader.js` | production entry page (loads the wasm module) | +| `index.html` | trunk entry point (dev only) | +| `www/style.css` | stylesheet | + +## Notes + +- The base image is decoded by the browser (`createImageBitmap`), not + by the `image` crate — faster decode and GPU-backed blitting. +- The crate compiles natively (`cargo check -p gipfel`) so it can be + checked in CI without a wasm toolchain; runtime is wasm-only. +- The hill database is shipped gzip-compressed (`gipfel.dat.gz`). |
