diff --git a/README.md b/README.md index ac94e1c8..a69c7aad 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ inherit it automatically. |-------------------|-----------------------------------------------|---------| | Python (PyO3) | `pip install wickra` | `examples/python/backtest.py` | | Node.js (napi-rs) | `npm install wickra` | `examples/node/backtest.js` | -| Browser / WASM | `npm install wickra-wasm` | `bindings/wasm/examples/index.html` | +| Browser / WASM | `npm install wickra-wasm` | `examples/wasm/index.html` | | Rust | `cargo add wickra` | `examples/rust/src/bin/backtest.rs` | Each binding ships several runnable examples (streaming, backtest, live feed); @@ -187,12 +187,13 @@ wickra/ ├── bindings/ │ ├── python/ PyO3 + maturin (publishes on PyPI) │ ├── node/ napi-rs (publishes on npm) -│ └── wasm/ wasm-bindgen (browsers, bundlers, Node) + examples/ +│ └── wasm/ wasm-bindgen (browsers, bundlers, Node) ├── examples/ examples/README.md indexes every language │ ├── data/ real BTCUSDT OHLCV datasets, one per timeframe │ ├── rust/ Rust workspace member (`wickra-examples`) │ ├── python/ backtest, live trading, parallel assets, multi-tf -│ └── node/ streaming, backtest, live trading (load `wickra`) +│ ├── node/ streaming, backtest, live trading (load `wickra`) +│ └── wasm/ browser demo for `wickra-wasm` └── .github/workflows/ CI and release pipelines ``` diff --git a/bindings/wasm/README.md b/bindings/wasm/README.md index 6efd73f5..8da4f8e5 100644 --- a/bindings/wasm/README.md +++ b/bindings/wasm/README.md @@ -43,5 +43,7 @@ for (const price of livePrices) { const sma = new SMA(20).batch(new Float64Array(historicalPrices)); ``` -An interactive demo lives in `bindings/wasm/examples/index.html`. After building -the package serve the `bindings/wasm/` directory and open `examples/index.html`. +An interactive demo lives in [`examples/wasm/index.html`](../../examples/wasm/index.html) +(top-level alongside the other language examples). After building the package +with `wasm-pack build`, serve the repository root and open +`examples/wasm/index.html` in a browser. diff --git a/docs/wiki/Quickstart-WASM.md b/docs/wiki/Quickstart-WASM.md index 2faea5fd..fae57426 100644 --- a/docs/wiki/Quickstart-WASM.md +++ b/docs/wiki/Quickstart-WASM.md @@ -114,13 +114,13 @@ try { ## A complete example -`bindings/wasm/examples/index.html` is a self-contained browser demo: it -streams a synthetic price series through six indicators and draws a live -chart on a ``. Open it after a `--target web` build: +`examples/wasm/index.html` is a self-contained browser demo: it streams a +synthetic price series through six indicators and draws a live chart on a +``. Open it after a `--target web` build: ```bash wasm-pack build bindings/wasm --target web --release --features panic-hook -# then serve the bindings/wasm directory and open examples/index.html +# then serve the repository root and open examples/wasm/index.html ``` ## See also diff --git a/examples/README.md b/examples/README.md index a17c134f..8440141a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -41,11 +41,11 @@ cd ../../examples/node && npm install # links wickra + installs `ws` | `backtest.js` | Basket of indicators over an OHLCV CSV; defaults to the bundled BTCUSDT daily dataset. | `node backtest.js [ohlcv.csv]` | | `live_trading.js` | Live Binance feed → RSI / MACD / Bollinger → signals. | `node live_trading.js --symbol BTCUSDT --interval 1m` | -## WebAssembly — `bindings/wasm/examples/` +## WebAssembly — `examples/wasm/` | Example | What it does | Run | | --- | --- | --- | -| `index.html` | Browser demo: streams a price series through six indicators and draws a live `` chart. | `wasm-pack build bindings/wasm --target web --release --features panic-hook`, then serve `bindings/wasm/` and open `examples/index.html` | +| `index.html` | Browser demo: streams a price series through six indicators and draws a live `` chart. | `wasm-pack build bindings/wasm --target web --release --features panic-hook`, then serve the repository root and open `examples/wasm/index.html` | ## Example datasets diff --git a/bindings/wasm/examples/index.html b/examples/wasm/index.html similarity index 98% rename from bindings/wasm/examples/index.html rename to examples/wasm/index.html index 6d8652ea..c146fd8c 100644 --- a/bindings/wasm/examples/index.html +++ b/examples/wasm/index.html @@ -42,7 +42,7 @@ import init, { version, installPanicHook, SMA, EMA, RSI, MACD, BollingerBands, ATR, - } from "../pkg/wickra_wasm.js"; + } from "../../bindings/wasm/pkg/wickra_wasm.js"; const canvas = document.getElementById("chart"); const ctx = canvas.getContext("2d");