#include <plot.h>
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) | |
| Line2D & | add (double x, double y) |
| template<class X, class Y> | |
| Line2D & | addArray (X &&x, Y &&y, size_t size) |
| template<class X, class Y> | |
| Line2D & | addArray (X &&x, Y &&y) |
| Line2D & | cut () |
| Point2D | prev () const |
| Line2D & | marker (double x, double y, int shape=-1) |
| Line2D & | dot (double x, double y, double screenR) |
| Adds a scatter-plot style circle. | |
| Line2D & | dot (double x, double y, double screenR, double unitColour) |
| Adds a scatter-plot style circle, with colour value in the 0-1 range. | |
| Line2D & | label (double valueX, double valueY, std::string name) |
| Line2D & | label (double valueX, double valueY, std::string name, double degrees, double distance=0) |
| Label with direction (degrees clockwise) and distance. | |
| Line2D & | label (std::string name, double degrees=0, double distance=0) |
| Adds a label using the latest point/marker/dot position. | |
| Line2D & | label (double xIsh, std::string name, double degrees=0, double distance=0) |
| Adds a label using the closest (line) point to the given x-axis position. | |
Draw config | |
| Line2D & | drawLine (bool draw=true) |
| Line2D & | drawFill (bool draw=true) |
| Line2D & | fillToY (double y) |
| Start/end the fill at a given Y value. | |
| Line2D & | fillToX (double x) |
| Start/end the fill at a given X value. | |
| Line2D & | fillTo (Line2D &other) |
Overridden from SvgDrawable | |
| 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. | |
| void | loopFrame (double endTime) override |
| Sets loop time (or < 0 to disable) for this element and all children. | |
| void | clearFrames () override |
| Removes all animation frames. Mostly useful if re-using the diagram for multiple animations. | |
| void | writeLabel (SvgWriter &svg, const PlotStyle &style) override |
| void | writeData (SvgWriter &svg, const PlotStyle &style) override |
Methods inherited from signalsmith::plot::SvgDrawable | |
| SvgDrawable (const SvgDrawable &other)=delete | |
| SvgDrawable & | operator= (const SvgDrawable &other)=delete |
| Bounds | layoutIfNeeded (const PlotStyle &style) |
| void | addChild (SvgDrawable *child, bool front=false) |
| Takes ownership of the child. | |
Attributes | |
| PlotStyle::Counter | styleIndex |
| bool | smoothFrame = false |
| Flag to attempt interpolation of the path between frames. | |
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. | |
Protected Attributes inherited from signalsmith::plot::SvgDrawable | |
| Bounds | bounds |
|
inlineoverridevirtual |
Removes all animation frames. Mostly useful if re-using the diagram for multiple animations.
Reimplemented from signalsmith::plot::SvgDrawable.
|
inline |
Adds a scatter-plot style circle.
|
inline |
Adds a scatter-plot style circle, with colour value in the 0-1 range.
|
inline |
Start/end the fill at a given X value.
|
inline |
Start/end the fill at a given Y value.
|
inline |
Label with direction (degrees clockwise) and distance.
|
inline |
Adds a label using the closest (line) point to the given x-axis position.
|
inline |
Adds a label using the latest point/marker/dot position.
|
inlineoverridevirtual |
Sets loop time (or < 0 to disable) for this element and all children.
Elements may have different loop time
Reimplemented from signalsmith::plot::SvgDrawable.
|
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.
Reimplemented from signalsmith::plot::SvgDrawable.
|
inlineoverridevirtual |
Reimplemented from signalsmith::plot::SvgDrawable.
|
inlineoverridevirtual |
Reimplemented from signalsmith::plot::SvgDrawable.
| bool signalsmith::plot::Line2D::smoothFrame = false |
Flag to attempt interpolation of the path between frames.