Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::plotters::detail Namespace Reference

Classes

struct  ColorStop
struct  DataRange
struct  NiceScale
struct  PlotViewportGeometry

Functions

std::string interpolateColorStops (float position, std::span< const ColorStop > stops)
std::string sampleContinuousColormap (float position, PlotConfig::Palette pal)
std::string color (std::size_t index, std::size_t total_count, PlotConfig::Palette pal)
std::string color (std::size_t index, PlotConfig::Palette pal)
real_t mapValue (real_t value, real_t data_min, real_t data_max, real_t svg_min, real_t svg_max)
std::string fmtScientific (real_t value)
 Formats a number for SVG display, using scientific notation if needed.
PlotViewportGeometry getViewportGeometry (const PlotConfig &config)
std::pair< real_t, real_t > 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 > 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 > 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 > 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 > K_COLORS
 Okabe-Ito colorblind-safe palette (calibrated for high contrast on dark and light).
constexpr std::array< std::string_view, 5 > K_GRAYSCALE
 Grayscale palette for B&W printing.
constexpr std::array< std::string_view, 5 > K_VIRIDIS
 Viridis perceptually uniform palette.

Function Documentation

◆ color() [1/2]

std::string correlation::plotters::detail::color ( std::size_t index,
PlotConfig::Palette pal )
inline
Here is the call graph for this function:

◆ color() [2/2]

std::string correlation::plotters::detail::color ( std::size_t index,
std::size_t total_count,
PlotConfig::Palette pal )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dataToScreen()

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 )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fmtScientific()

std::string correlation::plotters::detail::fmtScientific ( real_t value)
inline

Formats a number for SVG display, using scientific notation if needed.

◆ getViewportGeometry()

PlotViewportGeometry correlation::plotters::detail::getViewportGeometry ( const PlotConfig & config)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolateColorStops()

std::string correlation::plotters::detail::interpolateColorStops ( float position,
std::span< const ColorStop > stops )
inline
Here is the caller graph for this function:

◆ mapValue()

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 )
inline

◆ sampleContinuousColormap()

std::string correlation::plotters::detail::sampleContinuousColormap ( float position,
PlotConfig::Palette pal )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screenToData()

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 )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screenToSvg()

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 )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ svgToScreen()

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 )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ K_COLORS

std::array<std::string_view, 8> correlation::plotters::detail::K_COLORS
constexpr
Initial value:
= {
"#E69F00",
"#56B4E9",
"#009E73",
"#F0E442",
"#0072B2",
"#D55E00",
"#CC79A7",
"#00C49F",
}

Okabe-Ito colorblind-safe palette (calibrated for high contrast on dark and light).

◆ K_GRAYSCALE

std::array<std::string_view, 5> correlation::plotters::detail::K_GRAYSCALE
constexpr
Initial value:
= {
"#000000", "#404040", "#808080", "#B0B0B0", "#D0D0D0",
}

Grayscale palette for B&W printing.

◆ K_VIRIDIS

std::array<std::string_view, 5> correlation::plotters::detail::K_VIRIDIS
constexpr
Initial value:
= {
"#440154", "#3B528B", "#21908C", "#5DC863", "#FDE725",
}

Viridis perceptually uniform palette.