Commit 551647c4 authored by Stephanie Wegscheidl's avatar Stephanie Wegscheidl

first try Map with data --> Radius with normed values

and trying fixing barcharts in different boxes
parent 82d4e992
......@@ -259,9 +259,16 @@ server <- function(input, output, session) {
updateTabItems(session, "tabs",selected = "dashboard")
})
plotCounter <<- 0
#ADD BARCHART BUTTON
observeEvent(input$check_hist, {
plotCounter<<-plotCounter+1
print(plotCounter)
plotname <- paste("plot", plotCounter, sep="")
print(plotname)
xplotname<- paste("x",plotname,sep="")
yplotname<-paste("y",plotname, sep="")
insertUI(
selector= "#viewpanel", #wo will ichs hinhaben
......@@ -269,29 +276,37 @@ server <- function(input, output, session) {
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
selectInput("bar_x", "x-axis", choices=colnames(coconut.df)),
selectInput("bar_y", "y-axis", choices=colnames(coconut.df)),
plotOutput("bar", height = 250))
selectInput(xplotname, "x-axis", choices=colnames(coconut.df)),
selectInput(yplotname, "y-axis", choices=colnames(coconut.df)),
plotOutput(plotname, height = 250))
)
print("InsertUI wird aufgerufen.")
})
#DASHBOARD
#BAR VIEW
output$bar <- renderPlot({
local({
data<- structure(list(V1=as.numeric(coconut.df[[input$bar_y]]),
V2=as.numeric(coconut.df[[input$bar_x]])),
output[[plotname]] <- renderPlot({
print(plotname)
data<- structure(list(V1=as.numeric(coconut.df[[input$xplotname]]),
V2=as.numeric(coconut.df[[input$yplotname]])),
.Names=c("V1","V2"), row.names=c(NA,6L), class = "data.frame")
#Neues Plot
barplot(data$V1,data$V2,
ylab= input$bar_y,
xlab=input$bar_x)
ylab= input$yplotname,
xlab=input$xplotname)
})
})
## ALTES PLOT
#a=1
......@@ -429,11 +444,22 @@ server <- function(input, output, session) {
# MAP VIEW
output$map <- renderLeaflet({
print("MAP wird aufgerufen")
data <- as.numeric(coconut.df[[input$map_data]])
max_data<- max(data)
print("MAX DATA")
print(max_data)
c<-1
for(c in 1:length(data)){
data[c]<-(data[c]/max_data)*5
}
print(data)
m <<- leaflet()
x=1
m <- addTiles(m)
for(x in 1:length(coconut.df$gps.latitude)){
m <- addCircleMarkers(m,lng=as.numeric(longitude[x]), lat=as.numeric(latitude[x]), radius = 1, color ="red") #addPolylines does not work
m <- addCircleMarkers(m,lng=as.numeric(coconut.df$gps.longitude[x]), lat=as.numeric(coconut.df$gps.latitude[x]), radius = data[x], color ="red") #addPolylines does not work
x=x+1}
m
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment