This repository has been archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/fix-issue-#9' into dev
- Loading branch information
Showing
8 changed files
with
302 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: duflor.gui | ||
Title: Frontend for duflor-package | ||
Version: 0.0.1.9007 | ||
Version: 0.0.1.9008 | ||
Author: Claudius Appel | ||
Authors@R: c( | ||
person("Claudius", "Appel", email = "[email protected]" , role = c("aut", "cre")) | ||
|
@@ -22,6 +22,7 @@ Imports: | |
imager, | ||
magrittr, | ||
openxlsx, | ||
dplyr | ||
dplyr, | ||
ggplot2 | ||
Remotes: | ||
Claudius-Appel/duflor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#' Title | ||
#' | ||
#' @return ggplot-object for the respective KPI | ||
#' @keywords internal | ||
#' @importFrom ggplot2 ggplot | ||
#' @importFrom ggplot2 geom_bar | ||
#' @importFrom ggplot2 labs | ||
#' @importFrom ggplot2 theme_minimal | ||
#' @importFrom ggplot2 theme | ||
#' @importFrom ggplot2 guides | ||
#' @importFrom ggplot2 aes | ||
#' @importFrom ggplot2 element_text | ||
#' @importFrom utils hasName | ||
#' | ||
get_KPI_plot <- function(input, DATA) { | ||
key <- str_c(input$reinspected_spectrums2, input$reinspected_type2) | ||
if (hasName(DATA$results$results, key)) { | ||
removeNotification("spectrum.not.found.ggplot") | ||
filtered_data <- DATA$results$results[[key]] | ||
} else { | ||
# handle spectrums not present in results-set | ||
showNotification( | ||
ui = "This spectrum was not analysed for this image.", | ||
id = "spectrum.not.found.ggplot", | ||
duration = NA, | ||
type = "warning" | ||
) | ||
return(ggplot()) | ||
} | ||
names <- DATA$results$results$image_name | ||
group <- get_group(names) | ||
# construct data | ||
data <- | ||
data.frame(filtered_data = filtered_data, | ||
names = names, | ||
group = group) | ||
plt <- ggplot(data, aes(x = names, y = filtered_data, fill = group)) + | ||
geom_bar(stat = "identity", position = "dodge") + | ||
labs(x = "Names", y = "Filtered Datra") + | ||
theme_minimal() + | ||
theme(axis.text.x = element_text(angle = 45, hjust = 1)) | ||
return(plt) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#' trims numbers from groups from character-vector | ||
#' | ||
#' @param names . | ||
#' | ||
#' @return . | ||
#' @keywords internal | ||
#' | ||
get_group <- function(names) { | ||
prefix <- gsub("\\d", "", names) | ||
return(prefix) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.