Watts-College / paf-513-template

https://watts-college.github.io/paf-513-template/
MIT License
0 stars 0 forks source link

Dashboard Issue #22

Open pmorrizonaz opened 6 months ago

pmorrizonaz commented 6 months ago

I'm trying to create a new tab for my dashboard with a bar chart showing the number of accidents just on Mill Ave (y axis) by day of the week (x axis), with a user input to filter by time of day. However, when I run the dashboard, the user input option doesn't even show up on the sidebar, only the bar graph on its own. Here's my code:

`Accidents on Mill Ave by Day of Week

Inputs {.sidebar}


selectInput(inputId = "hourx", 
            label = h3("Time of Day"), 
            choices = c("0","1","2","3","4","5","6","7","8","9","10","11",
                        "12","13","14","15","16","17","18","19","20","21","22","23"),
            selected = "12")

Outputs


renderPlot({

  d5 <- dat %>%
    filter(hour == input$hourx[1])

  ggplot(data = d5, mapping = aes(x=d5$day, y=d5$StreetName == "Mill Ave")) +
    geom_col() +
    labs(title="Number of Accidents on Mill Ave by Day and Time",
         x = "Day of Week",
         y = "Number of Accidents on Mill Ave")

})

I have also included a screenshot to show what the tab looks like. Also, the graph is currently showing days on the x axis by alphabetical order instead of chronological order, any help on how to fix that would also be appreciated. @JasonSills dashboard-graph-issue

pmorrizonaz commented 6 months ago

Nevermind, the user input for hour of day is working and was working the entire time. The menu at the top of the dashboard with all of the tab options was just covering the adjustor. Once I adjusted the size of the window, it is viewable.

pmorrizonaz commented 6 months ago

I also figured out how to re-organize the days so that they're in the proper order, sorry for possibly bothering you haha

JasonSills commented 6 months ago

@pmorrizonaz Great job problem solving!

swest235 commented 6 months ago

@JasonSills @pmorrizonaz

I'm noticing a similar issue, not everything shows up on my laptop screen with a full window, it cuts off sections without there being a scroll bar.

Is this just a downside to Shiny or is there something to input in the code that allows the dashboard to 'shrink to fit' on the screen it is on?

When I load it on my larger external monitor it works fine, but on my laptop, it cuts sections out. It wouldn't be concerning except that there is no way to scroll to the side and see the covered areas.

JasonSills commented 6 months ago

@swest235

There isn't code to adjust text sizes (that I'm aware of, could always exist!). I've noticed that sometimes publishing to Shiny will take care of the issue, but most of the time it is reducing the amount of text and the length of name in a tab that fixes the issue.