observablehq/vega

Name: vega

Owner: Observable

Description: Convenience methods for using Vega and Vega-Lite in Observable.

Created: 2017-12-06 17:49:10.0

Updated: 2018-05-02 16:00:03.0

Pushed: 2018-05-23 05:55:06.0

Homepage: https://observablehq.com

Size: 2

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

@observablehq/vega

Convenience methods for using Vega and Vega-Lite in Observable. See this notebook for examples:

https://beta.observablehq.com/@mbostock/exploring-data-with-vega-lite

To load Vega-Lite:

lite = require("@observablehq/vega-lite@0.1")

To display a happy little chart:

lite({
ta: {
values: [
  {a: "A", b: 28}, {a: "B", b: 55}, {a: "C", b: 43},
  {a: "D", b: 91}, {a: "E", b: 81}, {a: "F", b: 53},
  {a: "G", b: 19}, {a: "H", b: 87}, {a: "I", b: 52}
]

rk: "bar",
coding: {
x: {field: "a", type: "ordinal"},
y: {field: "b", type: "quantitative"}


Or to load data with D3 and then display with Vega-Lite:

 require("d3-fetch@1")
 = d3.csv("https://vega.github.io/vega-lite/data/seattle-weather.csv")
lite({
ta: {values: data},
rk: "tick",
coding: {
x: {field: "precipitation", type: "quantitative"}



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.