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

Use ggplot2::get_alt_text() if available to provide better default alt text #3398

Merged
merged 6 commits into from
Jun 14, 2021

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented May 20, 2021

Closes #3397 (via tidyverse/ggplot2#4482)

library(shiny)

ui <- fluidPage(
  plotOutput("p")
)

server <- function(input, output, session) {
  output$p <- renderPlot({
    ggplot(mtcars, aes(wt, cyl)) + 
      geom_point() +
      labs(alt = "Foo bar")
  })
}

shinyApp(ui, server)

R/render-plot.R Outdated Show resolved Hide resolved
R/render-plot.R Outdated Show resolved Hide resolved
Copy link
Collaborator

@wch wch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, provided that the PR on the ggplot2 side stays pretty much the same.

cpsievert and others added 3 commits June 1, 2021 18:12
… informative default alt text for ggplots in renderPlot()
Co-authored-by: Winston Chang <winston@stdout.org>
@cpsievert cpsievert marked this pull request as ready for review June 8, 2021 17:18
@cpsievert cpsievert merged commit 2cdafed into master Jun 14, 2021
@cpsievert cpsievert deleted the get-alt-text branch June 14, 2021 15:22
@github-actions github-actions bot restored the get-alt-text branch June 14, 2021 15:26
schloerke added a commit that referenced this pull request Jun 15, 2021
* master:
  Move `./srcts` configs to top level to support types installation from GitHub (#3425)
  insertTab() now handles position correctly when target is NULL (#3404)
  yarn add node-gyp; yarn build (#3424)
  Export TypeScript type definitions to local folder (#3418)
  TypeScript: Remove `any` types / improve type definitions (#3414)
  Better color constrasting in sliderInput() (#3366)
  Use ggplot2::get_alt_text() if available to provide better default alt text (#3398)
  Set selectize dropdownParent to "body" to prevent clipping
schloerke added a commit that referenced this pull request Jun 16, 2021
cpsievert pushed a commit that referenced this pull request Jun 16, 2021
* Match spelling for Plot Object phrase

From #3398

* Document (GitHub Actions)

* Consistent casing for `"Plot object"` for plot alt text

Co-authored-by: schloerke <schloerke@users.noreply.github.com>
@cpsievert cpsievert deleted the get-alt-text branch June 16, 2021 20:20
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

Successfully merging this pull request may close these issues.

Use upcoming ggplot2 alt label
2 participants