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

Archetype: A bar chart. More...

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

 BarChart (rerun::datatypes::TensorBuffer buffer)
 
 BarChart (Collection< uint8_t > u8)
 Construct a BarChart from a Collection<uint8_t>.
 
 BarChart (Collection< uint16_t > u16)
 Construct a BarChart from a Collection<uint16_t>.
 
 BarChart (Collection< uint32_t > u32)
 Construct a BarChart from a Collection<uint32_t>.
 
 BarChart (Collection< uint64_t > u64)
 Construct a BarChart from a Collection<uint64_t>.
 
 BarChart (Collection< int8_t > i8)
 Construct a BarChart from a Collection<int8_t>.
 
 BarChart (Collection< int16_t > i16)
 Construct a BarChart from a Collection<int16_t>.
 
 BarChart (Collection< int32_t > i32)
 Construct a BarChart from a Collection<int32_t>.
 
 BarChart (Collection< int64_t > i64)
 Construct a BarChart from a Collection<int64_t>.
 
 BarChart (Collection< rerun::half > f16)
 Construct aBarChartfrom aCollection<half>`.
 
 BarChart (Collection< float > f32)
 Construct a BarChart from a Collection<float>.
 
 BarChart (Collection< double > f64)
 Construct a BarChart from a Collection<double>.
 
 BarChart (BarChart &&other)=default
 
 BarChart (const BarChart &other)=default
 
BarChartoperator= (const BarChart &other)=default
 
BarChartoperator= (BarChart &&other)=default
 
 BarChart (rerun::components::TensorData _values)
 
BarChart with_values (const rerun::components::TensorData &_values) &&
 The values. Should always be a 1-dimensional tensor (i.e. a vector).
 
BarChart with_many_values (const Collection< rerun::components::TensorData > &_values) &&
 This method makes it possible to pack multiple values in a single component batch.
 
BarChart with_color (const rerun::components::Color &_color) &&
 The color of the bar chart.
 
BarChart with_many_color (const Collection< rerun::components::Color > &_color) &&
 This method makes it possible to pack multiple color 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 BarChart u8 (Collection< uint8_t > u8)
 Construct a BarChart from a Collection<uint8_t>.
 
static BarChart u16 (Collection< uint16_t > u16)
 Construct a BarChart from a Collection<uint16_t>.
 
static BarChart u32 (Collection< uint32_t > u32)
 Construct a BarChart from a Collection<uint32_t>.
 
static BarChart u64 (Collection< uint64_t > u64)
 Construct a BarChart from a Collection<uint64_t>.
 
static BarChart i8 (Collection< int8_t > i8)
 Construct a BarChart from a Collection<int8_t>.
 
static BarChart i16 (Collection< int16_t > i16)
 Construct a BarChart from a Collection<int16_t>.
 
static BarChart i32 (Collection< int32_t > i32)
 Construct a BarChart from a Collection<int32_t>.
 
static BarChart i64 (Collection< int64_t > i64)
 Construct a BarChart from a Collection<int64_t>.
 
static BarChart f16 (Collection< rerun::half > f16)
 Construct a BarChart from a Collection<half>.
 
static BarChart f32 (Collection< float > f32)
 Construct a BarChart from a Collection<float>.
 
static BarChart f64 (Collection< double > f64)
 Construct a BarChart from a Collection<double>.
 
static BarChart update_fields ()
 Update only some specific fields of a BarChart.
 
static BarChart clear_fields ()
 Clear all the fields of a BarChart.
 

Public Attributes

std::optional< ComponentBatchvalues
 The values. Should always be a 1-dimensional tensor (i.e. a vector).
 
std::optional< ComponentBatchcolor
 The color of the bar chart.
 

Static Public Attributes

static constexpr const char IndicatorComponentName [] = "rerun.components.BarChartIndicator"
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.BarChart"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_values
 ComponentDescriptor for the values field.
 
static constexpr auto Descriptor_color
 ComponentDescriptor for the color field.
 

Detailed Description

Archetype: A bar chart.

The x values will be the indices of the array, and the bar heights will be the provided values.

Example

Simple bar chart

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_bar_chart");
rec.spawn().exit_on_failure();
rec.log("bar_chart", rerun::BarChart::i64({8, 4, 0, 9, 1, 4, 1, 6, 9, 0}));
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60

Member Function Documentation

◆ with_many_values()

BarChart rerun::archetypes::BarChart::with_many_values ( const Collection< rerun::components::TensorData > &  _values) &&
inline

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

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

◆ with_many_color()

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

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::BarChart::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::BarChart::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

◆ Descriptor_values

constexpr auto rerun::archetypes::BarChart::Descriptor_values
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "values",
Loggable<rerun::components::TensorData>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition bar_chart.hpp:52

ComponentDescriptor for the values field.

◆ Descriptor_color

constexpr auto rerun::archetypes::BarChart::Descriptor_color
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "color", Loggable<rerun::components::Color>::Descriptor.component_name
)

ComponentDescriptor for the color field.


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