Comments (4)
I just committed a change that enables conditional sidebars with tabs. The current implementation ties the sidebar ui to a particular tab. I will export module_tabs
and module_tabs_ui
that will make it easier to support conditional sidebars that are common to all tabs on the page.
Let me know any feedback/comments you have after you try it out!
from shinybones.
While the sidebar shows up now, I find I'm not able to access any inputs from the sidebar when it's in a tab. I'm guessing this is because it's not choosing the right namespace for the sidebar UI.
Minimal example:
test <- function(input, output, session, data_global = list(),
input_global = list(), ...){
ns <- session$ns
output$histogram <- renderPlot({
mtcars %>%
filter(wt > input$min_weight) %>%
ggplot(aes(mpg)) +
geom_histogram()
})
}
#' @rdname xp
test_ui <- function(id, data_global, ...){
ns <- shiny::NS(id)
shiny::fluidRow(
plotOutput(ns("histogram"))
)
}
#' @rdname xp
test_ui_sidebar <- function(id, data_global, ...){
ns <- shiny::NS(id)
sliderInput(ns("min_weight"), "Minimum Weight",
min = 1, max = 5, value = 3)
}
It works fine when _site.yml
has:
- text: Test
text: test
module: test
But if it's moved into a tab, the sidebar still shows up but input$min_weight
is NULL:
- text: Test
tabs:
- text: test
module: test
from shinybones.
Thanks for the detailed reprex! It was an issue with the namespace. I just pushed a fix and have tested that your example works. Let me know if it works for you.
from shinybones.
I have confirmed that it works now. Closing this!
from shinybones.
Related Issues (7)
- Use Google Analytics to track every time the page URL updates
- fix display_page to use tab names
- A failing module should fail gracefully without taking down the dashboard HOT 1
- Allow multiple modules to be laid out on a page HOT 1
- Change st_ prefix to sb_ HOT 1
- Don't try to source README.md files in components/pages folders HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shinybones.