-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish dataframe reference page (#7865)
We were missing a bunch of features and assets to be able to finish this, but now we have it all.
- Loading branch information
Showing
8 changed files
with
162 additions
and
11 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,17 @@ | ||
"""Craft a blueprint with the python API and save it to a file for future use.""" | ||
|
||
import sys | ||
|
||
import rerun.blueprint as rrb | ||
|
||
path_to_rbl = sys.argv[1] | ||
|
||
rrb.Blueprint( | ||
rrb.DataframeView( | ||
origin="/", | ||
query=rrb.archetypes.DataframeQuery( | ||
timeline="log_time", | ||
apply_latest_at=True, | ||
), | ||
), | ||
).save("rerun_example_dataframe_view_query", path_to_rbl) |
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,24 @@ | ||
"""Query and display the first 10 rows of a recording in a dataframe view.""" | ||
|
||
import sys | ||
|
||
import rerun as rr | ||
import rerun.blueprint as rrb | ||
|
||
path_to_rrd = sys.argv[1] | ||
|
||
rr.init("rerun_example_dataframe_view_query", spawn=True) | ||
|
||
rr.log_file_from_path(path_to_rrd) | ||
|
||
blueprint = rrb.Blueprint( | ||
rrb.DataframeView( | ||
origin="/", | ||
query=rrb.archetypes.DataframeQuery( | ||
timeline="log_time", | ||
apply_latest_at=True, | ||
), | ||
), | ||
) | ||
|
||
rr.send_blueprint(blueprint) |
27 changes: 27 additions & 0 deletions
27
docs/snippets/all/reference/dataframe_view_query_external.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,27 @@ | ||
//! Query and display the first 10 rows of a recording in a dataframe view. | ||
//! | ||
//! The blueprint is being loaded from an existing blueprint recording file. | ||
|
||
// ./dataframe_view_query_external /tmp/dna.rrd /tmp/dna.rbl | ||
|
||
#include <string> | ||
|
||
#include <rerun.hpp> | ||
|
||
int main(int argc, char** argv) { | ||
if (argc < 3) { | ||
return 1; | ||
} | ||
|
||
std::string path_to_rrd = argv[1]; | ||
std::string path_to_rbl = argv[2]; | ||
|
||
const auto rec = rerun::RecordingStream("rerun_example_dataframe_view_query_external"); | ||
rec.spawn().exit_on_failure(); | ||
|
||
// Log the files | ||
rec.log_file_from_path(path_to_rrd); | ||
rec.log_file_from_path(path_to_rbl); | ||
|
||
return 0; | ||
} |
19 changes: 19 additions & 0 deletions
19
docs/snippets/all/reference/dataframe_view_query_external.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,19 @@ | ||
""" | ||
Query and display the first 10 rows of a recording in a dataframe view. | ||
The blueprint is being loaded from an existing blueprint recording file. | ||
""" | ||
|
||
# python dataframe_view_query_external.py /tmp/dna.rrd /tmp/dna.rbl | ||
|
||
import sys | ||
|
||
import rerun as rr | ||
|
||
path_to_rrd = sys.argv[1] | ||
path_to_rbl = sys.argv[2] | ||
|
||
rr.init("rerun_example_dataframe_view_query_external", spawn=True) | ||
|
||
rr.log_file_from_path(path_to_rrd) | ||
rr.log_file_from_path(path_to_rbl) |
20 changes: 20 additions & 0 deletions
20
docs/snippets/all/reference/dataframe_view_query_external.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,20 @@ | ||
//! Query and display the first 10 rows of a recording in a dataframe view. | ||
//! | ||
//! The blueprint is being loaded from an existing blueprint recording file. | ||
// cargo r -p snippets -- dataframe_view_query_external /tmp/dna.rrd /tmp/dna.rbl | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let args = std::env::args().collect::<Vec<_>>(); | ||
|
||
let path_to_rrd = &args[1]; | ||
let path_to_rbl = &args[2]; | ||
|
||
let rec = rerun::RecordingStreamBuilder::new("rerun_example_dataframe_view_query_external") | ||
.spawn()?; | ||
|
||
rec.log_file_from_path(path_to_rrd, None /* prefix */, false /* static */)?; | ||
rec.log_file_from_path(path_to_rbl, None /* prefix */, false /* static */)?; | ||
|
||
Ok(()) | ||
} |
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