-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic support for in-app "Quick Start" guides (#3813)
### What This PR lays the basis for in-app "Quick Start" guides. After a failed attempt to use `re_sdk` from `re_viewer` (can't target wasm), this PR builds on recent `StoreDb` API improvements to create "quick start" recordings from scratch. This involves: - adding a nice `StoreDb::from_info_and_rows()` helper function - adding `SystemCommand::LoadStoreDb(StoreDb)` - adding `StoreSource::Viewer` (for recordings generated from the viewer itself) - some helper functions in `welcome_page.rs` This PR also introduces a draft for the (native-only) Python and Rust Quick Starts, and placeholder for the other languages. To address (in follow-up PR): - markdown formatting issue where H1 appears smaller than H2 (current work around: skip on using H1) - #3612 - specialise Quick Start for non-server Viewers - #3871 - write Quick Start for C++: - #3870 - markdown formatting issue: - lampsitter/egui_commonmark#19 <img width="1315" alt="image" src="https://github.com/rerun-io/rerun/assets/49431240/232b4a79-7917-4978-95d1-94474142da94"> * Fixes #3095 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3813) (if applicable) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/3813) - [Docs preview](https://rerun.io/preview/9c7ebbf37a890b5d09941102a4d7c3a35f53f277/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/9c7ebbf37a890b5d09941102a4d7c3a35f53f277/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/) --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
- Loading branch information
Showing
20 changed files
with
296 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## C++ Quick Start | ||
|
||
TODO(ab): https://github.com/rerun-io/rerun/issues/3870 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### How does it work? | ||
|
||
Rerun's goal is to make handling and visualizing multimodal data streams easy and performant. | ||
|
||
Rerun is made of two main building blocks: the SDK and the Viewer. The data provided by the user code is serialised by the SDK and transferred (via a log file, a TCP socket, a WebSocket, etc.) to the Viewer process for visualization. You can learn more about Rerun's operating modes [here](https://www.rerun.io/docs/reference/sdk-operating-modes). | ||
|
||
In the example above, the SDK connects via a TCP socket to the present viewer. | ||
|
||
The `log()` function logs _entities_ represented by the "entity path" provided as first argument. Entities are a collection of _components_, which hold the actual data such as position, color, or pixel data. _Archetypes_ such as `Points3D` are builder objects which help creating entities with a consistent set of components that are recognized by the Viewer (they can be entirely bypassed when required by advanced use-cases). You can learn more about Rerun's data model [here](https://www.rerun.io/docs/concepts/entity-component). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## Python Quick Start | ||
|
||
### Installing the Rerun SDK | ||
|
||
The Rerun SDK is available on [PyPI](https://pypi.org/) under the | ||
[`rerun-sdk`](https://pypi.org/project/rerun-sdk/) name. It can be installed like any other | ||
Python package: | ||
|
||
```sh | ||
pip install rerun-sdk | ||
``` | ||
|
||
### Try out the viewer | ||
|
||
The Rerun SDK comes with a demo that can be used to try the viewer. You can send a demo recording | ||
to this viewer using the following command: | ||
|
||
```sh | ||
python -m rerun_sdk.demo --connect | ||
``` | ||
|
||
This will open a new recording that looks like this: | ||
|
||
![Demo recording](https://static.rerun.io/quickstart2_simple_cube/632a8f1c79f70a2355fad294fe085291fcf3a8ae/768w.png) | ||
|
||
|
||
### Logging your own data | ||
|
||
Instead of a pre-packaged demo, you can log your own data. Copy and paste the following snippet in a new Python file and execute it to create a new recording in this viewer: | ||
|
||
```python | ||
${EXAMPLE_CODE} | ||
``` |
1 change: 1 addition & 0 deletions
1
crates/re_viewer/data/quick_start_guides/quick_start_connect.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../docs/code-examples/quick_start_connect.cpp |
1 change: 1 addition & 0 deletions
1
crates/re_viewer/data/quick_start_guides/quick_start_connect.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../docs/code-examples/quick_start_connect.py |
1 change: 1 addition & 0 deletions
1
crates/re_viewer/data/quick_start_guides/quick_start_connect.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../docs/code-examples/quick_start_connect.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## Rust Quick Start | ||
|
||
### Installing Rerun | ||
|
||
To use the Rerun SDK in your project, you need the [rerun crate](https://crates.io/crates/rerun) which you can add with `cargo add rerun`. | ||
|
||
Let's try it out in a brand-new Rust project: | ||
|
||
```sh | ||
cargo init cube && cd cube && cargo add rerun --features native_viewer | ||
``` | ||
|
||
Note that the Rerun SDK requires a working installation of Rust 1.72+. | ||
|
||
### Logging your own data | ||
|
||
Add the following code to your `main.rs` file: | ||
|
||
```rust | ||
${EXAMPLE_CODE} | ||
``` | ||
|
||
You can now run your application: | ||
|
||
```shell | ||
cargo run | ||
``` | ||
|
||
Once everything finishes compiling, you will see the points in this viewer: | ||
|
||
![Demo recording](https://static.rerun.io/intro_rust_result/cc780eb9bf014d8b1a68fac174b654931f92e14f/768w.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// TODO(ab): https://github.com/rerun-io/rerun/issues/3870 | ||
|
||
int main() { | ||
return 0; | ||
} |
Oops, something went wrong.