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
Added alt param #3006
Added alt param #3006
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's allow for alt
to be reactive. (Sorry for my misleading comments earlier!)
reprex goal: shinyApp(
ui = fluidPage(
actionButton("btn1", "Update plots"),
plotOutput("plot1", width = "400px")
),
server = function(input, output, session) {
dt <- reactive({
invalidateLater(3 * 1000)
rnorm(30)
})
output$plot1 <- renderPlot(
{
hist(dt())
},
alt = reactive({
paste("Dynamic alt text. Mean(x):", round(mean(dt()), 3))
})
)
}
) |
Co-authored-by: Barret Schloerke <barret@rstudio.com>
Co-authored-by: Barret Schloerke <barret@rstudio.com>
Co-authored-by: Barret Schloerke <barret@rstudio.com>
@schloerke, we've made it! I have confirmed the reactive expr is dynamically passed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after default alt
value is addressed
Co-authored-by: Barret Schloerke <barret@rstudio.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending alt
retrieval in renderCachedPlot
.
This ready-for-review PR attempts to follow up with the PR #2494 to address the alt text issue #612.
We have to make sure
alt
attribute to be dynamic (beyond static).Adding
alt
param torender*()
instead of*Output()
makes more sense to me (the actual screen reader user) given that we may want to have dynamicalt
text depending on graph changes.Reprex