shiny-demo: try to improve progress bar
Change-Id: I975bd1b87c6779bc2ed05c9f1044aead57f77c33
diff --git a/demo/shiny-apps/frequency_curves/server.R b/demo/shiny-apps/frequency_curves/server.R
index 655c51f..8de9272 100644
--- a/demo/shiny-apps/frequency_curves/server.R
+++ b/demo/shiny-apps/frequency_curves/server.R
@@ -9,12 +9,14 @@
# override log.info in RKorAPClient to get some progress info
log.info <- function(v, ...) {
original = paste0(...)
- detail <- if (str_detect(original, "in ([0-9]{4})")) {
+ detail <- if (str_detect(original, "Searching.*in ([0-9]{4})")) {
str_replace(original, ".*in ([0-9]{4}).*", "Suche in \\1")
+ } else if (str_detect(original, "Getting size.*in ([0-9]{4})")) {
+ str_replace(original, ".*in ([0-9]{4}).*", "Korpusgröße \\1")
} else {
"Randverteilung"
}
- incProgress(1 / (2 * length(query) * length(years)), detail = detail)
+ incProgress(1 / (2 * length(query) * length(years) + length(years)), detail = detail)
cat(original, file = logfile)
flush(logfile)
}