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

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

#include <rerun/archetypes/series_lines.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

SeriesLines with_names (const char *_name) &&
 Display name of the series.
 
 SeriesLines (SeriesLines &&other)=default
 
 SeriesLines (const SeriesLines &other)=default
 
SeriesLinesoperator= (const SeriesLines &other)=default
 
SeriesLinesoperator= (SeriesLines &&other)=default
 
SeriesLines with_colors (const Collection< rerun::components::Color > &_colors) &&
 Color for the corresponding series.
 
SeriesLines with_widths (const Collection< rerun::components::StrokeWidth > &_widths) &&
 Stroke width for the corresponding series.
 
SeriesLines with_names (const Collection< rerun::components::Name > &_names) &&
 Display name of the series.
 
SeriesLines with_visible_series (const Collection< rerun::components::SeriesVisible > &_visible_series) &&
 Which lines are visible.
 
SeriesLines with_aggregation_policy (const rerun::components::AggregationPolicy &_aggregation_policy) &&
 Configures the zoom-dependent scalar aggregation.
 
SeriesLines 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 SeriesLines update_fields ()
 Update only some specific fields of a SeriesLines.
 
static SeriesLines clear_fields ()
 Clear all the fields of a SeriesLines.
 

Public Attributes

std::optional< ComponentBatchcolors
 Color for the corresponding series.
 
std::optional< ComponentBatchwidths
 Stroke width for the corresponding series.
 
std::optional< ComponentBatchnames
 Display name of the series.
 
std::optional< ComponentBatchvisible_series
 Which lines are visible.
 
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.SeriesLines"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_colors
 ComponentDescriptor for the colors field.
 
static constexpr auto Descriptor_widths
 ComponentDescriptor for the widths field.
 
static constexpr auto Descriptor_names
 ComponentDescriptor for the names field.
 
static constexpr auto Descriptor_visible_series
 ComponentDescriptor for the visible_series field.
 
static constexpr auto Descriptor_aggregation_policy
 ComponentDescriptor for the aggregation_policy field.
 

Detailed Description

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

This archetype only provides styling information. Changes over time are supported for most but not all its fields (see respective fields for details), it's generally recommended to log this type as static.

The underlying data needs to be logged to the same entity-path using archetypes::Scalars. Dimensionality of the scalar arrays logged at each time point is assumed to be the same over time.

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",
.with_names("sin(0.01t)")
.with_widths(2.0f)
);
rec.log_static(
"trig/cos",
.with_names("cos(0.01t)")
.with_widths(4.0f)
);
// 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::Scalars(sin(static_cast<double>(t) / 100.0)));
rec.log("trig/cos", rerun::Scalars(cos(static_cast<double>(t) / 100.0)));
}
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Archetype: One or more double-precision scalar values, e.g.
Definition scalars.hpp:81
Archetype: Define the style properties for one or more line series in a chart.
Definition series_lines.hpp:75
SeriesLines with_names(const char *_name) &&
Display name of the series.
Definition series_lines.hpp:147
SeriesLines with_widths(const Collection< rerun::components::StrokeWidth > &_widths) &&
Stroke width for the corresponding series.
Definition series_lines.hpp:181
SeriesLines with_colors(const Collection< rerun::components::Color > &_colors) &&
Color for the corresponding series.
Definition series_lines.hpp:173
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:28

Member Function Documentation

◆ with_names() [1/2]

SeriesLines rerun::archetypes::SeriesLines::with_names ( const char *  _name) &&
inline

Display name of the series.

Used in the legend. Expected to be unchanging over time.

◆ with_colors()

SeriesLines rerun::archetypes::SeriesLines::with_colors ( const Collection< rerun::components::Color > &  _colors) &&
inline

Color for the corresponding series.

May change over time, but can cause discontinuities in the line.

◆ with_widths()

SeriesLines rerun::archetypes::SeriesLines::with_widths ( const Collection< rerun::components::StrokeWidth > &  _widths) &&
inline

Stroke width for the corresponding series.

May change over time, but can cause discontinuities in the line.

◆ with_names() [2/2]

SeriesLines rerun::archetypes::SeriesLines::with_names ( const Collection< rerun::components::Name > &  _names) &&
inline

Display name of the series.

Used in the legend. Expected to be unchanging over time.

◆ with_visible_series()

SeriesLines rerun::archetypes::SeriesLines::with_visible_series ( const Collection< rerun::components::SeriesVisible > &  _visible_series) &&
inline

Which lines are visible.

If not set, all line series on this entity are visible. Unlike with the regular visibility property of the entire entity, any series that is hidden via this property will still be visible in the legend.

May change over time, but can cause discontinuities in the line.

◆ with_aggregation_policy()

SeriesLines rerun::archetypes::SeriesLines::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.

Expected to be unchanging over time.

◆ with_many_aggregation_policy()

SeriesLines rerun::archetypes::SeriesLines::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::SeriesLines::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::SeriesLines::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

◆ colors

std::optional<ComponentBatch> rerun::archetypes::SeriesLines::colors

Color for the corresponding series.

May change over time, but can cause discontinuities in the line.

◆ widths

std::optional<ComponentBatch> rerun::archetypes::SeriesLines::widths

Stroke width for the corresponding series.

May change over time, but can cause discontinuities in the line.

◆ names

std::optional<ComponentBatch> rerun::archetypes::SeriesLines::names

Display name of the series.

Used in the legend. Expected to be unchanging over time.

◆ visible_series

std::optional<ComponentBatch> rerun::archetypes::SeriesLines::visible_series

Which lines are visible.

If not set, all line series on this entity are visible. Unlike with the regular visibility property of the entire entity, any series that is hidden via this property will still be visible in the legend.

May change over time, but can cause discontinuities in the line.

◆ aggregation_policy

std::optional<ComponentBatch> rerun::archetypes::SeriesLines::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.

Expected to be unchanging over time.

◆ IndicatorComponentName

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

◆ Descriptor_colors

constexpr auto rerun::archetypes::SeriesLines::Descriptor_colors
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "colors", Loggable<rerun::components::Color>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition series_lines.hpp:116

ComponentDescriptor for the colors field.

◆ Descriptor_widths

constexpr auto rerun::archetypes::SeriesLines::Descriptor_widths
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "widths",
Loggable<rerun::components::StrokeWidth>::Descriptor.component_name
)

ComponentDescriptor for the widths field.

◆ Descriptor_names

constexpr auto rerun::archetypes::SeriesLines::Descriptor_names
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "names", Loggable<rerun::components::Name>::Descriptor.component_name
)

ComponentDescriptor for the names field.

◆ Descriptor_visible_series

constexpr auto rerun::archetypes::SeriesLines::Descriptor_visible_series
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "visible_series",
Loggable<rerun::components::SeriesVisible>::Descriptor.component_name
)

ComponentDescriptor for the visible_series field.

◆ Descriptor_aggregation_policy

constexpr auto rerun::archetypes::SeriesLines::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: