Skip to content
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

variable UI elements #47

Closed
datalies opened this issue Nov 28, 2012 · 2 comments
Closed

variable UI elements #47

datalies opened this issue Nov 28, 2012 · 2 comments

Comments

@datalies
Copy link

datalies commented Nov 28, 2012

This may be an issue, or more of a question about how to do something - it doesn't seem possible as I see it now.

I have an application that takes an input (a search term, for example), processes that input in the shinyServer() and returns output to the mainPanel().

Conceptually, I would like to further manipulate this output, by creating checkboxes/sliders/, based on the output - that can be modified, then reactively updating certain outputs. Normally (in R), I would do something like this:

for(element in as.character(elements)) {
element_id <- paste(element, 'id', sep = '_')
element_label <- paste('Change level of', element', ':')
sliderInput(element,
element_label,
value = as.numeric(outputData[element]),
min = 1,
max = 1000)
}

... this for-loop approach does not work - the only solution I have come up with is to hard-code a bunch of conditionalPanel()s, and activate the ones relevant to the given search/output in question, which compromises any sort of order I might desire to display these UI elements in.

Is there a way to deliver a variable number of UI elements based on the data held in the Output object that shinyUI() elements draw from?

BTW! ... thank you soooo much for developing this package. I have been waiting for exactly this sort of project for 3 years now. It may be new and have development to go, but what you have here is exceptional and I can't thank you enough :)

PS I have only been using this package since Sunday, so I may be missing something obvious. I'm also new to the sort of server-client communication structure (i.e., input$ and output$ vars)

@jcheng5
Copy link
Member

jcheng5 commented Nov 28, 2012

See reactiveUI on this page: http://rstudio.github.com/shiny/tutorial/#dynamic-ui

If you would like to discuss further, please start a thread on the shiny-discuss group and we'd be happy to help. Thanks!

@jcheng5 jcheng5 closed this as completed Nov 28, 2012
@datalies
Copy link
Author

ah... yes. I glossed over that section a bit - but I see how you mean now.
I will refer to the shiny-discuss group for further (non-bug) issues. Many
thanks!

Dan

On Wed, Nov 28, 2012 at 2:45 PM, Joe Cheng notifications@github.com wrote:

See reactiveUI on this page:
http://rstudio.github.com/shiny/tutorial/#dynamic-ui

If you would like to discuss further, please start a thread on the
shiny-discuss https://groups.google.com/group/shiny-discuss group and
we'd be happy to help. Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-10824176.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants