Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/timdp/swirly

A marble diagram generator.
https://github.com/timdp/swirly

documentation javascript marble-diagrams nodejs observable reactive-programming rxjs svg typescript

Last synced: 4 months ago
JSON representation

A marble diagram generator.

Awesome Lists containing this project

README

        


Swirly


A marble diagram generator.


npm
JavaScript Standard Style

## Example

Here's Swirly rendering the effect of the `concatAll` operator:

![concatAll](examples/concatAll.png)

The image above was built from
[this marble diagram specification](examples/concatAll.txt).

Diagram specifications use an extension of the syntax used for
[RxJS marble testing](https://github.com/ReactiveX/rxjs/blob/fc3d4264395d88887cae1df2de1b931964f3e684/docs_app/content/guide/testing/marble-testing.md).
Please consult the [examples](examples.md) to learn how to create diagrams.

## Web Version

You can use Swirly in your browser at
[**swirly.dev**](https://swirly.dev/).

The Web version allows you to edit diagram specifications in real time and
export them to an SVG or a PNG image.

## CLI Version

Swirly is also available as a command-line utility. To run it, you need a
sufficiently recent version of [Node.js](https://nodejs.org/).

To install Swirly on your machine, just install the `swirly` npm package:

```bash
npm install -g swirly
```

Next, create `diagram.txt` with your diagram specification. Take a look at the
[examples](examples/) to learn about the expected syntax.

You can then generate an SVG image from the specification by simply running:

```bash
swirly diagram.txt diagram.svg
```

Swirly can also output PNG images. Since PNG is a raster image format, you may
want to increase the resolution to get a higher-quality result. You can do so by
passing `--scale` followed by a percentage. For example, this will render the
image at twice its original size:

```bash
swirly --scale=200 diagram.txt diagram.png
```

## Author

[Tim De Pauw](https://tmdpw.eu)

## License

MIT