setContinuousColorScale: Traces colors

View source: R/parallelPlot.R

setContinuousColorScaleR Documentation

Traces colors

Description

Tells which color scale to use when reference column is of type continuous.

Usage

setContinuousColorScale(id, continuousCsId)

Arguments

id

Output variable to read from (id which references the requested plot).

continuousCsId

One of the available color scale ids ("Viridis", "Inferno", "Magma", "Plasma", "Warm", "Cool", "Rainbow", "CubehelixDefault", "Blues","Greens", "Greys", "Oranges", "Purples", "Reds", "BuGn", "BuPu", "GnBu", "OrRd", "PuBuGn","PuBu", "PuRd", "RdBu", "RdPu", "YlGnBu", "YlGn", "YlOrBr", "YlOrRd").

Details

If a column is defined as the reference (for example by clicking on its header), a color scale is associated to this column. Available color scale ids are: 'Blues', 'RdBu', 'YlGnBu', 'YlOrRd', 'Reds'.

Value

No return value, called from shiny applications for side effects.

Examples

 if(interactive()) {
   library(shiny)
   library(parallelPlot)

   ui <- fluidPage(
       selectInput(
         "continuousCsSelect",
         "Continuous Color Scale:",
         choices = list(
           "Viridis" = "Viridis", "Inferno" = "Inferno", "Magma" = "Magma",
           "Plasma" = "Plasma", "Warm" = "Warm", "Cool" = "Cool", "Rainbow" ="Rainbow",
           "CubehelixDefault" = "CubehelixDefault", "Blues" = "Blues",
           "Greens" = "Greens", "Greys" = "Greys", "Oranges" = "Oranges",
           "Purples" = "Purples", "Reds" = "Reds", "BuGn" = "BuGn", "BuPu" = "BuPu",
           "GnBu" = "GnBu", "OrRd" = "OrRd", "PuBuGn" = "PuBuGn", "PuBu" = "PuBu",
           "PuRd" = "PuRd", "RdBu" = "RdBu", "RdPu" = "RdPu", "YlGnBu" = "YlGnBu",
           "YlGn" = "YlGn", "YlOrBr" = "YlOrBr", "YlOrRd" = "YlOrRd"
         ),
         selected = "Viridis"
       ),
       p("The selector controls the colors used when reference column is of type continuous"),
       parallelPlotOutput("parPlot")
   )

   server <- function(input, output, session) {
       output$parPlot <- renderParallelPlot({
           parallelPlot(iris, refColumnDim = "Sepal.Length")
       })
       observeEvent(input$continuousCsSelect, {
           parallelPlot::setContinuousColorScale("parPlot", input$continuousCsSelect)
       })
   }

   shinyApp(ui, server)
 }


parallelPlot documentation built on April 12, 2022, 9:06 a.m.