trase
trase::Histogram Class Reference

A collection of rectangles arranged evenly along the x-axis, with varying heights (i.e. More...

#include <Histogram.hpp>

Inheritance diagram for trase::Histogram:
Collaboration diagram for trase::Histogram:

Public Member Functions

 Histogram (Axis *parent)
 create a new Histogram, connecting it to the parent
 
template<typename AnimatedBackend >
TRASE_GEOMETRY_DISPATCH_BACKENDS void draw (AnimatedBackend &backend)
 draw the full histogram animation using the AnimatedBackend More...
 
template<typename Backend >
void draw (Backend &backend, float time)
 draw the histogram at a snapshot in time using the Backend More...
 
template<typename AnimatedBackend >
void draw_legend (AnimatedBackend &backend, const bfloat2_t &box)
 draw the full histogram legend animation More...
 
template<typename Backend >
void draw_legend (Backend &backend, float time, const bfloat2_t &box)
 draw the histogram legend at a snapshot in time More...
 
- Public Member Functions inherited from trase::Geometry
 Geometry (Axis *parent)
 
void add_frame (const DataWithAesthetic &data, float time)
 Adds a new data frame to this plot. More...
 
float get_time (const int i) const
 
const DataWithAestheticget_data (const int i) const
 
DataWithAestheticget_data (const int i)
 
size_t data_size () const
 
void set_transform (const Transform &transform)
 Sets the transform. More...
 
void set_label (const std::string &label)
 Set the label. More...
 
const std::string & get_label () const
 
const Colormapget_colormap () const
 
virtual void dispatch_legend (BackendSVG &file, float time, const bfloat2_t &box)=0
 
virtual void dispatch_legend (BackendSVG &file, const bfloat2_t &box)=0
 
template<typename AnimatedBackend >
void draw (AnimatedBackend &backend)
 
template<typename Backend >
void draw (Backend &backend, float time)
 
template<typename AnimatedBackend >
void draw_legend (AnimatedBackend &backend, const bfloat2_t &box)
 
template<typename Backend >
void draw_legend (Backend &backend, float time, const bfloat2_t &box)
 
- Public Member Functions inherited from trase::Drawable
 Drawable (Drawable *parent, const bfloat2_t &area_of_parent)
 constructs a Drawable under parent in the tree structure, and assigns it an drawable area given by area_of_parent More...
 
void resize (const bfloat2_t &parent_pixels)
 resize the drawable area (in raw pixels) using the parents area (in raw pixels)
 
void update_time_span (float time)
 if time is outside the current animation time span of this object then this time span is increased to include it
 
void add_frame_time (float time)
 adds a keyframe time to the animation
 
void update_frame_info (float time)
 fills out m_frame_info using a given time More...
 
const FrameInfoget_frame_info () const
 returns the current FrameInfo More...
 
const bfloat2_tpixels () const
 returns this objects drawable area in raw pixels
 
const bfloat2_tarea () const
 returns this objects drawable area as a ratio of the parents drawable area
 
bfloat2_tarea ()
 returns this objects drawable area as a ratio of the parents drawable area
 
Stylestyle () noexcept
 returns modifiable current style
 
const float & time_span () const
 returns time span of the animation
 
virtual void dispatch (BackendSVG &file, float time)=0
 
virtual void dispatch (BackendSVG &file)=0
 
template<typename AnimatedBackend >
void draw (AnimatedBackend &backend)
 draw this object using the given AnimatedBackend
 
template<typename Backend >
void draw (Backend &backend, float time)
 draw this object using the given Backend
 

Additional Inherited Members

- Protected Attributes inherited from trase::Geometry
std::vector< DataWithAestheticm_data
 dataset
 
std::string m_label
 label
 
const Colormapm_colormap
 colormap
 
Limits m_limits
 min/max limits of m_data across all frames
 
Transform m_transform
 transform
 
Axism_axis
 parent axis
 
- Protected Attributes inherited from trase::Drawable
std::vector< std::shared_ptr< Drawable > > m_children
 a list of Drawables that are children of this object
 
Drawablem_parent
 parent of this object
 
bfloat2_t m_area
 the area of this object as a ratio of its parent object
 
bfloat2_t m_pixels
 the area of this object in raw pixels (updated by resize())
 
float m_time_span
 the animation time span (see update_time_span())
 
std::vector< float > m_times
 the animation frame times (see add_frame_time())
 
FrameInfo m_frame_info
 stores information on the current draw time (see update_frame_info())
 
Style m_style
 fully styling information for each drawable
 

Detailed Description

A collection of rectangles arranged evenly along the x-axis, with varying heights (i.e.

a histogram with regular bins)

Aesthetics:

  • y (the heights of each rectangle)
  • x (this geometry uses min/max limits only)

Default Transform:

Member Function Documentation

◆ draw() [1/2]

template<typename AnimatedBackend >
TRASE_GEOMETRY_DISPATCH_BACKENDS void trase::Histogram::draw ( AnimatedBackend backend)

draw the full histogram animation using the AnimatedBackend

Parameters
backendthe AnimatedBackend to use when drawing

◆ draw() [2/2]

template<typename Backend >
void trase::Histogram::draw ( Backend backend,
float  time 
)

draw the histogram at a snapshot in time using the Backend

Parameters
backendthe Backend to use when drawing
timedraw the histogram at this time

◆ draw_legend() [1/2]

template<typename AnimatedBackend >
void trase::Histogram::draw_legend ( AnimatedBackend backend,
const bfloat2_t box 
)

draw the full histogram legend animation

Parameters
backendthe AnimatedBackend to use when drawing

◆ draw_legend() [2/2]

template<typename Backend >
void trase::Histogram::draw_legend ( Backend backend,
float  time,
const bfloat2_t box 
)

draw the histogram legend at a snapshot in time

Parameters
backendthe Backend to use when drawing
timedraw the legend at this time

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