-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathserver.R
More file actions
44 lines (38 loc) · 1.35 KB
/
server.R
File metadata and controls
44 lines (38 loc) · 1.35 KB
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
# ------------------------
# Author: Nicolas Durrande
# ------------------------
library(shiny)
source('catapultSettings.R')
source('catapultFunctions.R')
# Define server logic required to plot various variables against mpg
shinyServer(function(input, output) {
# plot catapult settings
output$catapultPlot <- renderPlot({
# source('catapultSettings.R')
# source('catapultFunctions.R')
Fact <- c(input$Fact1,input$Fact2,input$Fact3,input$Fact4)
cat <- computeCatapult(Fact,0)
par(mar=c(0,0,0,0),mfrow=c(1,2))
plot(c(-25,5),rep(-widthBall,2),ylim=c(-5,20),type='l',asp=1,ylab='',xlab="",axes=FALSE)
plotCatapult(cat,lightBlue,darkBlue)
thetaMax <- maxAngle(Fact)
cat <- computeCatapult(Fact,thetaMax)
plot(c(-25,5),rep(-widthBall,2),ylim=c(-5,20),type='l',asp=1,ylab='',xlab="",axes=FALSE)
plotCatapult(cat,lightBlue,darkBlue)
par(mfrow=c(1,1))
})
# Action
observeEvent(input$action, {
output$trajectoryPlot <- renderPlot({
Fact <- c(input$Fact1,input$Fact2,input$Fact3,input$Fact4)
runExperiment(Fact,input$wind,plot='new')
})
})
output$trajectoryPlot <- renderPlot({
Fact <- c(input$Fact1,input$Fact2,input$Fact3,input$Fact4)
runExperiment(Fact,input$wind,plot='new')
})
output$text1 <- renderText({
c(input$Fact1,input$Fact2,input$Fact3,input$Fact4,input$wind)
})
})