-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
67 lines (55 loc) · 1.79 KB
/
server.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# This is the server logic of a Shiny web application. You can run the
# application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
d_raw <- reactive({
read_rds("data/d_comparable.rds")
})
d_runs <- reactive({
d_raw() %>%
filter(params_n_qubits.qaoa <= input$qubits)
})
output$distPlot <- renderPlot({
validate(need(input$color, "Select Option"))
if (input$color == "none") {
p <- d_runs() %>%
ggplot(aes(
x = as.factor(params_n_qubits.qaoa),
y = metrics_energy
))
} else if (input$color == "params_instance_type") {
p <- d_runs() %>%
ggplot(
aes(
x = as.factor(params_n_qubits.qaoa),
y = metrics_energy,
col = params_instance_type
)
) +
facet_wrap(~classical_optimiser)
} else if (input$color == "classical_optimiser") {
p <- d_runs() %>%
ggplot(aes(
x = as.factor(params_n_qubits.qaoa),
y = metrics_energy,
col = classical_optimiser
))
}
if (input$plot_type == "box" ) {
p <- p + geom_boxplot()
} else if (input$plot_type == "violin") {
p <- p + geom_violin()
}
p +
theme_minimal() +
labs(x = "Qubit",
y = "Energy")
})
})