@rerun-io/web-viewer 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,3 +26,13 @@ await viewer.start(URL, parentElement);
|
|
|
26
26
|
// Once you're done with it, call `stop`:
|
|
27
27
|
viewer.stop();
|
|
28
28
|
```
|
|
29
|
+
|
|
30
|
+
ℹ️ Note:
|
|
31
|
+
This package only targets recent browsers.
|
|
32
|
+
Your environment must support importing `.wasm` files as ES modules.
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
npm run build
|
|
38
|
+
```
|
package/index.js
CHANGED
|
@@ -33,6 +33,7 @@ export class WebViewer {
|
|
|
33
33
|
async start(url, parent = document.body) {
|
|
34
34
|
const canvas = document.createElement("canvas");
|
|
35
35
|
canvas.id = randomId();
|
|
36
|
+
parent.append(canvas);
|
|
36
37
|
|
|
37
38
|
let WebHandle_class = await load();
|
|
38
39
|
const handle = new WebHandle_class();
|
|
@@ -41,7 +42,6 @@ export class WebViewer {
|
|
|
41
42
|
throw new Error(`Web viewer crashed: ${handle.panic_message()}`);
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
parent.append(canvas);
|
|
45
45
|
this.#canvas = canvas;
|
|
46
46
|
this.#handle = handle;
|
|
47
47
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rerun-io/web-viewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Embed the Rerun web viewer in your app",
|
|
5
5
|
"private": false,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build:wasm": "cargo run -p re_build_web_viewer -- --release --module -o rerun_js/web-viewer",
|
|
8
8
|
"build:types": "dts-buddy",
|
|
9
|
-
"build": "
|
|
9
|
+
"build": "npm run build:wasm && npm run build:types",
|
|
10
10
|
"prepublishOnly": "dts-buddy"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|