Vega.jl

A Julia package for generating visualizations in Vega

Getting Started
Visualization Primitives
Creating A Visualization From Scratch

Pre-defined Visualizations

Area Plot
Aster Plot
Bar Plot
Box Plot
Bubble Chart
Choropleth
Dot Plot
Grouped Bar
Heatmap
Horizon
Histogram
Joint Plot
Line Plot
Pie/Donut Chart
Population Chart
Punchcard
Ribbon Plot
Rug Plot
Scatter Plot
Stem-and-Leaf Plot
Stream Plot
Waterfall
Word Cloud

Interactive Visualization

Interact.jl and Vega in Jupyter Notebooks
Creating Interactive Sites Using Escher and Vega

Visualization Mutating Functions

colorscheme!
General Visualization Properties
hline! / vline!
hover!
jitter!
legend!
stroke!
text!
title!
xlab! / ylab!
xlim! / ylim!

View the Project on GitHubjohnmyleswhite/Vega.jl

General Visualization Properties

There are several commonly-used visualization properties in top-level ::VegaVisualization type such as width and height. Given that these are accessible from the high-level Julia composite type (i.e. the return type of every Vega plot), it doesn’t make sense to replicate these features as separate mutating functions.

For the most part, these properties have sensible defaults for working from Jupyter Notebook or from the REPL (which opens a new browser/tab); changing them is as simple as accessing the fields directly in the ::VegaVisualization composite type.

Height

Keyword:

height::Int
v = barplot(x = x, y = y)
v.height = 700

Width

Keyword:

width::Int
v2 = barplot(x = x, y = y)
v2.width = 1000

Background

The default for background is transparent, which can become an issue when you download PNG files. Set background to white or the desired color of your background is this is an issue.

Keyword:

background::AbstractString
v2 = barplot(x = x, y = y)
v2.background = "green"

Padding

Padding is an awkward union of CSS padding through the ::VegaPadding type, a single number for even padding all around the plot. The default is “auto”, which should be sufficient for most cases.

Keyword:

padding::Union(VegaPadding, Number, String)
v3 = barplot(x = x, y = y)
v3.padding = 10

Viewport

It is possible to change the portion of the graph shown, without changing the actual graph size. This is useful if you want to highlight a specific portion of the graph, but in practice it’s rarely used.

Keyword:

viewport::Vector{Int}