This may be obvious, but I can't figure how to do it. (I'm a seasoned programmer, but not very much with web-based tools; I'm a bit of a programming dinosaur. I know nada about Javascript, for instance.. )
I have a Shiny app that I am building, where in the tab panels of my app, the default panel is a bit of a 'this is what this app does and here are the options'; a road map, if you will. I would like if, in describing the app, I could have live links embedded; ie, "if you want to do this ...." and clicking on 'this' makes the corresponding tab panel of the app become the live panel. Is this do-able in Shiny, and if so, how?
Thanks!--
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.
I found it useful to increase the number of breaks as n increases, i.e.:
hist(data(), breaks = n/10, main = paste0('r', dist, '(', n, ')'), xlab ="range")
thanks again,
Patrick.
ui.R
:require(shiny)
shinyUI(navbarPage("",
tabPanel("Foo",
tabsetPanel(
tabPanel("Foo1",
sidebarLayout(
sidebarPanel(
tags$div(div(id="Foo2", tags$a("Foo2"))
)
),
mainPanel(p("hello Foo1"))
)),
tabPanel("Foo2",
sidebarLayout(
sidebarPanel(),
mainPanel(p("hello Foo2"))),
HTML("<script>$('#Foo2').click(function() {
tabs = $('.tabbable .nav.nav-tabs li')
tabs.each(function() {
$(this).removeClass('active')
})
$(tabs[1]).addClass('active')
tabsContents = $('.tabbable .tab-content .tab-pane')
tabsContents.each(function() {
$(this).removeClass('active')
})
$(tabsContents[1]).addClass('active')
$('#Foo2').trigger('change').trigger('shown');
})</script>")
)
)
),
tabPanel("Bar",
tabsetPanel(
tabPanel("Bar1",
sidebarLayout(
sidebarPanel(
tags$div(div(id="Bar2", tags$a("Bar2"))
)
),
mainPanel(p("hello Bar1"))
)),
tabPanel("Bar2",
sidebarLayout(
sidebarPanel(),
mainPanel(p("hello Bar2"))),
HTML("<script>$('#Bar2').click(function() {
tabs = $('.tabbable .nav.nav-tabs li')
tabs.each(function() {
$(this).removeClass('active')
})
$(tabs[1]).addClass('active')
tabsContents = $('.tabbable .tab-content .tab-pane')
tabsContents.each(function() {
$(this).removeClass('active')
})
$(tabsContents[1]).addClass('active')
$('#Bar2').trigger('change').trigger('shown');
})</script>")
)
)
)
)
)
When you click in the sidebar panel of foo1 the link to foo2 responds. But when you do the same in Bar, it goes somewhere else.