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

#include <svg_shapes.h>

Inheritance diagram for D3::SvgShapeGenerator:
D3::D3_Base D3::BaseLineGenerator D3::SymbolGenerator D3::LineGenerator D3::RadialLineGenerator D3::AreaGenerator D3::LinkGenerator D3::RadialAreaGenerator D3::ArcGenerator D3::ChordGenerator

Public Member Functions

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 Member Functions

 SvgShapeGenerator ()
 

Protected Attributes

int id
 

Detailed Description

A few particularly common shapes (circles, rectangles, and ellipses) have corresponding SVG elements that you can create directly. All other shapes (including lines) must be created by specifying a "path" describing their outline. Paths are defined with a mini-language that describes how you would draw the shape with a pen. You could write them by hand, but that's rarely desirable (especially when you're trying to systematically represent data). So d3 provides functions for generating functions that will convert data to paths. This is a base clase for all objects that manage such functions to inherit from. You probably want to instantiate derived versions, rather than this class directly.

Constructor & Destructor Documentation

D3::SvgShapeGenerator::SvgShapeGenerator ( )
inlineprotected

Member Function Documentation

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

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

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

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)
inline

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)
inline

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

Member Data Documentation

int D3::D3_Base::id
protectedinherited

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