From 732608f7647342d4dd9e005b8ccb7b359e9d13c7 Mon Sep 17 00:00:00 2001 From: Bryan Paget <8212170+bryanpaget@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:22:00 +0000 Subject: [PATCH] feat(rerun): add more comments --- .../en/1-Experiments/Notebooks/ReRun_EN.ipynb | 71 +++++++++++++++++-- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/docs/en/1-Experiments/Notebooks/ReRun_EN.ipynb b/docs/en/1-Experiments/Notebooks/ReRun_EN.ipynb index 7923ab390..375169b71 100644 --- a/docs/en/1-Experiments/Notebooks/ReRun_EN.ipynb +++ b/docs/en/1-Experiments/Notebooks/ReRun_EN.ipynb @@ -124,7 +124,40 @@ "id": "759d2169", "metadata": {}, "source": [ - "But that's not that impressive. ReRun shines when we view multi-model time-series data. Run the following code and interact with the ReRun Viewer. You can rotate the image and scan forward and backward in time." + "## DNA\n", + "\n", + "This is a minimal example that logs synthetic 3D data in the shape of a double helix. The underlying data is generated\n", + "using numpy and visualized using Rerun.\n", + "\n", + "### How it was made\n", + "\n", + "The full source code for this example is available\n", + "[on GitHub](https://github.com/rerun-io/rerun/blob/latest/examples/python/dna/main.py).\n", + "\n", + "#### Colored 3D points\n", + "\n", + "The colored 3D points were added to the scene by logging the\n", + "[rr.Points3D archetype](https://www.rerun.io/docs/reference/types/archetypes/points3d) to the\n", + "[helix/structure/left](recording://helix/structure/left) and [helix/structure/right](recording://helix/structure/right)\n", + "entities.\n", + "\n", + "#### 3D line strips\n", + "\n", + "The 3D line strips connecting the 3D point pairs are logged as an\n", + "[rr.LineStrips3D archetype](https://www.rerun.io/docs/reference/types/archetypes/line_strips3d) to the\n", + "[helix/structure/scaffolding entity](recording://helix/structure/scaffolding).\n", + "\n", + "#### Rotation\n", + "\n", + "The whole structure is rotated over time by logging a\n", + "[rr.Transform3D archetype](https://www.rerun.io/docs/reference/types/archetypes/transform3d) to the\n", + "[helix/structure entity](recording://helix/structure.Transform3D) that changes over time. This transform determines the rotation of\n", + "the [structure entity](recording://helix/structure) relative to the [helix](recording://helix) entity. Since all other\n", + "entities are children of [helix/structure](recording://helix/structure) they will also rotate based on this transform.\n", + "\n", + "You can visualize this rotation by selecting the two entities on the left-hand side and activating `Show transform` in\n", + "the Blueprint settings on the right-hand side. You will see one static frame (i.e., the frame of\n", + "[helix](recording://helix)) and the rotating frame (i.e., the frame of [structure](recording://helix/structure)).\n" ] }, { @@ -212,6 +245,37 @@ "rec.show(width=1024, height=768)" ] }, + { + "cell_type": "markdown", + "id": "cb0cbca9", + "metadata": {}, + "source": [ + "## Plots\n", + "\n", + "But that's not that impressive. ReRun shines when we view multi-model time-series data. The following code example shows rerun displaying simple plots corresponding to different reading on the same time-series data. This example shows various plot types that you can create using Rerun. Common usecases for such plots would be logging\n", + "losses or metrics over time, histograms, or general function plots.\n", + "\n", + "### How it was made\n", + "The full source code for this example is available [on GitHub](https://github.com/rerun-io/rerun/blob/latest/examples/python/plots/main.py).\n", + "\n", + "#### Bar charts\n", + "The [bar chart](recording://bar_chart) is created by logging the [rr.BarChart archetype](https://www.rerun.io/docs/reference/types/archetypes/bar_chart).\n", + "\n", + "#### Time series\n", + "All other plots are created using the\n", + "[rr.TimeSeriesScalar archetype](https://www.rerun.io/docs/reference/types/archetypes/bar_chart)\n", + "with different settings. Each plot is created by logging scalars at different time steps (i.e., the x-axis).\n", + "\n", + "For the [parabola](recording://curves/parabola) the radius and color is changed over time.\n", + "\n", + "[sin](recording://trig/sin) and [cos](recording://trig/cos) are logged with the same parent entity (i.e.,\n", + "`trig/{cos,sin}`) which will put them in the same view by default.\n", + "\n", + "For the [classification samples](recording://classification/samples) `rr.TimeSeriesScalar(..., scatter=True)` is used to\n", + "create separate points that do not connect over time. Note, that in the other plots the logged scalars are connected\n", + "over time by lines." + ] + }, { "cell_type": "code", "execution_count": null, @@ -219,11 +283,6 @@ "metadata": {}, "outputs": [], "source": [ - "#!/usr/bin/env python3\n", - "\"\"\"\n", - "Demonstrates how to log simple plots with the Rerun SDK.\n", - "\n", - "\"\"\"\n", "from __future__ import annotations\n", "\n", "import argparse\n",