trase
trase::DataWithAesthetic Class Reference

Combination of the RawData class and Aesthetics, this class points to a RawData object, and contains a mapping from aesthetics to RawData column numbers. More...

#include <Data.hpp>

Public Member Functions

 DataWithAesthetic (std::shared_ptr< RawData > data)
 
 DataWithAesthetic (std::shared_ptr< RawData > data, const std::unordered_map< int, int > &map, const Limits &limits)
 
template<typename Aesthetic >
ColumnIterator begin () const
 return a ColumnIterator to the beginning of the data column for aesthetic a, throws if a has not yet been set
 
template<typename Aesthetic >
ColumnIterator end () const
 return a ColumnIterator to the end of the data column for aesthetic a, throws if a has not yet been set
 
template<typename Aesthetic , typename T >
void set (const std::vector< T > &data)
 if aesthetic a is not yet been set, this creates a new data column and copies in data (throws if data does not have the correct number of rows). More...
 
template<typename Aesthetic >
void set (float min, float max)
 rather than adding new data, this allows the limits of a given aesthetic to be manually set. More...
 
template<typename Aesthetic >
bool has () const
 returns true if Aesthetic has been set
 
int rows () const
 returns number of rows in the data set
 
int cols () const
 returns number of cols in the data set
 
const Limitslimits () const
 returns the min/max limits of the data
 
template<typename T >
DataWithAestheticx (const std::vector< T > &data)
 
DataWithAestheticx (float min, float max)
 
template<typename T >
DataWithAestheticy (const std::vector< T > &data)
 
DataWithAestheticy (float min, float max)
 
template<typename T >
DataWithAestheticcolor (const std::vector< T > &data)
 
DataWithAestheticcolor (float min, float max)
 
template<typename T >
DataWithAestheticsize (const std::vector< T > &data)
 
DataWithAestheticsize (float min, float max)
 
template<typename T >
DataWithAestheticfill (const std::vector< T > &data)
 
DataWithAestheticfill (float min, float max)
 
template<typename T >
DataWithAestheticxmin (const std::vector< T > &data)
 
DataWithAestheticxmin (float min, float max)
 
template<typename T >
DataWithAestheticymin (const std::vector< T > &data)
 
DataWithAestheticymin (float min, float max)
 
template<typename T >
DataWithAestheticxmax (const std::vector< T > &data)
 
DataWithAestheticxmax (float min, float max)
 
template<typename T >
DataWithAestheticymax (const std::vector< T > &data)
 
DataWithAestheticymax (float min, float max)
 
template<typename T >
std::map< T, DataWithAestheticfacet (const std::vector< T > &data) const
 facets the data based on the input data column More...
 
template<typename T1 , typename T2 >
std::map< std::pair< T1, T2 >, DataWithAestheticfacet (const std::vector< T1 > &data1, const std::vector< T2 > &data2) const
 facets the data based on the dual input data columns More...
 

Detailed Description

Combination of the RawData class and Aesthetics, this class points to a RawData object, and contains a mapping from aesthetics to RawData column numbers.

Member Function Documentation

◆ facet() [1/2]

template<typename T >
std::map<T, DataWithAesthetic> trase::DataWithAesthetic::facet ( const std::vector< T > &  data) const

facets the data based on the input data column

The input data column (of the same number of rows as this dataset) contains N unique values. This function returns a map of each of these N values to a dataset containing all the rows that have this value

◆ facet() [2/2]

template<typename T1 , typename T2 >
std::map<std::pair<T1, T2>, DataWithAesthetic> trase::DataWithAesthetic::facet ( const std::vector< T1 > &  data1,
const std::vector< T2 > &  data2 
) const

facets the data based on the dual input data columns

The input data columns (of the same number of rows as this dataset) contains NxM unique value pairs. This function returns a map of each of these NxM values to a dataset containing all the rows that have this value

◆ set() [1/2]

template<typename Aesthetic , typename T >
void trase::DataWithAesthetic::set ( const std::vector< T > &  data)

if aesthetic a is not yet been set, this creates a new data column and copies in data (throws if data does not have the correct number of rows).

If aesthetic a has been previously set, its data column is overwritten with data

◆ set() [2/2]

template<typename Aesthetic >
void trase::DataWithAesthetic::set ( float  min,
float  max 
)

rather than adding new data, this allows the limits of a given aesthetic to be manually set.

This is used, for example, with geometries where the data is implicitly defined over a range (e.g. histograms with regular bin widths)


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