# @observablehq/vega-lite

> A convenience method for using Vega-Lite.

Latest version **0.3.0** (published 2020-04-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install @observablehq/vega-lite
pnpm add @observablehq/vega-lite
yarn add @observablehq/vega-lite
bun add @observablehq/vega-lite
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2020-04-03 |
| First published | 2017-12-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 726 B |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 42 |
| Author | Observable, Inc. |
| Maintainers | jashkenas, mbostock, tmcw, visnup |
| Keywords | vega, vega-lite |

## Links

- npm: https://www.npmjs.com/package/@observablehq/vega-lite
- Repository: https://github.com/observablehq/vega
- Issues: https://github.com/observablehq/vega/issues
- npm.io page: https://npm.io/package/@observablehq/vega-lite

## Recent versions

- 0.3.0 (latest) — 2020-04-03
- 0.2.0 — 2019-09-16
- 0.1.2 — 2018-08-19
- 0.1.1 — 2018-08-15
- 0.1.0 — 2018-02-01
- 0.0.0 — 2017-12-06

## README

# @observablehq/vega

Convenience methods for using [Vega](https://github.com/vega/vega) and [Vega-Lite](https://github.com/vega/vega-lite) in [Observable](https://observablehq.com). See this notebook for examples:

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

To load Vega-Lite:

```js
vegalite = require("@observablehq/vega-lite@0.3")
```

To display a happy little chart:

```js
vegalite({
  data: {
    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}
    ]
  },
  mark: "bar",
  encoding: {
    x: {field: "a", type: "ordinal"},
    y: {field: "b", type: "quantitative"}
  }
})
```

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

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

---
_Source: https://npm.io/package/@observablehq/vega-lite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
