Plotly chart colours to match the network
This commit is contained in:
6
app.R
6
app.R
@@ -560,9 +560,7 @@ server <- function(input, output, session) {
|
|||||||
if (nrow(boxPlot) > 0) {
|
if (nrow(boxPlot) > 0) {
|
||||||
|
|
||||||
palette <- brewer.pal(length(legends), "RdYlGn")
|
palette <- brewer.pal(length(legends), "RdYlGn")
|
||||||
#print(palette)
|
names(palette) <- 1:length(legends)
|
||||||
|
|
||||||
colours <- palette[as.integer(boxPlot$Group)]
|
|
||||||
|
|
||||||
#print(paste("Box plot, colours", nrow(boxPlot), length(colours)))
|
#print(paste("Box plot, colours", nrow(boxPlot), length(colours)))
|
||||||
#cat(colours)
|
#cat(colours)
|
||||||
@@ -570,7 +568,7 @@ server <- function(input, output, session) {
|
|||||||
categoryarray = boxPlot[,1],
|
categoryarray = boxPlot[,1],
|
||||||
zerolinewidth = 10)
|
zerolinewidth = 10)
|
||||||
#
|
#
|
||||||
plot_ly(boxPlot, x = boxPlot[,1], y = ~Range, color = colours, colors = palette, type = "box") %>%
|
plot_ly(boxPlot, x = boxPlot[,1], y = ~Range, color = as.character(boxPlot$Group), colors = palette, type = "box") %>%
|
||||||
layout(xaxis = xform, showlegend = FALSE, title = title)
|
layout(xaxis = xform, showlegend = FALSE, title = title)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user