6#include "../collection.hpp"
7#include "../component_batch.hpp"
8#include "../component_column.hpp"
9#include "../components/color.hpp"
10#include "../components/length.hpp"
11#include "../components/tensor_data.hpp"
12#include "../result.hpp"
55 std::optional<ComponentBatch>
values;
58 std::optional<ComponentBatch>
color;
64 std::optional<ComponentBatch>
widths;
68 static constexpr const char ArchetypeName[] =
"rerun.archetypes.BarChart";
94 *
this = std::move(*this).with_values(
215 .value_or_throw()) {}
228 return std::move(*
this);
237 return std::move(*
this);
243 return std::move(*
this);
252 return std::move(*
this);
259 return std::move(*
this);
269 return std::move(*
this);
275 return std::move(*
this);
299 template <
typename T>
304 struct AsComponents<archetypes::
BarChart> {
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:76
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: A bar chart.
Definition bar_chart.hpp:53
BarChart(Collection< double > f64)
Construct a BarChart from a Collection<double>.
Definition bar_chart.hpp:143
BarChart with_many_values(const Collection< rerun::components::TensorData > &_values) &&
This method makes it possible to pack multiple values in a single component batch.
Definition bar_chart.hpp:235
static constexpr auto Descriptor_abscissa
ComponentDescriptor for the abscissa field.
Definition bar_chart.hpp:79
BarChart(Collection< int64_t > i64)
Construct a BarChart from a Collection<int64_t>.
Definition bar_chart.hpp:131
static BarChart update_fields()
Update only some specific fields of a BarChart.
Definition bar_chart.hpp:218
static BarChart u32(Collection< uint32_t > u32)
Construct a BarChart from a Collection<uint32_t>.
Definition bar_chart.hpp:160
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static BarChart f16(Collection< rerun::half > f16)
Construct a BarChart from a Collection<half>.
Definition bar_chart.hpp:190
static constexpr auto Descriptor_values
ComponentDescriptor for the values field.
Definition bar_chart.hpp:71
BarChart(Collection< int32_t > i32)
Construct a BarChart from a Collection<int32_t>.
Definition bar_chart.hpp:127
static BarChart i64(Collection< int64_t > i64)
Construct a BarChart from a Collection<int64_t>.
Definition bar_chart.hpp:185
static BarChart i16(Collection< int16_t > i16)
Construct a BarChart from a Collection<int16_t>.
Definition bar_chart.hpp:175
static BarChart f64(Collection< double > f64)
Construct a BarChart from a Collection<double>.
Definition bar_chart.hpp:200
static BarChart u64(Collection< uint64_t > u64)
Construct a BarChart from a Collection<uint64_t>.
Definition bar_chart.hpp:165
std::optional< ComponentBatch > abscissa
The abscissa corresponding to each value. Should be a 1-dimensional tensor (i.e. a vector) in same le...
Definition bar_chart.hpp:61
static BarChart f32(Collection< float > f32)
Construct a BarChart from a Collection<float>.
Definition bar_chart.hpp:195
BarChart with_many_abscissa(const Collection< rerun::components::TensorData > &_abscissa) &&
This method makes it possible to pack multiple abscissa in a single component batch.
Definition bar_chart.hpp:266
BarChart with_color(const rerun::components::Color &_color) &&
The color of the bar chart.
Definition bar_chart.hpp:241
static BarChart u16(Collection< uint16_t > u16)
Construct a BarChart from a Collection<uint16_t>.
Definition bar_chart.hpp:155
static BarChart clear_fields()
Clear all the fields of a BarChart.
static constexpr auto Descriptor_widths
ComponentDescriptor for the widths field.
Definition bar_chart.hpp:84
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition bar_chart.hpp:68
BarChart with_many_color(const Collection< rerun::components::Color > &_color) &&
This method makes it possible to pack multiple color in a single component batch.
Definition bar_chart.hpp:250
BarChart(Collection< rerun::half > f16)
Construct aBarChartfrom aCollection<half>`.
Definition bar_chart.hpp:135
BarChart(Collection< uint16_t > u16)
Construct a BarChart from a Collection<uint16_t>.
Definition bar_chart.hpp:107
std::optional< ComponentBatch > widths
The width of the bins, defined in x-axis units and defaults to 1. Should be a 1-dimensional tensor (i...
Definition bar_chart.hpp:64
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static BarChart u8(Collection< uint8_t > u8)
Construct a BarChart from a Collection<uint8_t>.
Definition bar_chart.hpp:150
BarChart(Collection< uint8_t > u8)
Construct a BarChart from a Collection<uint8_t>.
Definition bar_chart.hpp:103
BarChart(Collection< float > f32)
Construct a BarChart from a Collection<float>.
Definition bar_chart.hpp:139
BarChart(Collection< int8_t > i8)
Construct a BarChart from a Collection<int8_t>.
Definition bar_chart.hpp:119
BarChart with_values(const rerun::components::TensorData &_values) &&
The values. Should always be a 1-dimensional tensor (i.e. a vector).
Definition bar_chart.hpp:226
BarChart(Collection< uint32_t > u32)
Construct a BarChart from a Collection<uint32_t>.
Definition bar_chart.hpp:111
BarChart with_abscissa(const rerun::components::TensorData &_abscissa) &&
The abscissa corresponding to each value. Should be a 1-dimensional tensor (i.e. a vector) in same le...
Definition bar_chart.hpp:256
static BarChart i32(Collection< int32_t > i32)
Construct a BarChart from a Collection<int32_t>.
Definition bar_chart.hpp:180
BarChart(Collection< uint64_t > u64)
Construct a BarChart from a Collection<uint64_t>.
Definition bar_chart.hpp:115
BarChart(Collection< int16_t > i16)
Construct a BarChart from a Collection<int16_t>.
Definition bar_chart.hpp:123
static constexpr auto Descriptor_color
ComponentDescriptor for the color field.
Definition bar_chart.hpp:75
static BarChart i8(Collection< int8_t > i8)
Construct a BarChart from a Collection<int8_t>.
Definition bar_chart.hpp:170
std::optional< ComponentBatch > color
The color of the bar chart.
Definition bar_chart.hpp:58
std::optional< ComponentBatch > values
The values. Should always be a 1-dimensional tensor (i.e. a vector).
Definition bar_chart.hpp:55
BarChart with_widths(const Collection< rerun::components::Length > &_widths) &&
The width of the bins, defined in x-axis units and defaults to 1. Should be a 1-dimensional tensor (i...
Definition bar_chart.hpp:273
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17
Component: An N-dimensional array of numbers.
Definition tensor_data.hpp:22
Datatype: The underlying storage for archetypes::Tensor.
Definition tensor_buffer.hpp:98
size_t num_elems() const
Number of elements in the buffer.