kaijagahm / ygdpDashboard

Interactive dashboard for YGDP survey data
3 stars 0 forks source link

(INT) Add toggle for different sized hexes #21

Open kaijagahm opened 3 years ago

kaijagahm commented 3 years ago

In the R script "idw_hex_interpolation.R", I generated hex grids of three different sizes from the continental US shapefile: large hexes, medium hexes, and small hexes.

I saved these as lists (interpListLarge.Rda, interpListMedium.Rda, interpListSmall.Rda) and as data frames (interpDFLarge.Rda, interpDFMedium.Rda, interpDFSmall.Rda) in "R/data/outputs/".

I had originally envisioned having a toggle option in the interpolation tab to toggle between the three different hex sizes. As of writing this (2020-12-08), I've written the app just with the large hexes. I may switch that to the medium ones. But eventually, I think it would be nice to have the option.

I haven't though through how to do this in detail. I think it would have to be a pretty high-level toggle, since the hex-associated data comes into play pretty early in the reactivity graph for interpolation mode. As soon as you define surveyDataI(), you're already creating a dependency on interpDFLarge (or whichever one is being used).

So, this really might be as simple as creating a three-way branching if/else decision point at the point of defining the surveyDataI() object, and then hooking that up to a three-way radio button selector (let's call it input$hexSize) at the bottom of the menu. But it might get more complicated. I'm not sure.

Also think about: