Skip to content

queryverse/VegaDatasets.jl

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

VegaDatasets

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Build Status Build status codecov

Overview

This package provides an easy way to load the datasets in vega-datasets from julia.

Installation

You can install this package from the julia REPL with the following command:

Pkg.add("VegaDatasets")

Getting started

The package only exports one function that takes the name of a dataset and returns a VegaDataset with that data:

using VegaDatasets

vg = dataset("iris")

VegaDataset implements the iterable tables interface, so it can be passed to any sink that accepts iterable tables.

For example, to convert a dataset into a DataFrame, you can write:

using VegaDatasets, DataFrames

df = DataFrame(dataset("iris"))

You can pipe a VegaDataset directly into a VegaLite.jl plot:

using VegaLite, VegaDatasets

dataset("iris") |> @vlplot(:point, x=:sepalLength, y=:petalWidth)

Non-tabular datasets

The following datasets are not tabular in nature:

  • earthquakes
  • graticule
  • londonBoroughs
  • londonTubeLines
  • miserables
  • us_10m
  • world_110m

In those cases an object is returned that can be lowered to JSON, or one can access the .path property for such an object to get a path to the location of the dataset.