Empirical
Public Member Functions | Protected Attributes | List of all members
D3::SymbolGenerator Class Reference

#include <svg_shapes.h>

Inheritance diagram for D3::SymbolGenerator:
D3::SvgShapeGenerator D3::D3_Base

Public Member Functions

 SymbolGenerator ()
 
void SetType (std::string type)
 
void SetSize (int size)
 
template<typename T , size_t SIZE>
std::string Generate (emp::array< emp::array< T, 2 >, SIZE > &data)
 
template<typename T , std::size_t SIZE>
Selection DrawShape (emp::array< emp::array< T, 2 >, SIZE > &data, Selection &s)
 
Selection DrawShape (Dataset data, Selection s)
 DrawShape will also accept a D3::Dataset. More...
 
template<typename T , std::size_t SIZE, std::size_t SIZE2>
Selection DrawShape (emp::array< emp::array< emp::array< T, 2 >, SIZE >, SIZE2 > &data)
 If you pass a triple-nested array, it will be treated as an array of paths. More...
 
int GetID () const
 
void Log () const
 

Protected Attributes

int id
 

Detailed Description

Generate symbols ("circle", "cross" "diamond", "square", "triangle-down", "triangle-up"). Often useful for making scatter plots.

Constructor & Destructor Documentation

D3::SymbolGenerator::SymbolGenerator ( )
inline

Member Function Documentation

template<typename T , std::size_t SIZE>
Selection D3::SvgShapeGenerator::DrawShape ( emp::array< emp::array< T, 2 >, SIZE > &  data,
Selection s 
)
inlineinherited

Draws the path associated with [data] onto the [s] selection (must contain a single SVG) element).

Selection D3::SvgShapeGenerator::DrawShape ( Dataset  data,
Selection  s 
)
inlineinherited

DrawShape will also accept a D3::Dataset.

template<typename T , std::size_t SIZE, std::size_t SIZE2>
Selection D3::SvgShapeGenerator::DrawShape ( emp::array< emp::array< emp::array< T, 2 >, SIZE >, SIZE2 > &  data)
inlineinherited

If you pass a triple-nested array, it will be treated as an array of paths.

template<typename T , size_t SIZE>
std::string D3::SvgShapeGenerator::Generate ( emp::array< emp::array< T, 2 >, SIZE > &  data)
inlineinherited

Generate the string describing the path associated with [data] Assumes [data] is an array of 2-element arrays describing (x,y) coordinates and makes the line that connects them

int D3::D3_Base::GetID ( ) const
inlineinherited
void D3::D3_Base::Log ( ) const
inlineinherited
void D3::SymbolGenerator::SetSize ( int  size)
inline

Set size in pixels to [size] - can be an int, a C++ function, or string naming a Javascript function in the current window, the emp namespace, or the d3 namespace.

void D3::SymbolGenerator::SetType ( std::string  type)
inline

Set the type of symbol generated. Must be a C++ function, a string containing the name of a Javascript function (in the current window, d3, or emp namespaces), or a string specifying a type ("circle", "cross" "diamond", "square", "triangle-down", "triangle-up").

Member Data Documentation

int D3::D3_Base::id
protectedinherited

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