From b8c85f7627a612c3e376fac76ffad1f828e746bd Mon Sep 17 00:00:00 2001 From: osobh Date: Sun, 27 Sep 2026 06:44:51 -0500 Subject: [PATCH] wasm-viewer: open by URL, lazily, with a request counter The page gets a URL box; ?file= now opens with openUrl instead of downloading the file, and the header shows the requests made and bytes fetched so far ("5 requests, 5 MiB of 191 MiB fetched (2.6%)"). Every file call is awaited, so local files (open) and remote ones share the code; a selection that finishes after another was made is not shown. browser.sh serves the page and fixtures with test/serve.py (no symlinks into the repository any more) and also checks a server without range support and, on the 200 MB file, that a small dataset and a window of the big one render with a single-digit percentage fetched. Co-Authored-By: Claude Opus 5.5 (1M context) --- examples/wasm-viewer/index.html | 138 ++++++++++++++++++--------- examples/wasm-viewer/test/browser.sh | 76 +++++++++------ 2 files changed, 140 insertions(+), 74 deletions(-) diff --git a/examples/wasm-viewer/index.html b/examples/wasm-viewer/index.html index d477e49..279c9b8 100644 --- a/examples/wasm-viewer/index.html +++ b/examples/wasm-viewer/index.html @@ -56,27 +56,39 @@ border: 1px solid var(--line); border-radius: 4px; } .error { color: var(--bad); font-family: var(--mono); white-space: pre-wrap; } .muted { color: var(--muted); } + form.url { display: flex; gap: 6px; margin-left: auto; flex: 1 1 320px; max-width: 560px; } + form.url input { flex: 1; min-width: 0; font: 13px var(--mono); padding: 4px 8px; background: var(--panel); + color: var(--ink); border: 1px solid var(--line); border-radius: 6px; } + .netstats { flex-basis: 100%; color: var(--muted); font-size: 12.5px; font-family: var(--mono); } + .netstats:empty { display: none; }

HDF5 Viewer

no file +
+ + +
+
-

Drop an HDF5 or NetCDF-4 file here, or use “Open file…”.

-

The file is read in this page by clawhdf5 compiled to WebAssembly; it is not uploaded anywhere.

+

Drop an HDF5 or NetCDF-4 file here, use “Open file…”, or give a URL.

+

The file is read in this page by clawhdf5 compiled to WebAssembly; a local file is not uploaded anywhere. + A file given by URL is not downloaded: only the byte ranges each view needs are fetched (HTTP range requests), + and the requests and bytes it has cost are shown at the top.