In this project, I'll practice building an a multi-tab Shiny application. The final product should look like this:
The Map panel is already built for you to model. Your scatter panel should enable users to search for a state in the scatterplot.
Your server.R
file already loads the data you need, as well as scripts for building a map and a scatter plot. Inside your shinyServer
, you should do the following:
- Create a
scatter
property on youroutput
object. That property should be arenderPlotly
object that returns a scatterplot (build_scatter
) - Make sure to pass your data and search string (i.e.,
input$search
) to yourbuild_scatter
function.
Your ui.R
file already has a tabPanel
built displaying your map. In this section, you should add another tabPanel
for your scatter-plot by doing the following:
- Create a
tabPanel
to show your scatter plot - Add a
titlePanel
to your tab - Create a
sidebarLayout
for this tab (page) - Create a
sidebarPanel
for your controls - In your
sidebarPanel
, make atextInput
widget for searching for a state in your scatter plot - Create a
mainPanel
, in which you should display your plotly Scatter plot