An open API service indexing awesome lists of open source software.

https://github.com/kieler/elk-cli

A commandline wrapper for elkjs.
https://github.com/kieler/elk-cli

Last synced: 8 months ago
JSON representation

A commandline wrapper for elkjs.

Awesome Lists containing this project

README

          

# ELK-CLI
This is a simple wrapper around [elkjs](https://github.com/kieler/elkjs) to enable its usage directly from the commandline. It can be supplied with a graph from a file or directly over standard input. The expected format is the `elkj` format. When passing it directly in the commandline, care must be taken to correctly escape all quotes in the JSON object. The layouted graph is written `elkj` format to standard output.

## Installation
The elk cli tool can be installed using node:
```
> npm install -g @kieler/elk-cli
```
and then run as
```
> elk -f
```

You can also run it directly using npx
```
> npx @kieler/elk-cli -f
```

## Usage

Layout a graph provided in a json file:
```
> elk -f examples/graph.json
```

Layout a graph directly as an argument:
```
> elk -g "{\"id\": \"root\"}"
```

When passing in the graph as a string directly make sure to escape all double quotes that are part of the JSON.

## Generate SVGs
You can automatically generate a simple SVG of the laid out graph using the `-s ` option. A css file for styling may be supplied using the `-c ` file. The examples folder contains an example style file.