-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
50 lines (45 loc) · 1.1 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
function(input, output){
df_1 <- reactive({
construct_df1(a = input$a,
b = input$b,
n = input$points)
})
pch_type <- reactive({
as.integer(input$pch_input)
})
color_1 <- reactive({
input$bgcolor
})
color_2 <- reactive({
input$ptcolor
})
p_size_1 <- reactive({
input$point_size
})
output$plot1 <- renderPlot({
Sys.sleep(1)
ggp_f(DF = df_1(), pch = pch_type(), p_size = p_size_1(), c1 = color_1(), c2 = color_2())
})
output$dwn_plot_1 <- downloadHandler(
filename = function(){
paste('phyllotaxis_plot', 'png', sep = '.')
},
content = function(file){
ggsave(filename = file,
plot = ggp_f(DF = df_1(), pch = pch_type(), p_size = p_size_1(), c1 = color_1(), c2 = color_2()),
device = 'png')
}
)
output$table1 <- renderDataTable({
Sys.sleep(1)
datatable(df_1())
})
output$dwn_data_1 <- downloadHandler(
filename = function(){
paste('phyllotaxis_data', 'csv', sep = '.')
},
content = function(file){
write.csv(df_1(), file)
}
)
}