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

BUG: Tweening converts some text labels to hex codes, fails when combined with other text #508

Open
katrinabrock opened this issue Dec 24, 2024 · 0 comments

Comments

@katrinabrock
Copy link

Issue trigger

Create an animation with an impacted text string as the label, for example 0 pi.

Expected behavior

This labels shows up both in main plots and transitional frames.

Actual behavior

Either the plot totally fails to render, with the error Error: The labelcolumn differs in type between the two inputs or transitional frames are labeled with #FFFFFF00.

MRE

anim_save(
  'example.gif',
  ggplot(aes(x=x,y=y,label=label), data = data.frame(
    label = '0 pi',
    x = 1:4,
    y = 1:4,
    frame = 1:4
  )) + geom_text() + transition_states(frame),
  nframes = 31,
  fps = 5
)

Results in:
example

anim_save(
  'example.gif',
  ggplot(aes(x=x,y=y,label=label), data = data.frame(
    label = c('0 pi', '0 pi', 'other', 'labels'),
    x = 1:4,
    y = 1:4,
    frame = 1:4
  )) + geom_text() + transition_states(frame),
  nframes = 31,
  fps = 5
)

Errors out with

Error : The labelcolumn differs in type between the two inputs

Likely from here: https://github.com/thomasp85/tweenr/blob/main/R/tween_state.R#L157

Exploring a little, the mis-match types are colour vs character, but not sure how this came to be.

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