USGS-R / wateRuse

Moved to: https://code.usgs.gov/water/water-use/wateruse
https://code.usgs.gov/water/water-use/wateruse
Creative Commons Zero v1.0 Universal
7 stars 11 forks source link

Shiny App Cleanup Tasks #75

Closed dblodgett-usgs closed 8 years ago

dblodgett-usgs commented 8 years ago

@ldecicco-USGS, @cadieter-usgs, and @mamaupin-usgs will enumerate and pass off to others.

@rwdudley-usgs will lead, @jshourds-usgs will review.

cadieter-usgs commented 8 years ago

Add the function to allow the mouse hover to get the area name (i.e. county) and data element value on the choropleth maps. Let me know if you want me to move this to a different issue.

ldecicco-USGS commented 8 years ago

I did add a hover to the map. It's not super great, but it seems to work most of the time.

ldecicco-USGS commented 8 years ago

@rwdudley-usgs and @jshourds-usgs and @cadieter-usgs and @mamaupin-usgs Why don't you guys start by using this GitHub issues to log the bugs that appear in the latest version of the shiny app. Don't add requested new features (you can create new issues for that). When we have a few issues, I'll try to help @rwdudley-usgs walk through the first batch of troubleshooting. Then he should be able to go from there.

rwdudley-usgs commented 8 years ago

Hi @ldecicco-USGS I'm back from vacation. I'm probably missing some items but right now I identify the following Shiny-related tasks:

Others? I have yet to review the Shiny code; I may need a tutorial...

ldecicco-USGS commented 8 years ago

I'd start by playing around with the app itself (not necessarily try to dig into the code immediately). Like, if you have different water use data sets, try those all out. When we do find a few issues, we can get a web ex set up to sort out what all is going on....

rwdudley-usgs commented 8 years ago

Will do.

ldecicco-USGS commented 8 years ago

I restructured the app a bit. Now, each tab has it's own file. @rwdudley-usgs , I think you could copy the file "inst/plotMultiElem.R", and try to make a new one for the new box plot function. Then on the ui.R file, you'll need to add a new tab. Copy the multiElement tab here:

https://github.com/USGS-R/wateRuse/blob/master/inst/shiny/ui.R#L59

So copy this part:

     tabPanel(title = tagList("Multi-Elements",shiny::icon("bar-chart")),
              value = "multiElem",
              fluidRow(
                column(9, 
                       plotOutput("plotMultiElem",width = 500, height = 500))

              ),
              h4(""),
              fluidRow(
                column(3, downloadButton('downloadPlotmultiElem', 'Download PNG')),
                column(3, downloadButton('downloadPlotmultiElemPDF', 'Download PDF')),
                column(3, downloadButton('downloadPlotmultiElemData', 'Download Data'))
              ),
              h4("R Code:"),
              verbatimTextOutput("plotMultiElemCode")
     ),

Change all the id's to something about boxplots. Give it a little try, and if you get confused, let me know.

rwdudley-usgs commented 8 years ago

Ok, I'll give it a go! I've been doing some testing and have discovered some Shiny bugs/features I'll post in a bit.

ldecicco-USGS commented 8 years ago

Sounds good. Make sure to pull from upstream first!

rwdudley-usgs commented 8 years ago

Shiny bugs (or features) for the first three functions (testing in Chrome browser). I have yet to methodically test the other functions. The first couple items common to all three I checked might not be considered bugs - common theme is lack of persistence of selections that users might expect. For example, for the first item below, one might choose PS.SWPop for one state, then switching to look at another state, the data.element changes to PS.GWPop instead of remaining PS.SWPop.

ldecicco-USGS commented 8 years ago

I edited your comment so I could respond...

ldecicco-USGS commented 8 years ago
  1. Yes, when changing the State or the actual data file, everything resets. This was done to check that everything in all the dropdowns actually correlates to some data. So a user can't pick something that doesn't exist
  2. Yes, it's much, much easier this way from a coding standpoint. It might be possible to create a key and retain what was in the previous state (I don't think you can count on the same orders....but may you can). Also, a lot of data sets only have the option "Area"...so I don't think it's much of an issue?
  3. That can be done
  4. You have to pick a different Data Element Type first (?...I think that's what you are describing). It sounded like people wanted the "type" filtered to make picking the specific elements a more manageable list. If that's not what you are talking about, let me know...it works to me at least.
  5. Same as above.
ldecicco-USGS commented 8 years ago

Ha, nevermind! I do now see 4 and 5...I think I can fix that pretty quick.

ldecicco-USGS commented 8 years ago

3, 4, and 5 should be OK now. 1 and 2 in my opinion are not worth the effort, but if it's a big deal...we can work on it.

rwdudley-usgs commented 8 years ago

Great! Thanks. I also think 1 and 2 are not a big deal.

grrmartin-USGS commented 8 years ago

In the Multi-Elements graph, when you pick the second Data Element Type y/Data Element y, it only wants to use the first entry on the Data Element y: pick list: (No mater what you pick, it reverts to the first item on the list.) This seems to be the same issue as number 4 above.

multielementissuecapture

grrmartin-USGS commented 8 years ago

Unable to deselect areas (graph remains same). Choose Areas/Click Here to Select Areas/Deselect All/

deselectareaissuecapture

ldecicco-USGS commented 8 years ago

The Select All and Deselect All won't work until you then click the "Click Here to Switch Areas". This is because when I had it doing it on the fly for bigger data sets (lots of "areas" be it counties, aquifers, HUCs), the app would go a little crazy trying to switch areas too fast (if the user clicked the buttons too fast, the previous calculations were still going on, then the code would get all confused and freeze up).

ldecicco-USGS commented 8 years ago

@grrmartin-USGS I think if you do another pull from upstream, the select issue you mentioned is fixed:

git pull upstream master
jshourds-usgs commented 8 years ago

So this is pretty picky but when uploading the regional dump file and playing around in shiny, is there any way we can list states in alphabetical order? I think selecting state would be easier that way. No offense to Wisc which shows up first... ;-) I checked the indiv dump files and they are listed in alphabetical order so I'm not sure how this comes about. Thanks!

jshourds-usgs commented 8 years ago

Sort of the same as above, when choosing the years to plot they should be in order, either newest to oldest or oldest to newest available. We may not be at this nitpicky stage yet so this can serve as a placeholder.

ldecicco-USGS commented 8 years ago

I just merged a pull request that I think should order the states and years a bit better (or worse, if you like WI on top...)

jshourds-usgs commented 8 years ago

Yay-- looks fabulous! Thank you @ldecicco-USGS ! And not to worry, WV and WY are the very bottom of the barrel!

ldecicco-USGS commented 8 years ago

I'm going to close this Issue. If new bugs come up, make a new Issue for the specific bugs, and assign to @rwdudley-usgs