trase
|
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 Limits & | limits () const |
returns the min/max limits of the data | |
template<typename T > | |
DataWithAesthetic & | x (const std::vector< T > &data) |
DataWithAesthetic & | x (float min, float max) |
template<typename T > | |
DataWithAesthetic & | y (const std::vector< T > &data) |
DataWithAesthetic & | y (float min, float max) |
template<typename T > | |
DataWithAesthetic & | color (const std::vector< T > &data) |
DataWithAesthetic & | color (float min, float max) |
template<typename T > | |
DataWithAesthetic & | size (const std::vector< T > &data) |
DataWithAesthetic & | size (float min, float max) |
template<typename T > | |
DataWithAesthetic & | fill (const std::vector< T > &data) |
DataWithAesthetic & | fill (float min, float max) |
template<typename T > | |
DataWithAesthetic & | xmin (const std::vector< T > &data) |
DataWithAesthetic & | xmin (float min, float max) |
template<typename T > | |
DataWithAesthetic & | ymin (const std::vector< T > &data) |
DataWithAesthetic & | ymin (float min, float max) |
template<typename T > | |
DataWithAesthetic & | xmax (const std::vector< T > &data) |
DataWithAesthetic & | xmax (float min, float max) |
template<typename T > | |
DataWithAesthetic & | ymax (const std::vector< T > &data) |
DataWithAesthetic & | ymax (float min, float max) |
template<typename T > | |
std::map< T, DataWithAesthetic > | facet (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 >, DataWithAesthetic > | facet (const std::vector< T1 > &data1, const std::vector< T2 > &data2) const |
facets the data based on the dual input data columns More... | |
Combination of the RawData class and Aesthetics, this class points to a RawData object, and contains a mapping from aesthetics to RawData column numbers.
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
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
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
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)