scenepic 1.1.0
3D Visualization Made Easy
|
A 2D viewport that animates one or more sparklines. More...
#include <graph.h>
Classes | |
struct | Margin |
Represents the margin along the edges of a graph. More... | |
struct | VerticalRule |
Represents a vertical line in a sparkline graph. More... | |
Public Member Functions | |
const std::string & | canvas_id () const |
A unique identifier for the canvas. More... | |
void | add_sparkline (const std::string &name, const std::vector< float > &values, const scenepic::Color &line_color=scenepic::Colors::Black, float line_width=1.0f, const std::vector< VerticalRule > &vertical_rules={}) |
Adds a sparkline to the graph. More... | |
std::string | to_string () const |
Return a JSON string representing the object. More... | |
JsonValue | to_json () const |
Convert this object into ScenePic json. More... | |
const Color & | background_color () const |
The background color of the frame. More... | |
Graph & | background_color (const Color &color) |
Set the background color of the frame. More... | |
const Margin & | margin () const |
The outside margin of the graph. More... | |
Graph & | margin (const Margin &margin) |
Set the outside margin of the graph. More... | |
const std::string & | name_align () const |
How to align the sparkline label (one of 'left', 'right', 'top', 'bottom', or 'none') More... | |
Graph & | name_align (const std::string &name_align) |
How to align the sparkline label (one of 'left', 'right', 'top', 'bottom', or 'none') More... | |
const std::string & | value_align () const |
How to align the sparkline value (one of 'left', 'right', 'top', 'bottom', or 'none') More... | |
Graph & | value_align (const std::string &value_align) |
How to align the sparkline value (one of 'left', 'right', 'top', 'bottom', or 'none') More... | |
const std::string & | font_family () const |
The font family used for the graph labels. More... | |
Graph & | font_family (const std::string &font_family) |
Set the font family used for the graph labels. More... | |
float | name_size () const |
The size of the graph labels in pixels. More... | |
Graph & | name_size (float name_size) |
Set the size of the graph labels in pixels. More... | |
float | value_size () const |
The size of the graph labels in pixels. More... | |
Graph & | value_size (float value_size) |
Set the size of the graph labels in pixels. More... | |
const std::string & | media_id () const |
The unique ID of the media file associated with this canvas. More... | |
Graph & | media_id (const std::string &media_id) |
The unique ID of the media file associated with this canvas. More... | |
Friends | |
class | Scene |
A 2D viewport that animates one or more sparklines.
void scenepic::Graph::add_sparkline | ( | const std::string & | name, |
const std::vector< float > & | values, | ||
const scenepic::Color & | line_color = scenepic::Colors::Black , |
||
float | line_width = 1.0f , |
||
const std::vector< VerticalRule > & | vertical_rules = {} |
||
) |
Adds a sparkline to the graph.
name | the name of the measured quantity |
values | a vector of measured values, one per frame |
line_color | the color of the line (and its labels) |
line_width | the width of the line |
vertical_rules | vertical rules to draw on the sparkline |
const Color & scenepic::Graph::background_color | ( | ) | const |
The background color of the frame.
Set the background color of the frame.
const std::string & scenepic::Graph::canvas_id | ( | ) | const |
A unique identifier for the canvas.
const std::string & scenepic::Graph::font_family | ( | ) | const |
The font family used for the graph labels.
Graph & scenepic::Graph::font_family | ( | const std::string & | font_family | ) |
Set the font family used for the graph labels.
const Margin & scenepic::Graph::margin | ( | ) | const |
The outside margin of the graph.
const std::string & scenepic::Graph::media_id | ( | ) | const |
The unique ID of the media file associated with this canvas.
This file will be used to drive playback, i.e. frames will be displayed in time with of the media file.
Graph & scenepic::Graph::media_id | ( | const std::string & | media_id | ) |
The unique ID of the media file associated with this canvas.
const std::string & scenepic::Graph::name_align | ( | ) | const |
How to align the sparkline label (one of 'left', 'right', 'top', 'bottom', or 'none')
Graph & scenepic::Graph::name_align | ( | const std::string & | name_align | ) |
How to align the sparkline label (one of 'left', 'right', 'top', 'bottom', or 'none')
float scenepic::Graph::name_size | ( | ) | const |
The size of the graph labels in pixels.
Graph & scenepic::Graph::name_size | ( | float | name_size | ) |
Set the size of the graph labels in pixels.
JsonValue scenepic::Graph::to_json | ( | ) | const |
Convert this object into ScenePic json.
std::string scenepic::Graph::to_string | ( | ) | const |
Return a JSON string representing the object.
const std::string & scenepic::Graph::value_align | ( | ) | const |
How to align the sparkline value (one of 'left', 'right', 'top', 'bottom', or 'none')
Graph & scenepic::Graph::value_align | ( | const std::string & | value_align | ) |
How to align the sparkline value (one of 'left', 'right', 'top', 'bottom', or 'none')
float scenepic::Graph::value_size | ( | ) | const |
The size of the graph labels in pixels.
Graph & scenepic::Graph::value_size | ( | float | value_size | ) |
Set the size of the graph labels in pixels.
|
friend |