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

Handle shape pallettes with unicode symbols #164

Open
jrnold opened this issue Feb 9, 2024 · 0 comments
Open

Handle shape pallettes with unicode symbols #164

jrnold opened this issue Feb 9, 2024 · 0 comments

Comments

@jrnold
Copy link
Owner

jrnold commented Feb 9, 2024

More robustly handle shape palettes with unicode symbols.

Right now the way it passes CRAN is to not run the examples with problematic palettes. The palettes will still raise a low-level error when a symbol cannot be converted on a

  • Catch errors and raise them with a more meaningful message for the user
  • Enforce the use of certain devices
  • ... Some better way to handle symbols?
❯ checking examples ... ERROR
  Running examples in ‘ggthemes-Ex.R’ failed
  The error most likely occurred in:
  
  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: cleveland_shape_pal
  > ### Title: Shape palette from Cleveland "Elements of Graphing Data"
  > ###   (discrete).
  > ### Aliases: cleveland_shape_pal
  > 
  > ### ** Examples
  > 
  > ###   (discrete).
  > 
  > 
  > library("ggplot2")
  > p <- ggplot(mtcars) +
  +      geom_point(aes(x = wt, y = mpg, shape = factor(gear))) +
  +      facet_wrap(~am) +
  +      theme_bw()
  > # overlapping symbol palette
  > p + scale_shape_cleveland()
  > # non-overlapping symbol palette
  > p + scale_shape_cleveland(overlap = FALSE)
  Error in grid.Call.graphics(C_points, x$x, x$y, x$pch, x$size) : 
    conversion failure on '○' in 'mbcsToSbcs': for ○ (U+25CB)
  Calls: <Anonymous> ... drawDetails -> drawDetails.points -> grid.Call.graphics
  Execution halted
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

No branches or pull requests

1 participant