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:
Would surveyDataI() depend directly on input$hexSize, or would you need to click the Apply button first? I think the latter would be more consistent with the rest of the current app functionality, but it might be harder to code.
Not sure if a three-way toggle widget exists (on the UI design side of things). Maybe check shinyWidgets? If not, then maybe we want radio buttons. Horizontal? Vertical?
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: