Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
PlotTypes.hpp File Reference

Common types, configuration structures, and palette/formatting utilities for SVG plotting. More...

#include "analysis/DistributionFunctions.hpp"
#include "math/Precision.hpp"
#include "plotters/PathFont.hpp"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <format>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for PlotTypes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  correlation::plotters::ReferenceLine
 User-defined reference marker line (constant X or constant Y). More...
struct  correlation::plotters::PlotConfig
 Theme and layout configuration for the plot. More...
struct  correlation::plotters::MetricPlotSettings
 User-configured axis limits, ticks, and scaling for a specific plot metric. More...
struct  correlation::plotters::HoverInfo
 Information about the mouse hover position. More...
struct  correlation::plotters::CurveStyle
 Custom rendering style for individual comparison curves. More...
struct  correlation::plotters::LabeledHistogram
 A labeled histogram for comparison rendering. More...
struct  correlation::plotters::detail::ColorStop
struct  correlation::plotters::detail::DataRange
struct  correlation::plotters::detail::NiceScale
struct  correlation::plotters::detail::PlotViewportGeometry

Namespaces

namespace  correlation
namespace  correlation::plotters
namespace  correlation::plotters::detail

Enumerations

enum class  correlation::plotters::TextAnchor : std::uint8_t { correlation::plotters::Start , correlation::plotters::Middle , correlation::plotters::End }
 Horizontal alignment / anchor options for SVG text rendering. More...

Functions

real_t correlation::plotters::sampleHistogramClamped (const std::vector< real_t > &x_bins, const std::vector< real_t > &y_vals, real_t x_val)
 Samples a 1D dataset y(x) at point x using linear interpolation with boundary clamping to [x_min, x_max].
std::string correlation::plotters::renderTextAsPath (const std::string &text, real_t x_pos, real_t y_pos, real_t size, TextAnchor anchor, std::string_view color, bool use_native_text=false)
 Renders text as a filled SVG path using the Roboto outline font. Uses evenodd fill-rule to render the font's inner holes properly.
std::string correlation::plotters::detail::interpolateColorStops (float position, std::span< const ColorStop > stops)
std::string correlation::plotters::detail::sampleContinuousColormap (float position, PlotConfig::Palette pal)
std::string correlation::plotters::detail::color (std::size_t index, std::size_t total_count, PlotConfig::Palette pal)
std::string correlation::plotters::detail::color (std::size_t index, PlotConfig::Palette pal)
real_t correlation::plotters::detail::mapValue (real_t value, real_t data_min, real_t data_max, real_t svg_min, real_t svg_max)
std::string correlation::plotters::detail::fmtScientific (real_t value)
 Formats a number for SVG display, using scientific notation if needed.
PlotViewportGeometry correlation::plotters::detail::getViewportGeometry (const PlotConfig &config)
std::pair< real_t, real_t > correlation::plotters::detail::screenToSvg (real_t screen_x, real_t screen_y, real_t widget_w, real_t widget_h, const PlotConfig &config)
std::pair< real_t, real_t > correlation::plotters::detail::screenToData (real_t screen_x, real_t screen_y, real_t widget_w, real_t widget_h, const PlotConfig &config, const NiceScale &x_scale, const NiceScale &y_scale)
std::pair< real_t, real_t > correlation::plotters::detail::svgToScreen (real_t svg_x, real_t svg_y, real_t widget_w, real_t widget_h, const PlotConfig &config)
std::pair< real_t, real_t > correlation::plotters::detail::dataToScreen (real_t data_x, real_t data_y, real_t widget_w, real_t widget_h, const PlotConfig &config, const NiceScale &x_scale, const NiceScale &y_scale)

Variables

constexpr std::array< std::string_view, 8 > correlation::plotters::detail::K_COLORS
 Okabe-Ito colorblind-safe palette (calibrated for high contrast on dark and light).
constexpr std::array< std::string_view, 5 > correlation::plotters::detail::K_GRAYSCALE
 Grayscale palette for B&W printing.
constexpr std::array< std::string_view, 5 > correlation::plotters::detail::K_VIRIDIS
 Viridis perceptually uniform palette.

Detailed Description

Common types, configuration structures, and palette/formatting utilities for SVG plotting.

License
SPDX-License-Identifier: AGPL-3.0-only