request: renderHTML

383 views
Skip to first unread message

Alex Brown

unread,
Mar 7, 2013, 12:33:22 AM3/7/13
to shiny-...@googlegroups.com
renderUI creates a div.  It also creates the expectation that new interactive UI elements are created.

renderText will only expect text input.  A tags$h4 will cause an error.

renderPrint converts tags$h4 into quoted HTML.

What if...

I want to output a h4?

I want to output a span

I want to output a span with interactive elements in?

Please create:

1) renderHTML analog to renderText that renders the html generated by the expression, without the expectation that it generates UI.

Note - you could use the same mechanism that you use for reactives to _detect_ UI in renderText and renderHTML, and re-register inputs accordingly.

2) the option to build renderUI with span (or anything).

-Alex

Alex Brown

unread,
Mar 7, 2013, 12:52:10 AM3/7/13
to shiny-...@googlegroups.com
I've tried adding styles or classes to make a div be an inline-block, but these all result in the outputText never getting the content.  no idea why.

Joe Cheng

unread,
Mar 7, 2013, 1:04:16 PM3/7/13
to shiny-...@googlegroups.com
Hi Alex,

Great questions as usual.

renderUI itself actually does not create a div, it's the uiOutput/htmlOutput that creates it. You can replace uiOutput/htmlOutput with something like these examples:

tags$h4(id='foo', class='shiny-html-output')
tags$span(id='bar', class='shiny-html-output')

It would be great though to add a "tag" parameter to uiOutput and htmlOutput so you don't need to know this secret incantation.

Also, the framework has no special expectation that renderUI generates UI. It's uiOutput/htmlOutput (and the class="shiny-html-output" that they both generate) that tells Shiny that there might be UI. There's no harm at all in not having UI in these outputs though.

Hope that helps.

-joe

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages