-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
94 lines (84 loc) · 2.13 KB
/
app.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
library(shiny)
library(DT)
library(tidyverse)
library(ggplot2)
library(bslib)
library(shinycssloaders) # withSpinner
library(pufr)
# References
# https://github.com/gpilgrim2670/SwimMap/blob/master/app.R
# Exporting the results of a table
# https://stackoverflow.com/questions/44504759/shiny-r-download-the-result-of-a-table
theme_set(
theme_minimal(base_family = "Inter", base_size = 18) +
theme(text = element_text(size = 24))
)
# crp_data <- read_rds("/path/to/test_data.rds")
about_text <- "
# What is PUFVis?
PUFVis is a shiny app to calculate, explore and visualize in detail Physical Unclonable Function metrics.
# References
[PUFR](https://servinagrero.github.io/pufr)
"
ui <- fluidPage(
## includeCSS("main.css"),
## theme = bs_theme(version = 5, bootswatch = "minty"),
navbarPage("PUF METRICS",
theme = bs_theme(
bootswatch = "zephyr",
base_font = font_google("IBM Plex Sans"),
code_font = font_google("JetBrains Mono")
),
tabPanel("Exploration",
fluid = TRUE,
titlePanel("Responses exploration"),
mainPanel(
DTOutput("tbl"),
downloadButton("exportMetrics", "Export metrics to CSV"),
)
),
tabPanel("Metric Summary",
fluid = TRUE,
titlePanel("PUF Metrics"),
sidebarLayout(
sidebarPanel(
hr(),
sliderInput(
inputId = "DivCompRankA",
label = "Top Times Range:",
min = 1, max = 3500,
value = c(1, 250)
),
),
mainPanel(
## helpText("Which devices and regions to show"),
plotOutput("dataHist"),
)
)
),
tabPanel("Load data",
fluid = TRUE,
titlePanel("Load Data")
),
tabPanel("About",
fluid = TRUE,
markdown(about_text)
)
)
)
server <- function(input, output) {
output$tbl <- renderDT(
iris,
options = list(lengthChange = FALSE)
)
output$exportMetrics <- downloadHandler(
filename = function() {
"metrics.csv"
},
content = function(fname) {
write.csv(data.frame(), fname)
}
)
}
# Run the application
shinyApp(ui = ui, server = server)