MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Portal::Forma::Plot::Series Class Reference

Convenience constructor for GeometryFn<shared_ptr<PlotContainer>>. More...

#include <SeriesBuilder.hpp>

+ Collaboration diagram for MayaFlux::Portal::Forma::Plot::Series:

Classes

struct  AxisMapping
 One or more roles mapped to a shared AxisRange and optional palette. More...
 
struct  TickRequest
 Tick request collected fluently and resolved into TickLabelsSpec by the terminal builder once axis mappings are known. More...
 

Public Types

using Role = Kakshya::DataDimension::Role
 
enum class  TickAxis : uint8_t { X , Y , Explicit }
 

Public Member Functions

BarsBuilder as_bars () const
 
FilledWaveformBuilder as_filled_waveform () const
 
ScatterBuilder as_scatter () const
 
WaveformBuilder as_waveform () const
 
Seriesbackground (Kinesis::AABB2D bounds, glm::vec3 color=glm::vec3(0.08F))
 Set a solid-color background quad for this plot area.
 
Kinesis::AABB2D background_bounds () const
 
glm::vec3 background_color () const
 
Seriesbounds (Kinesis::AABB2D bounds)
 Set the logical plot/data bounds used by labels, tick labels, legends, and future plot adornments.
 
Seriescolor (glm::vec3 c)
 
Seriescolor (std::initializer_list< glm::vec3 > colors)
 Append colors to the global palette.
 
bool has_background () const
 
Serieslabel (LabelSpec spec)
 Add an already-built label spec.
 
Serieslabel (std::string text, Kinesis::AABB2D bounds, glm::vec4 color={ 0.85F, 0.85F, 0.85F, 1.F }, std::string name={})
 Add a construction-free text label to this plot.
 
const std::vector< LabelSpec > & labels () const
 
Serieslegend (glm::vec2 origin)
 Request an automatic legend.
 
Serieslegend (glm::vec2 origin, std::initializer_list< LegendEntry > entries)
 Set a manual legend.
 
Serieslegend (LegendSpec spec)
 Set a manual legend from a pre-built spec.
 
const std::optional< LegendSpec > & legend_spec () const
 
const std::vector< glm::vec3 > & palette () const
 
const std::optional< Kinesis::AABB2D > & plot_bounds () const
 
std::vector< TickLabelsSpecresolved_tick_labels () const
 Resolve pending fluent tick requests into concrete tick label specs.
 
Seriesticks (TickEdge edge, AxisRange range, uint32_t count, uint8_t decimal_places=2, glm::vec4 color={ 0.65F, 0.65F, 0.65F, 1.F })
 Request tick labels on an arbitrary edge with an explicit range.
 
Seriesx (Role role, AxisRange range, std::initializer_list< glm::vec3 > palette)
 Map a single role to the X axis with per-mapping colors.
 
Seriesx (Role role, AxisRange range={})
 Map a single role to the X axis.
 
Seriesx (std::vector< Role > roles, AxisRange range, std::initializer_list< glm::vec3 > palette)
 Map multiple roles to the X axis with a shared range and per-mapping colors.
 
Seriesx (std::vector< Role > roles, AxisRange range={})
 Map multiple roles to the X axis with a shared range.
 
const std::vector< AxisMapping > & x_mappings () const
 
Seriesx_ticks (AxisRange range, uint32_t count, TickEdge edge=TickEdge::Bottom, uint8_t decimal_places=2, glm::vec4 color={ 0.65F, 0.65F, 0.65F, 1.F })
 Request X-axis tick labels with an explicit display range.
 
Seriesx_ticks (uint32_t count, TickEdge edge=TickEdge::Bottom, uint8_t decimal_places=2, glm::vec4 color={ 0.65F, 0.65F, 0.65F, 1.F })
 Request X-axis tick labels.
 
Seriesy (Role role, AxisRange range, std::initializer_list< glm::vec3 > palette)
 Map a single role to the Y axis with per-mapping colors.
 
Seriesy (Role role, AxisRange range={})
 Map a single role to the Y axis.
 
Seriesy (std::vector< Role > roles, AxisRange range, std::initializer_list< glm::vec3 > palette)
 Map multiple roles to the Y axis with a shared range and per-mapping colors.
 
Seriesy (std::vector< Role > roles, AxisRange range={})
 Map multiple roles to the Y axis with a shared range.
 
const std::vector< AxisMapping > & y_mappings () const
 
Seriesy_ticks (AxisRange range, uint32_t count, TickEdge edge=TickEdge::Left, uint8_t decimal_places=2, glm::vec4 color={ 0.65F, 0.65F, 0.65F, 1.F })
 Request Y-axis tick labels with an explicit display range.
 
Seriesy_ticks (uint32_t count, TickEdge edge=TickEdge::Left, uint8_t decimal_places=2, glm::vec4 color={ 0.65F, 0.65F, 0.65F, 1.F })
 Request Y-axis tick labels.
 
Seriesz (Role role, AxisRange range, std::initializer_list< glm::vec3 > palette)
 Map a single role to the Z axis with per-mapping colors.
 
Seriesz (Role role, AxisRange range={})
 Map a single role to the Z axis.
 
Seriesz (std::vector< Role > roles, AxisRange range, std::initializer_list< glm::vec3 > palette)
 Map multiple roles to the Z axis with a shared range and per-mapping colors.
 
Seriesz (std::vector< Role > roles, AxisRange range={})
 Map multiple roles to the Z axis with a shared range.
 
const std::vector< AxisMapping > & z_mappings () const
 

Private Attributes

Kinesis::AABB2D m_background_bounds {}
 
glm::vec3 m_background_color {}
 
bool m_has_background {}
 
std::vector< LabelSpecm_labels
 
std::optional< LegendSpecm_legend
 
std::vector< glm::vec3 > m_palette
 
std::optional< Kinesis::AABB2Dm_plot_bounds
 
std::vector< TickRequestm_ticks
 
std::vector< AxisMappingm_x
 
std::vector< AxisMappingm_y
 
std::vector< AxisMappingm_z
 

Detailed Description

Convenience constructor for GeometryFn<shared_ptr<PlotContainer>>.

Accumulates axis role mappings and palette, then produces a geometry function via an encoding terminal (.as_waveform(), .as_scatter(), .as_bars()).

This is an illustrative convenience surface over the GeometryFn contract, not the primary or idiomatic path. The raw lambda is always preferred when the builder cannot express what you need:

// raw — full power, always valid
[](auto c, auto& out, auto& el) { ... };
// builder — convenience for common cases
auto geom = Plot::series()
.y(Role::SPATIAL_Y, AxisRange{}.auto_scale(), { 0.2F, 0.8F, 1.0F })
.color({ 0.8F, 0.4F, 0.1F }) // fallback for unmapped series
.done();
Series & y(Role role, AxisRange range={})
Map a single role to the Y axis.
Series & color(std::initializer_list< glm::vec3 > colors)
Append colors to the global palette.
Series series()
Begin a Series chain.
Definition Plot.hpp:109
std::function< void(T value, std::vector< uint8_t > &out_bytes, Element &element)> GeometryFn
Geometry function signature.
Definition Mapped.hpp:64
AxisRange & auto_scale(bool enabled=true)
Enable or disable auto-scaling.
Definition AxisRange.hpp:52
Scalar domain extent for one plot axis.
Definition AxisRange.hpp:22

Multiple .x(), .y(), .z() calls accumulate independently. Each call appends a role-to-axis mapping with its own optional palette. The full PlotContainer is always passed to the generated function — no data is filtered or intercepted.

Color resolution order at geometry time:

  1. Per-mapping palette (cycled across series within that mapping).
  2. Global palette set via .color() (cycled across all series).
  3. White.

When the builder cannot express what you need, write the raw lambda. It receives the same PlotContainer.

Definition at line 92 of file SeriesBuilder.hpp.


The documentation for this class was generated from the following files: