-
Notifications
You must be signed in to change notification settings - Fork 21
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
ggplot2 dependency #5
Conversation
@tdhock Ever since I added the
I have done the following but the error is recurring:
Any ideas?? Edit: Stupid mistake. Forgot to update the NAMESPACE file. Package builds now. |
grob is defined in the grid pacakge, maybe you need to add that to our imports? |
more generally you should check the NAMESPACE file from ggplot2 and copy all the stuff that they import |
@tdhock Could you list the downfalls to this approach?
I think this way, both of our problems get solved:
I was thinking along these lines. Is it possible(to have two versions of |
I don't understand, can you please clarify? |
The problem earlier was that users could only have one version of If we change the name to |
I guess it is possible, but what is the benefit of having the separate ggplot2Animint package? Why not just put everythign in animint2? |
Yes, I mean it is technically the same thing, but I think it would be neater to just copy their repo along with the testing framework to make sure we don't break anything critical. Additionally we will also need to add our own tests. Also, like you mentioned, using the new Using the current approach, there will always be that task of chipping away the useless code; while I think we could just leave that as it is in the other package, without much hassle. Also, we could easily track any significant additions in the original And finally just some good programming practice to separate the animation code from the static code. Tracking bugs will be easier if I know that the Most of this can be done the current way too. But I would prefer this one. Looks easier and neater. |
ok in that case do we change all of geom_ to ageom_ etc? or do we keep geom_? |
@cpsievert can you please share your opinion? |
We will make all the relevant changes in the newer package. For e.g.:
|
for me it seems like making two packages is significantly more complicated
than making one package (two times installation, two times CRAN checks, etc)
to make sure that ggplot2 code we fork is working as it should, we can just
copy their tests to animint2 you know.
BTW, their tests are not nearly as thorough as ours. (they don't have a way
to test the visual properties of the rendered ggplots, which we do by
parsing the generated HTML)
…On Wed, Jun 14, 2017 at 1:01 PM, Faizan Uddin Fahad Khan < ***@***.***> wrote:
We will make all the relevant changes in the newer package. For e.g.:
1. We will change the geom names to geom_a*()
2. We will not export the functions that are already exported from
ggplot2 and are unchanged
3. Will add the new syntax and tests for allowing the new syntax etc.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA478qFWo2QgC423RhgbYzljVdnDzuwwks5sEBHSgaJpZM4N6A6p>
.
|
futhermore many of the ggplot2 tests are irrelevant for us. e.g. we won't
use the ggplot_build function anymore because it does not know about
showSelected, so we don't care whether or not it works.
…On Wed, Jun 14, 2017 at 1:06 PM, Toby Hocking ***@***.***> wrote:
for me it seems like making two packages is significantly more complicated
than making one package (two times installation, two times CRAN checks, etc)
to make sure that ggplot2 code we fork is working as it should, we can
just copy their tests to animint2 you know.
BTW, their tests are not nearly as thorough as ours. (they don't have a
way to test the visual properties of the rendered ggplots, which we do by
parsing the generated HTML)
On Wed, Jun 14, 2017 at 1:01 PM, Faizan Uddin Fahad Khan <
***@***.***> wrote:
> We will make all the relevant changes in the newer package. For e.g.:
>
> 1. We will change the geom names to geom_a*()
> 2. We will not export the functions that are already exported from
> ggplot2 and are unchanged
> 3. Will add the new syntax and tests for allowing the new syntax etc.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#5 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AA478qFWo2QgC423RhgbYzljVdnDzuwwks5sEBHSgaJpZM4N6A6p>
> .
>
|
I was kind of thinking the other way around. The
Regarding the tests, we could definitely copy them. But from a maintainers perspective, it would be easier with a separate package because:
Anyway, it is just bookkeeping and I don't think there are any major advantages/disadvantages. Just my personal viewpoint. The only significant difference will be that if we maintain a separate package, we can use that to create static plots for visual testing first, like you mentioned before. I don't think we will be able to do that if we copy the code(?) |
@tdhock Should we depend on your fork of |
hey Faizan it seems to be working fine now that I have removed the browser() statements |
actually I have to use devtools::load_all() to get it working |
> library(animint2)
> g <- ggplot()+geom_point(aes(Sepal.Length, Sepal.Width), data=iris, clickSelects="Species")
> g
> g <- ggplot()+geom_point(aes(Sepal.Length, Sepal.Width), data=iris, clickSelects="Species")
Error in plot_clone(p) : attempt to apply non-function
> devtools::load_all("~/R/animint2")
Loading animint2
> g <- ggplot()+geom_point(aes(Sepal.Length, Sepal.Width), data=iris, clickSelects="Species")
> g
> g <- ggplot()+geom_point(aes(Sepal.Length, Sepal.Width), data=iris, clickSelects="Species")
> g |
That is weird. Could you please try this? I am still getting the same error:
|
works for me after load_all: > library(animint2)
> mtcars$cyl <- as.factor(mtcars$cyl)
> p1 <- ggplot() + geom_point(aes(x=hp,
+ y=disp),
+ showSelected = c("cyl", "am"),
+ clickSelects = c("am"),
+ data = mtcars)
Warning: Ignoring unknown parameters: showSelected
> p2 <- ggplot() + geom_point(aes(x=hp,
+ y=disp,
+ showSelected = cyl),
+ data = mtcars)
Warning: Ignoring unknown aesthetics: showSelected
> p3 <- ggplot() + geom_point(aes(x=hp,
+ y=disp),
+ data = mtcars)
> p1 <- ggplot() + geom_point(aes(x=hp,
+ y=disp),
+ clickSelects = c("am"),
+ data = mtcars)
> p3
> p3
Error in plot_clone(plot) : attempt to apply non-function
> devtools::load_all("~/R/animint2")
Loading animint2
> p3
> p1
> |
Here is what I am doing:
|
I fixed the knitr test by changing knit_print.animint2 to knit_print.animint (the S3 method was not being called, so the default print method -- static ggplots -- was being used in the Rmd rendering process) |
@tdhock We are passing all the tests now except the compiler-gist test. So I guess we could start thinking about closing this PR. Is there anything else that can be done here? |
Hey Faizan this is great news, thanks for all your hard work! I just committed the secure string to the .travis.yml file, which I hope will fix the gist issue. otherwise maybe we need to generate a new gist api key and store it in a new travis secure https://docs.travis-ci.com/user/encryption-keys/ |
@tdhock Thanks! I have added the examples to the package and converted them to the new syntax but I haven't tested them yet. Maybe we could do that in a separate PR? Also looks like we will have to generate a new gist api key.. |
hey so I generated a new gist access token under github.com/settings, then I did |
ok, all tests are now passing, and I have updated the version in NEWS/DESCRIPTION/README. I give my official +1 for this PR, go ahead and merge when you are ready. |
The motive of this PR is to solve the
ggplot2
dependency thatanimint
had in previous versions.