Skip to content

Commit

Permalink
Disable scaling options appropriately wrt selected averaging option
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Oct 13, 2023
1 parent c861757 commit f696b0b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/plugins/correlation/ui/qml/CorrelationPlugin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ PluginContent
{
id: meanCentreScaling
text: qsTr("Mean Centre Scaling")
enabled: !plot.iqrStyle
enabled: plot.complexScalingEnabled
checkable: true
checked: plot.scaleType === PlotScaleType.MeanCentre
onTriggered: { plot.scaleType = PlotScaleType.MeanCentre; }
Expand All @@ -243,7 +243,7 @@ PluginContent
{
id: unitVarianceScaling
text: qsTr("Unit Variance Scaling")
enabled: !plot.iqrStyle
enabled: plot.complexScalingEnabled
checkable: true
checked: plot.scaleType === PlotScaleType.UnitVariance
onTriggered: { plot.scaleType = PlotScaleType.UnitVariance; }
Expand All @@ -253,7 +253,7 @@ PluginContent
{
id: paretoScaling
text: qsTr("Pareto Scaling")
enabled: !plot.iqrStyle
enabled: plot.complexScalingEnabled
checkable: true
checked: plot.scaleType === PlotScaleType.Pareto
onTriggered: { plot.scaleType = PlotScaleType.Pareto; }
Expand Down Expand Up @@ -623,13 +623,11 @@ PluginContent
MenuUtils.addActionTo(scalingMenu, meanCentreScaling);
MenuUtils.addActionTo(scalingMenu, unitVarianceScaling);
MenuUtils.addActionTo(scalingMenu, paretoScaling);
scalingMenu.enabled = Qt.binding(() =>
plot.averagingType === PlotAveragingType.Individual || plot.iqrStyle);

MenuUtils.addSeparatorTo(scalingMenu);

let scaleByAttributeMenu = MenuUtils.addSubMenuTo(scalingMenu, qsTr("By Attribute"));
scaleByAttributeMenu.enabled = Qt.binding(() => !plot.iqrStyle);
scaleByAttributeMenu.enabled = Qt.binding(() => plot.complexScalingEnabled);
plugin.model.numericalAttributeNames.forEach(function(attributeName)
{
let attributeMenuItem = MenuUtils.addItemTo(scaleByAttributeMenu, attributeName);
Expand Down Expand Up @@ -1069,6 +1067,8 @@ PluginContent
property bool iqrStyle: plot.groupByAnnotation || plot.averagingType === PlotAveragingType.IQR
onIqrStyleChanged: { updateMenu(); }

property bool complexScalingEnabled: plot.averagingType === PlotAveragingType.Individual

horizontalScrollPosition: horizontalPlotScrollBar.position / (1.0 - horizontalPlotScrollBar.size)

property var _lastSelectedRowsOfInterest: []
Expand Down

0 comments on commit f696b0b

Please sign in to comment.