Skip to content

Commit b1bc2de

Browse files
committed
Extend readme
1 parent 791f205 commit b1bc2de

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

examples/rust/custom_callback/README.md

+17-13
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ thumbnail_dimensions = [480, 291]
66

77
Example showing how to control an app with the Rerun viewer, by extending the viewer UI.
88

9-
The example builds on the [`extend_viewer_ui`](../extend_viewer_ui/) example, but is still rather basic.
10-
11-
## Architecture
12-
13-
```mermaid
14-
graph LR;
15-
App(App) --> Viewer(Viewer);
16-
Viewer(Viewer) --> App(App);
17-
```
18-
199
<picture>
2010
<img src="https://static.rerun.io/custom_callback/1434da408fd59ea1349169784b47d8ffc285022e/full.png" alt="Custom Viewer Callback example screenshot">
2111
<source media="(max-width: 480px)" srcset="https://static.rerun.io/custom_callback/1434da408fd59ea1349169784b47d8ffc285022e/480w.png">
@@ -24,9 +14,23 @@ graph LR;
2414
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/custom_callback/1434da408fd59ea1349169784b47d8ffc285022e/1200w.png">
2515
</picture>
2616

27-
[#2337](https://github.com/rerun-io/rerun/issues/2337): Note that in order to spawn a web viewer with these customizations applied,
28-
you have to build the web viewer of the version yourself.
29-
This is currently not supported outside of the Rerun repository.
17+
> [!NOTE]
18+
> [#2337](https://github.com/rerun-io/rerun/issues/2337): In order to spawn a web viewer with these customizations applied, you have to build the web viewer of the version yourself. This is currently not supported outside of the Rerun repository.
19+
20+
## Overview
21+
22+
This example is divided into two parts:
23+
24+
The example is divided into two parts:
25+
26+
- **Viewer** ([`src/viewer.rs`](src/viewer.rs)): Wraps the Rerun viewer inside an [`eframe`](https://github.com/emilk/egui/tree/master/crates/eframe) app.
27+
- **App** ([`src/app.rs`](src/app.rs)): The application that uses the Rerun SDK.
28+
29+
In the `app`, an additional TCP listener is opened to allow the `viewer` to send messages to the `app`.
30+
Similar to the [`extend_viewer_ui`](../extend_viewer_ui/) example, the `viewer` is wrapped in an `eframe` app, which allows us to handle the extra communication logic and define our own contorl UI using [`egui`](https://github.com/emilk/egui).
31+
32+
The communication between the `viewer` and the `app` is implemented in the [`comms`](src/comms/) module. It defines a simple protocol to send messages between the `viewer` and the `app` using [`bincode`](https://github.com/bincode-org/bincode).
33+
The protocol supports really basic commands that the `viewer` can send to the `app`, such as logging a [`Boxes3D`](https://www.rerun.io/docs/reference/types/archetypes/boxes3d) or [`Point3D`](https://www.rerun.io/docs/reference/types/archetypes/points3d) to an entity, or changing the radius of a set of points that is being logged.
3034

3135
## Testing it
3236

0 commit comments

Comments
 (0)