Skip to content

Commit 541f579

Browse files
committed
update
1 parent 35e35fd commit 541f579

File tree

5 files changed

+36
-65
lines changed

5 files changed

+36
-65
lines changed

Examples/Movies/server.R

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,37 @@
1-
## Make histogram of movie ratings
2-
3-
## Add data
4-
# This example is using the movies data (built into ggplot)
1+
# server.R
52
x = movies$rating
63
minx = min(x)
74
maxx = max(x)
85

96
shinyServer(function(input, output) {
107
output$trendPlot <- renderGraph({
11-
#pull number of bins from the ui
128
bins <- input$bins
13-
14-
# draw the histogram with
15-
# the specified number of bins
16-
trace1 <- list(
17-
x = x,
18-
autobinx = FALSE,
19-
xbins = list(
20-
start = minx,
21-
end = maxx,
22-
size = ((maxx-minx)/bins)
23-
),
24-
type = "histogram"
25-
)
26-
27-
# define data
9+
trace1 <- list(x = x,
10+
autobinx = FALSE,
11+
xbins = list(start = minx,
12+
end = maxx,
13+
size = ((maxx-minx)/bins)
14+
),
15+
type = "histogram"
16+
)
17+
2818
data <- list(trace1)
29-
# define layout information
30-
layout<- list(xaxis =
19+
layout<- list(xaxis =
3120
list(title = "Ratings",
32-
range = c(minx, maxx),
33-
autorange=FALSE,
34-
autotick=FALSE,
35-
tick0=minx,
36-
dtick= ((maxx-minx)/bins )))
37-
38-
# This sends message up to the browser client, which will get fed through to
39-
# Plotly's javascript graphing library embedded inside the graph
21+
range = c(minx, maxx),
22+
autorange = FALSE,
23+
autotick = FALSE,
24+
tick0 = minx,
25+
dtick = ((maxx-minx)/bins)
26+
)
27+
)
28+
4029
return(list(
41-
list(
42-
id="trendPlot",
43-
task="newPlot",
44-
data=data,
45-
layout=layout
46-
)
30+
list(id = "trendPlot",
31+
task = "newPlot",
32+
data = data,
33+
layout = layout
34+
)
4735
))
4836
})
4937
})

Examples/Movies/shinyapps/chelsea/Movies.dcf

Lines changed: 0 additions & 4 deletions
This file was deleted.

Examples/Movies/ui.R

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
# Define UI for application that draws a histogram
1+
# ui.R
22
shinyUI(fluidPage(
3-
4-
# Application title
5-
titlePanel("Movie Ratings!"),
6-
7-
# Sidebar with a slider input for the number of bins
8-
sidebarLayout(
9-
sidebarPanel(
10-
sliderInput("bins",
11-
"Number of bins:",
12-
min = 1,
13-
max = 50,
14-
value = 10)
15-
),
16-
17-
# Show a plot of the generated distribution
3+
titlePanel("Movie Ratings!"),
4+
sidebarLayout(
5+
sidebarPanel(
6+
sliderInput("bins",
7+
"Number of bins:",
8+
min = 1,
9+
max = 50,
10+
value = 10
11+
)
12+
),
1813
mainPanel(
19-
graphOutput("trendPlot")
14+
graphOutput("trendPlot")
2015
)
2116
)
2217
))

Examples/UN_Advanced/shinyapps/chelsea/UN_Advanced.dcf

Lines changed: 0 additions & 4 deletions
This file was deleted.

Examples/UN_Simple/shinyapps/chelsea/UN_Simple.dcf

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)