Skip to content

14524 histogram adjustments - #14526

Open
kriben wants to merge 5 commits into
devfrom
14524-histogram-adjustments
Open

14524 histogram adjustments#14526
kriben wants to merge 5 commits into
devfrom
14524-histogram-adjustments

Conversation

@kriben

@kriben kriben commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes #14524.

kriben added 5 commits August 14, 2026 10:12
…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
kriben marked this pull request as ready for review August 14, 2026 11:50
@kriben kriben self-assigned this Aug 14, 2026
@kriben
kriben requested a review from magnesj August 14, 2026 11:50

@kriben kriben left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Histogram adjustments

1 participant