Skip to content

Commit

Permalink
Update version, add installation instructions, as if on CRAN (#115)
Browse files Browse the repository at this point in the history
* Update version, add installation instructions, as if on CRAN

* Update pkgdown dev mode, add cran comments, README urls, formatting in CONTRIBUTING

* Update cran comments

* correct spelling

* Update for resubmission

* Address CRAN concerns:

- add to Python and Altair to SystemRequirements
- deprecate some functions re-exported from vegawidget
- update CRAN comments
- update NEWS
- update pkgdown reference

* Update cran comments

* update CRAN comments

* Correct date of email

* one more edit

* Make CRAN corrections

🎉 on CRAN
  • Loading branch information
ijlyttle authored Jul 11, 2019
1 parent 1c65410 commit d65f8b5
Show file tree
Hide file tree
Showing 21 changed files with 227 additions and 105 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
^\.gitattributes$
^CONTRIBUTING\.md$
^CONTRIBUTING\.Rmd$
^cran-comments\.md$
^CRAN-RELEASE$
4 changes: 3 additions & 1 deletion CONTRIBUTING.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Please build pkgdown as much as you would like - the `docs` folder is git-ignore

### Versioning

The version nuumber may have as many as four components. The first two digits will mirror the first two digits of the version number of the supported (Python) Altair version; this is currently ``r altair::altair_version()$altair``.
The version number may have as many as four components. The first two digits will mirror the first two digits of the version number of the supported (Python) Altair version; this is currently ``r altair::altair_version()$altair``.

The third component will correspond to a CRAN release of this package; these will be tagged.

Expand All @@ -108,6 +108,8 @@ adding a vignette | `master` | `r mark_yes` | `r g
helping with a new feature | `<feature-branch>` | `r mark_no` | `r grin`
proposing a new feature | `master` | `r mark_yes` | `r grin`

<br>

Please roxygenize as a part of your pull-request.

### Git branch strategy
Expand Down
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,23 @@ documentation is at the “root” of the documentation site; the latest

### Versioning

The version nuumber may have as many as five components. The first three
digits will mirror the version number of the supported (Python) Altair
version; this is currently `3.1.0`.
The version number may have as many as four components. The first two
digits will mirror the first two digits of the version number of the
supported (Python) Altair version; this is currently `3.1.0`.

The fourth component will correspond to a CRAN release of this package;
The third component will correspond to a CRAN release of this package;
these will be tagged.

A fifth component denotes a development version.
A fourth component denotes a development version.

Our goal is that each commit to the `master` branch will have an
incremented version-number.

### Pull requests

Pull requests are very welcome. Accordingly, the branch into which you
should make a pull-request will depend on the situation:
should make a pull-request will depend on the
situation:

| Situation | Reference branch | Add item to NEWS.md | Appreciated |
| -------------------------- | ------------------ | ------------------- | ----------- |
Expand All @@ -139,6 +140,8 @@ should make a pull-request will depend on the situation:
| helping with a new feature | `<feature-branch>` || 😁 |
| proposing a new feature | `master` || 😁 |

<br>

Please roxygenize as a part of your pull-request.

### Git branch strategy
Expand Down
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: altair
Version: 3.1.0.9011
Title: R Interface to 'Altair'
Version: 3.1.1
Title: Interface to 'Altair'
Description: Interface to 'Altair' <https://altair-viz.github.io>, which itself
is a 'Python' interface to 'Vega-Lite' <https://vega.github.io/vega-lite>.
This package uses the 'Reticulate' framework
Expand All @@ -26,6 +26,7 @@ Authors@R: c(
person("Jake", "Vanderplas", comment = "Altair library", role = c("ctb")),
person("Brian", "Granger", comment = "Altair library", role = c("ctb"))
)
SystemRequirements: Python (>= 3.5.0), (Python) Altair (>= 3.1.0)
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down
4 changes: 0 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export(knit_print.altair.vegalite.v3.api.TopLevelMixin)
export(knit_print.vegaspec)
export(renderVegawidget)
export(repr_vegalite3.altair.vegalite.v3.api.Chart)
export(spec_mtcars)
export(vega_embed)
export(vegawidget)
export(vegawidgetOutput)
Expand All @@ -35,11 +34,8 @@ importFrom(repr,repr_text)
importFrom(repr,repr_vegalite2)
importFrom(vegawidget,as_vegaspec)
importFrom(vegawidget,knit_print.vegaspec)
importFrom(vegawidget,renderVegawidget)
importFrom(vegawidget,vega_embed)
importFrom(vegawidget,vegawidget)
importFrom(vegawidget,vegawidgetOutput)
importFrom(vegawidget,vw_as_json)
importFrom(vegawidget,vw_to_bitmap)
importFrom(vegawidget,vw_to_svg)
importFrom(vegawidget,vw_write_png)
Expand Down
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# altair 3.1.0 (development version)
# altair 3.1.1

* Deprecate `vw_as_json()`, `vegawidgetOutput()`, `renderVegawidget()`; these are available in the **vegawidget** package. (#117)

* Remove references to `r_to_py()`, as **retuculate** manages this automatically. (#83)

Expand Down Expand Up @@ -36,7 +38,7 @@

* adds `as_chart()`, to import a vegaspec as an Altair chart

* revomes rendering functions in favor of a separate package, [**vegawidget**](https://github.com/vegawidget/vegawidget) - vegawidget functions imported and exported using templating function `vegawidget::use_vegawidget()`.
* removes rendering functions in favor of a separate package, [**vegawidget**](https://github.com/vegawidget/vegawidget) - vegawidget functions imported and exported using templating function `vegawidget::use_vegawidget()`.

* adds requirement to use reticulate (>=) 1.9, to avoid conflict between data-frame variable-names and python methods (#50, @aliciaschep) and to remove the need to use the `r_to_py()` function for data (#83)

Expand Down
7 changes: 4 additions & 3 deletions R/alt.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# see zzz.R for "creation" of the alt object

#' Create Altair chart from vegaspec
#' Create Altair chart from vegaspec
#'
#' @param spec vegaspec
#' @inheritParams as_vegaspec
#'
#' @return altair object
#'
#' @examples
#' if (interactive()) {
#' as_chart(vegawidget::spec_mtcars)
Expand All @@ -14,7 +15,7 @@
as_chart <- function(spec) {

spec <- as_vegaspec(spec)
spec <- vw_as_json(spec)
spec <- vegawidget::vw_as_json(spec)

chart <- alt$Chart()$from_json(spec)

Expand Down
39 changes: 39 additions & 0 deletions R/deprecated.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#' Coerce vegaspec to JSON
#'
#' Deprecated, please use \code{vegawidget::\link[vegawidget]{vw_as_json}}.
#'
#' @inherit vegawidget::vw_as_json params return
#' @export
#'
vw_as_json <- function(spec, pretty = TRUE) {
.Deprecated("vegawidget::vw_as_json")
vegawidget::vw_as_json(spec, pretty = pretty)
}

#' Shiny-output for vegawidget
#'
#' Deprecated, please use \code{vegawidget::\link[vegawidget]{vegawidgetOutput}}.
#'
#' @inherit vegawidget::vegawidgetOutput params return
#' @export
#'
vegawidgetOutput <- function(outputId, width = "auto", height = "auto") {
.Deprecated("vegawidget::vegawidgetOutput")
vegawidget::vegawidgetOutput(
outputId = outputId,
width = width,
height = height
)
}

#' Render shiny-output for vegawidget
#'
#' Deprecated, please use \code{vegawidget::\link[vegawidget]{renderVegawidget}}.
#'
#' @inherit vegawidget::renderVegawidget params return
#' @export
#'
renderVegawidget <- function(expr, env = parent.frame(), quoted = FALSE) {
.Deprecated("vegawidget::renderVegawidget")
vegawidget::renderVegawidget(expr = expr, env = env, quoted = quoted)
}
18 changes: 12 additions & 6 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#' [reticulate: Installing Python Packages](https://rstudio.github.io/reticulate/articles/python_packages.html)
#' @examples
#' \dontrun{
#' # not run because it requires Python
#' install_altair()
#' }
#' @export
Expand Down Expand Up @@ -114,6 +115,7 @@ install_altair <- function(method = c("conda", "virtualenv"),
#' @seealso [reticulate::py_config()], [install_altair()], [altair_version()]
#' @examples
#' \dontrun{
#' # not run because it requires Python
#' check_altair()
#' }
#' @export
Expand Down Expand Up @@ -157,27 +159,31 @@ altair_version <- function() {
#' @return invisible `NULL`, called for side-effects
#' @keywords internal
#' @examples
#' \dontrun{
#' version_supported <- "2.0.1"
#' # issues error
#' check_altair_version("1.2", version_supported)
#' \donttest{
#' # issues error
#' check_altair_version("1.2", version_supported)
#'
#' # issues warning
#' check_altair_version("2.1", version_supported)
#' # issues warning
#' check_altair_version("2.1", version_supported)
#' }
#'
#' # issues message
#' check_altair_version("2.0.0", version_supported)
#' check_altair_version("2.0.0rc1", version_supported)
#'
#' # does nothing
#' check_altair_version("2.0.1", version_supported)
#' }
#'
check_altair_version <-
function(version_installed = altair_version()$altair,
version_supported = getOption("altair.python.version"),
quiet = FALSE) {

if (is.null(version_supported)) {
stop("`version_supported` is NULL, is `altair` package loaded?")
}

installed <- get_version_components(version_installed)
supported <- get_version_components(version_supported)

Expand Down
43 changes: 0 additions & 43 deletions R/utils-vegawidget.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
#'
NULL

#' Coerce vegaspec to JSON
#'
#' See \code{vegawidget::\link[vegawidget]{vw_as_json}} for details.
#'
#' @name vw_as_json
#' @rdname vw_as_json
#' @importFrom vegawidget vw_as_json
#' @export
#'
NULL

#### print functions ####

#' Knit-print method
Expand Down Expand Up @@ -74,37 +63,5 @@ NULL
#'
NULL

#### shiny functions ####

#' Shiny-output for vegawidget
#'
#' See \code{vegawidget::\link[vegawidget]{vegawidgetOutput}} for details.
#'
#' @name vegawidgetOutput
#' @rdname vegawidgetOutput
#' @importFrom vegawidget vegawidgetOutput
#' @export
#'
NULL

#' Render shiny-output for vegawidget
#'
#' See \code{vegawidget::\link[vegawidget]{renderVegawidget}} for details.
#'
#' @name renderVegawidget
#' @rdname renderVegawidget
#' @importFrom vegawidget renderVegawidget
#' @export
#'
NULL

#### specs ####

#' Example vegaspecs
#'
#' See \code{vegawidget::\link[vegawidget]{spec_mtcars}} for details.
#'
#' @name spec_mtcars
#' @export
#'
spec_mtcars <- vegawidget::spec_mtcars
16 changes: 13 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ knitr::opts_chunk$set(
fig.path = "man/figures/README-",
dev = "svg"
)
url_local <- function(x) {
file.path("https://vegawidget.github.io/altair", x)
}
```

[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
Expand All @@ -27,7 +31,13 @@ In this documentation, the capitalized word **Altair** shall refer to the Python

## Installation

A development version is available from [GitHub](https://github.com/):
You can install altair from CRAN with:

```{r cran-installation, eval=FALSE}
install.packages("altair")
```

The development version of is available from [GitHub](https://github.com/):

``` r
# install.packages("devtools")
Expand Down Expand Up @@ -135,7 +145,7 @@ This project is a collaborative effort. In addition to the principal authors:

## Contributing

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
Please note that this project is released with a [Contributor Code of Conduct](`r url_local("CODE_OF_CONDUCT.html")`).
By participating in this project you agree to abide by its terms.

This project also has a [Contributing Guide](CONTRIBUTING.md).
This project also has a [Contributing Guide](`r url_local("CONTRIBUTING.html")`).
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ package.

## Installation

A development version is available from [GitHub](https://github.com/):
You can install altair from CRAN with:

``` r
install.packages("altair")
```

The development version of is available from
[GitHub](https://github.com/):

``` r
# install.packages("devtools")
Expand Down Expand Up @@ -79,7 +86,7 @@ to convert Altair charts into SVG strings or write SVG files. With the
**[png](https://CRAN.R-project.org/package=png)** packages installed,
you can get a bitmap array, or write PNG files.

When knitting to a non-HTML format, e.g. `github_document`, this package
When knitting to a non-HTML format, e.g. `github_document`, this package
provides a `knit_print()` function that will intercept the normal
renderer, using instead its own renderer, allowing you to specify
`"png"` , `"svg"` or `"pdf"`. Like the image functions, this requires
Expand Down Expand Up @@ -115,9 +122,9 @@ Some things to keep in mind:
- Where you see a `.` in the Python examples, use a `$` instead.

- In your data, columns that contain dots can be wrapped in square
brackets in Altair specifications, e.g. `[Sepal.Width]`, to keep
brackets in Altair specifications, e.g. `[Sepal.Width]`, to keep
Altair from throwing an error. Alternatively, you can use a
double-backslash, e.g. `Sepal\\.Width`.
double-backslash, e.g. `Sepal\\.Width`.

These and other “gotchas” are compiled, along with workarounds, in an
article: [Field Guide to Python
Expand All @@ -130,7 +137,8 @@ The documentation for this package includes some

- [Getting
Started](https://vegawidget.github.io/altair/articles/altair.html):
a walkthrough to get a first chart to work
a walkthrough to get a first chart to
work

- [Installation](https://vegawidget.github.io/altair/articles/installation.html):
some more-detailed instructions
Expand Down Expand Up @@ -210,7 +218,8 @@ authors:
## Contributing

Please note that this project is released with a [Contributor Code of
Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree
to abide by its terms.
Conduct](https://vegawidget.github.io/altair/CODE_OF_CONDUCT.html). By
participating in this project you agree to abide by its terms.

This project also has a [Contributing Guide](CONTRIBUTING.md).
This project also has a [Contributing
Guide](https://vegawidget.github.io/altair/CONTRIBUTING.html).
Loading

0 comments on commit d65f8b5

Please sign in to comment.