Extensions

So a change under viewer/wasm/src needs trunk build for the demo page and the staging script (which runs both trunk and esbuild) before anything that embeds the element picks it up.

Wasm viewer scaffold

To sanity-check the pipeline:

Additional notes: - The wasm shell is being split into smaller modules under viewer/wasm/src/wasm (e.g. delta parsing, selection handling, overlay label helpers). Keep new changes localized to these modules and update viewer/wasm/src/wasm/mod.rs when adding files.

  1. Generate a SceneGraph payload using the release CLI and visible scratch space:

    mkdir -p ~/scratch/orbitron-wasm
    conda run -n orbitron-dev cargo build --release -p orbitron-cli --bin orbitron
    ORBITRON_CLI=target/release/orbitron \
      conda run -n orbitron-dev python viewer/wasm/scripts/generate_scene_bin.py \
        io/pipelines/tests/fixtures/xyz/benzene.xyz \
        ~/scratch/orbitron-wasm/scene.bin
  2. Build and serve the wasm app with the scene on the same origin:

    cd viewer/wasm
    conda run -n orbitron-dev trunk build --release
    cp ~/scratch/orbitron-wasm/scene.bin dist/scene.bin
    cd dist
    conda run -n orbitron-dev python -m http.server 8081 --bind 127.0.0.1
  3. Load the scene bytes:

    http://127.0.0.1:8081/?scene=/scene.bin