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

animation support in html and markdown #166

Merged
merged 5 commits into from
Mar 13, 2012
Merged

animation support in html and markdown #166

merged 5 commits into from
Mar 13, 2012

Conversation

gabysbrain
Copy link

Hi! I needed to add support for creating animations with the markdown renderer for my own stuff and figured it would be good to have directly in knitr. Right now it only works with png output and uses ffmpeg to create the movie.

What do you think?

@yihui
Copy link
Owner

yihui commented Mar 8, 2012

Oops... you have already started working on what I planned to do two months later in Google Summer of Code: http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2012:knitr

FFmpeg is certain one way to go, and I'm thinking how to include more support to animations in HTML (like saveHTML() and saveGIF() in my animation package). I will come back and see what I can do. Thanks a lot!

# TODO: only supports png device for now
# set up the ffmpeg run
ffmpeg.opts <- options$aniopts
fig.fname <- paste(sub(paste(fig.num, '$',sep=''), '', x[1]), "%d.png", sep="")
Copy link
Owner

Choose a reason for hiding this comment

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

I think this is sub(str_c(fig.num, '$'), '%d', x[1]), right?

I do not see a particular reason to restrict to png only, e.g. how about fig.fname = str_c(sub(str_c(fig.num, '$'), '%d', x[1]), x[2])

@yihui
Copy link
Owner

yihui commented Mar 11, 2012

I will be happy to accept this pull request after you have made the changes I mentioned above (you just keep pushing to your fork and they will appear here). For consistency of style, I will replace <- with = later after merging your code, and in future I guess I will also generalize this hook beyond ffmpeg.

Thanks!

@gabysbrain
Copy link
Author

Great! I'll probably make those changes soon. It depends on how much I want to procrastinate on this paper deadline :)

I looked at your summer of code proposal. It actually looks like your interests and mine are aligned. I'd also like to have a notebook-style interface running R for computations. There's a project I've recently set up on bitbucket right now: https://bitbucket.org/gabysbrain/r-notebook if you're interested. In my case I'm using markdown for the text format.

For the animations my main motivation for using mp4 for the animations is for quick and dirty interactive plots. I generate a series of plots, each one with a different setting for a variable and then use the slider to interactively move through the different variable settings. I think it would be great if the other animation types are supported.

@yihui
Copy link
Owner

yihui commented Mar 12, 2012

I do not have access to that repository but I believe markdown will change R users' impression about dynamic reporting. Sweave has a high barrier, i.e. LaTeX. I will focus more on markdown in version 0.5 to make it even easier to write code and compile.

The above changes are actually pretty easy; I'm sure you can do them in 5 minutes :)

@gabysbrain
Copy link
Author

Ah yes, I accidentally left the project as private. It's accessible now, but there's not much there.

Anyway, the changes are all done.

yihui added a commit that referenced this pull request Mar 13, 2012
animation support in html and markdown
@yihui yihui merged commit 66bed6e into yihui:master Mar 13, 2012
@yihui
Copy link
Owner

yihui commented Mar 13, 2012

thanks, I have added it to my watch list

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants