vega_schema: Create string for schema-URL

View source: R/spec-version.R

vega_schemaR Documentation

Create string for schema-URL

Description

Useful if you are creating a vegaspec manually.

Usage

vega_schema(
  library = c("vega_lite", "vega"),
  version = NULL,
  major = is.null(version)
)

Arguments

library

character, either "vega" or "vega_lite"

version

character, version of library, e.g. "5.2.0"; if version is provided, major defaults to FALSE.

major

logical return major version-tags rather than the tags for the specific versions supported by this package

Value

character URL for schema

Examples

  vega_schema()
  vega_schema("vega", major = FALSE)
  vega_schema("vega_lite", version = "5.2.0")

  # creating a spec by hand
  spec <-
    list(
      `$schema` = vega_schema(),
      width = 300,
      height = 300
      # and so on
    ) %>%
    as_vegaspec()


vegawidget documentation built on May 29, 2024, 12:17 p.m.