TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_plot_types.h File Reference
#include <gui_controls/gui_curve_types.h>
#include <gui_core/input/gui_gesture.h>
#include <gui_core/gui_base_types.h>
#include <gui_controls/gui_view_ref.h>
#include <functional>
#include <span>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  tachyon::PlotSeries
 One set of values, such as a histogram's red channel. More...
struct  tachyon::PlotHandle
 A marker dragged along the x axis under the plot. More...
struct  tachyon::PlotEdit
 A change to the handles: where each was and is. More...
struct  tachyon::PlotData
 A plot: what it shows and how. More...
struct  tachyon::PlotViewState
 How one Plot shows a PlotData: the series picked, the part in view, and what the user is doing in it. More...
struct  tachyon::PlotView
 A plot shown in one place: what it shows and the one view of it together. More...
struct  tachyon::PlotRange
 A span of one axis. More...

Namespaces

namespace  tachyon

Typedefs

using tachyon::PlotViewRef = BasicViewRef<PlotData, PlotViewState>
 A plot and one view of it, as Plot and the helpers take them.
using tachyon::ConstPlotViewRef = BasicViewRef<const PlotData, const PlotViewState>

Enumerations

enum class  tachyon::PlotSeriesKind : uint8_t { tachyon::PlotSeriesKind::Line , tachyon::PlotSeriesKind::Bars , tachyon::PlotSeriesKind::Area }
 How a series is drawn. More...
enum class  tachyon::PlotScale : uint8_t { tachyon::PlotScale::Linear , tachyon::PlotScale::Log }
 How the y axis maps values. More...

Functions

std::vector< float > tachyon::HistogramBins (std::span< const float > samples, int bins, float min=0.0f, float max=1.0f)
 samples counted into bins equal bins over [min, max]; a sample at max goes in the last one, and those outside or not finite in none.
void tachyon::ApplyPlotEdit (PlotData &data, const PlotEdit &edit, bool undo=false)
 Does (or with undo, undoes) edit on the handles.
PlotEdit tachyon::MovePlotHandleEdit (const PlotData &data, int handle, float x)
 Moves handle handle to x, kept between its neighbours and inside the x range; the edit, or an empty one when it doesn't move.
void tachyon::CommitPlotEdit (PlotViewRef view, const PlotEdit &edit)
 Applies edit and hands it to view.data.onEdit; does nothing for an empty one.
PlotRange tachyon::PlotShownX (ConstPlotViewRef view)
 The part of the x range in view: all of it until the plot is zoomed, then the part zoomed to, kept inside [xMin, xMax].
PlotRange tachyon::PlotShownY (ConstPlotViewRef view)
 The y range drawn: yMax from the values in view with fitY, then mapped by yScale.
float tachyon::PlotScaleY (const PlotData &data, float value)
 value along the drawn y axis, by the view's scale.