Description Usage Arguments References Examples
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.
1 2 3 4 5 |
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 |
|
stroke |
stroke color |
stroke_opacity |
|
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. |
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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.