Fix file indentation
This commit is contained in:
319
ui.R
319
ui.R
@@ -3,188 +3,157 @@ source("global.R")
|
|||||||
ui <- function() {
|
ui <- function() {
|
||||||
page_fillable(
|
page_fillable(
|
||||||
h1("Polizeiliche Kriminalstatistik Hamburg",
|
h1("Polizeiliche Kriminalstatistik Hamburg",
|
||||||
style = "color: #003064; background: #b8ecff; padding: 20px 0px 20px 20px; background-clip: padding-box; font-family: Lato,Arial,Helvetica,sans-serif;font-weight: 400", #text-align: center
|
style = "color: #003064; background: #b8ecff; padding: 20px 0px 20px 20px; background-clip: padding-box; font-family: Lato,Arial,Helvetica,sans-serif;font-weight: 400", #text-align: center
|
||||||
class = "display-4"),
|
class = "display-4"
|
||||||
|
),
|
||||||
navset_card_tab(
|
navset_card_tab(
|
||||||
nav_panel("Karte",
|
nav_panel("Karte",
|
||||||
page_sidebar(
|
page_sidebar(
|
||||||
layout_columns(
|
layout_columns(
|
||||||
leafletOutput("hhmap"),
|
leafletOutput("hhmap"),
|
||||||
card(
|
card(
|
||||||
div(
|
div(
|
||||||
# h3 oder div dient als Block-Element und richtet seinen Inhalt (das span) rechtsbündig aus
|
# h3 oder div dient als Block-Element und richtet seinen Inhalt (das span) rechtsbündig aus
|
||||||
style = "text-align: right; width: 100%; ",
|
style = "text-align: right; width: 100%; ",
|
||||||
|
# Der Text wird in ein span verpackt und erhält die Border.
|
||||||
# Der Text wird in ein span verpackt und erhält die Border.
|
# Ein span nimmt nur den Platz ein, den der Inhalt benötigt (inline).
|
||||||
# Ein span nimmt nur den Platz ein, den der Inhalt benötigt (inline).
|
tags$span(
|
||||||
tags$span(
|
"2024",
|
||||||
"2024",
|
style = "
|
||||||
style = "
|
border: 1px solid rgba(40,70,94,0.1);
|
||||||
border: 1px solid rgba(40,70,94,0.1);
|
border-radius: 5px;
|
||||||
border-radius: 5px;
|
padding: 5px 10px 5px 10px;
|
||||||
padding: 5px 10px 5px 10px;
|
background-color: #eeeeee;
|
||||||
background-color: #eeeeee;
|
"
|
||||||
"
|
# padding ist der abstand an leerer Fläche in der reihenfolge top right bottom left
|
||||||
# padding ist der abstand an leerer Fläche in der reihenfolge top right bottom left
|
# farbe rgba ist die exakte Farbe der Trennlinien und Card-Umrandungen aus der App
|
||||||
# farbe rgba ist die exakte Farbe der Trennlinien und Card-Umrandungen aus der App
|
|
||||||
)
|
|
||||||
),
|
|
||||||
div(
|
|
||||||
class = "d-flex align-items-end gap-2",
|
|
||||||
h5(strong("Bezirk:"), style = "margin-bottom: 0;"),
|
|
||||||
textOutput("txt_map_selection_bezirk"),
|
|
||||||
),
|
|
||||||
div(
|
|
||||||
class = "d-flex align-items-end gap-2",
|
|
||||||
h5(strong("Stadtteil:"), style = "margin-bottom: 0;"),
|
|
||||||
textOutput("txt_map_selection_stadtteil"),
|
|
||||||
),
|
|
||||||
plotOutput("grph_top3"),
|
|
||||||
#tableOutput("tbl_2024"),
|
|
||||||
),
|
|
||||||
col_widths = c(8, 4),
|
|
||||||
),
|
|
||||||
sidebar = sidebar(
|
|
||||||
radioButtons(
|
|
||||||
inputId = "rd_maptype",
|
|
||||||
label = "Kartentyp",
|
|
||||||
choices = c("Bezirke", "Stadtteile"),
|
|
||||||
selected = "Bezirke"
|
|
||||||
),
|
|
||||||
tags$head(
|
|
||||||
tags$style(HTML("
|
|
||||||
.selectize-dropdown-content .option {
|
|
||||||
border-bottom: 1px solid #dee2e6; /* Die Trennlinie */
|
|
||||||
padding: 8px 10px; /* Abstand zwischen Text und Linie */
|
|
||||||
}
|
|
||||||
"))
|
|
||||||
),
|
|
||||||
selectizeInput(
|
|
||||||
inputId = "search",
|
|
||||||
label = tags$span(icon("search"),"Suche"),
|
|
||||||
choices = NULL,
|
|
||||||
selected = NULL,
|
|
||||||
multiple = FALSE, # Hier wahrscheinlich nur Einzelauswahl gewünscht
|
|
||||||
options = list(
|
|
||||||
placeholder = "Anfangen zu tippen...",
|
|
||||||
openOnFocus = FALSE,
|
|
||||||
allowEmptyOption = TRUE,
|
|
||||||
selectOnTab = FALSE,
|
|
||||||
plugins = list('dropdown_header')
|
|
||||||
)
|
|
||||||
),
|
|
||||||
div(
|
|
||||||
tags$h5("Heatmap zur Häufigkeit der Straftaten:", style = "font-weight: bold; margin-bottom: 10px;"),
|
|
||||||
selectizeInput(
|
|
||||||
inputId = "heatmap",
|
|
||||||
label = "Wähle eine Straftat:",
|
|
||||||
choices = list_of_crimes,
|
|
||||||
selected = NULL,
|
|
||||||
options = list(
|
|
||||||
placeholder = "Keine Auswahl",
|
|
||||||
plugins = list('clear_button')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
uiOutput("txt_map_selection_bezirk"),
|
||||||
|
uiOutput("txt_map_selection_stadtteil"),
|
||||||
|
plotOutput("grph_top3"),
|
||||||
|
),
|
||||||
|
col_widths = c(8, 4),
|
||||||
|
),
|
||||||
|
sidebar = sidebar(
|
||||||
|
radioButtons(
|
||||||
|
inputId = "rd_maptype",
|
||||||
|
label = "Kartentyp",
|
||||||
|
choices = c("Bezirke", "Stadtteile"),
|
||||||
|
selected = "Bezirke"
|
||||||
|
),
|
||||||
|
tags$head(
|
||||||
|
tags$style(
|
||||||
|
HTML("
|
||||||
|
.selectize-dropdown-content .option {
|
||||||
|
border-bottom: 1px solid #dee2e6; /* Die Trennlinie */
|
||||||
|
padding: 8px 10px; /* Abstand zwischen Text und Linie */
|
||||||
|
}
|
||||||
|
.legend {
|
||||||
|
background: white !important; /* Der Hintergrund der Legenden-Box */
|
||||||
|
opacity: 1 !important; /* Die Box selbst ist nicht transparent */
|
||||||
|
}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
selectizeInput(
|
||||||
|
inputId = "search",
|
||||||
|
label = tags$span(icon("search"),"Suche"),
|
||||||
|
choices = NULL,
|
||||||
|
selected = NULL,
|
||||||
|
multiple = FALSE, # Hier wahrscheinlich nur Einzelauswahl gewünscht
|
||||||
|
options = list(
|
||||||
|
placeholder = "Anfangen zu tippen...",
|
||||||
|
openOnFocus = FALSE,
|
||||||
|
allowEmptyOption = TRUE,
|
||||||
|
selectOnTab = FALSE,
|
||||||
|
plugins = list('dropdown_header')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
div(
|
||||||
|
tags$h5(
|
||||||
|
"Heatmap zur Häufigkeit der Straftaten:",
|
||||||
|
style = "font-weight: bold; margin-bottom: 10px;"
|
||||||
|
),
|
||||||
|
selectizeInput(
|
||||||
|
inputId = "heatmap",
|
||||||
|
label = "Wähle eine Straftat:",
|
||||||
|
choices = list_of_crimes,
|
||||||
|
selected = NULL,
|
||||||
|
options = list(
|
||||||
|
placeholder = "Keine Auswahl",
|
||||||
|
plugins = list('clear_button')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
),
|
),
|
||||||
nav_panel("Vergleich",
|
nav_panel("Vergleich",
|
||||||
layout_sidebar(
|
layout_sidebar(
|
||||||
sidebar = sidebar(
|
sidebar = sidebar(
|
||||||
title = "Vergleichs-Optionen",
|
title = "Vergleichs-Optionen",
|
||||||
width = 400,
|
width = 400,
|
||||||
radioButtons(
|
tags$hr(),
|
||||||
"vergleichs_modus",
|
uiOutput("vergleichs_inputs"),
|
||||||
"Wählen Sie den Vergleichstyp:",
|
selectizeInput(
|
||||||
choices = c(
|
"vergleich_location",
|
||||||
"Straftat vs. Orte" = "ort_vergleich",
|
"Zu vergleichende Orte",
|
||||||
"Ort vs. Straftaten" = "straftat_vergleich"
|
choices = auswahlmöglichkeiten,
|
||||||
),
|
multiple = TRUE
|
||||||
selected = "ort_vergleich"
|
|
||||||
),
|
),
|
||||||
|
|
||||||
tags$hr(),
|
selectizeInput(
|
||||||
|
"vergleich_straftat",
|
||||||
# 2. Dynamische Input-Felder für die Orte und Straftaten
|
"Zu vergleichende Straftaten",
|
||||||
uiOutput("vergleichs_inputs"),
|
choices = list_of_crimes,
|
||||||
|
multiple = TRUE
|
||||||
selectizeInput(
|
),
|
||||||
"vergleich_location",
|
# 3. Gemeinsamer Input: Das Jahr
|
||||||
"Zu vergleichende Orte",
|
selectizeInput(
|
||||||
choices = auswahlmöglichkeiten,
|
"vergleichs_jahr",
|
||||||
multiple = TRUE
|
"Jahr wählen:",
|
||||||
|
choices = c(2024, 2023),
|
||||||
),
|
selected = 2024,
|
||||||
|
),
|
||||||
selectizeInput(
|
),
|
||||||
"vergleich_straftat",
|
card(
|
||||||
"Zu vergleichende Straftaten",
|
card_header(uiOutput("vergleichs_titel")), # Dynamischer Titel
|
||||||
choices = list_of_crimes,
|
plotOutput("vergleich_balkendiagramm")
|
||||||
multiple = TRUE
|
)
|
||||||
),
|
)
|
||||||
# 3. Gemeinsamer Input: Das Jahr
|
|
||||||
selectizeInput(
|
|
||||||
"vergleichs_jahr",
|
|
||||||
"Jahr wählen:",
|
|
||||||
choices = c(2024, 2023),
|
|
||||||
selected = 2024,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
card(
|
|
||||||
card_header(uiOutput("vergleichs_titel")), # Dynamischer Titel
|
|
||||||
plotOutput("vergleich_balkendiagramm")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
nav_panel("Weiterführende Informationen",
|
||||||
|
accordion(
|
||||||
|
accordion_panel(
|
||||||
|
title = "Raub, räuberische Erpressung, räuberischer Angriff auf Kraftfahrer",
|
||||||
nav_panel("Wiki",
|
accordion(
|
||||||
accordion(
|
accordion_panel(
|
||||||
accordion_panel(
|
title = h4("Raub nach § 249 StGB", style = "margin: 0;"),
|
||||||
title = "Raub, räuberische Erpressung, räuberischer Angriff auf Kraftfahrer",
|
value = "raub_249",
|
||||||
card(
|
p("Raubdelikte sind Straftaten, bei denen jemand eine fremde bewegliche Sache wegnimmt, indem er Gewalt anwendet oder mit Gewalt droht, um sie sich oder einem Dritten rechtswidrig zuzueignen."),
|
||||||
card_header(
|
),
|
||||||
h4(bs_icon("cash-stack"),
|
),
|
||||||
"Raub nach § 249 StGB")
|
accordion(
|
||||||
),
|
accordion_panel(
|
||||||
p("Raubdelikte nach § 249 des deutschen Strafgesetzbuch sind Straftaten, bei denen jemand eine fremde bewegliche Sache wegnimmt, indem er Gewalt anwendet oder mit Gewalt droht, um sie sich oder einem Dritten rechtswidrig zuzueignen."),
|
title = h4("Räuberische Erpressung nach § 255 StGB", style = "margin: 0;"),
|
||||||
tags$blockquote(
|
value = "raub_255",
|
||||||
class = "blockquote",
|
p("Räuberische Erpressung ist eine
|
||||||
"(1) Wer mit Gewalt gegen eine Person oder unter Anwendung von Drohungen mit gegenwärtiger Gefahr für Leib oder Leben eine fremde bewegliche Sache einem anderen in der Absicht wegnimmt, die Sache sich oder einem Dritten rechtswidrig zuzueignen, wird mit Freiheitsstrafe nicht unter einem Jahr bestraft.",
|
schwere Form der Erpressung, bei der Gewalt gegen eine Person oder die Drohung mit gegenwärtiger Lebens- oder Gesundheitsgefahr eingesetzt wird, um eine Vermögensverfügung zu erzwingen, wodurch der Täter wie ein Räuber (§ 249 StGB) bestraft wird, also mit mindestens einem Jahr Freiheitsstrafe."),
|
||||||
tags$br(), #Zeilenumbruch
|
),
|
||||||
"(2) In minder schweren Fällen ist die Strafe Freiheitsstrafe von sechs Monaten bis zu fünf Jahren."
|
),
|
||||||
)
|
accordion(
|
||||||
),
|
accordion_panel(
|
||||||
card(
|
title = h4("Räuberischer Angriff auf Kraftfahrer nach § 316a StGB", style = "margin: 0;"),
|
||||||
card_header(
|
value = "raub_316a",
|
||||||
h4(icon("money-bill-transfer"),
|
p("Ein räuberischer Angriff auf Kraftfahrer ist ein
|
||||||
"Räuberische Erpressung nach § 255 StGB")
|
Verbrechen, bei dem ein Täter unter Ausnutzung der besonderen Situation im Straßenverkehr Gewalt gegen den Fahrer oder Mitfahrer anwendet, um einen Raub, räuberischen Diebstahl oder eine räuberische Erpressung zu begehen."),
|
||||||
),
|
),
|
||||||
p("Räuberische Erpressung (§ 255 StGB) ist eine
|
),
|
||||||
schwere Form der Erpressung, bei der Gewalt gegen eine Person oder die Drohung mit gegenwärtiger Lebens- oder Gesundheitsgefahr eingesetzt wird, um eine Vermögensverfügung zu erzwingen, wodurch der Täter wie ein Räuber (§ 249 StGB) bestraft wird, also mit mindestens einem Jahr Freiheitsstrafe."),
|
),
|
||||||
tags$blockquote(
|
),
|
||||||
class = "blockquote",
|
|
||||||
"Wird die Erpressung durch Gewalt gegen eine Person oder unter Anwendung von Drohungen mit gegenwärtiger Gefahr für Leib oder Leben begangen, so ist der Täter gleich einem Räuber zu bestrafen."
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
accordion_panel(
|
|
||||||
title = "Gewaltkriminalität",
|
|
||||||
#icon =
|
|
||||||
"Gewaltkriminalität ist doof."
|
|
||||||
),
|
|
||||||
accordion_panel(
|
|
||||||
title = "Was ganz langes.",
|
|
||||||
#icon
|
|
||||||
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
id = "tab"
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user