blob: 37c09ea4958dc5389a62c5b739c49c7df331d58b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# wipfel
Browser front end for gipfel (WASM, Yew + canvas 2D). See
[`/wasm-plan.md`](../../wasm-plan.md) for the overall plan and milestones.
**Status: W1 (scaffold + image display) done** — open/drag-drop a JPEG,
pan (drag) and zoom (wheel, cursor-anchored). Peak identification,
fitting and saving arrive in W2/W3.
## Development
Prerequisites: [rustup](https://rustup.rs) and trunk:
```sh
cargo install --locked trunk
```
Serve with hot reload:
```sh
cd crates/wipfel
trunk serve --port 8090 # then open http://localhost:8090
```
Release build (static output in `dist/`, serveable by any web server):
```sh
trunk build --release
```
## 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 |
| `src/bridge.rs` | JS glue: image decode, blob read, canvas ctx |
| `index.html` | trunk entry point (canonical trunk layout) |
| `www/style.css` | stylesheet (trunk asset) |
## 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 wipfel`) so it can
be checked in CI without a wasm toolchain; runtime is wasm-only.
|