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: about 1 year ago
JSON representation
Julia package for loading the standard Vega data sets
- Host: GitHub
- URL: https://github.com/queryverse/vegadatasets.jl
- Owner: queryverse
- License: other
- Created: 2018-03-03T00:43:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T00:36:24.000Z (over 3 years ago)
- Last Synced: 2025-03-26T12:51:13.043Z (about 1 year ago)
- Topics: julia, queryverse
- Language: Julia
- Homepage:
- Size: 6.93 MB
- Stars: 20
- Watchers: 3
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# VegaDatasets
[](http://www.repostatus.org/#active)
[](https://travis-ci.org/queryverse/VegaDatasets.jl)
[](https://ci.appveyor.com/project/queryverse/vegadatasets-jl/branch/master)
[](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.