CPlot
Builds a plot specification from the supplied configuration value. Add or replace named data columns with setData() and call plot() to produce the bitmap; construction alone does not render it.
Graphics & compute
Build a plot from a declarative value configuration and named numeric data.
#include <mc/CPlot.h>Link Catalyst::MacShared or Catalyst::MacStatic. Configure pixel width and height, a data map of numeric columns, and a layers vector.
Each layer selects a geom such as "line". Its aes map uses symbols, for example csym("x"), to refer to columns. Literal strings remain literal settings.
class CPlotusing Float = double;
using Floats = CVector<Float>;
Builds a plot specification from the supplied configuration value. Add or replace named data columns with setData() and call plot() to produce the bitmap; construction alone does not render it.
~CPlot();
void plot();
Lays out the configured plot and renders its bitmap. Call again after changing data; use buffer() to access the resulting pixels.
unsigned char* buffer();
Returns borrowed RGBA pixels, or nullptr before rendering or after invalidation.
void setData(const cstr& name, const Floats& data);
Replaces a named numeric column and invalidates the previous bitmap. Call plot() again before reading pixels.