-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Gradient Button On Colour tab In Plot Options Sub Dialog. #8733
Added Gradient Button On Colour tab In Plot Options Sub Dialog. #8733
Conversation
@lilyclements could you check and approve. You are better at colours than me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MeSophie that's a nice addition and it seems to work too!
a) The sub-dialog has become excessively wide, see above.
b) The range of colours for the gradient is very small. Usually it is linger and with an option to choose one:
c) The setting of discrete at the top right always resets. I made it continuous when it was needed, and it didn't remember. The next time I returned there it has reset to discrete..
Here is a nice looking heatmap, making use of the gradient and going from Yellow to Blue!
@rdstern Could you please test the change? For c) the control always resets the old value because it automatically detects the value of the receiver y. For cases such as histogramm and bar plots, the control value remains discrete because it is the default value and there is no y variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MeSophie the width of the dialog is now resolved.
a) The high
option now has the bigger set of colours. But could you please add the pick colour option too?
b) The low
is still short. Is that intentional? Could that become the same as the High option?
c) In the dialog I changed and used Pastel1 as the palette. If I then change discrete
to continuous
or vice versa, it resets the palette to the default of Accent. And it is reset to the default of Accent, each time I return to the tab. That also happens with other options, e.g. divergent, that use that control.
d) In the heatmap dialog the setting of the colours (discrete or continuous) depends on the fillcontrol in the dialog:
Usually, as here, it is numeric, so continuous. But it can be a factor, in which case discrete is needed. Can this be detected, and become automatic on the colour tab? If it has to be a single setting for the dialog, then usually it will be numeric, and so continuous.
@rdstern I solved part a), b) and c). For part d) I'm still investigating on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MeSophie I'm getting build errors?
@rdstern Could you please check the dialog ? |
@MeSophie this still seems to bed giving you various troubles. I tried with the usual survey, bar chart, village by variety and then your colour an gradient. When I run it gives an error and I can see why. Here is the code generated:
It has ignored all the options in @N-thony there is also a more general oddity, which seems far worse here than before. The first time you click on the Plot Options it takes ages to go into them. In general at least 5 seconds, but perhaps more obviously here, it took over 25 seconds. Could you investigate, either in this pull request, or more generally in a new pull request? Where is it going in the code the first time that takes so long - and also isn't needed after that? |
@rdstern the message error was because I didn't put the appropriate function for discrete scale. I added scale_fill_manual and scale_colour_manual function. Could you please test the dialog again? |
@rdstern by testing the new change in Boxplot dialog with our survey data, As shown in the figure below, detection in the colour tap of our plot options sub dialog executes perfectly as a function of the variable Y. When we click Return and then Ok, we get an error message saying discrete value supplied to continue scale. This is because the fill value is discrete and the scale fill function used is continuous. Would it be a good idea to carry out the detection here according to the fill parameter, as we did in the HeatMap Dialog? |
@rdstern please anything new about this PR? |
@MeSophie yes I have just read your question above again. You are right. In this dialog it is the fill that is being coloured, not the y variable. So it should detect when that is a factor and then use discrete. |
@rdstern Could you please check the new change?
@rdstern Could you please check the new change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instat/dlgBoxPlot.vb
Outdated
@@ -56,6 +56,7 @@ Public Class dlgBoxplot | |||
Private clsXScaleDateFunction As New RFunction | |||
Private clsYScaleDateFunction As New RFunction | |||
Private clsFacetsFunction As New RFunction | |||
Private Fillvariable As Boolean = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you rename this variable for something more descriptive of it purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is solved.
instat/dlgHeatMapPlot.vb
Outdated
@@ -19,6 +19,7 @@ Public Class dlgHeatMapPlot | |||
Private bFirstLoad As Boolean = True | |||
Private bRCodeSet As Boolean = True | |||
Private bReset As Boolean = True | |||
Private Fillvariable As Boolean = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is solved.
instat/dlgHeatMapPlot.vb
Outdated
@@ -554,7 +555,7 @@ Public Class dlgHeatMapPlot | |||
clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, | |||
clsNewFacetFunction:=clsRFacetFunction, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, ucrNewBaseSelector:=ucrHeatMapSelector, clsNewFacetVariablesOperator:=clsFacetVariablesOperator, | |||
strMainDialogGeomParameterNames:=strGeomParameterNames, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, | |||
clsNewAnnotateFunction:=clsAnnotateFunction, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, bReset:=bResetSubdialog) | |||
clsNewAnnotateFunction:=clsAnnotateFunction, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, NewFillvariable:=True, bReset:=bResetSubdialog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with NewFillvariable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is solved.
instat/sdgPlots.vb
Outdated
@@ -108,6 +110,7 @@ Public Class sdgPlots | |||
Private dctDivergingPairsContinuous As New Dictionary(Of String, String) | |||
Private dctQualititivePairsContinuous As New Dictionary(Of String, String) | |||
Public strAxisType As String | |||
Public Fillvariable As Boolean = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@N-thony I thing this question is for Boxplot dialog. If so this is solved.
instat/sdgPlots.vb
Outdated
@@ -108,6 +110,7 @@ Public Class sdgPlots | |||
Private dctDivergingPairsContinuous As New Dictionary(Of String, String) | |||
Private dctQualititivePairsContinuous As New Dictionary(Of String, String) | |||
Public strAxisType As String | |||
Public FillAesdetection As Boolean = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for Boolean type we always name a variable by starting with small b
see line 72.
But my question is to understand if you need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Solve and I added the b on FillAesdetection
and NewFillAesdetection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need line 113
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need line 113
@N-thony I deleted this line
instat/sdgPlots.vb
Outdated
End Sub | ||
|
||
Public Sub SetRCode(clsNewOperator As ROperator, clsNewCoordPolarFunction As RFunction, clsNewCoordPolarStartOperator As ROperator, clsNewYScalecontinuousFunction As RFunction, clsNewXScalecontinuousFunction As RFunction, clsNewLabsFunction As RFunction, | ||
clsNewXLabsTitleFunction As RFunction, clsNewYLabTitleFunction As RFunction, clsNewFacetFunction As RFunction, clsNewThemeFunction As RFunction, dctNewThemeFunctions As Dictionary(Of String, RFunction), ucrNewBaseSelector As ucrSelector, | ||
bReset As Boolean, Optional clsNewGlobalAesFunction As RFunction = Nothing, Optional clsNewXScaleDateFunction As RFunction = Nothing, Optional clsNewYScaleDateFunction As RFunction = Nothing, Optional clsNewFacetVariablesOperator As ROperator = Nothing, | ||
Optional clsNewScaleFillViridisFunction As RFunction = Nothing, Optional clsNewScaleColourViridisFunction As RFunction = Nothing, Optional strMainDialogGeomParameterNames() As String = Nothing, Optional clsNewAnnotateFunction As RFunction = Nothing, | ||
Optional bNewEnableFill As Boolean = True, Optional bNewChangeScales As Boolean = False, Optional bNewEnableColour As Boolean = True, Optional bNewEnableDiscrete As Boolean = True, Optional strNewAxisType As String = "discrete") | ||
Optional bNewEnableFill As Boolean = True, Optional NewFillAesdetection As Boolean = False, Optional bNewChangeScales As Boolean = False, Optional bNewEnableColour As Boolean = True, Optional bNewEnableDiscrete As Boolean = True, Optional strNewAxisType As String = "discrete") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bChangeAesParameter instead of NewFillAesdetection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is solved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #8623.
@rdstern @lilyclements I added the gradient button on color tap. Please have a look.