Over the past few days, I have been getting my thoughts together for this project (trying to remember what I had forgotten since UseR!)
I am starting to grasp what needs to be done in terms of documentation, but I think the immediate need is for a testing infrastructure.
I see three levels of tests:
- End-to-end translation of a ggplot object to a ggspec to a Vega-Lite spec.
- Visual confirmation that our ideas for end-to-end translation make visual sense
- Unit tests for subcomponents of the translations.
I plan to work on 1. and 2. in the very short-term. This will include some reference ggplot2 plots for geom_point() and geom_bar() (or maybe geom_col()), which will let Wenyu start to extend things at his end.
For item 3., this is something that Haley has already implemented for "ggspec", but that we will plan to work with Wenyu on in "ggvega" (as I try to get better with TS testing).
Here's my immediate plan for a PR:
I will build some helper functions to make it easier to access the source code to compile the objects themselves, something like:
# return the path to the example file
gg_example_file("scatterplot-iris") # for external use
gg_example_file_dev("scatterplot-iris") # for internal use
# return a ggplot object
gg_example("scatterplot-iris")
gg_example_dev("scatterplot-iris")
Once all this is done, I plan to merge the PR so that the examples can be used right away.
In the coming days, I plan to build some testing infrastructure that will work for entire specs (as opposed to components of specs).
Over the past few days, I have been getting my thoughts together for this project (trying to remember what I had forgotten since UseR!)
I am starting to grasp what needs to be done in terms of documentation, but I think the immediate need is for a testing infrastructure.
I see three levels of tests:
I plan to work on 1. and 2. in the very short-term. This will include some reference ggplot2 plots for
geom_point()andgeom_bar()(or maybegeom_col()), which will let Wenyu start to extend things at his end.For item 3., this is something that Haley has already implemented for "ggspec", but that we will plan to work with Wenyu on in "ggvega" (as I try to get better with TS testing).
Here's my immediate plan for a PR:
inst/exploratorytodev/exploratory, and add thedevdirectory to.Rbuildignore.inst/examples/ggplot2where there would a file for each example, e.g.:scatterplot-iris.Rcontaining the source code to create the ggplot objectI will build some helper functions to make it easier to access the source code to compile the objects themselves, something like:
Once all this is done, I plan to merge the PR so that the examples can be used right away.
In the coming days, I plan to build some testing infrastructure that will work for entire specs (as opposed to components of specs).