Signalsmith's Basic C++ Plots  1.1.0
A minimal C++ plotting library
Nested Classes | Methods | Attributes
signalsmith::plot::Line2D Class Reference

#include <plot.h>

Detailed Description

A line on a 2D plot, with fill and/or stroke.

Inherits signalsmith::plot::SvgDrawable.

Nested Classes

class  LineLabel
 

Methods

 Line2D (Axis &axisX, Axis &axisY, PlotStyle::Counter styleIndex)
 
Line2Dadd (double x, double y)
 
template<class X , class Y >
Line2DaddArray (X &&x, Y &&y, size_t size)
 
template<class X , class Y >
Line2DaddArray (X &&x, Y &&y)
 
Line2Dmarker (double x, double y, int shape=-1)
 
void toFrame (double time, bool clear=true) override
 Creates a frame from the current stat, and optionally clears the state ready for the next frame. More...
 
void loopFrame (double endTime) override
 Sets loop time (or < 0 to disable) More...
 
void clearFrames () override
 Removes all animation frames. Mostly useful if re-using the diagram for multiple animations. More...
 
Line2Dlabel (double valueX, double valueY, std::string name)
 
Line2Dlabel (double valueX, double valueY, std::string name, double degrees, double distance=0)
 
Line2Dlabel (std::string name, double degrees=0, double distance=0)
 
Line2Dlabel (double xIsh, std::string name, double degrees=0, double distance=0)
 
void writeLabel (SvgWriter &svg, const PlotStyle &style) override
 
void writeData (SvgWriter &svg, const PlotStyle &style) override
 
Draw config
Line2DdrawLine (bool draw=true)
 
Line2DdrawFill (bool draw=true)
 
Line2DfillToY (double y)
 Start/end the fill at a given Y value. More...
 
Line2DfillToX (double x)
 Start/end the fill at a given X value. More...
 
Line2DfillTo (Line2D &other)
 
- Methods inherited from signalsmith::plot::SvgDrawable
 SvgDrawable (const SvgDrawable &other)=delete
 
SvgDrawableoperator= (const SvgDrawable &other)=delete
 
Bounds layoutIfNeeded (const PlotStyle &style)
 
void addChild (SvgDrawable *child, bool front=false)
 Takes ownership of the child. More...
 

Attributes

PlotStyle::Counter styleIndex
 
bool smoothFrame = false
 

Additional Inherited Members

- Protected Member Functions inherited from signalsmith::plot::SvgDrawable
void invalidateLayout ()
 
virtual void layout (const PlotStyle &style)
 
void addLayoutChild (SvgDrawable *child)
 These children are removed when the layout is invalidated. More...
 
- Protected Attributes inherited from signalsmith::plot::SvgDrawable
Bounds bounds
 

Method Details

◆ clearFrames()

void signalsmith::plot::Line2D::clearFrames ( )
inlineoverridevirtual

Removes all animation frames. Mostly useful if re-using the diagram for multiple animations.

Reimplemented from signalsmith::plot::SvgDrawable.

◆ fillToX()

Line2D& signalsmith::plot::Line2D::fillToX ( double  x)
inline

Start/end the fill at a given X value.

◆ fillToY()

Line2D& signalsmith::plot::Line2D::fillToY ( double  y)
inline

Start/end the fill at a given Y value.

◆ loopFrame()

void signalsmith::plot::Line2D::loopFrame ( double  loopTime)
inlineoverridevirtual

Sets loop time (or < 0 to disable)

Reimplemented from signalsmith::plot::SvgDrawable.

◆ toFrame()

void signalsmith::plot::Line2D::toFrame ( double  time,
bool  clear = true 
)
inlineoverridevirtual

Creates a frame from the current stat, and optionally clears the state ready for the next frame.

The time is the start-time of the frame being created.

Two lines with a different number of frames

Reimplemented from signalsmith::plot::SvgDrawable.