Giter VIP home page Giter VIP logo

vega-datasets's Introduction

Vega Datasets

npm version Build Status

Collection of datasets used in Vega and Vega-Lite examples. This data lives at https://github.com/vega/vega-datasets and https://cdn.jsdelivr.net/npm/vega-datasets.

Common repository for example datasets used by Vega related projects. Keep changes to this repository minimal as other projects (Vega, Vega Editor, Vega-Lite, Polestar, Voyager) use this data in their tests and for examples.

The list of sources is in SOURCES.md.

To access the data in Observable, you can import vega-dataset. Try our example notebook. To access these datasets from Python, you can use the Vega datasets python package. To access them from Julia, you can use the VegaDatasets.jl julia package.

Versioning

We use semantic versioning. However, since this package serve datasets we have additional rules about how we version data.

We do not change data in patch releases except to resolve formatting issues. Minor releases may change the data but only update datasets in ways that do not change field names or file names. Minor releases may also add datasets. Major versions may change file names, file contents, and remove or update files.

How to use it

HTTP

You can also get the data directly via HTTP served by GitHub or jsDelivr (a fast CDN) like:

https://vega.github.io/vega-datasets/data/cars.json or with a fixed version (recommended) such as https://cdn.jsdelivr.net/npm/vega-datasets@2/data/cars.json.

You can find a full listing of the available datasets at https://cdn.jsdelivr.net/npm/vega-datasets/data/.

NPM

Get the data on disk

npm i vega-datasets

Now you have all the datasets in a folder in node_modules/vega-datasets/data/.

Get the URLs or Data via URL

npm i vega-datasets

Now you can import data = require('vega-datasets') and access the URLs of any dataset with data[NAME].url. data[NAME]() returns a promise that resolves to the actual data fetched from the URL. We use d3-dsv to parse CSV files.

Here is a full example

import data from 'vega-datasets';

const cars = await data['cars.json']();
// equivalent to
// const cars = await (await fetch(data['cars.json'].url)).json();

console.log(cars);

Development process

Install dependencies with yarn.

Release Process

Publishing is handled by a 2-branch pre-release process, configured in publish.yml. All changes should be based off the default next branch, and are published automatically.

  • PRs made into the default branch that would trigger a version bump are auto-deployed to the next pre-release tag on NPM. The result can be installed with npm install vega-datasets/@next.
    • When merging into next, please use the squash and merge strategy.
  • To release a new stable version, open a PR from next into stable using this compare link.
    • When merging from next into stable, please use the create a merge commit strategy.

vega-datasets's People

Contributors

dependabot-preview[bot] avatar domoritz avatar dependabot[bot] avatar jheer avatar palewire avatar eitanlees avatar kanitw avatar willium avatar rileychang avatar ydlamba avatar p42-ai[bot] avatar greenkeeper[bot] avatar chanwutk avatar jwolondon avatar arvind avatar mcnuttandrew avatar hydrosquall avatar davidanthoff avatar ionathan avatar jakevdp avatar pbi-david avatar lawlesst avatar visnup avatar yhoonkim avatar light-and-salt avatar mcorrell avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.