diff --git a/modules/module_plotly_map.R b/modules/module_plotly_map.R index cc8e02280cf0a24bf254c8a95044b12c1a53df4f..5c4b4ad4dff915c80bb0b1490066ae083f5d106b 100644 --- a/modules/module_plotly_map.R +++ b/modules/module_plotly_map.R @@ -50,7 +50,7 @@ plotly_map_code <- function(id, filename = "plot.png", content = function(file) { ggplot2::ggsave(file, plot = plot_gg(), - device = "png", width = 7, + device = "png", width = 8, height = 5) } ) diff --git a/plot_functions/ts_plot.R b/plot_functions/ts_plot.R index b182eb0bd427043df77cbbb1510eb75dd2efb0f7..b2fed1c9cfa507e2f5feb0449d28dc0f3d3f5d5e 100644 --- a/plot_functions/ts_plot.R +++ b/plot_functions/ts_plot.R @@ -17,9 +17,7 @@ ts_plot <- reactive({ labs(y = y_col) + theme_wqGraph() + add_footer() + - theme(legend.position = "top", - legend.title = element_blank()) + - guides(color = guide_legend(nrow = 3)) + theme(legend.title = element_blank()) return(plot_out) @@ -62,15 +60,15 @@ ts_plot_plotly <- reactive({ ts_plot_out <- reactive({ code_out <- paste0(setup_multi_site(),' - site_info <- attr(dv_data, "siteInfo") - colors_R4 <- palette.colors(n = 8,palette = "R4") - colors_R4 <- colors_R4[1:nrow(site_info)] - site_info$color <- colors_R4 - - y_col <- paste(strwrap(attr(dv_data, "variableInfo")[["dv_label"]], - width = 40), collapse = "\n") - - pal <- setNames(site_info$color, site_info$station_nm) +site_info <- attr(dv_data, "siteInfo") +colors_R4 <- palette.colors(n = 8,palette = "R4") +colors_R4 <- colors_R4[1:nrow(site_info)] +site_info$color <- colors_R4 + +y_col <- paste(strwrap(attr(dv_data_complete, "variableInfo")[["dv_label"]], + width = 40), collapse = "\n") + +pal <- setNames(site_info$color, site_info$station_nm) # Static plot: @@ -81,6 +79,7 @@ ts_plot <- ggplot(data = dv_data_complete) + scale_color_manual(values = pal) + theme_wqGraph() + add_footer() + + labs(y = y_col) + theme(legend.title = element_blank()) ts_plot @@ -96,7 +95,7 @@ ts_plot library(plotly) -y_col <- paste(strwrap(attr(dv_data, "variableInfo")[["dv_label"]], +y_col <- paste(strwrap(attr(dv_data_complete, "variableInfo")[["dv_label"]], width = 35), collapse = "<br>") fig <- plot_ly(dv_data_complete,