14524 histogram adjustments - #14526
Conversation
…o text Select logarithmic binning and a logarithmic x-axis automatically when creating a grid statistics histogram plot from a 3D view showing a logarithmic result (RiaResultNames::isLogarithmicResult). Show a plot info label at the top right of the plot canvas describing active data filters: "Filter: Visible cells in 3D view" when a cell filter view is set, and "Filter: User defined x-range [min..max]" when the bin range is user-defined. The label collects unique filter descriptions from the data sources of all visible curves and is removed when no filters are active.
…hmic property Selecting a logarithmic result manually in the grid statistics data source property editor now enables logarithmic binning and a logarithmic x-axis, the same as creating the plot from a 3D view. The previously selected result variable is tracked so that only an actual property change enables logarithmic binning: other property edits leave a user-selected binning mode alone, and binning modes stored in project files are kept as-is on load.
… property Make the property-driven binning mode symmetric: selecting a non-logarithmic result (e.g. FLUXNUM) after a logarithmic one (e.g. PERMX) sets the binning mode and x-axis back to linear. Replace the one-way logarithmicBinningEnabled signal with a binningModeChanged signal carrying the new mode, so the x-axis scale follows the binning mode in both directions, also when the binning mode itself is changed in the UI.
A user-defined bin range is tied to the value range of a specific result: a range set up for FLUXNUM does not apply to PERMX. Reset the bin range mode to Automatic and the min/max cutoffs to their defaults when another property is selected, and reset the stale cutoffs when the user sets the bin range mode back to Automatic.
Initialize the min and max cutoffs to the data range of the selected result when the bin range mode is set to User Defined. The previous fixed default of [0..1] excluded most values for results like PERMX. The data range is computed by the same statistics query as the histogram, respecting the selected time step and an active visible-cells filter, but without custom binning so min and max are the range of the data.
kriben
left a comment
There was a problem hiding this comment.
The result-aware binning and filter annotation are useful improvements, and preserving persisted binning choices is handled carefully. I found two edge cases to address: binning changes currently mutate a shared x-axis based on one curve, and the filter annotation does not account for the collection-level visibility toggle.
This review was prepared by an automated review bot working on behalf of @kriben.
|
|
||
| auto axisProperties = dynamic_cast<RimPlotAxisProperties*>( plot->axisPropertiesForPlotAxis( axisX() ) ); | ||
| if ( axisProperties ) axisProperties->setLogarithmicScaleEnabled( true ); | ||
| if ( axisProperties ) axisProperties->setLogarithmicScaleEnabled( binningMode == RigHistogramCalculator::BinningMode::LOGARITHMIC ); |
There was a problem hiding this comment.
Important: All histogram curves are assigned the default bottom x-axis, so this changes the scale for every curve sharing that axis, not only the curve whose binning changed. In a plot containing both linear and logarithmic data sources, the last edited curve wins; switching to logarithmic can also hide zero or negative values from the linear curves. Please account for all visible curves on this axis before changing its scale, or assign a separate x-axis when the modes differ.
| QStringList descriptions; | ||
| for ( RimHistogramCurve* curve : histogramCurves() ) | ||
| { | ||
| if ( !curve->isChecked() || !curve->dataSource() ) continue; |
There was a problem hiding this comment.
Important: This only checks the curve’s own checkbox, but the collection also has a master isCurvesVisible() toggle. When that collection is hidden, individually checked curves still contribute descriptions, and the collection update path does not refresh this label, so filter text can remain while no histograms are displayed. Please gate this on collection visibility and ensure the label is refreshed when the master toggle changes.
Fixes #14524.