{"id":42057570,"url":"https://github.com/qqrm/webgpu-candles","last_synced_at":"2026-01-26T07:17:20.915Z","repository":{"id":297917039,"uuid":"997881047","full_name":"qqrm/webgpu-candles","owner":"qqrm","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-20T03:10:26.000Z","size":6636,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-23T09:19:53.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qqrm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"DOCS/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-06-07T11:49:08.000Z","updated_at":"2025-09-18T14:53:43.000Z","dependencies_parsed_at":"2025-06-09T14:34:27.484Z","dependency_job_id":"98725ca1-2357-47ef-8ae3-a14a649bcc16","html_url":"https://github.com/qqrm/webgpu-candles","commit_stats":null,"previous_names":["qqrm/price-chart-wasm","qqrm/webgpu-candles"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/qqrm/webgpu-candles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqrm%2Fwebgpu-candles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqrm%2Fwebgpu-candles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqrm%2Fwebgpu-candles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqrm%2Fwebgpu-candles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qqrm","download_url":"https://codeload.github.com/qqrm/webgpu-candles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqrm%2Fwebgpu-candles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28769585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T06:37:25.426Z","status":"ssl_error","status_checked_at":"2026-01-26T06:37:23.039Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-26T07:17:20.244Z","updated_at":"2026-01-26T07:17:20.909Z","avatar_url":"https://github.com/qqrm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebGPU Candles\n\n![screenshot](res/screen.png)\n\nA demonstration Bitcoin candlestick chart built with **WebGPU** for rendering and **Leptos** for the reactive UI. Real-time price data is streamed from Binance via WebSocket and drawn directly to a `\u003ccanvas\u003e` using Rust compiled to WebAssembly.\nThe chart supports zoom levels from roughly `0.2x` up to `32x` with a minimum of one visible candle.\n\u003e **Note**: WebGPU must be enabled in your browser. The demo works in Microsoft Edge but is not supported in Firefox.\n\n## Demo\n\nThe development version is available at \u003chttps://qqrm.github.io/webgpu-candles/dev/\u003e, and release builds\nare published at \u003chttps://qqrm.github.io/webgpu-candles/\u003e. GitHub Pages publishes these files from the\n`gh-pages` branch, keeping build artifacts out of `main`.\n\nThe project requires the `wasm32-unknown-unknown` target, which the build script verifies is installed. Install it with:\n`rustup target add wasm32-unknown-unknown`.\n\n## Setup\n\n```bash\n# Add the WebAssembly compilation target\nrustup target add wasm32-unknown-unknown\n# Install Trunk for building and serving\ncargo install trunk\n```\n\nInstall either [Trunk](https://trunkrs.dev/) or [wasm-pack](https://rustwasm.github.io/wasm-pack/) depending on your preferred workflow.\n\nTo automatically format and lint the code before each commit, enable the pre-commit hook:\n\n```bash\ngit config core.hooksPath .githooks\n```\n\n## Building with Trunk\n\nTrunk compiles the project and automatically injects the generated WASM into `index.html`:\n\n```bash\ntrunk serve       # dev server on http://localhost:8080\n# or\ntrunk build --dist dist-local\n```\n\nLocal builds are saved to `dist-local`. In GitHub Actions the `dist` path is\nuploaded to the `gh-pages` branch to publish the demo. The `dist/` directory is\nnot stored in the repository; the `gh-pages` branch contains the `version`\nfile with the SHA of the last commit.\n\nBoth release and development builds are deployed to `gh-pages`. To use a different location, adjust the deployment steps in the workflow files:\n`.github/workflows/build.yml` and `.github/workflows/release.yml`.\n\nWhen using Trunk, open **`index.html`** (served automatically when using `trunk serve`). The file contains a Trunk hook so the WASM is loaded for you:\n\n```html\n\u003c!-- Trunk will automatically inject the WASM here --\u003e\n\n\u003clink data-trunk rel=\"rust\" data-wasm-opt=\"z\" /\u003e\n```\n\n### Subresource Integrity\n\nTrunk automatically includes integrity hashes for the generated JavaScript\nand WebAssembly files.\n\n## Building with wasm-pack\n\nAlternatively, you can build using wasm-pack:\n\n```bash\nwasm-pack build --target web --release\n```\n\nThis produces a `pkg/` directory with the compiled `price_chart_wasm.js`. After running wasm-pack, open **`leptos-index.html`**, which manually imports the generated file:\n\n```html\n\u003cscript type=\"module\"\u003e\n    import init, { hydrate } from './pkg/price_chart_wasm.js';\n    // ...\n\u003c/script\u003e\n```\n\n## Directory Structure\n\nKey folders are under `src/`:\n\n```text\nsrc/\n├── app.rs                  # Leptos UI components and reactivity\n├── lib.rs                  # WASM exports (entry points)\n├── simple_shader.wgsl      # WebGPU shaders\n├── domain/                 # Core domain logic (chart, market data, logging)\n├── infrastructure/         # WebSocket and WebGPU renderer implementations\n```\n\nFor more architectural details see [ARCHITECTURE.md](DOCS/ARCHITECTURE.md).\nPlanned features are listed in [FEATURES.md](DOCS/FEATURES.md).\nDetails on the WebSocket feed are in [WEBSOCKETS.md](DOCS/WEBSOCKETS.md).\n\n## Documentation\n\nAll additional documentation lives in the [`DOCS/`](DOCS/) directory:\n\n- [ARCHITECTURE.md](DOCS/ARCHITECTURE.md)\n- [FEATURES.md](DOCS/FEATURES.md)\n- [WEBSOCKETS.md](DOCS/WEBSOCKETS.md)\n- [CONTRIBUTING.md](DOCS/CONTRIBUTING.md)\n- [PIPELINES.md](.github/workflows/PIPELINES.md)\n- [TESTS.md](DOCS/TESTS.md)\n- [PIPELINES.md](DOCS/PIPELINES.md)\n- [VOLUME_SYNC_FIXES.md](DOCS/VOLUME_SYNC_FIXES.md)\n- [COLORS.md](DOCS/COLORS.md)\n\n## Chart Elements\n\nThe chart is composed of several layers:\n\n- Candles with wicks representing OHLC data\n- Volume bars below the main chart\n- Time and price grid lines\n- A highlighted line for the current price\n- Technical indicators:\n  - Simple Moving Averages (20, 50, 200 periods)\n  - Exponential Moving Averages (12, 26 periods)\n  - Ichimoku cloud with Tenkan, Kijun, Senkou spans and Chikou line\n\n## Benchmarks\n\nTo measure performance use:\n\n```bash\nwasm-pack test --chrome --headless\n```\n\nFPS is printed to the console and the `perf.yml` workflow saves the log as an\nartifact. Current metric values are stored in [PIPELINES.md](.github/workflows/PIPELINES.md).\n`tests/performance_limit.rs` logs when FPS drops below 30 for large charts.\n\n\n## Tests\n\nThe tests use [`wasm-bindgen-test`](https://docs.rs/wasm-bindgen-test). Run\nthem with:\n\n```bash\nwasm-pack test --chrome --headless\n\n```\nor\n```bash\nwasm-pack test --chrome\n```\n\nAlternatively install Node dependencies and run:\n\n```bash\nnpm install\nnpm test\n```\n\nSee [TESTS.md](DOCS/TESTS.md) for more details about the test suite.\n\n## Native Run\n\nFor benchmarking outside the browser you can run the native binary. Parallel ECS\nsystems powered by Rayon are enabled automatically:\n\n```bash\ncargo run --release --features parallel\n```\n## Docker\n\nBuild and run the container with:\n```bash\ndocker build -t webgpu-candles .\ndocker run --rm -p 8080:80 webgpu-candles\n```\n(the container uses nginx, so port 80 is mapped to host 8080).\n\n## Debug\n```bash\nnpx wscat -c wss://stream.binance.com:9443/ws/btcusdt@kline_1m\n```\n\n## License\nThis project is distributed under the [MIT License](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqqrm%2Fwebgpu-candles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqqrm%2Fwebgpu-candles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqqrm%2Fwebgpu-candles/lists"}