Summary Plot: Compute default y-range based on visible plots

Previously, when the stepping dimension was set to 'well' for range aggregation, it was based on all wells. If one of the wells had extreme values and was not visible, it would set the y-range to match the extreme value, making some curves invisible. We have now changed the default setting to use visible subplots to determine the y-range aggregation.
This commit is contained in:
Magne Sjaastad 2023-08-24 10:08:53 +02:00
parent e7c62b1d42
commit 58e35bdbec
2 changed files with 11 additions and 21 deletions

View File

@ -798,22 +798,6 @@ void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
analyzer.appendAddresses( addresses );
}
auto rangeAggregation = AxisRangeAggregation::NONE;
if ( analyzer.quantities().size() == 1 && summaryPlots().size() > 1 )
{
// Many plots, single summary vector
rangeAggregation = AxisRangeAggregation::SUB_PLOTS;
}
if ( !analyzer.wellNames().empty() )
{
rangeAggregation = AxisRangeAggregation::WELLS;
}
else if ( !analyzer.regionNumbers().empty() )
{
rangeAggregation = AxisRangeAggregation::REGIONS;
}
auto stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR;
if ( analyzer.wellNames().size() == 1 )
{
@ -849,9 +833,15 @@ void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK;
}
m_axisRangeAggregation = rangeAggregation;
m_sourceStepping->setStepDimension( stepDimension );
// Previously, when the stepping dimension was set to 'well' for range aggregation, it was based on all wells. If one of the wells had
// extreme values and was not visible, it would set the y-range to match the extreme value, making some curves invisible. We have now
// changed the default setting to use visible subplots to determine the y-range aggregation.
// https://github.com/OPM/ResInsight/issues/10543
m_axisRangeAggregation = AxisRangeAggregation::SUB_PLOTS;
setAutoValueStates();
}

View File

@ -390,10 +390,10 @@ void RimSummaryPlotManager::createNewPlot()
plotBuilder.setAddresses( filteredAddressesFromSource );
plotBuilder.setDataSources( summaryCases, ensembles );
RicSummaryPlotBuilder::RicGraphCurveGrouping groping = RicSummaryPlotBuilder::RicGraphCurveGrouping::NONE;
if ( m_individualPlotPerVector ) groping = RicSummaryPlotBuilder::RicGraphCurveGrouping::SINGLE_CURVES;
if ( m_individualPlotPerObject ) groping = RicSummaryPlotBuilder::RicGraphCurveGrouping::CURVES_FOR_OBJECT;
plotBuilder.setGrouping( groping );
RicSummaryPlotBuilder::RicGraphCurveGrouping grouping = RicSummaryPlotBuilder::RicGraphCurveGrouping::NONE;
if ( m_individualPlotPerVector ) grouping = RicSummaryPlotBuilder::RicGraphCurveGrouping::SINGLE_CURVES;
if ( m_individualPlotPerObject ) grouping = RicSummaryPlotBuilder::RicGraphCurveGrouping::CURVES_FOR_OBJECT;
plotBuilder.setGrouping( grouping );
plotBuilder.setIndividualPlotPerDataSource( m_individualPlotPerDataSource );