-
Notifications
You must be signed in to change notification settings - Fork 40
implement test-hjust-text-anchor.R #43
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in tests it is best to be as explicit as possible, so I would recommend that grad.desc.viz returns an animint list of ggplots and options, and then you take animint2HTML outside of the grad.desc.viz function, e.g.
viz <- grad.desc.viz(hjust=0)
info <- animint2HTML(viz)|
I have implemented https://github.com/caijun/animint/blob/master/inst/htmljs/animint.js#L717-L733 Tests of Yes, it's easier to understand the code if putting As for the The invalid input of hjust should be checked in |
|
These changes look good. Although it is possible to check for invalid hjust values at rendering time (and maybe report it using console.log), I think it makes more sense to check at compile time and then assume we have valid values at rendering time. Actually there is already R code that should stop the compiler with an error https://github.com/tdhock/animint/blob/master/R/animint.R#L174-L188 so please change the test to check for an error (not a warning), as we do with hjust for axis labels https://github.com/tdhock/animint/blob/master/tests/testthat/test-rotate.R#L90-L97 |
|
I check for invalid hjust values inside the https://github.com/caijun/animint/blob/master/R/animint.R#L322-L330 The test for invalid hjust values has been changed to check for an error. https://github.com/caijun/animint/blob/master/tests/testthat/test-hjust-text-anchor.R#L114 All tests of test-hjust-text-anchor.R have been successfully passed, and you can merge this branch. |
|
Looks good to me. Now just update the package version to 2015.03.23 in DESCRIPTION, and add some info about the bug that you fixed in NEWS. After that I will merge into master. |
implement geom_text(aes(hjust))
Using test-hjust-text-anchor.R to test Animint, the testing results are as follows
style.value does not match 'start'. Actual value: "middle"
style.value does not match 'end'. Actual value: "middle"