Add 7-day rolling average trendline to daily plots
Closed this issue · 4 comments
Original starting point: Modify the function plot_daily
in order to add a toggle-able 7-day average. Toggle-able like clicking a line on the plotly graph, not using a shiny button.
I was able to add the 7-day rolling average (using the same rollapply
function from the zoo package), which was used in the flattening plots function for the dashboard. This was made "toggle-able" (superb word by the way) through Plotly legend traces (in addition to a toggle-able trace for the daily bar plot).
Additionally, I added the range slider()
function to plot_daily
as a possible feature to add.
See the branch "daily-plots".
@kbelisar, I removed the range slider for now, but this offers a pathway to potentially replacing the filtering sidebar in shiny with something in plotly in the future. Could be worth creating a separate issue.
Updated the legends and plot titles
Merged with main!