scales.hpp
Tools for scaling graph axes in D3.
-
namespace D3
-
-
class Category10Scale : private D3::D3_Base
- #include <scales.hpp>
Public Functions
-
inline Category10Scale()
-
inline Category10Scale()
-
class Category20bScale : private D3::D3_Base
- #include <scales.hpp>
Public Functions
-
inline Category20bScale()
-
inline Category20bScale()
-
class Category20cScale : private D3::D3_Base
- #include <scales.hpp>
Public Functions
-
inline Category20cScale()
Protected Attributes
-
int id
-
inline Category20cScale()
-
class Category20Scale : private D3::D3_Base
- #include <scales.hpp>
Public Functions
-
inline Category20Scale()
-
inline Category20Scale()
-
class IdentityScale : public D3::Scale
- #include <scales.hpp>
Subclassed by D3::LinearScale
Public Functions
-
inline IdentityScale()
-
inline IdentityScale(bool derived)
-
inline IdentityScale &SetTicks(int count)
-
inline IdentityScale &SetTickFormat(int count, std::string format)
-
inline IdentityScale()
-
class LinearScale : public D3::IdentityScale
- #include <scales.hpp>
Subclassed by D3::LogScale, D3::PowScale, D3::TimeScale
Public Functions
-
inline LinearScale()
-
inline LinearScale(bool derived)
-
template<typename T, size_t SIZE>
inline LinearScale &SetRangeRound(array<T, SIZE> values)
-
inline LinearScale &SetRangeRound(double min, double max)
-
inline LinearScale &SetInterpolate(std::string factory)
-
inline LinearScale &Clamp(bool clamp)
-
inline LinearScale &Nice(int count = -1)
-
inline LinearScale()
-
class LogScale : public D3::LinearScale
- #include <scales.hpp>
-
class OrdinalScale : public D3::QuantizeScale
- #include <scales.hpp>
-
class PowScale : public D3::LinearScale
- #include <scales.hpp>
-
class QuantileScale : public D3::QuantizeScale
- #include <scales.hpp>
-
class QuantizeScale : public D3::Scale
- #include <scales.hpp>
Subclassed by D3::OrdinalScale, D3::QuantileScale, D3::ThresholdScale
-
class Scale : public D3::D3_Base
- #include <scales.hpp>
Scales in D3 are functions that take input values and map them to output based on a scaling function. They are often used to map data calues to x, y coordinates in pixels describing where on the screen elements should be placed. This is a base class to inherit from - should never be made stand-alone
Subclassed by D3::IdentityScale, D3::QuantizeScale
Public Functions
-
inline Scale()
-
inline Scale(bool derived)
Decoy constructor so we don’t construct extra base scales.
-
template<typename T, size_t SIZE>
inline Scale &SetRange(array<T, SIZE> values) Set the output values corresponding to values in the domain. Output for values in between will be interpolated with a function determined by the type of the scale. Array should contain same number of elements as the one used to set the domain.
-
template<typename T, size_t SIZE>
inline Scale &SetDomain(array<T, SIZE> values) Set the input values corresponding to values in the range. Array should contain same number of elements as the one used to set the range.
-
inline double ApplyScale(double input)
Calculate the ouput for [input], based on the scale’s scaling function.
-
inline int ApplyScale(int input)
Protected Functions
-
inline Scale(int id)
-
inline Scale()
-
class ThresholdScale : public D3::QuantizeScale
- #include <scales.hpp>
-
class TimeScale : public D3::LinearScale
- #include <scales.hpp>
-
class Category10Scale : private D3::D3_Base