Browse Source

change colours; hide control panel

Petra Lamborn 3 years ago
parent
commit
89395dd1e3
2 changed files with 10 additions and 2 deletions
  1. 2
    2
      scratch.R
  2. 8
    0
      viz/app.R

+ 2
- 2
scratch.R View File

@@ -90,8 +90,8 @@ work_simp %>%
90 90
     total = sum(ifelse(total < 0, 0, total)), .groups="drop"
91 91
   ) -> work_to
92 92
 
93
-tencols <-  c("#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", 
94
-              "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a")
93
+tencols <-  c("#6a3d9a", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", 
94
+              "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#a6cee3")
95 95
 tencols[which.max(work_from[1, 5:14])]
96 96
 
97 97
 

+ 8
- 0
viz/app.R View File

@@ -4,6 +4,7 @@ library(leaflet)
4 4
 library(rgdal)
5 5
 library(dplyr)
6 6
 library(leaflet.extras)
7
+library(shinyWidgets)
7 8
 
8 9
 source("leafletfunctions.R")
9 10
 
@@ -97,6 +98,9 @@ ui <- fluidPage(
97 98
                              inline = FALSE),
98 99
                 div(id="locinfo",
99 100
                     htmlOutput("lochtml"))),
101
+  absolutePanel(top = 25, right = 10, id="control2",
102
+                materialSwitch("controlswitch", value=TRUE, right=TRUE,
103
+                               inline=TRUE, status="info")),
100 104
   absolutePanel(bottom = 30, left = 10, id="loading",
101 105
                 p("Loading..."))
102 106
 )
@@ -235,6 +239,10 @@ random rounding</a>
235 239
   observeEvent(input$radiocolour, ignoreInit = TRUE, {
236 240
     updateMap()
237 241
   })
242
+  observeEvent(input$controlswitch, ignoreInit = TRUE, {
243
+    shinyjs::toggleElement("mapcontrol", anim=TRUE,
244
+                           time = 0.5)
245
+  })
238 246
   output$lochtml <- renderUI({
239 247
     seled <- sel.SA2.code()
240 248
     seled <- ifelse(is.na(seled), 0, seled)