-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Main ui & server functions #149
Comments
Hey @jonthegeek, your recommendation makes sense. To re-phrase, we want to replace lines of code like I think when I wrote this, I had assumed we'd one day add a study drop down filter. I'm still quite curious how the user will select the study they're interested in, but that's a discussion for another day. |
Oh let's hold off on this for now. I'm pretty sure we're going to end up making (most of?) the input data reactive so it can be updated automatically via a database connection (for example). Assuming we do, we'll need to set everything in the server still, so we'll undo some of the stuff this ticket calls for. I think our server generator should return a server function (with the reactive inputs "baked in"), but that will be a small change overall (slightly changing where some pieces of the call occur), but I need to look at the code to figure out exactly what I mean by that 😊 |
Updated thought: We should pass |
Feature Details
The functions that are currently
ui
andserver
should takedfResults
,dfGroups
,dfMetrics
, anddfBounds
as arguments, and return the resultingui
object andserver
function, respectively. By initializing a "raw" ui and then updating with the data, we're making the app slower and more fragile than it needs to be. All the data checking can happen when the app launches overall; it doesn't need to happen per-user (which is what we're doing right now). Likewise, we shouldn't have code in the server that goes to each user that handles what to do whendfGroups
loads for the first time, because that is always the same (for every user); we can set that stuff up in theui
itself.While we're at it, these functions should have more-specific names, to avoid collisions. Our
ui
function builds a gsm-specific UI, sogsm_ui
orinitialize_gsm_ui
would be more appropriate. Similarly, ourserver
function is a gsm-specific server function, sogsm_server
orinitialize_gsm_server
is more appropriate.Example Code
Possible Implementation
This can be rough to wrap your mind around, particularly for the server function, since we'll return a function, which has data built into it. But it will make things run much better/cleaner.
Additional Comments
The text was updated successfully, but these errors were encountered: