mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 07:30:20 -05:00
#14524 Histogram: Start a user-defined bin range at the data range
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.
This commit is contained in:
1 parent
05588f4327
commit
488d631d81
4 files changed
+53
-5
No files matched your search
@@ -109,6 +109,14 @@ void RimHistogramDataSource::resetBinRange()
|
||||
m_binRangeMax = m_binRangeMax.defaultValue();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::optional<std::pair<double, double>> RimHistogramDataSource::dataRange() const
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -142,6 +150,16 @@ void RimHistogramDataSource::fieldChangedByUi( const caf::PdmFieldHandle* change
|
||||
{
|
||||
resetBinRange();
|
||||
}
|
||||
|
||||
// Start a user-defined range at the data range: the default [0..1] could exclude most values
|
||||
if ( changedField == &m_binRangeMode && m_binRangeMode() == BinRangeMode::USER_DEFINED )
|
||||
{
|
||||
if ( auto range = dataRange() )
|
||||
{
|
||||
m_binRangeMin = range->first;
|
||||
m_binRangeMax = range->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user