Standalone web-based layout viewer using KLayout
Project description
kwasm
Standalone wasm-based client-only layout viewer for semiconductor designs, powered by KLayout.
kwasm compiles KLayout's layout rendering engine to WebAssembly via Emscripten, wrapped in a Rust FFI layer. The result is an interactive GDS2/OASIS viewer that runs entirely in the browser — no install required.
Features
- View GDS2 and OASIS layout files in the browser
- Pan, zoom, select, measure, and draw annotations
- Layer panel with per-layer visibility toggling and color display
- Toolbar with switchable interaction modes
- Dark and light theme
- Load layouts via drag & drop or
?url=query parameter - Configurable toolbar via
?tools=query parameter - Python package with embeddable Jupyter viewer
- CLI for bundling layouts into self-contained HTML files
Quick Start
# Build the WASM binary and assemble dist/
just build
# Build docs site and serve at http://localhost:8080
just serve
Available Commands
| Command | Description |
|---|---|
just build |
Build WASM artifacts (python build.py) |
just dev |
Build + copy bundled HTML to Python package |
just wheel |
Build Python wheel |
just dist |
Build everything (WASM + wheel) |
just check |
Check WASM compilation (no link) |
just docs |
Build documentation site |
just serve [port] |
Build docs and serve (default port 8080) |
just clean |
Clean build artifacts |
Query Parameters
| Parameter | Description |
|---|---|
?url= |
Load a layout file from a URL (e.g. ?url=https://example.com/chip.gds) |
?tools= |
Comma-separated list of toolbar tools to show. All tools are shown by default. |
?lyp= |
Load a .lyp layer properties file from a URL (e.g. ?lyp=layers.lyp) |
?drop= |
Enable/disable drag & drop (true/false). Default: true. |
?layers= |
Show/hide the layer panel (true/false). Default: true. |
Available tool names for ?tools=:
| Name | Description |
|---|---|
select |
Pointer/select mode |
move |
Pan mode |
ruler |
Ruler/measure mode |
clear-rulers |
Erase all rulers |
fit-all |
Zoom to fit layout |
reload |
Reload layout |
top-ports |
Toggle top-level port markers |
instance-ports |
Toggle instance port markers |
text |
Toggle text labels |
theme |
Light/dark mode toggle |
Example: ?tools=ruler,top-ports,instance-ports shows only the ruler, top-level ports, and instance ports buttons.
Python Package
kwasm is available as a Python package that bundles the WASM viewer:
pip install kwasm
Jupyter Notebook
import kwasm
kwasm.show("my_chip.gds")
kwasm.show("my_chip.gds", lyp="layers.lyp", tools=("ruler", "fit-all"))
When used with gdsfactory, you can pass components directly:
import gdsfactory as gf
import kwasm
c = gf.components.mzi()
kwasm.show(c)
CLI
# Bundle a GDS into a self-contained HTML file
kwasm bundle my_chip.gds --output viewer.html --lyp layers.lyp
# Bundle and open in the default browser
kwasm view my_chip.gds
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kwasm-0.0.15-py3-none-any.whl.
File metadata
- Download URL: kwasm-0.0.15-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82ea2e5d62473e0bdb00dffb269b950fabef5833e3c1c2432971634591a1e089
|
|
| MD5 |
aedf5d9184d859748d48d78905197abf
|
|
| BLAKE2b-256 |
1e81fdf31db7df848ed8c0a7c7b817ef1bbaf2c9602c433c6ca97e98498dbd0e
|
Provenance
The following attestation bundles were made for kwasm-0.0.15-py3-none-any.whl:
Publisher:
release.yml on doplaydo/kwasm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kwasm-0.0.15-py3-none-any.whl -
Subject digest:
82ea2e5d62473e0bdb00dffb269b950fabef5833e3c1c2432971634591a1e089 - Sigstore transparency entry: 1017380097
- Sigstore integration time:
-
Permalink:
doplaydo/kwasm@cfb3fc2b9af12fabbf6412371772aefb1c1e6201 -
Branch / Tag:
refs/tags/0.0.15 - Owner: https://github.com/doplaydo
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cfb3fc2b9af12fabbf6412371772aefb1c1e6201 -
Trigger Event:
push
-
Statement type: