Skip to content
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

Ivan Colour Palette Changes #845

Merged
merged 3 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions instat/clsGgplotDefaults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@ Public Class GgplotDefaults
End Get
End Property

Public Shared ReadOnly Property clsScaleColorViridisFunction As RFunction
Get
Dim clsTempFunc As New RFunction

clsTempFunc.SetPackageName("viridis")
clsTempFunc.SetRCommand("scale_colour_viridis")
clsTempFunc.AddParameter("option", Chr(34) & "viridis" & Chr(34), iPosition:=0)
clsTempFunc.AddParameter("alpha", "1", iPosition:=1)
clsTempFunc.AddParameter("begin", "0", iPosition:=2)
clsTempFunc.AddParameter("end", "1", iPosition:=3)
clsTempFunc.AddParameter("direction", "1", iPosition:=4)
Return clsTempFunc
End Get
End Property

Public Shared ReadOnly Property clsScaleFillViridisFunction As RFunction
Get
Dim clsTempFunc As New RFunction

clsTempFunc.SetPackageName("viridis")
clsTempFunc.SetRCommand("scale_fill_viridis")
clsTempFunc.AddParameter("option", Chr(34) & "viridis" & Chr(34), iPosition:=0)
clsTempFunc.AddParameter("alpha", "1", iPosition:=1)
clsTempFunc.AddParameter("begin", "0", iPosition:=2)
clsTempFunc.AddParameter("end", "1", iPosition:=3)
clsTempFunc.AddParameter("direction", "1", iPosition:=4)
Return clsTempFunc
End Get
End Property

Public Shared ReadOnly Property clsDefaultThemeParameter As RParameter
Get
Dim clsTempParam As New RParameter
Expand Down
11 changes: 10 additions & 1 deletion instat/dlgBoxPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Public Class dlgBoxplot
Private clsCoordPolarFunction As New RFunction
Private clsCoordPolarStartOperator As New ROperator
Private clsThemeFunction As New RFunction
Private clsScaleFillViridisFunction As New RFunction
Private clsScaleColourViridisFunction As New RFunction
Private dctThemeFunctions As Dictionary(Of String, RFunction)
Private bResetSubdialog As Boolean = True
Private bResetBoxLayerSubdialog As Boolean = True
Expand Down Expand Up @@ -257,6 +259,9 @@ Public Class dlgBoxplot
clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone()
clsXScaleDateFunction = GgplotDefaults.clsXScaleDateFunction.Clone()
clsYScaleDateFunction = GgplotDefaults.clsYScaleDateFunction.Clone()
clsScaleFillViridisFunction = GgplotDefaults.clsScaleFillViridisFunction
clsScaleColourViridisFunction = GgplotDefaults.clsScaleColorViridisFunction

dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)
clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorBoxPlot.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph")
ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator)
Expand Down Expand Up @@ -300,7 +305,11 @@ Public Class dlgBoxplot
End Sub

Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click
sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=ucrSelectorBoxPlot, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction,
clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction,
clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction,
clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction,
ucrNewBaseSelector:=ucrSelectorBoxPlot, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog)
sdgPlots.ShowDialog()
bResetSubdialog = False

Expand Down
Loading