Skip to contents

Core

Build and inspect the visualization spec.

glyph()
Create a Glyph Visualization
print(<glyph_spec>)
Auto-render when printed (like ggplot2)

Marks

Geometric layers that draw data onto the plot.

marks
Visual Marks
mark_area()
Add an area mark
mark_bar()
Add a bar mark
mark_line()
Add a line mark
mark_link()
Add a link/edge mark (for networks, sankeys, slope graphs)
mark_point()
Add a point mark (scatterplot)
mark_ribbon()
Add a ribbon/band mark (for confidence intervals, ranges)
mark_rule()
Add a rule (reference line) mark
mark_text()
Add a text/label mark

Interactivity

Tooltips, zoom, brushing, and linked selections.

interactivity
First-Class Interactivity
interact()
Add interactive behaviors to a glyph spec
selection()
Add a selection parameter (advanced)

Animation

Transitions and entrance/exit animation.

animation
Animation Grammar
animate()
Add animation/transition behavior

Scales

Control how data maps to visual properties.

scale()
Define a scale for an aesthetic channel
scale_color() scale_log() scale_time()
Scales

Theming

Token-based theme system and plot titles.

theming
Token-Based Theming
theme_tokens()
Set theme tokens
titles()
Add a title, subtitle, or caption

Layout

Multi-plot composition and auxiliary panels.

layout
Layout Composition
compose()
Compose multiple glyph specs into a layout
marginals()
Add a marginal plot (histogram/density on axes)
inset()
Add an inset plot
facet()
Facet a plot by one or two variables

Rendering

Compile the spec and render or export it.

rendering
Rendering Pipeline
compile()
Compile a glyph spec to a resolved representation
render()
Render a glyph spec as an htmlwidget
export()
Export to various formats
to_vegalite()
Export the spec as Vega-Lite JSON (interop)