Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Milestone 05 #44

Closed
19 tasks done
dy-lin opened this issue Mar 25, 2020 · 13 comments
Closed
19 tasks done

Milestone 05 #44

dy-lin opened this issue Mar 25, 2020 · 13 comments

Comments

@dy-lin
Copy link
Member

dy-lin commented Mar 25, 2020

Milestone 05

  • Update your dashboard proposal based on TA feedback (see issue Milestone 4 Feedback #46)
  • Create the dashboard you proposed to do for your dataset

Task 1: Build your dashboard (80%)

Exploration Tab

At minimum your dashboard must have:

  • clear headings, labels, instructions for use (using html and/or markdown components)
  • some type of motivation for what the dashboard is supposed to do, or what questions it can help you answer
  • at least two plots (using dccGraph and ggplot2 with ggplotly)
  • a minimum of two core components
  • a minimum of two callbacks
  • an aesthetically pleasing layout (you can use the examples or make your own)

You are encouraged (but not required) to try:

  • Adding hover and tooltip features
  • Tabs

Linear Regression Tab

At minimum your dashboard must have:

  • clear headings, labels, instructions for use (using html and/or markdown components)
  • some type of motivation for what the dashboard is supposed to do, or what questions it can help you answer
  • at least two plots (using dccGraph and ggplot2 with ggplotly)
  • a minimum of two core components
  • a minimum of two callbacks
  • an aesthetically pleasing layout (you can use the examples or make your own)

You are encouraged (but not required) to try:

  • Adding hover and tooltip features
  • Cross-filtering
  • Tabs

Examples of Dashboards in R

To give you some ideas of how your final dashboard looks like, here are a few examples of Dashboards in R by former students:

@dy-lin
Copy link
Member Author

dy-lin commented Mar 25, 2020

I was thinking we could follow the same pattern as we've done so far (I'll do exploration and you'll do linear regression). However, instead of the radio buttons Exploration or Linear Regression that we had planned in our sketch, I was thinking we could make use of tabs instead, like in the Job Analyzer dashboard:

image

I will most likely finish my portion by Friday night and then you can work on it then. I'm not sure how it'll work since we will both be working on the same file app.R and committing to our shared repo (not our forks). I think it would be better if we work at separate times to avoid huge merge conflicts, or just to commit often but don't push or pull often?

@Nima-Jamshidi
Copy link
Collaborator

@dy-lin Sorry, Yulia asked me to share my screen. I coudln't respond to you in repl. I got you. We totally misread Firas's point:))

@dy-lin
Copy link
Member Author

dy-lin commented Mar 26, 2020

Haha yeah, no worries! Since we'll be working on our forks, I'm going to reverse app.R to what it was for milestone 04, and we can both sync the forks and start fresh :)

@dy-lin
Copy link
Member Author

dy-lin commented Mar 28, 2020

I have addressed some of Yulia's feedback from Issue #46:

  • add some text to the correlation plot to help understand interpretation
  • merge the grouped bar chart and the stacked bar chart into one plot by adding x-axis options
  • add some source and motivation (from introduction of report)

@dy-lin
Copy link
Member Author

dy-lin commented Mar 28, 2020

Since the dashboard criteria has already been fulfilled on my part, I suppose it isn't as important that your part also contains two callbacks, etc.

I have written in the app.R file (which I will create and accept a pull request for soon), where your part will go in app$layout, labelled #### NIMA'S PART ####. On your tab, I've already added my reset button, the viridis toggle, and a theme selector. It will be up to you to implement them in your plotting functions.

to avoid reuse of variable names, here are the ones that I've already used:

age_plot
app
authors
corr_diag
corr_label
corr_layout
corr_plot
costs
data
data_desc
data_table
facet_plot
feat_dd
final_table
get_lower_tri
get_upper_tri
header
information
make_age_plot
make_cor_plot
make_facet_plot
master_toggles
melted_costs
one_plot
p1
p2
p4
plot1
plot1_cap
plot1_full
plot2
plot2_cap
plot2_full
plot3
plot3_cap
plot3_full
research_question
reset_button
rm_diag
tab1_bottom_half
tab1_page
tab1_sidebar_bottom
tab1_sidebar_top
tab1_top_half
tab2_page
theme_dd
themes
title
two_plots
vars
viridis_button
x_dd
xaxis_val

Some variables above will be referring to shared variables, but hopefully this list makes your part a bit easier.

I've organized the script into the usual structure we've seen in class. The script is long, so I've used this style comment header:

## HEADER ----

This creates a 'section' (more info here: https://support.rstudio.com/hc/en-us/articles/200484568-Code-Folding-and-Sections). By adding 4 dashes after the comment, it creates a 'section' that will show up in RStudio's 'table of contents'. Unfortunately the images in that link are corrupted. Basically, using the folding will allow you to see a 'table of contents' by clicking the top right icon next to 'source'.

Screen Shot 2020-03-27 at 8 11 47 PM

By going to Edit > Folding > Collapse/Expand you can collapse or expand the sections. Hopefully this will keep things more organized until we can split them into scripts and source them.

Let me know if you encountered any issues with the dashboard. Maybe I can save you some time if it's an error I've encountered!

I've attached some screenshots of what it currently looks like to give you an idea:
Screen Shot 2020-03-27 at 8 15 41 PM
Screen Shot 2020-03-27 at 8 15 51 PM
Screen Shot 2020-03-27 at 8 16 01 PM

Problems that still need to be addressed:

  • the reset button does reset the graphs (undos all the user-selected parameters, but the physical buttons themselves do not seem to change
  • what this means is, while the viridis button is on, I can hit reset, and the graphs themselves will be no longer viridis. But the toggle itself is still 'on', which means the next selection the user makes (e.g. using a dropdown), will result in viridis to be turned back on since the switch is physically still left on
  • I already created an issue about this in the Discussion repo, waiting on a response.

I will tag you once I've created the pull request and merged it so you can run app.R and see the dashboard for yourself.

@dy-lin
Copy link
Member Author

dy-lin commented Mar 28, 2020

@Nima-Jamshidi, I have merged the pull request for app.R tab1. I am considering my part finished, and will not work on it anymore to avoid any merge conflicts. Once you are also done, we can move portions of our app.R to dash_components.R and dash_functions.R to make the script easier to manage.

Remember to sync your fork before you start:

git fetch upstream
git merge upstream/master

@dy-lin
Copy link
Member Author

dy-lin commented Mar 31, 2020

Hi @Nima-Jamshidi, how are you doing with tab2? If you are having difficulties and cannot finish in time, you can remove the reset and viridis toggles from your tab and just leave them out.

@Nima-Jamshidi
Copy link
Collaborator

Nima-Jamshidi commented Mar 31, 2020

Hi @dy-lin , I have been working on it. Sorry, I couldn't update you sooner. Check the app, please. By the way, I edited your section a bit. Sorry for not asking beforehand. I just used do.call function to reduce the lines and automize part of your plots. I thought that it's a nifty feature that could make the scripts clearer.
What's your opinion on my tab? Feel free to edit and add to it. I mostly worked on the callbacks. For example, when you deselect a variable on the checklist, its option at the bottom of the page gets disabled. Also, I made the app to at least choose three variables for the regression model by disabling to uncheck the boxes when only 3 boxes are checked on the checklist.
I also included default values for the options in the bottom box, which was a massive headache since the boxes would get enabled and disabled by changes in the checkbox and would disrupt them.

@dy-lin
Copy link
Member Author

dy-lin commented Mar 31, 2020

Looks great! I didn't know about the do.call command, and for some reason was having issues with case_when. I like that you moved the relevant sidebar components to the corresponding graph.

I'm going to try and fix my reset button, but if that doesn't work I will just leave it, tag it, and submit it. The reset button works to reset the graphs, but currently does not reset the other components (i.e. does not reset the dropdown, checkboxes, etc.)

@dy-lin
Copy link
Member Author

dy-lin commented Mar 31, 2020

@Nima-Jamshidi, I am waiting for Firas to help me out with resetting the reset button in this issue. If he does not get back to me in time, I will just leave the reset button out of the app$layout so it cannot be clicked (i.e. n_clicks will always be zero) and leave the callbacks as is.

As I understand after submission tonight, we will receive feedback from a TA, so there is still wiggle room for modifying the dashboard should Firas reply after the deadline today. So if he replies in time and I am able to implement by tonight's deadline, I will-- if not, I'll temporarily remove the reset button, tag the release and submit our link.

@Nima-Jamshidi
Copy link
Collaborator

@dy-lin I solved the issue with reset-button. Check it out. There is still a bug. The corrplot does not update similar to other plots when reset-button is clicked. I do not know the reason for that.
Also, Firas apologized for the problem with the in-class feedback problem. He said he himself can give us feedback on our project. I will create a release and an issue for him to write down his feedback.
If you want to change anything with the project, feel free to do that and please submit it to Canvas afterward.

@dy-lin
Copy link
Member Author

dy-lin commented Mar 31, 2020

Hi @Nima-Jamshidi Thanks for fixing the reset button, after my most request merge, the corrplot seems to be updating on my end. I'll tag a 5.1, and you can check if it updates on your end?

@dy-lin
Copy link
Member Author

dy-lin commented Mar 31, 2020

I'll submit the tagged release to canvas for now. If we end up making more changes we can just resubmit on Canvas I believe.

@dy-lin dy-lin closed this as completed Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants