Struct re_types::archetypes::BarChart
source · pub struct BarChart {
pub values: TensorData,
}Expand 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
ⓘ
//! Create and log a bar chart
fn main() -> Result<(), Box<dyn std::error::Error>> {
let (rec, storage) = rerun::RecordingStreamBuilder::new("rerun_example_bar_chart").memory()?;
rec.log(
"bar_chart",
&rerun::BarChart::new(vec![8_i64, 4, 0, 9, 1, 4, 1, 6, 9, 0]),
)?;
rerun::native_viewer::show(storage.take())?;
Ok(())
}Fields§
§values: TensorDataThe values. Should always be a rank-1 tensor.
Implementations§
Trait Implementations§
source§impl Archetype for BarChart
impl Archetype for BarChart
§type Indicator = GenericIndicatorComponent<BarChart>
type Indicator = GenericIndicatorComponent<BarChart>
The associated indicator component, whose presence indicates that the high-level
archetype-based APIs were used to log the data. Read more
source§fn name() -> ArchetypeName
fn name() -> ArchetypeName
The fully-qualified name of this archetype, e.g.
rerun.archetypes.Points2D.source§fn indicator() -> MaybeOwnedComponentBatch<'static>
fn indicator() -> MaybeOwnedComponentBatch<'static>
source§fn required_components() -> Cow<'static, [ComponentName]>
fn required_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that must be provided by the user when constructing
this archetype.
source§fn recommended_components() -> Cow<'static, [ComponentName]>
fn recommended_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that should be provided by the user when constructing
this archetype.
source§fn optional_components() -> Cow<'static, [ComponentName]>
fn optional_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that may be provided by the user when constructing
this archetype.
source§fn all_components() -> Cow<'static, [ComponentName]>
fn all_components() -> Cow<'static, [ComponentName]>
Returns the names of all components that must, should and may be provided by the user when
constructing this archetype. Read more
source§fn from_arrow(
arrow_data: impl IntoIterator<Item = (Field, Box<dyn Array>)>
) -> DeserializationResult<Self>
fn from_arrow( arrow_data: impl IntoIterator<Item = (Field, Box<dyn Array>)> ) -> DeserializationResult<Self>
Given an iterator of Arrow arrays and their respective field metadata, deserializes them
into this archetype. Read more
source§impl AsComponents for BarChart
impl AsComponents for BarChart
source§fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
Exposes the object’s contents as a set of
ComponentBatchs. Read moresource§fn num_instances(&self) -> usize
fn num_instances(&self) -> usize
The number of instances in each batch. Read more
source§impl PartialEq for BarChart
impl PartialEq for BarChart
impl StructuralPartialEq for BarChart
Auto Trait Implementations§
impl RefUnwindSafe for BarChart
impl Send for BarChart
impl Sync for BarChart
impl Unpin for BarChart
impl UnwindSafe for BarChart
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more