Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Larsibaer committed May 13, 2023
2 parents c10ac41 + 1f0087e commit 01d0184
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -186,4 +186,5 @@ poetry.toml
# LSP config files
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks,python
# End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks,python
.DS_Store
Binary file added Bildschirmfoto vom 2023-05-13 11-48-42.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bildschirmfoto vom 2023-05-13 12-18-20.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 27 additions & 5 deletions map/app.R
Expand Up @@ -74,10 +74,32 @@ sidebar <-dashboardSidebar(
pickerInput("locInput","Serviceangebot", choices=unique(data$Serviceangebot), options = list(`actions-box` = TRUE),multiple = T)
)

js_code <- '
function copyToClipboard(text) {
var textarea = document.createElement("textarea");
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
document.execCommand("copy");
document.body.removeChild(textarea);
alert("Text copied to clipboard: " + text);
}'

css <- "
custom-cursor:hover {
cursor: pointer;
}
"


ui <- dashboardPage(
dashboardHeader(),
sidebar,
body,
tags$head(
tags$script(HTML(js_code)),
tags$style(HTML(css))
)
)

server <- function(input, output) {
Expand Down Expand Up @@ -113,12 +135,12 @@ server <- function(input, output) {
popup = ~paste0(
"<table>",
"<tr><td style='border-bottom: 1px solid black;' colspan='2'><strong>Total:</strong> ", count, "</td></tr>",
"<tr><td style='border-bottom: 1px solid black;' colspan='2'>", Ort, "</td></tr>",
"<tr><td>", top_5_names[1, rownum], ":</td><td>", paste0(format(top_5_values[1, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td>", top_5_names[2, rownum], ":</td><td>", paste0(format(top_5_values[2, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td>", top_5_names[3, rownum], ":</td><td>", paste0(format(top_5_values[3, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td>", top_5_names[4, rownum], ":</td><td>", paste0(format(top_5_values[4, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td onclick='copyToClipboard(\"", Ort, "\")',id = 'custom-cursor'' style='border-bottom: 1px solid black;' colspan='2'>", Ort, "</td></tr>",
"<tr><td>", top_5_names[5, rownum], ":</td><td>", paste0(format(top_5_values[5, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td>", top_5_names[4, rownum], ":</td><td>", paste0(format(top_5_values[4, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td>", top_5_names[3, rownum], ":</td><td>", paste0(format(top_5_values[3, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td>", top_5_names[2, rownum], ":</td><td>", paste0(format(top_5_values[2, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"<tr><td>", top_5_names[1, rownum], ":</td><td>", paste0(format(top_5_values[1, rownum] / count * 100, digits = 2), "%"), "</td></tr>",
"</table>"
),
radius = ~log(count),
Expand Down
26 changes: 21 additions & 5 deletions pipeline.ipynb
Expand Up @@ -5,7 +5,19 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Preparing"
"# Pipeline\n",
"In diesem File findet die ganze Verarbeitung der Daten statt. Die Einstellungen sind im unteren Codeblock zu finden.\n",
"\n",
"Hier gäbe es performancetechnisch noch einiges zu optimieren, jedoch liegt das ausserhalb des Scopes dieser Arbeit."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Preparing\n",
"Vorbereitung der Packages und Einstellungen"
]
},
{
Expand Down Expand Up @@ -37,7 +49,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Preprocessing"
"# Preprocessing\n",
"Datenverarbeitung als Grundlage für die nachfolgenden Schritte"
]
},
{
Expand Down Expand Up @@ -304,7 +317,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# TF-IDF"
"# TF-IDF\n",
"Berechnung der Keywords mittels TF-IDF"
]
},
{
Expand Down Expand Up @@ -383,7 +397,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# OneHotEncoding Top N Words"
"# OneHotEncoding Top N Words\n",
"OneHotEncodierung der wichtigsten Wörter im ganzen Datensatz"
]
},
{
Expand Down Expand Up @@ -451,7 +466,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Get coordinates "
"# Get coordinates \n",
"Koordinaten zu den Orten hinzufügen"
]
},
{
Expand Down

0 comments on commit 01d0184

Please sign in to comment.