4#ifndef _SCENEPIC_GRAPH_H_
5#define _SCENEPIC_GRAPH_H_
101 const std::string& name,
102 const std::vector<float>& values,
104 float line_width = 1.0f,
105 const std::vector<VerticalRule>& vertical_rules = {});
179 const std::string& name,
180 const ValueBuffer& values,
183 const std::vector<VerticalRule>& vertical_rules);
190 ValueBuffer m_values;
193 std::vector<VerticalRule> m_vertical_rules;
203 std::string m_canvas_id;
204 std::string m_media_id;
205 std::vector<Sparkline> m_sparklines;
206 Color m_background_color;
208 std::string m_font_family;
209 std::string m_name_align;
210 std::string m_value_align;
Class for representing color values.
Definition: color.h:19
A 2D viewport that animates one or more sparklines.
Definition: graph.h:19
const std::string & value_align() const
How to align the sparkline value (one of 'left', 'right', 'top', 'bottom', or 'none')
std::string to_string() const
Return a JSON string representing the object.
const std::string & font_family() const
The font family used for the graph labels.
float value_size() const
The size of the graph labels in pixels.
const std::string & media_id() const
The unique ID of the media file associated with this canvas.
Graph & name_align(const std::string &name_align)
How to align the sparkline label (one of 'left', 'right', 'top', 'bottom', or 'none')
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.
Graph & background_color(const Color &color)
Set the background color of the frame.
const Color & background_color() const
The background color of the frame.
const std::string & name_align() const
How to align the sparkline label (one of 'left', 'right', 'top', 'bottom', or 'none')
float name_size() const
The size of the graph labels in pixels.
Graph & name_size(float name_size)
Set the size of the graph labels in pixels.
const std::string & canvas_id() const
A unique identifier for the canvas.
Graph & media_id(const std::string &media_id)
The unique ID of the media file associated with this canvas.
Graph & value_size(float value_size)
Set the size of the graph labels in pixels.
const Margin & margin() const
The outside margin of the graph.
Graph & value_align(const std::string &value_align)
How to align the sparkline value (one of 'left', 'right', 'top', 'bottom', or 'none')
Graph & font_family(const std::string &font_family)
Set the font family used for the graph labels.
Graph & margin(const Margin &margin)
Set the outside margin of the graph.
JsonValue to_json() const
Convert this object into ScenePic json.
Representation of a JSON value according to the specification at https://www.json....
Definition: json_value.h:30
Top level container representing an entire ScenePic.
Definition: scene.h:58
const Color Black
Definition: color.h:95
Definition: audio_track.h:14
Represents the margin along the edges of a graph.
Definition: graph.h:23
std::string to_string() const
Returns a string representation of the margin.
double right
The right margin in pixels.
Definition: graph.h:52
double top
The top margin in pixels.
Definition: graph.h:49
Margin(double size)
Constructor.
JsonValue to_json() const
Convert this object into ScenePic json.
Margin(double top, double right, double bottom, double left)
Constructor.
double left
The left margin in pixels.
Definition: graph.h:58
double bottom
The bottom margin in pixels.
Definition: graph.h:55
Margin()
Default constructor.
Represents a vertical line in a sparkline graph.
Definition: graph.h:63
Color color
The color of the line.
Definition: graph.h:85
std::string to_string() const
Returns a string representation of the margin.
JsonValue to_json() const
Convert this object into ScenePic json.
float line_width
The width of the line in pixels.
Definition: graph.h:87
VerticalRule(std::int64_t frame, const Color &color=scenepic::Colors::Black, float line_width=1.0f)
Constructor.
std::int64_t frame
The frame at which to add the line.
Definition: graph.h:83