Skip to content

Commit

Permalink
Create blueprint for plot example (#5518)
Browse files Browse the repository at this point in the history
### What
 - Builds on top of #5517

Now that we have origin-based content defaults, I'm happy with this
blueprint.

```python
    blueprint = rrb.Blueprint(
        rrb.Horizontal(
            rrb.Grid(
                rrb.BarChartView(name="Bar Chart", origin="/bar_chart"),
                rrb.TimeSeriesView(name="Curves", origin="/curves"),
                rrb.TimeSeriesView(name="Trig", origin="/trig"),
                rrb.TimeSeriesView(name="Classification", origin="/classification"),
            ),
            rrb.TextDocumentView(name="Description", origin="/description"),
            column_shares=[2, 1],
        ),
        rrb.SelectionPanel(expanded=False),
        rrb.TimePanel(expanded=False),
    )
```


![image](https://github.com/rerun-io/rerun/assets/3312232/fad8a49f-5541-420f-b382-f27509bbed81)


### 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 the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5518/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5518/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5518/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5518)
- [Docs
preview](https://rerun.io/preview/eab89b24fcee4cf40f47c7f0da6352c9dc4bf45d/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/eab89b24fcee4cf40f47c7f0da6352c9dc4bf45d/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
jleibs authored Mar 15, 2024
1 parent 4dec4aa commit 735c12c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions examples/python/plots/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from math import cos, sin, tau

import numpy as np
import rerun as rr # pip install rerun-sdk
import rerun as rr
import rerun.blueprint as rrb

DESCRIPTION = """
# Plots
Expand Down Expand Up @@ -126,7 +127,22 @@ def main() -> None:
rr.script_add_args(parser)
args = parser.parse_args()

rr.script_setup(args, "rerun_example_plot")
blueprint = rrb.Blueprint(
rrb.Horizontal(
rrb.Grid(
rrb.BarChartView(name="Bar Chart", origin="/bar_chart"),
rrb.TimeSeriesView(name="Curves", origin="/curves"),
rrb.TimeSeriesView(name="Trig", origin="/trig"),
rrb.TimeSeriesView(name="Classification", origin="/classification"),
),
rrb.TextDocumentView(name="Description", origin="/description"),
column_shares=[2, 1],
),
rrb.SelectionPanel(expanded=False),
rrb.TimePanel(expanded=False),
)

rr.script_setup(args, "rerun_example_plot", blueprint=blueprint)

rr.log("description", rr.TextDocument(DESCRIPTION, media_type=rr.MediaType.MARKDOWN), timeless=True)
log_bar_chart()
Expand Down

0 comments on commit 735c12c

Please sign in to comment.