|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Manages curve visibility, custom palette colors, pinned comparison runs, and Slint toggle models. More...
#include <PlotSeriesManager.hpp>
Public Member Functions | |
| PlotSeriesManager ()=default | |
| Default constructor. | |
| void | setCurveVisible (int curve_id, bool visible) |
| Toggles the visibility of a curve by its toggle index. | |
| void | setAllCurvesVisible (bool visible, std::string_view filter="") |
| Sets the visibility for all currently tracked toggle curves. If a filter is specified or active, sets visibility only for matching curves. | |
| void | invertCurveVisibility (std::string_view filter="") |
| Inverts the visibility of curves. If a filter is specified or active, inverts only matching curves. | |
| void | setFilterText (std::string_view filter) |
| Sets the active substring search filter for curve toggles. | |
| std::string_view | getFilterText () const noexcept |
| Retrieves the active substring search filter. | |
| bool | isCurveVisible (const std::string &key, bool default_val=true) const |
| Checks if a specific curve key is visible. | |
| const std::map< std::string, bool > & | getCurveVisibilityMap () const noexcept |
| Retrieves the complete curve visibility map. | |
| void | setCustomColor (int curve_id, const std::string &color_hex) |
| Sets a custom hex color for a curve by its toggle index. | |
| const std::map< std::string, std::string > & | getCustomColors () const noexcept |
| Retrieves the map of custom curve colors. | |
| void | pinCurrentRun (const std::map< std::string, correlation::analysis::Histogram > &hists) |
| Pins the provided histogram dataset as a comparison overlay run. | |
| void | clearPinnedRuns () noexcept |
| Clears all pinned comparison runs. | |
| const std::vector< PinnedRun > & | getPinnedRuns () const noexcept |
| Retrieves all pinned comparison runs. | |
| size_t | getPinnedRunsCount () const noexcept |
| Retrieves the count of pinned comparison runs. | |
| void | setShowDifference (bool show) noexcept |
| Sets whether the overlaid difference curve Y_diff is shown. | |
| bool | shouldShowDifference () const noexcept |
| Queries whether the overlaid difference curve is visible. | |
| const std::vector< std::string > & | getCurrentToggleKeys () const noexcept |
| Retrieves the currently ordered list of curve toggle keys. | |
| std::shared_ptr< slint::VectorModel< CurveToggleItem > > | generateToggleItems (const correlation::analysis::Histogram *hist, const correlation::plotters::PlotConfig &config, const std::map< std::string, real_t > &ashcroft_weights={}) |
| Generates the Slint VectorModel of CurveToggleItem for UI presentation. | |
| const std::map< std::string, std::string > & | getAssignedCurveColors () const noexcept |
| Retrieves the active assigned colors for current histogram curves (defaults + custom). | |
| void | reset () noexcept |
| Resets all series state (visibility overrides, custom colors, pinned runs, and flags). | |
Private Attributes | |
| std::map< std::string, bool > | curve_visibility_map_ |
| std::map< std::string, std::string > | custom_curve_colors_ |
| std::map< std::string, std::string > | assigned_curve_colors_ |
| std::vector< std::string > | current_toggle_keys_ |
| std::vector< PinnedRun > | pinned_runs_ |
| std::string | filter_text_ |
| bool | show_difference_curve_ {false} |
Manages curve visibility, custom palette colors, pinned comparison runs, and Slint toggle models.
|
default |
Default constructor.
|
noexcept |
Clears all pinned comparison runs.
|
nodiscard |
Generates the Slint VectorModel of CurveToggleItem for UI presentation.
| [in] | hist | Pointer to the current active analytical histogram. |
| [in] | config | Active plot rendering configuration for default palette colors. |
| [in] | ashcroft_weights | Map of partial labels to their Ashcroft-Langreth weights. |
|
inlinenodiscardnoexcept |
Retrieves the active assigned colors for current histogram curves (defaults + custom).
|
inlinenodiscardnoexcept |
Retrieves the currently ordered list of curve toggle keys.
|
inlinenodiscardnoexcept |
Retrieves the complete curve visibility map.
|
inlinenodiscardnoexcept |
Retrieves the map of custom curve colors.
|
inlinenodiscardnoexcept |
Retrieves the active substring search filter.
|
inlinenodiscardnoexcept |
Retrieves all pinned comparison runs.


|
inlinenodiscardnoexcept |
Retrieves the count of pinned comparison runs.
| void correlation::app::PlotSeriesManager::invertCurveVisibility | ( | std::string_view | filter = "" | ) |
Inverts the visibility of curves. If a filter is specified or active, inverts only matching curves.
| [in] | filter | Optional substring filter to restrict which curves are inverted. |

|
nodiscard |
Checks if a specific curve key is visible.
| [in] | key | Curve key name. |
| [in] | default_val | Default state returned if key is not explicitly registered. |

| void correlation::app::PlotSeriesManager::pinCurrentRun | ( | const std::map< std::string, correlation::analysis::Histogram > & | hists | ) |
Pins the provided histogram dataset as a comparison overlay run.
| [in] | hists | Map of plot names to histograms. |
|
noexcept |
Resets all series state (visibility overrides, custom colors, pinned runs, and flags).
| void correlation::app::PlotSeriesManager::setAllCurvesVisible | ( | bool | visible, |
| std::string_view | filter = "" ) |
Sets the visibility for all currently tracked toggle curves. If a filter is specified or active, sets visibility only for matching curves.
| [in] | visible | Target visibility state for curves. |
| [in] | filter | Optional substring filter to restrict which curves are modified. |
| void correlation::app::PlotSeriesManager::setCurveVisible | ( | int | curve_id, |
| bool | visible ) |
Toggles the visibility of a curve by its toggle index.
| [in] | curve_id | Index corresponding to the current toggle item. |
| [in] | visible | Target visibility state. |
| void correlation::app::PlotSeriesManager::setCustomColor | ( | int | curve_id, |
| const std::string & | color_hex ) |
Sets a custom hex color for a curve by its toggle index.
| [in] | curve_id | Index corresponding to the current toggle item. |
| [in] | color_hex | Hex color string (e.g. "#RRGGBB"). |
| void correlation::app::PlotSeriesManager::setFilterText | ( | std::string_view | filter | ) |
Sets the active substring search filter for curve toggles.
| [in] | filter | Substring filter (e.g. "Fe", "O-H", "Total"). |
|
inlinenoexcept |
Sets whether the overlaid difference curve Y_diff is shown.
| [in] | show | True to show difference curve, false to hide. |
|
inlinenodiscardnoexcept |
Queries whether the overlaid difference curve is visible.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |