Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/queryverse/VegaDatasets.jl

Julia package for loading the standard Vega data sets
https://github.com/queryverse/VegaDatasets.jl

julia queryverse

Last synced: 2 days ago
JSON representation

Julia package for loading the standard Vega data sets

Awesome Lists containing this project

README

        

# VegaDatasets

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![Build Status](https://travis-ci.org/queryverse/VegaDatasets.jl.svg?branch=master)](https://travis-ci.org/queryverse/VegaDatasets.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/ad1mcex5tjbe160r/branch/master?svg=true)](https://ci.appveyor.com/project/queryverse/vegadatasets-jl/branch/master)
[![codecov](https://codecov.io/gh/queryverse/VegaDatasets.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/queryverse/VegaDatasets.jl)

## Overview

This package provides an easy way to load the datasets in [vega-datasets](https://github.com/vega/vega-datasets) from julia.

## Installation

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

````julia
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:

````julia
using VegaDatasets

vg = dataset("iris")
````

``VegaDataset`` implements the [iterable tables](https://github.com/queryverse/IterableTables.jl) 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:

````julia
using VegaDatasets, DataFrames

df = DataFrame(dataset("iris"))
````

You can pipe a ``VegaDataset`` directly into a [VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl) plot:

````julia
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.