HeatmapState
HeatmapState
State class for HeatmapWidget. More…
#include <HeatmapState.hpp>
Inherits from EditorState, QObject
Public Signals
| Name | |
|---|---|
| void | alignmentEventKeyChanged(QString const & key) |
| void | intervalAlignmentTypeChanged(IntervalAlignmentType type) |
| void | offsetChanged(double offset) |
| void | windowSizeChanged(double window_size) |
| void | viewStateChanged() |
| void | backgroundColorChanged(QString const & hex_color) |
| void | unitsChanged() Emitted when the unit list changes (add/remove). |
| void | scalingChanged() Emitted when scaling mode changes. |
| void | colorRangeChanged() Emitted when color range config changes. |
| void | colormapChanged() Emitted when colormap preset changes. |
| void | estimationParamsChanged() Emitted when estimation params (bin_size) change. |
| void | sortChanged() Emitted when sort mode or direction changes. |
Public Functions
| Name | |
|---|---|
| HeatmapState(QObject * parent =[nullptr]) | |
| ~HeatmapState() override =default | |
| virtual QString | getTypeName() const override Get unique type name for this editor state. |
| virtual QString | getDisplayName() const override Get display name for UI. |
| virtual void | setDisplayName(QString const & name) override Set display name. |
| QString | getAlignmentEventKey() const |
| void | setAlignmentEventKey(QString const & key) |
| IntervalAlignmentType | getIntervalAlignmentType() const |
| void | setIntervalAlignmentType(IntervalAlignmentType type) |
| double | getOffset() const |
| void | setOffset(double offset) |
| double | getWindowSize() const |
| void | setWindowSize(double window_size) |
| PlotAlignmentState * | alignmentState() |
| RelativeTimeAxisState * | relativeTimeAxisState() |
| VerticalAxisState * | verticalAxisState() |
| CorePlotting::ViewStateData const & | viewState() const Get the current view state. |
| void | setXZoom(double zoom) |
| void | setYZoom(double zoom) |
| void | setPan(double x_pan, double y_pan) |
| void | setXBounds(double x_min, double x_max) Set X data bounds. Emits viewStateChanged() AND stateChanged(). |
| void | setYBounds(double y_min, double y_max) Set Y data bounds. Emits viewStateChanged() AND stateChanged(). |
| std::vector< std::string > const & | unitKeys() const Get the list of selected DigitalEventSeries keys. |
| void | addUnit(std::string const & key) Add a DigitalEventSeries key to the unit list. |
| void | removeUnit(std::string const & key) Remove a DigitalEventSeries key from the unit list. |
| void | addUnits(std::vector< std::string > const & keys) Add multiple DigitalEventSeries keys at once. |
| void | removeUnits(std::vector< std::string > const & keys) Remove multiple DigitalEventSeries keys at once. |
| bool | hasUnit(std::string const & key) const Check if a unit key is currently selected. |
| size_t | unitCount() const Get the number of selected units. |
| Neuralyzer::Plots::ScalingMode | scaling() const Get the current scaling mode. |
| void | setScaling(Neuralyzer::Plots::ScalingMode scaling) Set the scaling mode. Emits scalingChanged() and stateChanged(). |
| Neuralyzer::Plots::EstimationParams const & | estimationParams() const Get the current estimation parameters. |
| void | setEstimationParams(Neuralyzer::Plots::EstimationParams const & params) Set the estimation parameters. Emits estimationParamsChanged() and stateChanged(). |
| HeatmapSortMode | sortMode() const Get the current sort mode. |
| void | setSortMode(HeatmapSortMode mode) Set the sort mode. Emits sortChanged() and stateChanged(). |
| bool | sortAscending() const Get the current sort direction. |
| void | setSortAscending(bool ascending) Set the sort direction. Emits sortChanged() and stateChanged(). |
| HeatmapColorRangeConfig const & | colorRange() const Get the current color range configuration. |
| void | setColorRangeMode(HeatmapColorRangeConfig::Mode mode) Set the color range mode. Emits colorRangeChanged() and stateChanged(). |
| void | setColorRangeBounds(double vmin, double vmax) Set the manual color range bounds. Emits colorRangeChanged() and stateChanged(). |
| void | setColorRange(HeatmapColorRangeConfig const & config) Set the full color range config. Emits colorRangeChanged() and stateChanged(). |
| CorePlotting::Colormaps::ColormapPreset | colormapPreset() const Get the current colormap preset. |
| void | setColormapPreset(CorePlotting::Colormaps::ColormapPreset preset) Set the colormap preset. Emits colormapChanged() and stateChanged(). |
| QString | getBackgroundColor() const |
| void | setBackgroundColor(QString const & hex_color) |
| HeatmapStateData const & | data() const |
| virtual std::string | toJson() const override Serialize state to JSON string. |
| virtual bool | fromJson(std::string const & json) override Restore state from JSON string. |
Additional inherited members
Public Signals inherited from EditorState
| Name | |
|---|---|
| void | stateChanged() Emitted when any state property changes. |
| void | displayNameChanged(QString const & newName) Emitted when display name changes. |
| void | dirtyChanged(bool isDirty) Emitted when dirty state changes. |
Public Functions inherited from EditorState
| Name | |
|---|---|
| EditorState(QObject * parent =[nullptr]) Construct a new EditorState. |
|
| ~EditorState() override =default Virtual destructor. |
|
| QString | getInstanceId() const Get unique instance ID. |
| bool | isDirty() const Check if state has unsaved changes. |
| void | markClean() Mark state as clean (after save). |
Protected Functions inherited from EditorState
| Name | |
|---|---|
| void | markDirty() Mark state as modified. |
| void | setInstanceId(QString const & id) Set instance ID (for deserialization). |
| QString | generateInstanceId() Generate a new unique instance ID. |
Detailed Description
class HeatmapState;State class for HeatmapWidget.
View state is the single source of truth for zoom/pan. RelativeTimeAxisState and VerticalAxisState are kept in sync with the view state.
Public Signals Documentation
signal alignmentEventKeyChanged
void alignmentEventKeyChanged(
QString const & key
)signal intervalAlignmentTypeChanged
void intervalAlignmentTypeChanged(
IntervalAlignmentType type
)signal offsetChanged
void offsetChanged(
double offset
)signal windowSizeChanged
void windowSizeChanged(
double window_size
)signal viewStateChanged
void viewStateChanged()signal backgroundColorChanged
void backgroundColorChanged(
QString const & hex_color
)signal unitsChanged
void unitsChanged()Emitted when the unit list changes (add/remove).
signal scalingChanged
void scalingChanged()Emitted when scaling mode changes.
signal colorRangeChanged
void colorRangeChanged()Emitted when color range config changes.
signal colormapChanged
void colormapChanged()Emitted when colormap preset changes.
signal estimationParamsChanged
void estimationParamsChanged()Emitted when estimation params (bin_size) change.
signal sortChanged
void sortChanged()Emitted when sort mode or direction changes.
Public Functions Documentation
function HeatmapState
explicit HeatmapState(
QObject * parent =nullptr
)function ~HeatmapState
~HeatmapState() override =defaultfunction getTypeName
inline virtual QString getTypeName() const overrideGet unique type name for this editor state.
Return: Type name, e.g., “MediaWidget”, “DataViewerWidget”
Reimplements: EditorState::getTypeName
This is used for:
- Factory registration
- Serialization type field
- Properties panel routing
function getDisplayName
virtual QString getDisplayName() const overrideGet display name for UI.
Return: Display name, e.g., “Media Viewer 1”
Reimplements: EditorState::getDisplayName
This is the user-visible name shown in tabs, window titles, etc. It may be customized by the user.
function setDisplayName
virtual void setDisplayName(
QString const & name
) overrideSet display name.
Parameters:
- name New display name
Reimplements: EditorState::setDisplayName
function getAlignmentEventKey
QString getAlignmentEventKey() constfunction setAlignmentEventKey
void setAlignmentEventKey(
QString const & key
)function getIntervalAlignmentType
IntervalAlignmentType getIntervalAlignmentType() constfunction setIntervalAlignmentType
void setIntervalAlignmentType(
IntervalAlignmentType type
)function getOffset
double getOffset() constfunction setOffset
void setOffset(
double offset
)function getWindowSize
double getWindowSize() constfunction setWindowSize
void setWindowSize(
double window_size
)function alignmentState
inline PlotAlignmentState * alignmentState()function relativeTimeAxisState
inline RelativeTimeAxisState * relativeTimeAxisState()function verticalAxisState
inline VerticalAxisState * verticalAxisState()function viewState
inline CorePlotting::ViewStateData const & viewState() constGet the current view state.
function setXZoom
void setXZoom(
double zoom
)function setYZoom
void setYZoom(
double zoom
)function setPan
void setPan(
double x_pan,
double y_pan
)function setXBounds
void setXBounds(
double x_min,
double x_max
)Set X data bounds. Emits viewStateChanged() AND stateChanged().
function setYBounds
void setYBounds(
double y_min,
double y_max
)Set Y data bounds. Emits viewStateChanged() AND stateChanged().
function unitKeys
inline std::vector< std::string > const & unitKeys() constGet the list of selected DigitalEventSeries keys.
function addUnit
void addUnit(
std::string const & key
)Add a DigitalEventSeries key to the unit list.
function removeUnit
void removeUnit(
std::string const & key
)Remove a DigitalEventSeries key from the unit list.
function addUnits
void addUnits(
std::vector< std::string > const & keys
)Add multiple DigitalEventSeries keys at once.
function removeUnits
void removeUnits(
std::vector< std::string > const & keys
)Remove multiple DigitalEventSeries keys at once.
function hasUnit
bool hasUnit(
std::string const & key
) constCheck if a unit key is currently selected.
function unitCount
inline size_t unitCount() constGet the number of selected units.
function scaling
inline Neuralyzer::Plots::ScalingMode scaling() constGet the current scaling mode.
function setScaling
void setScaling(
Neuralyzer::Plots::ScalingMode scaling
)Set the scaling mode. Emits scalingChanged() and stateChanged().
function estimationParams
inline Neuralyzer::Plots::EstimationParams const & estimationParams() constGet the current estimation parameters.
function setEstimationParams
void setEstimationParams(
Neuralyzer::Plots::EstimationParams const & params
)Set the estimation parameters. Emits estimationParamsChanged() and stateChanged().
function sortMode
inline HeatmapSortMode sortMode() constGet the current sort mode.
function setSortMode
void setSortMode(
HeatmapSortMode mode
)Set the sort mode. Emits sortChanged() and stateChanged().
function sortAscending
inline bool sortAscending() constGet the current sort direction.
function setSortAscending
void setSortAscending(
bool ascending
)Set the sort direction. Emits sortChanged() and stateChanged().
function colorRange
inline HeatmapColorRangeConfig const & colorRange() constGet the current color range configuration.
function setColorRangeMode
void setColorRangeMode(
HeatmapColorRangeConfig::Mode mode
)Set the color range mode. Emits colorRangeChanged() and stateChanged().
function setColorRangeBounds
void setColorRangeBounds(
double vmin,
double vmax
)Set the manual color range bounds. Emits colorRangeChanged() and stateChanged().
function setColorRange
void setColorRange(
HeatmapColorRangeConfig const & config
)Set the full color range config. Emits colorRangeChanged() and stateChanged().
function colormapPreset
inline CorePlotting::Colormaps::ColormapPreset colormapPreset() constGet the current colormap preset.
function setColormapPreset
void setColormapPreset(
CorePlotting::Colormaps::ColormapPreset preset
)Set the colormap preset. Emits colormapChanged() and stateChanged().
function getBackgroundColor
QString getBackgroundColor() constfunction setBackgroundColor
void setBackgroundColor(
QString const & hex_color
)function data
inline HeatmapStateData const & data() constfunction toJson
virtual std::string toJson() const overrideSerialize state to JSON string.
Return: JSON string representation of state
Reimplements: EditorState::toJson
Subclasses should use reflect-cpp for serialization: ```cpp
std::string toJson() const override { return rfl::json::write(_data); }
### function fromJson
```cpp
virtual bool fromJson(
std::string const & json
) override
Restore state from JSON string.
Parameters:
- json JSON string to parse
Return: true if parsing succeeded, false on error
Reimplements: EditorState::fromJson
Subclasses should use reflect-cpp for deserialization: ```cpp
bool fromJson(std::string const& json) override { auto result = rfl::json::read
Updated on 2026-11-13 at 20:25:40 +0000