Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::SeriesLine Struct Reference

Archetype: Define the style properties for a line series in a chart. More...

#include <rerun/archetypes/series_line.hpp>

Public Types

using IndicatorComponent = rerun::components::IndicatorComponent< IndicatorComponentName >
 Indicator component, used to identify the archetype when converting to a list of components.
 

Public Member Functions

 SeriesLine (SeriesLine &&other)=default
 
 SeriesLine (const SeriesLine &other)=default
 
SeriesLineoperator= (const SeriesLine &other)=default
 
SeriesLineoperator= (SeriesLine &&other)=default
 
SeriesLine with_color (const rerun::components::Color &_color) &&
 Color for the corresponding series.
 
SeriesLine with_many_color (const Collection< rerun::components::Color > &_color) &&
 This method makes it possible to pack multiple color in a single component batch.
 
SeriesLine with_width (const rerun::components::StrokeWidth &_width) &&
 Stroke width for the corresponding series.
 
SeriesLine with_many_width (const Collection< rerun::components::StrokeWidth > &_width) &&
 This method makes it possible to pack multiple width in a single component batch.
 
SeriesLine with_name (const rerun::components::Name &_name) &&
 Display name of the series.
 
SeriesLine with_many_name (const Collection< rerun::components::Name > &_name) &&
 This method makes it possible to pack multiple name in a single component batch.
 
SeriesLine with_aggregation_policy (const rerun::components::AggregationPolicy &_aggregation_policy) &&
 Configures the zoom-dependent scalar aggregation.
 
SeriesLine with_many_aggregation_policy (const Collection< rerun::components::AggregationPolicy > &_aggregation_policy) &&
 This method makes it possible to pack multiple aggregation_policy in a single component batch.
 
Collection< ComponentColumncolumns (const Collection< uint32_t > &lengths_)
 Partitions the component data into multiple sub-batches.
 
Collection< ComponentColumncolumns ()
 Partitions the component data into unit-length sub-batches.
 

Static Public Member Functions

static SeriesLine update_fields ()
 Update only some specific fields of a SeriesLine.
 
static SeriesLine clear_fields ()
 Clear all the fields of a SeriesLine.
 

Public Attributes

std::optional< ComponentBatchcolor
 Color for the corresponding series.
 
std::optional< ComponentBatchwidth
 Stroke width for the corresponding series.
 
std::optional< ComponentBatchname
 Display name of the series.
 
std::optional< ComponentBatchaggregation_policy
 Configures the zoom-dependent scalar aggregation.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.SeriesLine"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_color
 ComponentDescriptor for the color field.
 
static constexpr auto Descriptor_width
 ComponentDescriptor for the width field.
 
static constexpr auto Descriptor_name
 ComponentDescriptor for the name field.
 
static constexpr auto Descriptor_aggregation_policy
 ComponentDescriptor for the aggregation_policy field.
 

Detailed Description

Archetype: Define the style properties for a line series in a chart.

This archetype only provides styling information and should be logged as static when possible. The underlying data needs to be logged to the same entity-path using archetypes::Scalar.

Example

Line series

image

#include <rerun.hpp>
#include <cmath>
constexpr float TAU = 6.28318530717958647692528676655900577f;
int main() {
const auto rec = rerun::RecordingStream("rerun_example_series_line_style");
rec.spawn().exit_on_failure();
// Set up plot styling:
// They are logged static as they don't change over time and apply to all timelines.
// Log two lines series under a shared root so that they show in the same plot by default.
rec.log_static(
"trig/sin",
rerun::SeriesLine().with_color({255, 0, 0}).with_name("sin(0.01t)").with_width(2)
);
rec.log_static(
"trig/cos",
rerun::SeriesLine().with_color({0, 255, 0}).with_name("cos(0.01t)").with_width(4)
);
// Log the data on a timeline called "step".
for (int t = 0; t <static_cast<int>(TAU * 2.0 * 100.0); ++t) {
rec.set_time_sequence("step", t);
rec.log("trig/sin", rerun::Scalar(sin(static_cast<double>(t) / 100.0)));
rec.log("trig/cos", rerun::Scalar(cos(static_cast<double>(t) / 100.0)));
}
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Archetype: A double-precision scalar, e.g.
Definition scalar.hpp:80
Archetype: Define the style properties for a line series in a chart.
Definition series_line.hpp:65
SeriesLine with_width(const rerun::components::StrokeWidth &_width) &&
Stroke width for the corresponding series.
Definition series_line.hpp:143
SeriesLine with_name(const rerun::components::Name &_name) &&
Display name of the series.
Definition series_line.hpp:160
SeriesLine with_color(const rerun::components::Color &_color) &&
Color for the corresponding series.
Definition series_line.hpp:128

Member Function Documentation

◆ with_many_color()

SeriesLine rerun::archetypes::SeriesLine::with_many_color ( const Collection< rerun::components::Color > &  _color) &&
inline

This method makes it possible to pack multiple color in a single component batch.

This only makes sense when used in conjunction with columns. with_color should be used when logging a single row's worth of data.

◆ with_many_width()

SeriesLine rerun::archetypes::SeriesLine::with_many_width ( const Collection< rerun::components::StrokeWidth > &  _width) &&
inline

This method makes it possible to pack multiple width in a single component batch.

This only makes sense when used in conjunction with columns. with_width should be used when logging a single row's worth of data.

◆ with_name()

SeriesLine rerun::archetypes::SeriesLine::with_name ( const rerun::components::Name _name) &&
inline

Display name of the series.

Used in the legend.

◆ with_many_name()

SeriesLine rerun::archetypes::SeriesLine::with_many_name ( const Collection< rerun::components::Name > &  _name) &&
inline

This method makes it possible to pack multiple name in a single component batch.

This only makes sense when used in conjunction with columns. with_name should be used when logging a single row's worth of data.

◆ with_aggregation_policy()

SeriesLine rerun::archetypes::SeriesLine::with_aggregation_policy ( const rerun::components::AggregationPolicy _aggregation_policy) &&
inline

Configures the zoom-dependent scalar aggregation.

This is done only if steps on the X axis go below a single pixel, i.e. a single pixel covers more than one tick worth of data. It can greatly improve performance (and readability) in such situations as it prevents overdraw.

◆ with_many_aggregation_policy()

SeriesLine rerun::archetypes::SeriesLine::with_many_aggregation_policy ( const Collection< rerun::components::AggregationPolicy > &  _aggregation_policy) &&
inline

This method makes it possible to pack multiple aggregation_policy in a single component batch.

This only makes sense when used in conjunction with columns. with_aggregation_policy should be used when logging a single row's worth of data.

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::SeriesLine::columns ( const Collection< uint32_t > &  lengths_)

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

The specified lengths must sum to the total length of the component batch.

◆ columns() [2/2]

Collection< ComponentColumn > rerun::archetypes::SeriesLine::columns ( )

Partitions the component data into unit-length sub-batches.

This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.

Member Data Documentation

◆ name

std::optional<ComponentBatch> rerun::archetypes::SeriesLine::name

Display name of the series.

Used in the legend.

◆ aggregation_policy

std::optional<ComponentBatch> rerun::archetypes::SeriesLine::aggregation_policy

Configures the zoom-dependent scalar aggregation.

This is done only if steps on the X axis go below a single pixel, i.e. a single pixel covers more than one tick worth of data. It can greatly improve performance (and readability) in such situations as it prevents overdraw.

◆ IndicatorComponentName

constexpr const char rerun::archetypes::SeriesLine::IndicatorComponentName[]
staticconstexpr
Initial value:
=
"rerun.components.SeriesLineIndicator"

◆ Descriptor_color

constexpr auto rerun::archetypes::SeriesLine::Descriptor_color
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "color", Loggable<rerun::components::Color>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition series_line.hpp:91

ComponentDescriptor for the color field.

◆ Descriptor_width

constexpr auto rerun::archetypes::SeriesLine::Descriptor_width
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "width",
Loggable<rerun::components::StrokeWidth>::Descriptor.component_name
)

ComponentDescriptor for the width field.

◆ Descriptor_name

constexpr auto rerun::archetypes::SeriesLine::Descriptor_name
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "name", Loggable<rerun::components::Name>::Descriptor.component_name
)

ComponentDescriptor for the name field.

◆ Descriptor_aggregation_policy

constexpr auto rerun::archetypes::SeriesLine::Descriptor_aggregation_policy
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "aggregation_policy",
Loggable<rerun::components::AggregationPolicy>::Descriptor.component_name
)

ComponentDescriptor for the aggregation_policy field.


The documentation for this struct was generated from the following file: