Custom palette

This commit is contained in:
2019-04-16 10:55:33 +01:00
parent e011ccfdba
commit 25da02896d
2 changed files with 11 additions and 5 deletions

14
app.R
View File

@@ -204,6 +204,9 @@ server <- function(input, output, session) {
dataStorage <- "data/" dataStorage <- "data/"
palette <- c("firebrick", "coral", "rosybrown", "tan", "salmon", "olivedrab", "seagreen", "aquamarine", "darkcyan", "dodgerblue", "steelblue", "royalblue")
models <- NULL models <- NULL
pressures <- NULL pressures <- NULL
@@ -500,7 +503,6 @@ server <- function(input, output, session) {
nodeSpacing <- ifelse(.selections$bbnNames, 600, 150) nodeSpacing <- ifelse(.selections$bbnNames, 600, 150)
palette <- brewer.pal(nrow(model$legend), "Set3")
nodes <- data.frame( nodes <- data.frame(
id = rownames(nodes), id = rownames(nodes),
@@ -540,6 +542,7 @@ server <- function(input, output, session) {
} }
legendDF <- data.frame( legendDF <- data.frame(
id = 1:nrow(model$legend), id = 1:nrow(model$legend),
label = model$legend, label = model$legend,
@@ -573,10 +576,13 @@ server <- function(input, output, session) {
genPlot <- function(boxPlot, title, paletteLength) { genPlot <- function(boxPlot, title, paletteLength) {
if (nrow(boxPlot) > 0) { if (nrow(boxPlot) > 0) {
print(paste('Palette length', paletteLength)) #print(paste('Palette length', paletteLength))
palette <- brewer.pal(paletteLength, "Set3") #palette <- brewer.pal(paletteLength, "Set3")
names(palette) <- 1:paletteLength
#palette <- c("red", "sienna3", "plum2", "rosybrown4", "sandybrown", "yellow", "seashell3", "palegreen", "springgreen4", "steelblue", "azure")
names(palette) <- 1:length(palette)
#print(paste("Box plot, colours", nrow(boxPlot), length(colours))) #print(paste("Box plot, colours", nrow(boxPlot), length(colours)))
#cat(colours) #cat(colours)