view_config: view aesthetics

Description Usage Arguments References Examples

Description

At its core, a Vega-Lite specification describes a single plot. This function works to format those views with all of the options avaiable under config.view.* When a facet channel is added, the visualization is faceted into a trellis plot, which contains multiple plots. Each plot in either a single plot or a trellis plot is called a view. View configuration allows us to customize each individual single plot and each plot in a trellis plot.

Usage

1
2
3
4
5
view_config(vl, width = 200, height = 200, fill = NULL,
  fill_opacity = NULL, stroke = NULL, stroke_opacity = NULL,
  stroke_width = NULL, stroke_dash = NULL, stroke_dash_offset = NULL)

view_size(vl, width = 200, height = 200)

Arguments

vl

Vega-Lite object

width, height

width and height property of the view configuration determine the width of a visualization with a continuous x-scale and the height of a visualization with a continuous y-scale respectively. Visit the URL in the References section for more information.

fill

fill color

fill_opacity

0.0-1.0

stroke

stroke color

stroke_opacity

0.0-1.0

stroke_width

stroke of the width in pixels

stroke_dash

an array of alternating stroke, space lengths for creating dashed or dotted lines.

stroke_dash_offset

the offset (in pixels) into which to begin drawing with the stroke dash array.

References

Vega-Lite view spec

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
vegalite() %>%
  view_size(300, 200) %>%
  add_data("https://vega.github.io/vega-editor/app/data/unemployment-across-industries.json") %>%
  encode_x("date", "temporal") %>%
  encode_y("count", "quantitative", aggregate="sum") %>%
  encode_color("series", "nominal") %>%
  scale_color_nominal_vl(scheme="category20b") %>%
  timeunit_x("yearmonth") %>%
  scale_x_time_vl(nice="month") %>%
  axis_x(format="%Y", labelAngle=0) %>%
  mark_area()

hrbrmstr/vegalite documentation built on May 17, 2019, 5:38 p.m.