thebioengineer / camcorder

Record plots generated during an R session and replay as a gif!
https://thebioengineer.github.io/camcorder/
Other
204 stars 7 forks source link

gg_record for code #6

Open gkaramanis opened 4 years ago

gkaramanis commented 4 years ago

I saw @Z3tt mentioning flipbook on Slack and it just hit me: I’ve written a couple of functions to save the code from the Source pane as a comment in the png file or as a text file.

We could have an option to save the code in output formats that support comments/metadata or as text files alongside the output files.

If you think it sounds interesting and it’s a good fit for camcorder, I’ll gladly share the code!

thebioengineer commented 4 years ago

Open a branch with the code!

z3tt commented 4 years ago

Haha, actually had the same idea but didn't wanted to push it too far 😋 I like the idea as long as we do not compete too much with Gina, it's a great project!

thebioengineer commented 4 years ago

For sure, {flipbook} has found a following and is a super cool project and we don't want to just re-implement their work. we could maybe reach out and see about how camcorder and flipbook could work together? a final slide that contains a gif of the process could be cool?

gkaramanis commented 4 years ago

I can see how it's similar in some ways, the use case I had in mind was going back to a plot and see the code for it. Anyway, we'll see how it turns out and we can decide then!

z3tt commented 4 years ago

I think in general it sounds very interesting, especially if it would work not only with code but any type of text output. I directly have gifs in mind that show how to improve a plot with notes next to it what and why to improve.

thebioengineer commented 4 years ago

@gkaramanis could you maybe link to the code? One thought I have right now is make use of trelliscope where the code and plot could be viewed side by side, as well as all images. https://github.com/hafen/trelliscopejs

gkaramanis commented 4 years ago

OK, I've sent you both an invite to the repo. Didn't know of trelliscope, the idea sounds interesting!

TylerGrantSmith commented 4 years ago

In general this would seem difficult/impossible to work fully generally. Plots can be built up over multiple statements and multiple chunks of code. You can take the plot object itself and try and reverse engineer the code a la https://github.com/coolbutuseless/ggreverse but then this also would fail for more general plots, like the output of patchwork