bcgov / groundwater-levels-indicator

R scripts for an indicator on long-term trends in groundwater levels in B.C. published on Environmental Reporting BC
Apache License 2.0
19 stars 7 forks source link

Implement interactive data visualization using R & R Markdown #7

Closed stephhazlitt closed 5 years ago

stephhazlitt commented 6 years ago

This issue is a paid opportunity through the BCDevExchange. To apply, visit the opportunity page and submit a proposal by 16:00 Pacific Time, Wednesday, September 26, 2018.


Remake and simplification of existing D3 (JavaScript) interactive data visualization reporting Trends in Groundwater Levels using R and R Markdown.

See the existing D3 (JavaScript) Trends in Groundwater Levels interactive data visualization: Trends in Groundwater Levels - Environmental Reporting BC. The remake project will result in a data visualization with only some of the current functionality maintained—an interactive map with markers, tooltip on hover and a modal window with pre-prepared content on click. The remake will also involve a few enhancements, such as including natural resource region polygons on the map and adding direct links in an observation well modal window to the Groundwater Level Data Interactive Map.

Data Visualization Design/Layout

Datavis design should include a larger version of the existing map showing observation well markers coloured by trend category, with natural resource region polygons (enhancement). It should be 900px wide, and not more than 900px high.

image image

Functionality

The British Columbia summary pie and bar charts in the existing interactive data visualization will not be included in the remake—they will appear elsewhere in future versions of the indicator.

Technologies

Resources

stephhazlitt commented 6 years ago

Hi folks, I am the contact for this Code With Us opportunity. Please post any questions you have here and I'll do my best to respond promptly.

iuriishamkin commented 6 years ago

Hello Stephanie,

Is it possible to get a copy of your print template for the markdown file? envreportutils.internal::print_ver is not accessible.

Sincerely, Iurii

stephhazlitt commented 6 years ago

Hi @iuriishamkin, thanks for your question. Unfortunately the print template is in one of our internal packages. If you replace output: envreportutils.internal::print_ver with output: pdf_document the Rmd should knit for you?

iuriishamkin commented 6 years ago

@stephhazlitt I've already done! Thanks for a prompt reply.

I was getting this error so I thougth theme was edited by a template:

Error in width_cm(guide$keywidth %||% theme$legend.key.width %||% theme$legend.key.size) : Unknown input

ateucher commented 6 years ago

Hi @iuriishamkin - just stepping in here for @stephhazlitt as she's unavailable today. The Rmd renders for me without the template (the template doesn't change anything with respect to ggplot2 themes so I think your error is unrelated to the template).

Have you installed the envreportutils pacakge (remotes::install_github("bcgov/envreportutils"))? That package does define themes and is available publicly.

Cheers, Andy

iuriishamkin commented 6 years ago

@ateucher you're completely right!

This issue was caused by missing API key for get_googlemap() calls in 04_output.R. Because of that summary_map wasn't initialized properly.

Maybe it's worth adding a mention about a key in the comment for those not familiar with this API? Also, xtable library used in markdown file is missing in the package list. Just a heads up.

Regards, Iurii

ateucher commented 6 years ago

Ok, nice sleuthing @iuriishamkin. I think the requirement for a Google Maps API key for ggmap is new; I believe Google used to let you do a certain number of queries without one. We will document that.

iuriishamkin commented 6 years ago

@ateucher my pleasure! It's an interesting project to dig into.

stephhazlitt commented 6 years ago

Thanks to everyone for your interest in helping us out with this Code With Us opportunity.

The opportunity closed on September 26th—we received 8 proposals. All proposals were scored against the proposal evaluation criteria. The opportunity has been assigned to @steffilazerte who had the highest scoring proposal.

If you would like feedback on your proposal, please feel free to contact me at the email address in my @stephhazlitt profile.

Thanks again to everyone.

ateucher commented 5 years ago

This is complete as of #4