ソースを参照

Simpler, more transferable layout

Petra Lamborn 4 年 前
コミット
7d6da85285
共有1 個のファイルを変更した28 個の追加45 個の削除を含む
  1. 28
    45
      MedicalCentres/app.R

+ 28
- 45
MedicalCentres/app.R ファイルの表示

@@ -10,47 +10,34 @@ DHBs <- sort(unique(Geo2017$dhb_name))
10 10
 DHBs <- c(DHBs[DHBs != "Missing"], "Missing")
11 11
 
12 12
 
13
-ui <- fillPage(title = "New Zealand GP Practice Locations 2017",
14
-    tags$style(type = "text/css", 
15
-               "#medmap {
16
-                 height: 100% !important;
17
-                 posiiton: absolute;
18
-                 top: 0;
19
-                 left: 0;
20
-               }
21
-               #ddown {
22
-                 position: absolute;
23
-                 top: 0;
24
-                 right: 0;
25
-                 z-index: 10;
26
-               }"),
27
-    dropdownButton(
28
-      strong("Not Implemented"), hr(),
29
-      searchInput("mapsearch",
30
-                  placeholder = "Search GP practices by name",
31
-                  btnSearch = icon("search"), 
32
-                  btnReset = icon("remove"), 
33
-                  width = "100%"),
34
-      hr(),
35
-      radioButtons("selcol", "Colour by",
36
-                   choices = c("None",
37
-                               "DHB",
38
-                               "Snargleflagen")),
39
-      hr(),
40
-      checkboxInput("dhboverlay", "Show DHBs"),
41
-      hr(),
42
-      #pickerInput("dhbpicker",
43
-      #            label = "Show from DHBs",
44
-      #            choices = DHBs,
45
-      #            multiple = TRUE,
46
-      #            options = pickerOptions(size=3),
47
-      #            selected = DHBs),
48
-      #hr(),
49
-      actionLink("closedrop", label = "close", icon = icon("close"),
50
-                 style="float:right"),
51
-      circle=FALSE, inputId = "ddown", right = TRUE,
52
-      label = "Options", inline = FALSE),
53
-    leafletOutput(outputId = "medmap")
13
+ui <- fluidPage(title = "New Zealand GP Practice Locations 2017",
14
+        sidebarLayout(position = "right",
15
+          sidebarPanel(width = 4,
16
+            strong("Not Implemented"), hr(),
17
+            searchInput("mapsearch",
18
+                        placeholder = "Search GP practices by name",
19
+                        btnSearch = icon("search"), 
20
+                        btnReset = icon("remove"), 
21
+                        width = "100%"),
22
+            hr(),
23
+            radioButtons("selcol", "Colour by",
24
+                         choices = c("None",
25
+                                     "DHB",
26
+                                     "Snargleflagen")),
27
+            hr(),
28
+            checkboxInput("dhboverlay", "Show DHB boundaries"),
29
+            hr(),
30
+            pickerInput("dhbpicker",
31
+                        label = "Show from DHBs",
32
+                        choices = DHBs,
33
+                        multiple = TRUE,
34
+                        options = pickerOptions(size=10),
35
+                        selected = DHBs)
36
+          ),
37
+          mainPanel(width = 8,
38
+            leafletOutput(outputId = "medmap", height = "100vh")
39
+          )
40
+        )
54 41
 )
55 42
 
56 43
 server <- function(input, output) {
@@ -61,10 +48,6 @@ server <- function(input, output) {
61 48
                        lat = Geo2017$lat,
62 49
                        popup = Geo2017$name)
63 50
     })
64
-    
65
-    observeEvent(input$closedrop, {
66
-      toggleDropdownButton("ddown")
67
-    })
68 51
 }
69 52
 
70 53
 # Run the application