File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ # git checkout feature/transmit
2+ # R CMD install ./
3+
4+ library(shiny )
5+ library(plotly )
6+
7+ ui <- fluidPage(
8+ plotlyOutput(" plot" ),
9+ verbatimTextOutput(" click" )
10+ )
11+
12+ server <- function (input , output , session ) {
13+
14+ output $ plot <- renderPlotly({
15+ # specify some map projection/options
16+ g <- list (
17+ scope = ' usa' ,
18+ projection = list (type = ' albers usa' ),
19+ lakecolor = toRGB(' white' )
20+ )
21+ plot_ly(z = state.area , text = state.name , locations = state.abb ,
22+ type = ' choropleth' , locationmode = ' USA-states' ) %> %
23+ layout(geo = g )
24+ })
25+
26+ output $ click <- renderPrint({
27+ d <- event_data(" plotly_click" )
28+ if (is.null(d )) " Click on a state to view event data" else d
29+ })
30+
31+ }
32+
33+ shinyApp(ui , server )
You can’t perform that action at this time.
0 commit comments