terraref / traitvis-webapp

Shiny application for visualizing trait data
https://traitvis.workbench.terraref.org/
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

Add url parameter support #49

Open kimberlyh66 opened 5 years ago

kimberlyh66 commented 5 years ago

This addresses #45.

Users can pass in the following parameters to the /search route url:

Home page url: http://127.0.0.1:6309/#!/

Example search url: http://127.0.0.1:6309/?exp_name=MAC+Season+1&subexp_name=Biomass&var=Canopy+Height+(cm)&cultivar=None&date=2016-07-14#!/search

kimberlyh66 commented 5 years ago

This pull request does not include the repeatability plot (pull request #54) or trait plot caption (pull request #51).

To add trait plot caption, add the following to line 44 of the render-trait-plot.R file

caption = paste0('caption text - see pull request #51'),.

To add repeatability plot, add the code from render_rep_plot function (from pull request #54) to a separate file named render-rep-plot.R. The code and parameters may have to be modified as the code used to get selected variable and cultivar used to subset full cache data is different for search page versus home page. Since there may be differences, a render_home_rep_plot and render_search_rep_plot function will need to be created (for generation of output). These functions should be placed in render_home_outputs.R and render_search_outputs.R and called in render_subexp_output (for home page) and render_search_output (for search page).

The repeatability plot output id for each page should be added to render_subexp_ui and render_search_ui. For example, the home page repeatability plot output id (plotOutput(paste0('rep_plot_', id_str))) should be added to render_subexp_ui function at line 64.

KristinaRiemer commented 5 years ago

When I go to the example URL, the below screenshot is what I see. Is that what it's supposed to look like? I guess I was expecting it to still have all the season tabs at the top, drop down menus, etc.

Screen Shot 2019-11-08 at 9 07 55 AM

All the merge conflicts would be fairly straightforward to deal with, if we're going to merge this pull request. If we're making a new one, I think the file organization with the new R scripts should be in a separate pull request from the URL stuff.

dlebauer commented 5 years ago

I had asked her to merge the map and plot tabs. If the merge conflicts are straightforward to resolve that would be fantastic!

dlebauer commented 5 years ago

Whether combining these plots on the main app is a good idea for UI is an open question that you are welcome to use your judgment or get feedback on (eg on the slack channel, from specific people, etc)