Visualize simulated BWE as a piecewise constant function.
To facilitate this change, I replaced the graph style with one style
config for lines/interpolation and one style config for points.
The output functions were updated to make use of the new styles.
Bug: None
Change-Id: I42404a8ce274d6e433bcdd6aee4b15b640e78b40
Reviewed-on: https://webrtc-review.googlesource.com/22000
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20645}
diff --git a/rtc_tools/event_log_visualizer/plot_base.h b/rtc_tools/event_log_visualizer/plot_base.h
index 318d425..700ffbf 100644
--- a/rtc_tools/event_log_visualizer/plot_base.h
+++ b/rtc_tools/event_log_visualizer/plot_base.h
@@ -18,12 +18,16 @@
namespace webrtc {
namespace plotting {
-enum PlotStyle {
- LINE_GRAPH,
- LINE_DOT_GRAPH,
- BAR_GRAPH,
- LINE_STEP_GRAPH,
- DOT_GRAPH
+enum class LineStyle {
+ kNone, // No line connecting the points. Used to create scatter plots.
+ kLine, // Straight line between consecutive points.
+ kStep, // Horizontal line until the next value. Used for state changes.
+ kBar // Vertical bars from the x-axis to the point.
+};
+
+enum class PointStyle {
+ kNone, // Don't draw the points.
+ kHighlight // Draw circles or dots to highlight the points.
};
struct TimeSeriesPoint {
@@ -33,23 +37,31 @@
};
struct TimeSeries {
- TimeSeries() = default;
- TimeSeries(const char* label, PlotStyle style) : label(label), style(style) {}
- TimeSeries(const std::string& label, PlotStyle style)
- : label(label), style(style) {}
+ TimeSeries() = default; // TODO(terelius): Remove the default constructor.
+ TimeSeries(const char* label,
+ LineStyle line_style,
+ PointStyle point_style = PointStyle::kNone)
+ : label(label), line_style(line_style), point_style(point_style) {}
+ TimeSeries(const std::string& label,
+ LineStyle line_style,
+ PointStyle point_style = PointStyle::kNone)
+ : label(label), line_style(line_style), point_style(point_style) {}
TimeSeries(TimeSeries&& other)
: label(std::move(other.label)),
- style(other.style),
+ line_style(other.line_style),
+ point_style(other.point_style),
points(std::move(other.points)) {}
TimeSeries& operator=(TimeSeries&& other) {
label = std::move(other.label);
- style = other.style;
+ line_style = other.line_style;
+ point_style = other.point_style;
points = std::move(other.points);
return *this;
}
std::string label;
- PlotStyle style;
+ LineStyle line_style = LineStyle::kLine;
+ PointStyle point_style = PointStyle::kNone;
std::vector<TimeSeriesPoint> points;
};