https://github.com/junosuarez/svega
A cli tool to render vega-lite visualizations to svg
https://github.com/junosuarez/svega
Last synced: 9 months ago
JSON representation
A cli tool to render vega-lite visualizations to svg
- Host: GitHub
- URL: https://github.com/junosuarez/svega
- Owner: junosuarez
- Created: 2020-10-25T01:57:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-25T03:22:36.000Z (over 5 years ago)
- Last Synced: 2025-02-15T16:46:22.255Z (over 1 year ago)
- Language: JavaScript
- Size: 122 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# svega
A cli tool to render [vega-lite](https://vega.github.io/vega-lite) visualizations to svg.

## Installation
```
npm install --global @junosuarez/svega
# or
yarn add --global @junosuarez/svega
```
## Usage
```
svega [opts] < data.json > out.svg
stdin must be data, stdout will be svg or empty
OPTIONS:
--format=[auto],json,ndjson,csv
```
The output on stdout is an SVG string. You can save this to a file, open it in your favorite viewer, or display it right in your terminal:
## Displaying svg in your terminal
Kudos to [Kate](https://twitter.com/thingskatedid/status/1316074032379248640) for sending me down this whole graphical terminal adventure.
The examples use `isvg`, the following shell alias, using [kitty terminal](https://sw.kovidgoyal.net/kitty/kittens/icat.html) and rsvg-convert (with `brew install imagemagick`):
```sh
alias isvg='rsvg-convert --zoom=2 | kitty icat --align=left'
```
## Alternatives
There is an official [vega-cli](https://github.com/vega/vega/tree/master/packages/vega-cli) package that includes two tools that may suit your needs:
- vg2svg
- vl2svg