Skip to content

Commit

Permalink
update docu for visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Nov 12, 2024
1 parent f8e6f73 commit 246a9d6
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 4 deletions.
56 changes: 56 additions & 0 deletions bs/.development/PlotsDocu.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
library(ggplot2)
library(cowplot)
df <- CO2

p1 <- ggplot(data = df,
aes(x = conc, y = uptake, group = conc)) +
geom_boxplot() +
theme(
axis.text = element_text(size = 24),
axis.title = element_text(size = 24)
)

p2 <- ggplot(data = df,
aes(x = conc, y = uptake,
group = interaction(conc, Treatment),
fill = Treatment)) +
geom_boxplot() +
theme(
axis.text = element_text(size = 24),
axis.title = element_text(size = 24),
legend.text = element_text(size = 20),
legend.title = element_text(size = 20)
)


p3 <- ggplot(data = df,
aes(x = conc, y = uptake,
group = interaction(conc, Treatment),
colour = Treatment)) +
geom_boxplot() +
theme(
axis.text = element_text(size = 24),
axis.title = element_text(size = 24),
legend.text = element_text(size = 20),
legend.title = element_text(size = 20)
)

p4 <- ggplot(data = df,
aes(x = conc, y = uptake,
group = conc)) +
geom_boxplot() +
facet_wrap(~ Treatment) +
theme(
axis.text = element_text(size = 24),
axis.title = element_text(size = 24),
legend.text = element_text(size = 20),
legend.title = element_text(size = 20),
strip.text = element_text(size = 20)
)


p <- plot_grid(p1, p2, p3, p4, labels = c("a", "b", "c", "d"), label_size = 40)

ggsave(filename = "../R/www/DocuPlot.jpg", p, width = 20, height = 20)


Binary file modified bs/.development/Rplots.pdf
Binary file not shown.
85 changes: 83 additions & 2 deletions bs/R/MainApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,90 @@ server <- function(input, output, session) {
observeEvent(input[["visualization_docu"]], {
showModal(modalDialog(
title = "Visualization",
includeHTML("www/visualization.html"),
HTML(
'
<p>The <strong>Visualisation Tab</strong>
in Biostats allows users to explore and visualize data through several plot types,
including <em>Boxplots</em>, <em>Scatterplots</em>, and <em>Lineplots</em>.
Below is an outline of each feature, including controls and customization options.
</p>
<div class="boxed-output">
<p><strong>Data Grouping and Splitting</strong></p>
<p>Use these options to separate data into groups or apply filters dynamically:</p>
<ul>
<li><strong>Split by Group</strong>: Enables user to subset data using one or more column(s).</li>
</ul>
</div>
'
),
br(),
renderImage({
list(src = "www/DocuPlot.jpg",
contentType = 'image/jpg',
width = 650,
height = 500,
alt = "Basic Plot"
)
}, deleteFile = FALSE),
br(),
br(),
br(),
br(),
br(),
HTML(
'
<div class="boxed-output">
<p><strong>Variable Selection</strong></p>
<p>Select variables for both the x-axis and y-axis:</p>
<ul>
<li><strong>Y Variable</strong>: Set the variable for the y-axis.</li>
<li><strong>X Variable</strong>: Set the variable for the x-axis, with options to treat it as a factor or numeric. (see plot a)</li>
</ul>
</div>
<div class="boxed-output">
<p><strong>Conditional Options</strong></p>
<p>Customize your plot with the following settings:</p>
<ul>
<li>Choose columns of the dataset which are used to further distinguish the data. </li>
<li>In case of boxplots groups can be defined for the colour of the box border and the fill of the box (See plot b and c)</li>
<li>The other plot types only support the colour attribute (see plot c).</li>
<li><strong>Legend Titles</strong>: Set titles for fill and color legends to improve interpretability.</li>
</ul>
</div>
<div class="boxed-output">
<p><strong>Axis and Facet Controls</strong></p>
<p>Adjust axis labels, ranges, and facet options:</p>
<ul>
<li><strong>Axis Labels</strong>: Set custom labels for x and y axes.</li>
<li><strong>Axis Ranges</strong>: Define minimum and maximum values for zooming in on data.</li>
<li><strong>Split plot by a column</strong> Specify a variable to create several subplots (see plot d)</li>
</ul>
</div>
<div class="boxed-output">
<p><strong>Plot Type Selection and Plot Creation</strong><p>
<p>Choose between Boxplot, Scatterplot, and Lineplot, and click "Create Plot" to generate:</p>
<p>Use the interactive adjustments for dimensions and resolution before saving or exporting plots.</p>
</div>
<div class="boxed-output">
<p><strong>Saving and Exporting Options</strong></p>
<p>Once satisfied with the plot, use these controls to save and export:</p>
<ul>
<li><strong>Add to Result File</strong>: Adds the current result to the <em>result file</em>.
This is a temporary file holding all results.</li>
<li><strong>Final selection</strong>: tick the boxes from the <em>result file</em> to add them to the result file. </li>
<li><strong>Download Options</strong>: Export plots with custom width, height, and resolution.</li>
<li><strong>Save results</strong>: by clicking this button the file is either sent to your ELN (please refresh the page) or saved locally.</li>
</ul>
</div>
'
),
easyClose = TRUE,
footer = NULL
footer = NULL,
size = "l"
))
})
# docu formula editor
Expand Down
4 changes: 2 additions & 2 deletions bs/R/visualisation.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ visServer <- function(id, data, listResults) {
req(!is.null(data$df))
req(is.data.frame(data$df))
colnames <- c("", names(data$df))
tooltip <- "Select the value of the colour variable"
tooltip <- "Select a variable for the colour variable. By chosing this groups are formed based on the unique entries in this column. Thereby, each entry gets its own colour to distinguish the groups. Dependent on the plot type either the lines, dots or the frame of the boxes are labelled"
div(
tags$label(
"Dependent Variable",
Expand All @@ -266,7 +266,7 @@ visServer <- function(id, data, listResults) {
req(!is.null(data$df))
req(is.data.frame(data$df))
colnames <- c("", names(data$df))
tooltip <- "Select the value of the fill variable"
tooltip <- "Select a variable for the fill variable. By chosing this groups are formed based on the unique entries in this column. Thereby, each entry gets its own colour to distinguish the groups."
div(
tags$label(
"Dependent Variable",
Expand Down
Binary file added bs/R/www/DocuPlot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 246a9d6

Please sign in to comment.