Permalink
Browse files

units in legend title

  • Loading branch information...
1 parent 9974198 commit 197cded7626782483b4c85d8053459322ca846a3 @blmoore committed Jun 23, 2015
Showing with 12 additions and 2 deletions.
  1. +11 −2 server.R
  2. +1 −0 styles.css
View
@@ -44,11 +44,20 @@ map_choice <- function(inp){
list(var="none", type="none"))
}
+legend_hdr <- function(inp){
+ switch(inp,
+ "Severity" = "Severity",
+ "Casualties" = "Number of casualties",
+ "Time" = "Time (24h)",
+ "Vehicles" = "Number of vehicles",
+ "Speed limit" = "Speed limit (mph)",
+ "")
+}
+
monthly <- accidents %>% group_by(a_date_yr, a_date_mon) %>% tally()
monthly$a_date_mon <- factor(monthly$a_date_mon, levels=month.name, ordered=T)
monthly$a_date_yr <- factor(paste0("20",monthly$a_date_yr), levels=2013:2010)
-
shinyServer(function(input, output, session) {
getData <- reactive({
@@ -100,7 +109,7 @@ shinyServer(function(input, output, session) {
observe({
# modify map of changed input i.e. colour by
ax <- getData()
- title <- input$color
+ title <- legend_hdr(input$color)
updateRadioButtons(session, "color_mob", selected=input$color)
View
@@ -70,6 +70,7 @@ div.leaflet-control-zoom {
.legend {
background: rgba(255,255,255,1);
+ max-width: 90px;
}
p.foot {

0 comments on commit 197cded

Please sign in to comment.